expdp遇到UDE-31623 ORA-31623 ORA-06512

一個(gè)簡(jiǎn)單的expdp導(dǎo)出诊霹,在之前是正常的,但是隔了一天后出現(xiàn)問(wèn)題了哟冬,具體報(bào)錯(cuò)信息如下:
UDE-31623: operation generated ORACLE error 31623
ORA-31623: a job is not attached to this session via the specified handle
ORA-06512: at "SYS.DBMS_DATAPUMP", line 3326
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4551
ORA-06512: at line 1

解決過(guò)程:
1矩距、剛開(kāi)始以為是session數(shù)滿了,因?yàn)樵摍C(jī)器session數(shù)設(shè)置很少,很容易滿恰力。經(jīng)過(guò)測(cè)試不是該問(wèn)題叉谜,而且我后來(lái)想了下如果session數(shù)滿了的話,報(bào)錯(cuò)信息應(yīng)該不是這個(gè)踩萎。
2停局、刪除該用戶下export表,刪除了還是不好使
3香府、網(wǎng)上查資料董栽,說(shuō)應(yīng)該授予create any table的權(quán)限,授予了還是不好使
4回还、查看mos裆泳,讓檢查dba_registry和所有無(wú)效對(duì)象308388.1,檢查了都是對(duì)的
5柠硕、查看stream_pool_size大小工禾,參考文章How to resolve the Data Pump error ORA-31623 (a job is not attached to this session via the specified handle) ? (文檔 ID 1907256.1);其原值是0蝗柔,也就是如果自動(dòng)調(diào)節(jié)闻葵,這個(gè)沒(méi)有下限;查看v$sgainfo看到這個(gè)stream pool的大小為32MB癣丧,db_cache_size有6G槽畔,shared_pool_size有3G,總的sga就9.6G左右胁编,所以這個(gè)stream_pool被壓制得很厲害厢钧,給其設(shè)置一個(gè)下限值,改成128MB時(shí)報(bào)錯(cuò)嬉橙,內(nèi)存沒(méi)有多的可用于調(diào)節(jié)這個(gè)早直,說(shuō)明sga空閑內(nèi)存不多了,改成64MB成功市框,單后執(zhí)行expdp也成功了霞扬。

第一次遇到stream_pool_size導(dǎo)致的expdp問(wèn)題,記錄以下備忘枫振。

How to resolve the Data Pump error ORA-31623 (a job is not attached to this session via the specified handle) ? (文檔 ID 1907256.1) 轉(zhuǎn)到底部轉(zhuǎn)到底部

In this Document
Goal
Solution
References

Applies to:
Oracle Database - Standard Edition - Version 10.1.0.2 to 12.1.0.2 [Release 10.1 to 12.1]
Enterprise Manager for Oracle Database - Version 10.1.0.2 to 12.1.0.6.0 [Release 10.1 to 12.1]
Oracle Database - Personal Edition - Version 10.1.0.2 to 12.1.0.2 [Release 10.1 to 12.1]
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.1.0.2 [Release 10.1 to 12.1]
Information in this document applies to any platform.
Goal

This document explains how to resolve the following errors during an Export DataPump (expdp) or Import DataPump job (impdp):
$ expdp system/manager DIRECTORY=my_dir DUMPFILE=expdp_f.dmp LOGFILE=expdp_f.log FULL=y

Export: Release 11.2.0.1.0 - Production on Thu Jun 19 13:14:32 2014
Copyright 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

UDE-31623: operation generated ORACLE error 31623
ORA-31623: a job is not attached to this session via the specified handle
ORA-06512: at "SYS.DBMS_DATAPUMP", line 3263
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4488
ORA-06512: at line 1

-- or: --

UDI-31623: operation generated ORACLE error 31623
ORA-31623: a job is not attached to this session via the specified handle
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DATAPUMP", line 1137
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4583
ORA-06512: at line 1

-- or: --

UDI-00008: operation generated ORACLE error 31623
ORA-31623: a job is not attached to this session via the specified handle
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DATAPUMP", line 1137
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4583
ORA-06512: at line 1
...

There are several possible reasons why a Data Pump cannot be started. Each root cause has its own solution.
Solution

  1. First check the value for the STREAMS_POOL_SIZE in the database:
    connect / as sysdba

show parameter streams_pool
select * from v$sgainfo;

If the STREAMS_POOL_SIZE is too small, then a Data Pump job will fail. This can also happen when using Automatic Shared Memory Management (ASMM), or Automatic Memory Management (AMM) and there is not sufficient memory to increase the STREAMS_POOL_SIZE.
Manual settings for the STREAMS_POOL_SIZE of 64M, 128M or even to 256M have proven to be successful.

For details and full resolution, see:
Note 1080775.1 - UDE-31623 Error With DataPump Export

  1. Check for any possible invalid Data Pump queue objects:
    connect / as sysdba

