--用oracle系統權限的帳號 登錄 sql
-- 1.建立用戶session
create user u_name identified by "u_password";
--2.賦予權限oracle
grant dba, resource, connect to u_name; grant create session to u_name; grant create table to u_name; grant create view to u_name; grant create tablespace to u_name; grant unlimited tablespace to u_name; grant select any table to u_name; grant select any dictionary to u_name;
create directory directory_name as 'D:\oracleEnv\Oracle\product\11.2.0\db\backup'; --路徑能夠本身指定
GRANT read,write ON DIRECTORY directory_name TO u_name;
create tablespace table_space_name datafile 'D:\oracleEnv\Oracle\product\11.2.0\dbhome_1\oradata\table_space_name.DBF' size 2500M autoextend on next 500M maxsize 12000M;
ALTER USER table_space_name DEFAULT TABLESPACE u_name;
select tablespace_name , file_id,bytes from dba_data_files where tablespace_name='my_table_space_name';
-簡單版 ide
impdp u_name/u_password@ORCL dumpfile=file_path full=y table_exists_action=replace
--經常使用版spa
impdp u_name/u_password@ip_address/space_name directory=my_director full=y dumpfile=my_dmp_file.DMP logfile=my_dmp_file.log table_exists_action=replace;
--高級版code
impdp u_name/u_password@ip_address/space_name directory=my_director full=y dumpfile=my_dmp_file.DMP logfile=my_dmp_file.log [remap_schema=user_1:user_2] [remap_tablespace =table_space_1:table_space_2] [table_exists_action=replace]