這篇文章主要講解了“expdpnf導(dǎo)出問(wèn)題分析”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“expdpnf導(dǎo)出問(wèn)題分析”吧!
站在用戶(hù)的角度思考問(wèn)題,與客戶(hù)深入溝通,找到大安網(wǎng)站設(shè)計(jì)與大安網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶(hù)體驗(yàn)好的作品,建站類(lèi)型包括:成都網(wǎng)站建設(shè)、成都做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名注冊(cè)、雅安服務(wù)器托管、企業(yè)郵箱。業(yè)務(wù)覆蓋大安地區(qū)。
中止僵死的expdp任務(wù)
--dba_datapump_jobs查找數(shù)據(jù)泵作業(yè)
SELECT owner_name, job_name, operation, job_mode,
state, attached_sessions
FROM dba_datapump_jobs
WHERE job_name NOT LIKE 'BIN$%'
ORDER BY 1,2;
OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE ATTACHED
---------- ------------------- --------- --------- ----------- --------
SCOTT EXPDP_20051121 EXPORT SCHEMA EXECUTING 1
SCOTT SYS_EXPORT_TABLE_01 EXPORT TABLE NOT RUNNING 0
SCOTT SYS_EXPORT_TABLE_02 EXPORT TABLE NOT RUNNING 0
SYSTEM SYS_EXPORT_FULL_01 EXPORT FULL NOT RUNNING 0
--查找數(shù)據(jù)泵的master表
SELECT o.status, o.object_id, o.object_type,
o.owner||'.'||object_name "OWNER.OBJECT"
FROM dba_objects o, dba_datapump_jobs j
WHERE o.owner=j.owner_name AND o.object_name=j.job_name
AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;
STATUS OBJECT_ID OBJECT_TYPE OWNER.OBJECT
------- ---------- ------------ -------------------------
VALID 85283 TABLE SCOTT.EXPDP_20051121
VALID 85215 TABLE SCOTT.SYS_EXPORT_TABLE_02
VALID 85162 TABLE SYSTEM.SYS_EXPORT_FULL_01
--刪除master表
DROP TABLE scott.sys_export_table_02;
--對(duì)于啟用了recyclebin的系統(tǒng),需要額外運(yùn)行
purge dba_recyclebin;
-------------正常中止expdp作業(yè)---------------------------
--查到j(luò)ob_name
select * from dba_datapump_jobs;
OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE DEGREE ATTACHED_SESSIONS DATAPUMP_SESSIONS
------------------------------------------------------------ ------------------------------ ----------
SYSTEM SYS_EXPORT_FULL_01 EXPORT FULL EXECUTING 1 1 3
--attach該任務(wù)
expdp system/sys attach=SYS_EXPORT_FULL_01
Export> stop_job
Export> KILL_JOB
修改正在執(zhí)行導(dǎo)入操作的impdp并行度,提高導(dǎo)入效率
impdp uname/password attach=SYS_IMPORT_SCHEMA_01 ---回車(chē),可以查看該任務(wù)的詳細(xì)情況
rac expdp導(dǎo)出時(shí)報(bào)錯(cuò):ORA-31693、ORA-31617、ORA-19505、ORA-27037
ac expdp導(dǎo)出時(shí)報(bào)錯(cuò):
ORA-31693: Table data object "scott"."dept" failed to load/unload and is being skipped due to error:
ORA-31617: unable to open dump file "/home/oraclerac/dump_dir/oravs_expdp_05.dmp" for write
ORA-19505: failed to identify file "/home/oraclerac/dump_dir/oravs_expdp_05.dmp"
ORA-27037: unable to obtain file status
錯(cuò)誤原因:
在RAC環(huán)境下如果PARALLEL參數(shù)設(shè)置大于1,進(jìn)程會(huì)在RAC的各個(gè)節(jié)點(diǎn)上進(jìn)行導(dǎo)出。如果導(dǎo)出目錄不共享的話(huà)就會(huì)報(bào)錯(cuò)
解決方法:
1、設(shè)置為共享的directory;
2、導(dǎo)出語(yǔ)句添加cluster=n選項(xiàng),指定只在本地導(dǎo)出;
分區(qū)表數(shù)據(jù)泵導(dǎo)入太慢,達(dá)不到客戶(hù)的遷移要求
導(dǎo)出語(yǔ)句如下:(10G單節(jié)點(diǎn))
userid='/ as sysdba'
directory=milk_dir
dumpfile=mon_%U.dmp
logfile=0828.log
schemas=mon
parallel=8
導(dǎo)入語(yǔ)句(11G的rac):
userid='/ as sysdba'
directory=milk_dir
dumpfile=mon_%U.dmp
logfile=0828.log
parallel=8
CLUSTER=N
整個(gè)過(guò)程導(dǎo)出花費(fèi)了3個(gè)小時(shí)不到,導(dǎo)入花費(fèi)了近10個(gè)小時(shí)。這個(gè)過(guò)程實(shí)在是太慢,,,,, 在整個(gè)導(dǎo)入過(guò)程中,通過(guò)實(shí)時(shí)刷新日志,發(fā)現(xiàn)一到分區(qū)表的分區(qū)就賊慢,就算是一個(gè)分區(qū)只有22條數(shù)據(jù)。也要2分鐘刷新一次,相當(dāng)于兩分鐘導(dǎo)入了160條數(shù)據(jù),這速度,,,,,,,,,,,不行,,,,不行,,,,,
從新優(yōu)化導(dǎo)入的parfile:
userid='/ as sysdba'
directory=milk_dir
dumpfile=mon_%U.dmp
logfile=0828.log
parallel=8
ACCESS_METHOD=DIRECT_PATH
CLUSTER=N
導(dǎo)入速度直接從花費(fèi)10小時(shí)降為兩小時(shí),符合遷移的效率
ACCESS_METHOD=DIRECT_PATH
官方的解釋?zhuān)?/p>
use ACCESS_METHOD=DIRECT_PATH to import the data, as this access method does not check the table metadata before import
導(dǎo)出含clob字段的表數(shù)據(jù),報(bào)快照過(guò)舊,無(wú)法導(dǎo)出
該問(wèn)題是因?yàn)楹琧lob字段表數(shù)據(jù)過(guò)大導(dǎo)致,需要修改數(shù)據(jù)庫(kù)閃回參數(shù)解決
查看undo表空間大小是否足夠,undo_retention參數(shù)是否設(shè)置太小,一般跟undo空間無(wú)關(guān),只需修改參數(shù)即可
目前解決辦法有兩個(gè),加大retention或者使用pctversion
另外,對(duì)于使用MSSM表空間的表,只有pctverion可用,lob retention不可用
1、加大retention
查看undo參數(shù)
SQL> show parameter undo
--修改undo閃回參數(shù)
alter system set undo_retention=7200 scope=both;
通過(guò)查詢(xún)oracle官網(wǎng),oracle的lob大字段有自己的retention參數(shù),如果只調(diào)整undo_retention,而沒(méi)有同步到lob大字段,該參數(shù)還是默認(rèn)的900s,確認(rèn)查詢(xún)結(jié)果如下:
select table_name,column_name,pctversion,retention from dba_lobs where table_name='T_PATIENT_DOC_COLB';
select table_name,column_name,pctversion,retention from dba_lobs where table_name='T_PATIENTS_DOC_CA';
select table_name,column_name,pctversion,retention from dba_lobs where table_name='T_CARE_DOC';
修改表含有l(wèi)ob大字段的retention設(shè)置
ALTER TABLE T_PATIENT_DOC_COLB MODIFY LOB(CONTENT)(retention);
ALTER TABLE T_PATIENTS_DOC_CA MODIFY LOB(SIGN)(retention);
ALTER TABLE T_PATIENTS_DOC_CA MODIFY LOB(TIMESTAMP)(retention);
ALTER TABLE T_CARE_DOC MODIFY LOB(CARE_DOC)(retention);
2、使用pctversion
從結(jié)果中可以看到,當(dāng)顯示指定pctversion的時(shí)候,retention參數(shù)會(huì)失效
SQL> alter table T_PATIENTS_DOC_CA modify lob(SIGN) (pctversion 10);
SQL> select column_name, pctversion, retention from user_lobs where table_name = 'T_PATIENTS_DOC_CA';
COLUMN_NAME PCTVERSION RETENTION
------------------------------ --------- ----------
SIGN 10
TIMESTAMP 7200
感謝各位的閱讀,以上就是“expdpnf導(dǎo)出問(wèn)題分析”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)expdpnf導(dǎo)出問(wèn)題分析這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!