oracle data pump import and export dmp file syntax

Import operation

(This example is the import of multiple data pump files COSPACE.DMP, WISDOMGOV.DMP)


0, database login


plsql uses the sys account and as sysdba to log in to the orcl instance;


1. Create an operation directory in the imported database


1.1. Create a dump folder in the root directory of the E disk (put all data pump files in this directory (e:\dump))
1.2. Log in to the database with the system administrator, and execute the following command
create directory dump_dir in the SQL executor as'e:\dump'; 

2. Create a table space (execute the following commands in the sql executor)


2.1. Create a COSPACE
tablespace create tablespace COSPACE  
logging  
datafile'E:\app\Administrator\oradata\orclWG\COSPACE.DBF' --Note: The path specified when the database instance was created is
size 50m  
autoextend on  
next 50m maxsize 20480m  

extent management local;

 2.2. Create WISDOMGOV
tablespace create tablespace WISDOMGOV 
logging  
datafile'E:\app\Administrator\oradata\orcl\WISDOMGOV.DBF' --Note: The path specified when the database instance was created at the time
size 50m  
autoextend on  
next 50m maxsize 20480m  
extent management local ;

 

3. Create a user (execute the following commands in the sql executor)


3.1、创建COSPACE用户
create user COSPACE identified by lilo123  
default tablespace  COSPACE;


3.2、创建WISDOMGOV用户
create user WISDOMGOV identified by lilo123  
default tablespace  WISDOMGOV;


4. User empowerment (execute the following commands in the sql executor)


4.1, empower COSPACE
grant connect, resource, dba to COSPACE;


4.2. Empower to WISDOMGOV
grant connect, resource, dba to WISDOMGOV;


5. Assign the data pump usage directory to the user (execute the following commands in the sql executor)


5.1、grant read,write on directory dump_dir to COSPACE;
5.2、grant read,write on directory dump_dir to WISDOMGOV;


6. Execute import data (switch to the path where the data pump is stored, execute the cmd command line as follows)


6.1、impdp COSPACE/123456@orclWG directory=dump_dir dumpfile=COSPACE.DMP
6.2、impdp WISDOMGOV/123456@orcl directory=dump_dir dumpfile=WISDOMGOV.DMP


 

 


Export operation (export multiple data pump files)

0, database login


plsql uses the sys account and as sysdba to log in to the orcl instance;


1. Create an operation directory


1.1. Create a dump folder in the root directory of Disk E (the path where the data pump is exported and stored)
1.2. Log in to the database with the system administrator and execute the following command in the SQL executor
create directory dump_dir as'e:\dump'; 
1.3, Assign the permissions of the directory to the user, execute the following command (executed by SQL executor)
1.3.1, assign to the cospace user
grant read, write on directory dump_dir to cospace;
1.3.2, assign to the wisdomgov user
grant read, write on directory dump_dir to wisdomgov;


2. Export data (switch to the path where the data pump is stored, execute the cmd command line as follows)


2.1. Export cospace data
expdp cospace/123456@orclWG directory=dump_dir file=COSPACE.dmp schemas=cospace
2.1. Export wisdomgov data
expdp wisdomgov/123456@orcl directory=dump_dir file=WISDOMGOV.dmp schemas=wisdomgov

Guess you like

Origin blog.csdn.net/chudelong1/article/details/108897370
Recommended