資料泵匯出匯入資料標準文件
1, 確認匯出使用者資料分佈
select distinct owner||'+'||tablespace_name from dba_segments
where owner in (select username from dba_users where account_status='OPEN')
and owner like '%UAM%' order by 1;
OWNER||'+'||TABLESPACE_NAME
-------------------------------------------------------------
UAMQAS05+UAMQAS
UAMQAS07+UAMQAS[@more@]2, 確認匯出使用者擁有許可權
select username,granted_role from user_role_privs;
USERNAME GRANTED_ROLE
------------------------------ ------------------------------
UAMQAS05 CONNECT
UAMQAS05 RESOURCE
select username,privilege from user_sys_privs;
USERNAME PRIVILEGE
------------------------------ ----------------------------------------
UAMQAS05 CREATE VIEW
UAMQAS05 UNLIMITED TABLESPACE
select owner,table_name,grantee,privilege from user_tab_privs;
OWNER TABLE_NAME GRANTEE PRIVILEGE
------------------------------ ------------------------------ ------------------------------ -------------
SYS UAMQASDMPDIR UAMQAS05 WRITE
SYS UAMQASDMPDIR UAMQAS05 READ
確認使用者擁有:connect,resource,create view,unlimited tablespace許可權
3, 確認匯出使用者目錄許可權
select * from all_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
------------------------------ ------------------------------ ------------------------------------
SYS UAMQASDMPDIR /home/oracle/sql/uamqas02/exp
select owner,table_name,grantee,privilege from user_tab_privs;
OWNER TABLE_NAME GRANTEE PRIVILEGE
------------------------------ ------------------------------ ------------------------------ -------------
SYS UAMQASDMPDIR UAMQAS05 WRITE
SYS UAMQASDMPDIR UAMQAS05 READ
確認使用者對目錄物件:UAMQASDMPDIR,實際位置/home/oracle/sql/uamqas02/exp擁有讀寫許可權
4, 新建匯入使用者,參考匯出使用者許可權,配置匯入使用者許可權和目錄物件
create tablespace uamqas_ts datafile '/oradata/qasdb01/uamqas_ts01.dbf' size 1000m
autoextend on next 500m maxsize 20000m extent management local default compress basic;
create user uamqas11 identified by uamqas11 default tablespace uamqas_ts;
grant connect,resource,create view to uamqas11;
create directory exp_dir as '/home/oracle/temp';
grant read,write on directory sys.exp_dir to uamqas11;
5, 匯出資料
源資料庫和目標資料庫版本不一致的情況,在高版本資料庫發起匯出動作時,加上引數version=10.2(低版本資料庫),以保持相容性
expdp uamqas05/uamqas05 directory=UAMQASDMPDIR dumpfile=expdp.uamqas05.20110224.dmp content=all
logfile=expdp.uamqas05.20110224.log exclude=TABLE:"IN ('UAM_INTERACTIVE_LOG')" schemas=uamqas05
如果存在exclude或者include,特殊字元注意使用斜槓轉義
expdp uamqas05/uamqas05 directory=UAMQASDMPDIR dumpfile=expdp.uamqas05.2011022402.dmp content=METADATA_ONLY
logfile=expdp.uamqas05.2011022402.log include=TABLE:"IN ('UAM_INTERACTIVE_LOG')" schemas=uamqas05
6, 匯入資料
cd /home/oracle/temp
impdp uamqas11/uamqas11 directory=exp_dir dumpfile=expdp.uamqas05.20110224.dmp content=all
logfile=impdp.uamqas05.20110224.log exclude=TABLE:"IN ('UAM_INTERACTIVE_LOG')"
remap_schema=uamqas05:uamqas11 REMAP_TABLESPACE=uamqas:uamqas_ts
impdp uamqas11/uamqas11 directory=exp_dir dumpfile=expdp.uamqas05.2011022402.dmp content=METADATA_ONLY
logfile=impdp.uamqas05.2011022402.log include=TABLE:"IN ('UAM_INTERACTIVE_LOG')"
remap_schema=uamqas05:uamqas11 REMAP_TABLESPACE=uamqas:uamqas_ts
select distinct owner||'+'||tablespace_name from dba_segments
where owner in (select username from dba_users where account_status='OPEN')
and owner like '%UAM%' order by 1;
OWNER||'+'||TABLESPACE_NAME
-------------------------------------------------------------
UAMQAS05+UAMQAS
UAMQAS07+UAMQAS[@more@]2, 確認匯出使用者擁有許可權
select username,granted_role from user_role_privs;
USERNAME GRANTED_ROLE
------------------------------ ------------------------------
UAMQAS05 CONNECT
UAMQAS05 RESOURCE
select username,privilege from user_sys_privs;
USERNAME PRIVILEGE
------------------------------ ----------------------------------------
UAMQAS05 CREATE VIEW
UAMQAS05 UNLIMITED TABLESPACE
select owner,table_name,grantee,privilege from user_tab_privs;
OWNER TABLE_NAME GRANTEE PRIVILEGE
------------------------------ ------------------------------ ------------------------------ -------------
SYS UAMQASDMPDIR UAMQAS05 WRITE
SYS UAMQASDMPDIR UAMQAS05 READ
確認使用者擁有:connect,resource,create view,unlimited tablespace許可權
3, 確認匯出使用者目錄許可權
select * from all_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
------------------------------ ------------------------------ ------------------------------------
SYS UAMQASDMPDIR /home/oracle/sql/uamqas02/exp
select owner,table_name,grantee,privilege from user_tab_privs;
OWNER TABLE_NAME GRANTEE PRIVILEGE
------------------------------ ------------------------------ ------------------------------ -------------
SYS UAMQASDMPDIR UAMQAS05 WRITE
SYS UAMQASDMPDIR UAMQAS05 READ
確認使用者對目錄物件:UAMQASDMPDIR,實際位置/home/oracle/sql/uamqas02/exp擁有讀寫許可權
4, 新建匯入使用者,參考匯出使用者許可權,配置匯入使用者許可權和目錄物件
create tablespace uamqas_ts datafile '/oradata/qasdb01/uamqas_ts01.dbf' size 1000m
autoextend on next 500m maxsize 20000m extent management local default compress basic;
create user uamqas11 identified by uamqas11 default tablespace uamqas_ts;
grant connect,resource,create view to uamqas11;
create directory exp_dir as '/home/oracle/temp';
grant read,write on directory sys.exp_dir to uamqas11;
5, 匯出資料
源資料庫和目標資料庫版本不一致的情況,在高版本資料庫發起匯出動作時,加上引數version=10.2(低版本資料庫),以保持相容性
expdp uamqas05/uamqas05 directory=UAMQASDMPDIR dumpfile=expdp.uamqas05.20110224.dmp content=all
logfile=expdp.uamqas05.20110224.log exclude=TABLE:"IN ('UAM_INTERACTIVE_LOG')" schemas=uamqas05
如果存在exclude或者include,特殊字元注意使用斜槓轉義
expdp uamqas05/uamqas05 directory=UAMQASDMPDIR dumpfile=expdp.uamqas05.2011022402.dmp content=METADATA_ONLY
logfile=expdp.uamqas05.2011022402.log include=TABLE:"IN ('UAM_INTERACTIVE_LOG')" schemas=uamqas05
6, 匯入資料
cd /home/oracle/temp
impdp uamqas11/uamqas11 directory=exp_dir dumpfile=expdp.uamqas05.20110224.dmp content=all
logfile=impdp.uamqas05.20110224.log exclude=TABLE:"IN ('UAM_INTERACTIVE_LOG')"
remap_schema=uamqas05:uamqas11 REMAP_TABLESPACE=uamqas:uamqas_ts
impdp uamqas11/uamqas11 directory=exp_dir dumpfile=expdp.uamqas05.2011022402.dmp content=METADATA_ONLY
logfile=impdp.uamqas05.2011022402.log include=TABLE:"IN ('UAM_INTERACTIVE_LOG')"
remap_schema=uamqas05:uamqas11 REMAP_TABLESPACE=uamqas:uamqas_ts
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15877397/viewspace-1046814/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 資料泵匯出匯入
- 資料泵的匯入匯出
- 資料泵匯出匯入表
- Oracle資料泵-schema匯入匯出Oracle
- Oracle資料泵的匯入和匯出Oracle
- Oracle資料泵匯出匯入(expdp/impdp)Oracle
- Oracle使用資料泵匯出匯入表Oracle
- 資料泵取匯出和匯入(一)
- 資料庫泵(expdp/impdp)匯入匯出流程資料庫
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- Impdp資料泵匯入
- 12c 資料泵匯入匯出級別
- 使用資料泵impdp匯入資料
- 資料泵匯出匯入物化檢視(ORA-39083)
- oracle10G新特性之資料泵匯出/匯入Oracle
- 【匯入匯出】資料泵 job_name引數的使用
- 資料庫 MySQL 資料匯入匯出資料庫MySql
- 資料泵無法匯入JOB
- 使用資料泵工具expdp工具匯出資料
- 資料泵匯出資料包錯處理
- Oracle 資料匯入匯出Oracle
- mysql資料匯入匯出MySql
- mysql資料匯出匯入MySql
- Oracle資料匯入匯出Oracle
- oracle監控資料泵匯入和匯出的sql語句OracleSQL
- 12c pdb的資料泵匯入匯出簡單示例
- Oracle使用資料泵在異機之間匯出匯入表Oracle
- 10g資料泵和匯入匯出效能對比(三)
- 10g資料泵和匯入匯出效能對比(二)
- 10g資料泵和匯入匯出效能對比(一)
- 10g資料泵和匯入匯出效能對比(四)
- 10g資料泵和匯入匯出效能對比(六)
- 10g資料泵和匯入匯出效能對比(五)
- shell,ant指令碼實現自動資料泵(exp.expdp)匯出匯入資料指令碼
- 資料泵避免個別表資料的匯出
- 資料泵匯出索引資料和統計資訊嗎索引
- Oracle expdp資料泵遠端匯出Oracle
- 使用資料泵匯出DDL語句