An example of oracle impdp and expdp is provided.
Create a test table and insert Test Data
Create table test_tab (id number not null primary key, name varchar2 (20); insert into test_tab values (1, 'Data 1 ');
Create directory object
create or replace directory DMP_DIR as '/oradata/ebankbak/';
Export the specified table
expdp mia/mia tables=test_tab dumpfile=test.dmp directory=DMP_DIR
Import the specified table
Table_exists_action parameter: skip (skip an object. If the object already exists, skip it and execute the next one), append (append existing table data without affecting the original row ), truncate (delete existing table rows and save all data) and replace (delete existing tables, create new tables, and save data)
impdp mia/mia directory=dmp_dir dumpfile=test.dmp table_exists_action=skip
impdp mia/mia directory=dmp_dir dumpfile=test.dmp table_exists_action=append
impdp mia/mia directory=dmp_dir dumpfile=test.dmp table_exists_action=truncate
impdp mia/mia directory=dmp_dir dumpfile=test.dmp table_exists_action=replace
Import the specified table, modify the table space, and modify the user. Parameter: remap_schema = original user: target user, remap_tablespace = (original table space: target table space). You can use ", "Split, such as (a: B, c: d)
impdp mia/mia DIRECTORY=DMP_DIR dumpfile=test.dmp logfile=impdp_index.log remap_schema=uibs:mia remap_tablespace=\(IBSDATA:MIADATA\)
Include (including specified object)/exclude (ignore specified object) parameter description
The parameter is [object_type]: [name_clause], and [object_type]: [name_clause] object_type specifies the object type, such as table, view, procedure, package, sequence, index name_clause specifies the SQL condition (you can leave it unspecified), such as: include = table: "in ('1', '2')", sequence: "= 'myseq '", if no condition is specified, all objects are represented, such as exclude = index.