Oracle Database Import and Export, oracle Import and Export
I. Preparations
Create a tablespace:
Create temporary tablespace yangwen_temp
Tempfile 'd: \ oracle \ oradata \ orcl \ yangwen_temp.dbf'
Size 50 m
Autoextend on
Next 50 m maxsize 20480 m
Extent management local;
Create tablespace yangwen_data
Logging
Datafile 'd: \ oracle \ oradata \ orcl \ yangwen_data.dbf'
Size 50 m
Autoextend on
Next 50 m maxsize 20480 m
Extent management local;
-- Create a user
Create user admin123 identified by 123456
Default tablespace yangwen_data
Temporary tablespace yangwen_temp;
-- Grant Permissions
Grant connect, resource, dba to admin123;
Ii. Import and export Methods
Solution 1:
1.1 database backup-logical backup:
Expdp wzzjxt/wzzjxt @ wzzj DIRECTORY = data_dump_dir dumpfile = % backup_file %. dmp
1.2 database restoration-logical Restoration:
Impdp aaa/aaa directory = data_dump_dir dumpfile = px. DMP REMAP_SCHEMA = px: aaa
Example:
Create users and grant permissions
Create directory DATA_PUMP_DIR as 'd :\';
Create user v106 identified by v106;
Grant dba, connect, resource to v106;
Grant read, write on directory DATA_PUMP_DIR to v106;
Impdp sanyuechu/sanyuechu DIRECTORY = DATA_PUMP_DIR DUMPFILE = TEST. DMP
Solution 2:
1.1 database backup-logical backup:
Exp userName/passWord @ IP file = d:/database file. dmp
Database restoration-logical Restoration:
Create a user: (Execute SQL in sys)
Create user userName identified by passWord;
Grant dba, connect, resource to userName;
Imp userName/passWord @ ORCL file = E: \ database file. dmp ignore = y full = y log = e: \ app \ log \ imp. log