show parameter aq
col owner for a10
col object_name for a30
analyze table kupc$datapump_quetab validate structure cascade;
analyze table kupc$datapump_quetab_1 validate structure cascade;
select object_id, owner, object_name, status from dba_objects
where object_name like 'KUPC$DATAPUMP_QUETAB%';
set lines 100
col status for a9
col object_type for a20;
col owner.object for a50
select status, object_id, object_type, owner||'.'||object_name "OWNER.OBJECT"
from dba_objects
where object_name like '%DATAPUMP_QUETAB%' order by 3,4;

If there are any invalid queue objects, then a Data Pump job will fail. This usually also results in the following error in the alert.log file:
ORA-00600: internal error code, arguments: [kwqbgqc: bad state], [1], [1], [], [], [], [], []

For details and full resolution, see:
Note 754401.1 - Errors ORA-31623 And ORA-600 [kwqbgqc: bad state] During DataPump Export Or Import

  1. Check for any invalid registry components (CATALOG, CATPROC and JAVAVM), and invalid sys owned objects:
    connect / as sysdba

set lines 90
col version for a12
col comp_id for a8
col schema like version
col comp_name format a35
col status for a12
select comp_id,schema,status,version,comp_name from dba_registry order by 1;

set lines 120
col status for a9
col object_type for a20;
col owner.object for a50
select status, object_id, object_type, owner||'.'||object_name "OWNER.OBJECT"
from dba_objects
where status != 'VALID' and owner='SYS' and object_name not like 'BIN$%'
order by 4,2;

If the registry components CATALOG, CATPROC and/or JAVAVM, and/or objects like SYS.KUPW$WORKER or SYS.KUPP$PROC are invalid, then a Data Pump job will likely fail.
To resolve this problem, reload Data Pump in the database:
connect / as sysdba

-- Start spooling to file:
spool catproc.out
set lines 120 numwidth 12 pages 10000 long 2000000000
alter session set NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
show user
select sysdate from dual;

shutdown immediate
-- for 9.2, use: startup migrate
startup migrate

@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
@?/rdbms/admin/utlrp.sql
spool off

spool registry.out
-- Registry status:
set lines 90
col version for a12
col comp_id for a8
col schema like version
col comp_name format a35
col status for a12
select comp_id,schema,status,version,comp_name from dba_registry order by 1;

-- Invalid objects:
set lines 120
col status for a9
col object_type for a20;
col owner.object for a50
select status, object_id, object_type, owner||'.'||object_name "OWNER.OBJECT"
from dba_objects
where status != 'VALID' and owner='SYS' and object_name not like 'BIN$%'
order by 4,2;

shutdown immediate
startup
spool off

For details and references, see:
Note 430221.1 - How To Reload Datapump Utility EXPDP/IMPDP
Note 863312.1 - Best Practices for running catalog, catproc and utlrp script
Note 308388.1 - Error ORA-31623 When Submitting A DataPump Export Job

In case JAVAVM component is invalid, validate it using the steps from:

Note 1112983.1 - How to Reload the JVM in 11.2.0.x
Note 276554.1 - How to Reload the JVM in 10.1.0.X and 10.2.0.X
Note 1612279.1 - How to Reload the JVM in 12.1.0.x

and/or create a Java SR if more help is needed.

  1. Check if parameter _FIX_CONTROL is set for Bug 6167716:
    connect / as sysdba

show parameter _fix_control

If this hidden parameter is set, then a Data Pump job will fail.

For details and full resolution, see:
Note 1150733.1 - DataPump Export (EXPDP) Fails With Errors ORA-31623 ORA-6512 If Parameter _FIX_CONTROL='6167716:OFF' Has Been Set

  1. If the Data Pump job is started through a package, check if the package was created with invoker's right (AUTHID clause):
    connect / as sysdba

set lines 120 numwidth 12 pages 10000 long 2000000000
col ddl for a100
select dbms_metadata.get_ddl('PACKAGE','MY_PACKAGE','SCOTT') "DDL" from dual;

If the package was created with an invoker's right, then a Data Pump job will fail when started through this package.

For details and full resolution, see:
Note 1579091.1 - DataPump Job Fails With Error ORA-31623 A Job Is Not Attached To This Session Via The Specified Handle

  1. If the Data Pump job is started in DBConsole / OEM, and the job is selected to be re-run (or you want to edit the job), then the Data Pump job will fail and following errors will be reported:
    ERROR: No data pump job named "jobname" exists in the database
    ORA-31623: a job is not attached to this session via the specified handle
    Execute Failed: ORA-31623: a job is not attached to this session via the specified handle
    ORA-6512: at "SYS.DBMS_DATAPUMP", line 2315
    ORA-6512: at "SYS.DBMS_DATAPUMP", line 3157
    ORA-6512: at line 27 (DBD ERROR: OCIStmtExecute)

-- or --

Edit is not supported for this job type, only general information

