Home Database Mysql Tutorial Oracle 数据库导入导出命令语句

Oracle 数据库导入导出命令语句

Jun 07, 2016 pm 05:46 PM
oracle database Import and Export

下面介绍的是导入导出的实例,向导入导出看实例基本上就可以完成,因为Oracle 数据库导入导出办要用到两个命令一个是exp导出,一个是imp导入,操作方法相当简单哦。

下面介绍的是导入导出的实例,向导入导出看实例基本上就可以完成,因为Oracle 数据库导入导出办要用到两个命令一个是exp导出,一个是imp导入,操作方法相当简单哦。

oracle 的exp/imp命令用于实现对的导出/导入操作;

exp命令用于把数据从远程服务器导出至本地,生成dmp文件;

imp命令用于把本地的数据库dmp文件从本地导入到远程的Oracle数据库中。

数据导出:

通过输入 EXP 命令和用户名/口令,您可以 后接用户名/口令的命令:

例程: EXP SCOTT/TIGER  或者,您也可以通过输入跟有各种参数的 EXP 命令来控制“导出”

按照不同参数。要指定参数,您可以使用关键字:

  格式: EXP KEYWORD=value 或 KEYWORD=(value1,value2,…,valueN)

例程: EXP SCOTT/TIGER GRANTS=Y TABLES=(EMP,DEPT,MGR)  或 TABLES=(T1: P1,T1: P2),如果 T1 是分区表

USERID 必须是命令行中的第一个参数。

例子

 1 将数据库TEST完全导出,用户名system 密码manager 导出到D:daochu.dmp中

 代码如下 复制代码
   exp system/manager@TEST file=d:daochu.dmp full=y

 2 将数据库中system用户与sys用户的表导出

 代码如下 复制代码
   exp system/manager@TEST file=d:daochu.dmp owner=(system,sys)

 3 将数据库中的表table1 、table2导出

 代码如下 复制代码
   exp system/manager@TEST file=d:daochu.dmp tables=(table1,table2)

 4 将数据库中的表table1中的字段filed1以"00"打头的数据导出

 代码如下 复制代码
   exp system/manager@TEST file=d:daochu.dmp tables=(table1) query=" where filed1 like  '00%'"

 
上面是常用的导出,对于压缩我不太在意,用winzip把dmp文件可以很好的压缩, 不过在上面命令后面 加上 compress=y  就可以了

数据的导入

例程: IMP SCOTT/TIGER  或者, 可以通过输入 IMP 命令和各种参数来控制“导入”

按照不同参数。要指定参数,您可以使用关键字:

格式: IMP KEYWORD=value 或 KEYWORD=(value1,value2,…,vlaueN)

例程: IMP SCOTT/TIGER IGNORE=Y TABLES=(EMP,DEPT) FULL=N

1 将D:daochu.dmp 中的数据导入 TEST数据库中。

 代码如下 复制代码
   imp system/manager@TEST  file=d:daochu.dmp

   上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入。
   在后面加上 ignore=y 就可以了。

2 将d:daochu.dmp中的表table1 导入

 代码如下 复制代码
 imp system/manager@TEST  file=d:daochu.dmp  tables=(table1)

 
基本上上面的导入导出够用了。不少情况我是将表彻底删除,然后导入

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1670
14
PHP Tutorial
1274
29
C# Tutorial
1256
24
What should I do if Oracle form cannot be opened? What should I do if Oracle form cannot be opened? Jul 04, 2023 pm 05:51 PM

Oracle form cannot be opened solution: 1. Check whether the Forms configuration file is set correctly; 2. Make sure the correct environment variables are set on the computer; 3. Check whether the network connection is normal and try to use other network connection methods to verify; 4. Check the code of the Form and try to comment out the code part that may cause the problem, and then reopen it; 5. Try to recompile the Form file; 6. Try to replace the original file with the backup file, and then reopen the Form.

How to modify oracle encoding format How to modify oracle encoding format Jul 06, 2023 am 11:35 AM

Methods to modify the Oracle encoding format: 1. Create a new database instance in the Oracle database where the encoding format is to be modified; 2. Use the Oracle SQL Developer tool to adjust the encoding format of the database by modifying the NLS parameters; 3. Use "ALTER DATABASE" command to modify the encoding format of the database; 4. Use the Export/Import tool to specify the encoding format of the new database during the data migration process; 5. Use third-party tools.

What should I do if Oracle cannot export an empty table? What should I do if Oracle cannot export an empty table? Jul 05, 2023 am 11:00 AM

Oracle cannot export empty table solution: 1. Update the export tool version. You can try to update the export tool we are using and check if a new version is available; 2. Use other export tools. Different tools may have different Export mechanism, we can try to use other tools to solve the problem; 3. We can create a temporary table, insert a record into it, and then use the export tool to export the data; 4. We can try to export the data into the form of an INSERT statement. And export the INSERT statement to a file.

How to use Hyperf framework for Excel import and export How to use Hyperf framework for Excel import and export Oct 25, 2023 pm 12:13 PM

How to use the Hyperf framework to import and export Excel Summary: This article will introduce how to implement the import and export functions of Excel files in the Hyperf framework, and give specific code examples. Keywords: Hyperf framework, Excel import, Excel export, code sample import First, we need to ensure that the phpoffice/phpspreadsheet library is installed in the project. It can be installed by executing the following command in the terminal: composer

How to import and export data through PHP and database How to import and export data through PHP and database Sep 08, 2023 am 10:03 AM

How to import and export data through PHP and database Importing and exporting data are common needs in web development, especially when processing large amounts of data. As a commonly used server-side scripting language, PHP can be used in combination with a database to achieve fast and efficient data import and export functions. This article will introduce how to use PHP code to import and export data, and provide corresponding sample code. 1. Data export Data export usually saves the data in the database in a local file in a certain format for daily use.

What to do if Oracle cannot be uninstalled What to do if Oracle cannot be uninstalled Jul 04, 2023 pm 05:44 PM

Solution to Oracle cannot be uninstalled: 1. Check permission issues and ensure that you have sufficient permissions; 2. Stop related services and processes; 3. Manually uninstall Oracle, delete the installation directory and all subdirectories and files, and Oracle-related entries in the registry. Keys and values, Oracle-related services in Windows services, and all Oracle-related environment variables; 4. Try to use third-party uninstall tools; 5. Seek help from professional database administrators or technical support personnel.

How Oracle creates a database How Oracle creates a database Oct 11, 2023 pm 01:43 PM

The steps to create an Oracle database are as follows: 1. Install Oracle software; 2. Start Oracle Installation Assistant; 3. Create database; 4. Configure database parameters; 5. Create table space; 6. Create user; 7. Grant permissions; 8. Start Database; 9. Connection to database; 10. Database management.

What to do if oracle dba has insufficient permissions What to do if oracle dba has insufficient permissions Jul 04, 2023 pm 05:17 PM

Solution to insufficient oracle dba permissions: 1. Determine the specific reasons for insufficient permissions; 2. Request additional permissions; 3. Update or modify user permissions, which can be done through command line tools or Oracle management tools; 4. Research Oracle's specific permissions , understand and study the different permissions and roles in the Oracle database; 5. Conduct regular permission audits to check and eliminate unnecessary or wrong permissions; 6. Learn and develop skills; 7. For help and support, you can seek other DBAs Or ask the Oracle community for help.

See all articles