Oracle Import and Export (used more), oracle Import and Export
1. create directory (role system/sys) create directoryHello_fileAs'D: \ dupmfile';
-- View all created Directories
-- Select * from dba_directories;
-- Drop directory.
-- Drop directory exp_dir;
2. create a tablespace (you can use its default tablespace) 2.1 create a temporary tablespace create temporary tablespace
Hello_temp
Tempfile
'F: \ oracle \ data \ hello_temp.dbf'
Size 1024 m
Autoextend on
Next 32 m
Extent management local;
2.2 create tablespace
Hello_data
Logging
Datafile
'F: \ oracle \ data \ hello_data.dbf'
Size 512 m
Autoextend on
Next 32 m
Extent management local;
3. Create a user and modify the tablespace conn system/system @ orcl;
-- Before deleting a user
Drop user
Hello_userCascade;
-- Create a user (if there is a tablespace, add it)
Create user
Hello_userIdentified
PassDefault; -- tablespace hello_data temporary tablespace hello_temp;
4. grant permissions-User Permissions
Grant resource, connect, dba
Hello_user;
-- Directory permission
Grant read, write on directory
Hello_fileTo
Hello_user;
5. Export expdp original_user/pass @ orcl directory = hello_file dumpfile = data20151114.dmp schemas = original_user
-- Export to the directory d: \ dupmfile created in directory
6. Import -- remap_tablespace to change the tablespace
-- Remap_schema: Imports original_user to hello_user. If the user name is the same, this statement can be omitted.
-- Data20151114.dmp: name of the database file exported
Impdp hello_user/pass @ orcl directory =
Hello_fileDumpfile =
Data20151114.dmpRemap_tablespace =
Original_data: hello_dataRemap_schema = original_user: hello_user