For details and full resolution, see:
Note 788301.1 - Error ORA-31623 On DataPump Export Via DBScheduler After First Run Was Successful
Note 461307.1 - How To Export Database Using DBConsole/OEM In 10G

  1. If parameter LOGTIME is being used, Data Pump export/import with LOGTIME parameter crashes if the environment variable NLS_DATE_FORMAT is set.

For details and full resolution, see:
Note 1936319.1 - Data Pump Export Or Import Throws ORA-31623 When Using LOGTIME Parameter

References
NOTE:754401.1 - Errors ORA-31623 And ORA-600 [kwqbgqc: bad state] During DataPump Export Or Import
NOTE:1080775.1 - UDE-31623 Error With DataPump Export
NOTE:308388.1 - Error ORA-31623 When Submitting A DataPump Job
NOTE:1150733.1 - DataPump Export (EXPDP) Fails With Errors ORA-31623 ORA-6512 If Partameter _FIX_CONTROL='6167716:OFF' Has Been Set
NOTE:1579091.1 - DataPump Job Fails With Error ORA-31623 A Job Is Not Attached To This Session Via The Specified Handle
NOTE:788301.1 - Error ORA-31623 On DataPump Export Via DBScheduler After First Run Was Successful
NOTE:461307.1 - How To Export Database Using DBConsole/OEM In 10G
NOTE:863312.1 - Best Practices for running catalog, catproc and utlrp script
NOTE:430221.1 - How To Reload Datapump Utility EXPDP/IMPDP
NOTE:1936319.1 - Data Pump Export Or Import Throws ORA-31623 When Using LOGTIME Parameter

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末喻圃,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子粪滤,更是在濱河造成了極大的恐慌斧拍,老刑警劉巖,帶你破解...
    沈念sama閱讀 206,839評(píng)論 6 482
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件杖小,死亡現(xiàn)場(chǎng)離奇詭異饮焦,居然都是意外死亡怕吴,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,543評(píng)論 2 382
  • 文/潘曉璐 我一進(jìn)店門(mén)县踢,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人伟件,你說(shuō)我怎么就攤上這事硼啤。” “怎么了斧账?”我有些...
    開(kāi)封第一講書(shū)人閱讀 153,116評(píng)論 0 344
  • 文/不壞的土叔 我叫張陵谴返,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我咧织,道長(zhǎng)嗓袱,這世上最難降的妖魔是什么? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 55,371評(píng)論 1 279
  • 正文 為了忘掉前任习绢,我火速辦了婚禮渠抹,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘闪萄。我一直安慰自己梧却,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,384評(píng)論 5 374
  • 文/花漫 我一把揭開(kāi)白布败去。 她就那樣靜靜地躺著放航,像睡著了一般。 火紅的嫁衣襯著肌膚如雪圆裕。 梳的紋絲不亂的頭發(fā)上广鳍,一...
    開(kāi)封第一講書(shū)人閱讀 49,111評(píng)論 1 285
  • 那天,我揣著相機(jī)與錄音吓妆,去河邊找鬼赊时。 笑死,一個(gè)胖子當(dāng)著我的面吹牛耿战,可吹牛的內(nèi)容都是我干的蛋叼。 我是一名探鬼主播,決...
    沈念sama閱讀 38,416評(píng)論 3 400
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼剂陡,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼狈涮!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起鸭栖,我...
    開(kāi)封第一講書(shū)人閱讀 37,053評(píng)論 0 259
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤歌馍,失蹤者是張志新(化名)和其女友劉穎,沒(méi)想到半個(gè)月后晕鹊,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體松却,經(jīng)...
    沈念sama閱讀 43,558評(píng)論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡暴浦,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,007評(píng)論 2 325
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了晓锻。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片歌焦。...
    茶點(diǎn)故事閱讀 38,117評(píng)論 1 334
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖砚哆,靈堂內(nèi)的尸體忽然破棺而出独撇,到底是詐尸還是另有隱情,我是刑警寧澤躁锁,帶...
    沈念sama閱讀 33,756評(píng)論 4 324
  • 正文 年R本政府宣布纷铣,位于F島的核電站,受9級(jí)特大地震影響战转,放射性物質(zhì)發(fā)生泄漏搜立。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,324評(píng)論 3 307
  • 文/蒙蒙 一槐秧、第九天 我趴在偏房一處隱蔽的房頂上張望啄踊。 院中可真熱鬧,春花似錦色鸳、人聲如沸社痛。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 30,315評(píng)論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)蒜哀。三九已至,卻和暖如春吏砂,著一層夾襖步出監(jiān)牢的瞬間撵儿,已是汗流浹背。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 31,539評(píng)論 1 262
  • 我被黑心中介騙來(lái)泰國(guó)打工狐血, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留淀歇,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 45,578評(píng)論 2 355
  • 正文 我出身青樓匈织,卻偏偏與公主長(zhǎng)得像浪默,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子缀匕,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,877評(píng)論 2 345

推薦閱讀更多精彩內(nèi)容