Import (Restore) Oracle dmp files to different tablespaces and different users
Copy A dmp backup file from the production environment, build a test environment on another computer, and run the imp command to import the dmp file with the following error:
Problem description:
IMP-00038: cannot be converted to Environment Character Set handle
IMP-00000: Import failed
Solution:
Use the impdp command to import data.
Reference import command
Impdp onlinecolzs/onlinecozs dumpfile = XXX. dmp directory = dpdata1 remap_schema = onlinecol: onlinecolzs remap_tablespace = ts_onlinecol_prod: zaixianzs_data
Parameter description
Dumpfile: name of the dmp file to be imported
Directory: directory folder where the dmp file is located
REMAP_SCHEMA: This option is used to load all objects in the source scheme to the Target Scheme. REMAP_SCHEMA = source_schema: target_schema
REMAP_TABLESPACE: import all objects in the source tablespace to the target tablespace. REMAP_TABLESPACE = source_tablespace: target: tablespace
-----------------------------------------
Procedure:
1. Create a tablespace and a user.
2. Create a directory
Create directory dpdata1 as 'd: \ tempdmp'
Copy the dmp file to the Created directory folder (D: \ tempdmp). You must manually create this folder.
3. Execute the impdp import command:
Impdp onlinecolzs/onlinecozs dumpfile = XXX. dmp directory = dpdata1 remap_schema = onlinecol: onlinecolzs remap_tablespace = ts_onlinecol_prod: zaixianzs_data
Ts_onlinecol_prod: name of the tablespace in the old dmp file. If you do not know the name of the original tablespace, write it first. When importing the table, the system will prompt that the tablespace does not exist, write the name of the tablespace that does not exist.
Zaixianzs_data: name of the tablespace to be imported (name of the tablespace created in step 1)