資料泵匯出匯入資料標準文件
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資料泵匯出匯入(expdp/impdp)Oracle
- Oracle資料泵的匯入和匯出Oracle
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- 資料泵匯出匯入物化檢視(ORA-39083)
- 資料庫 MySQL 資料匯入匯出資料庫MySql
- sqoop資料匯入匯出OOP
- Oracle 資料匯入匯出Oracle
- Oracle資料匯入匯出Oracle
- phpMyAdmin匯入/匯出資料PHP
- Oracle expdp資料泵遠端匯出Oracle
- MySQL入門--匯出和匯入資料MySql
- Mongodb資料的匯出與匯入MongoDB
- oracle資料匯出匯入(exp/imp)Oracle
- 匯入和匯出AWR的資料
- EasyPoi, Excel資料的匯入匯出Excel
- Mysql 資料庫匯入與匯出MySql資料庫
- Oracle資料庫匯入匯出。imp匯入命令和exp匯出命令Oracle資料庫
- PHP大資料xlswriter匯入匯出(最優資料化)PHP大資料
- 【最佳實踐】MongoDB匯出匯入資料MongoDB
- SQL資料庫的匯入和匯出SQL資料庫
- 複雜「場景」資料匯入匯出
- ClickHouse 資料表匯出和匯入(qbit)
- oracle10g expdp資料泵的bug,按schema匯出,匯入impdp時無jobOracle
- 【資料泵】EXPDP匯出表結構(真實案例)
- 細緻入微:如何使用資料泵匯出表的部分列資料
- MongoDB--Mongodb 中資料匯出與匯入MongoDB
- 大文字資料,匯入匯出到資料庫資料庫
- 資料搬運元件:基於Sqoop管理資料匯入和匯出元件OOP
- [Docker核心之容器、資料庫檔案的匯入匯出、容器映象的匯入匯出]Docker資料庫
- mongodb使用自帶命令工具匯出匯入資料MongoDB
- QZpython匯入匯出redis資料的實現deuPythonRedis
- 使用Dbeaver 進行資料的匯入和匯出
- 使用VUE+SpringBoot+EasyExcel 整合匯入匯出資料VueSpring BootExcel
- sqoop用法之mysql與hive資料匯入匯出OOPMySqlHive
- 達夢資料庫遷移資料/複製表/匯入匯出2資料庫
- Oracle用資料泵匯入資料包12899的錯誤碼解決方法Oracle
- mysql匯出資料MySql
- MATLAB匯入資料Matlab