ORACLE Import and Export and Character Set problems, oracle Import and Export
1. Export dump data files
Expdp schemas = RBMS directory = DATA_PUMP_DIR dumpfile = RBMS_20160412.dmp
Schemas = mode. It can be understood that RBMS is the user name.
Directory = directory. DATA_PUMP_DIR is the default directory for creating a database. It is used to store the files and logs imported and exported by the database.
Dumpfile = dump file name, RBMS_20160412.dmp is the custom export file ming name
2. query the specific path of DATA_PUMP_DIR.
Select * from dba_directories;
Example: C: \ 04-database \ admin \ rbms \ dpdump \
3. Import the dump file
Impdp RBMS/RBMS @ RBMS schemas = RBMS dumpfile = RBMS. DMP directory = DATA_PUMP_DIR
RBMS/RBMS @ RBMS specifies the user name, password, and database. This user can be not created and will be automatically created during import.
4. Solve the Problem of garbled data import
Simply put, it is necessary to determine whether the character sets of the server (oracle itself), client (windows system), and dmp files are consistent.
I have been tossing this garbled code for a long time. I will explain the reasons for the garbled code:
(1) The company's broken computer is an English system. The first database creation forgot to change the oracle character set. The default is not ZHS16GBK.
(2) the oracle database created in Windows 7 does not contain oracle information in the registry.
The only relief is that the character set of my file can be determined to be ZHS16GBK.
Cause (1) the fastest way to solve the problem is to delete the database, recreate the database, and carefully select the character set ZHS16GBK.
Cause (2) Configure oracle system environment variables:
Variable name ORACLE_HOME
Variable value E: \ Oracle \ product \ 11.2.0 \ dbhome_1 -- modify according to your own path
Variable name TNS_ADMIN
Variable value: E: \ Oracle \ product \ 11.2.0 \ dbhome_1 \ NETWORK \ ADMIN -- modify according to your own path
The variable name is NLS_LANG.
Variable value SIMPLIFIED CHINESE_CHINA.ZHS16GBK -- changed to the same character set as the server.
Variable name ORACLE_SID.
Variable value RBMS -- RBMS is my own sid. You can view tnsnames. ora
Ps:
(1) If you only use the SQL * plus provided by Oracle, you only need to start OracleServiceORCL. If you use third-party tools such as PL/SQL Developer, the OracleOraDb11g_home1TNSListener service must also be enabled. OracleDBConsoleorcl must be enabled to access the web-based EM, and is rarely used by other services.
(2) configuration files required for oracle, listener. ora and tnsnames. ora.