1. Create a directory. Before importing and exporting data, you must first create directory # sqlplusassysdbagt; createdirectorydump_diras
1. create a directory. Before importing and exporting data, you must first create directory # sqlplus/as sysdbagt; create directory dump_dir
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 linuxidc;
3. Export
-- Export the table structure and data under the linuxidc user from the database orcl, excluding the table JK_COMPANY_VIDICON_INFO.
Expdp linuxidc/linuxidc @ 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 linuxidc/linuxidc @ orcl directory = dump_dir dumpfile = test5.dmp nologfile = y tables = jk_company_vidicon_info
4. Import
-- Import the objects in the original linuxidc solution to the linuxidc solution. Instead of idcfree, replace the objects in the original solution when table conflicts exist.
Impdp idcfree/idcfree @ orcl directory = dump_dir dumpfile = test4.dmp nologfile = y schemas = linuxidc table_exists_action = replace
-- Import objects in the original solution linuxidc to the new solution idcfree
Impdp idcfree/idcfree @ orcl directory = dump_dir dumpfile = test4.dmp nologfile = y remap_schema = linuxidc: idcfree
5. Example of using the parameter file *. par
# Vi exp_table.par
DIRECTORY = dump_dir
DUMPFILE = expdp_linuxidc.dmp
LOGFILE = expdp_linuxidc.log
CONTENT = METADATA_ONLY
# Expdp linuxidc/linuxidc @ 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