Import/export from oracle (impdb + expdb) tutorial, impdbexpdb
Data Pump export:
0: su-oracle
1: sqlplus/nolog
2: connect/as sysdba
3: create directory data_dp as '/home/oracle/data_dp'; #/home/oracle/data_dp must exist (for oracle Users)
4: grant read, write on directory data_dp to DZCMS; # DZCMS is the user data to export
5: select * from dba_directories; # Check whether the directory is successfully created.
6: Go to the bin directory and run:
./Expdp YIJIACHEDU/YIJIACHEDU @ orcl11g schemas = yijiachedu directory = data_dp dumpfile = YJCD20160918.DMP compression = all
If the Metadata processing is not available error occurs, run the following command in sysdba:
Execute sys. dbms_metadata_util.load_stylesheets;
Data Pump import:
0: su-oracle
1: sqlplus/nolog
2: connect/as sysdba
3: create directory data_dp as '/home/oracle/data_dp'; #/home/oracle/data_dp must exist (for oracle Users)
4: grant read, write on directory data_dp to DZCMSXC; # DZCMS is the user data to import
5: select * from dba_directories; # Check whether the directory is successfully created.
6: Go to the bin directory and run:
./Impdp DZCMSXC/DZCMSXC @ orcl11g DIRECTORY = DZCMS_DP dumpfile = dzcms20160616.dmp REMAP_SCHEMA = DZCMS: DZCMSXC REMAP_TABLESPACE = DZCMSDATA: DZCMSXC
# REMAP_SCHEMA = DZCMS: DZCMSXC: indicates the user to be replaced.
# REMAP_TABLESPACE = DZCMSDATA: DZCMSXC indicates the tablespace to be replaced
The following statement can be used to check whether the number of tables is consistent:
Select count (*) from dba_tables t where t. owner = 'dzcmsxc ';