oracle EXPDP and IMPDP backup and import

Points to note when using EXPDP and IMPDP:

EXP and IMP are client-side utility programs that can be used both on the client side and on the server side.

EXPDP and IMPDP are tool programs on the server side, they can only be used on the ORACLE server side, not on the client side.

IMP only applies to EXP exported files, not EXPDP exported files; IMPDP only applies to EXPDP exported files, not EXP exported files.

When using the expdp or impdp command, you can temporarily not indicate the user name/password@instance name as identity, and then enter it according to the prompt, such as:

expdp schemas=scott dumpfile=expdp.dmp DIRECTORY=dpdata1;

1. Create a logical directory, this command does not A real directory will be created in the operating system, preferably created by an administrator such as system (sys as sysdba).

create directory dpdata1 as 'd:\test\dump';

Second, check the administrator directory (also check whether the operating system exists, because Oracle does not care whether the directory exists, if it does not exist, an error occurs)

select * from dba_directories;

3. Give the scott user the operation authority in the specified directory, preferably given by administrators such as system.

grant read,write on directory dpdata1 to scott;

4. Export data

1) According to the user guide

expdp scott/tiger@orcl schemas=scott dumpfile=expdp.dmp DIRECTORY=dpdata1;

2) Parallel process parallel

expdp scott/tiger@orcl directory=dpdata1 dumpfile=scott3.dmp parallel=40 job_name=scott3

3) Direct

expdp scott/tiger@orcl TABLES=emp,dept dumpfile=expdp.dmp DIRECTORY=dpdata1 ;

4) Lead

expdp scott/tiger@orcl directory=dpdata1 dumpfile=expdp.dmp Tables=emp query='WHERE deptno=20';

5) Lead

expdp system/manager DIRECTORY=dpdata1 DUMPFILE=tablespace by tablespace. dmp TABLESPACES=temp,example;

6) Import the entire database

expdp system/manager DIRECTORY=dpdata1 DUMPFILE=full.dmp FULL=y;

5. Restore data

remap_tablespace=users:test_tbsp This command is used to specify the tablespace when importing

1) Import to the specified user

impdp scott/tiger DIRECTORY=dpdata1 DUMPFILE=expdp.dmp SCHEMAS=scott;

2) Change the owner of the table

impdp system/manager DIRECTORY=dpdata1 DUMPFILE=expdp.dmp TABLES=scott.dept REMAP_SCHEMA=scott:system;

3)导入表空间

impdp system/manager DIRECTORY=dpdata1 DUMPFILE=tablespace.dmp TABLESPACES=example;

4)导入数据库

impdb system/manager DIRECTORY=dump_dir DUMPFILE=full.dmp FULL=y;

5)追加数据

impdp system/manager DIRECTORY=dpdata1 DUMPFILE=expdp.dmp SCHEMAS=system TABLE_EXISTS_ACTION

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326625430&siteId=291194637
Recommended