Steps:
1. Create a directory. You must create a directory before importing and exporting the directory.
# Sqlplus/as sysdba
> Create directory dump_dir as '/home/Oracle/dump ';
Note: dump_dir points to the actual physical path/home/oracle/dump, and the/home/oracle/dump directory must exist.
2. Grant the permission to read and write directories to corresponding users.
> Grant read, write on directory dump_dir to bkjia;
3. Export
-- Export the table structure and data under bkjia from the database orcl, excluding the table JK_COMPANY_VIDICON_INFO.
Expdp bkjia/bkjia @ orcl directory = dump_dir dumpfile = test4.dmp nologfile = y exclude = table: \ "in \ (\ 'jk _ COMPANY_VIDICON_INFO \'\)\"
Note: If the expdp parameter is directly written in the command line, you need to add the Escape Character '\' to the exclude value in this example.
* In the par parameter file, no escape character is required. If you add a parameter, an error is returned. The table name must be in uppercase.
-- Export the specified table jk_company_vidicon_info:
Expdp bkjia/bkjia @ orcl directory = dump_dir dumpfile = test5.dmp nologfile = y tables = jk_company_vidicon_info
4. Import
-- Import the objects in bkjia of the original scheme into bkjia. This scheme is not idcfree. Replace the scheme in case of table conflicts
Impdp idcfree/idcfree @ orcl directory = dump_dir dumpfile = test4.dmp nologfile = y schemas = bkjia table_exists_action = replace
-- Import the objects in the original scheme bkjia into the new scheme idcfree
Impdp idcfree/idcfree @ orcl directory = dump_dir dumpfile = test4.dmp nologfile = y remap_schema = bkjia: idcfree
5. Example of using the parameter file *. par
# Vi exp_table.par
DIRECTORY = dump_dir
DUMPFILE = expdp_bkjia.dmp
LOGFILE = expdp_bkjia.log
CONTENT = METADATA_ONLY
# Expdp bkjia/bkjia @ orcl parfile = exp_table.par
------------------------
# Vi exp_evwp.par
Directory = dump_dir
Dumpfile = test3.dmp
Nologfile = y
Exclude = table: "in ('jk _ COMPANY_VIDICON_INFO ')"
# Expdp evwp/evwp @ orcl parfile = exp_evwp.par