【故障處理】ORA-31600和ORA-04063錯誤

lhrbest發表於2018-07-20


【故障處理】ORA-31600和ORA-04063錯誤




有朋友在執行drop操作時,報瞭如下的錯誤,經過查詢mos文件和遠端協助最後終於處理了,記錄下。


ORA-00604: error occurred at recursive SQL level 1

ORA-31600: invalid input value COMPATIBLE for parameter VERSION in function GET_DDL

ORA-06512: at "SYS.DBMS_METADATA", line 5805

ORA-06512: at "SYS.DBMS_METADATA", line 8344

ORA-06512: at line 1

ORA-06512: at line 10



ERROR at line 1:

ORA-00604: error occurred at recursive SQL level 2

ORA-04063: package body "SYS.DBMS_METADATA" has errors

ORA-06512: at line 10


解決辦法:

SQL> shutdown immediate

SQL> spool /tmp/spool.txt

SQL> startup upgrade    

SQL>@?/rdbms/admin/catupgrd.sql

SQL> shutdown immediate

SQL> spool off

--檢查日誌有沒有特殊的報錯

SQL> Startup

SQL>@?/rdbms/admin/utlrp.sql




ORA-31600 While Running DBMS_METADATA.GET_DDL (文件 ID 1567572.1)

In this Document


Symptoms

Cause

Solution


APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later
Information in this document applies to any platform.
***Checked for relevance on 11-Jan-2016***

SYMPTOMS

While trying to get any table or any object DDL using DBMS_METADATA, the following errors occurs

SQL> select dbms_metadata.GET_DDL('TABLE', 'Table_Name', 'SCHEMA') from dual;


ERROR:
ORA-31600: invalid input value COMPATIBLE for parameter VERSION in function GET_DDL
ORA-06512: at "SYS.DBMS_METADATA", line 3110
ORA-06512: at "SYS.DBMS_METADATA", line 3165
ORA-06512: at "SYS.DBMS_METADATA", line 4812
ORA-06512: at line 1

 

The Compatible parameter in database parameters file is set to proper value.

CAUSE

 Issue caused by inconsistencies with packages.

SOLUTION

1- Shutdown the database if it is not down

2- Run the below steps

SQL> spool /tmp/spool.txt
SQL> startup upgrade    
SQL>@?/rdbms/admin/catupgrd.sql
SQL> shutdown immediate
SQL> spool off

 
3- Startup again with no upgrade option

4- Run utlrp.sql to validate invalide objects

SQL>@?/rdbms/admin/utlrp.sql to validate objects

5- Re-test DBMS_METADATA again

SQL> select dbms_metadata.GET_DDL('TABLE', 'Table_Name', 'SCHEMEA') from dual;





About Me

........................................................................................................................

● 本文作者:小麥苗,部分內容整理自網路,若有侵權請聯絡小麥苗刪除

● 本文在itpub( http://blog.itpub.net/26736162 )、部落格園( http://www.cnblogs.com/lhrbest )和個人微信公眾號( xiaomaimiaolhr )上有同步更新

● 本文itpub地址: http://blog.itpub.net/26736162

● 本文部落格園地址: http://www.cnblogs.com/lhrbest

● 本文pdf版、個人簡介及小麥苗雲盤地址: http://blog.itpub.net/26736162/viewspace-1624453/

● 資料庫筆試面試題庫及解答: http://blog.itpub.net/26736162/viewspace-2134706/

● DBA寶典今日頭條號地址: http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826

........................................................................................................................

● QQ群號: 230161599 (滿) 、618766405

● 微信群:可加我微信,我拉大家進群,非誠勿擾

● 聯絡我請加QQ好友 646634621 ,註明新增緣由

● 於 2018-07-01 06:00 ~ 2018-07-31 24:00 在魔都完成

● 最新修改時間:2018-07-01 06:00 ~ 2018-07-31 24:00

● 文章內容來源於小麥苗的學習筆記,部分整理自網路,若有侵權或不當之處還請諒解

● 版權所有,歡迎分享本文,轉載請保留出處

........................................................................................................................

小麥苗的微店 https://weidian.com/s/793741433?wfr=c&ifr=shopdetail

小麥苗出版的資料庫類叢書 http://blog.itpub.net/26736162/viewspace-2142121/

小麥苗OCP、OCM、高可用網路班 http://blog.itpub.net/26736162/viewspace-2148098/

小麥苗騰訊課堂主頁 https://lhr.ke.qq.com/

........................................................................................................................

使用 微信客戶端 掃描下面的二維碼來關注小麥苗的微信公眾號( xiaomaimiaolhr )及QQ群(DBA寶典)、新增小麥苗微信, 學習最實用的資料庫技術。

........................................................................................................................

歡迎與我聯絡

 

 



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2158232/,如需轉載,請註明出處,否則將追究法律責任。

相關文章