日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle重建orainventory,重建oraInventory解决ORA-20001

發布時間:2023/12/18 编程问答 53 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle重建orainventory,重建oraInventory解决ORA-20001 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

數據庫啟動報ORA-20001: Latest xml inventory is not loaded into table錯誤

Completed: ALTER DATABASE OPEN

2018-01-23T23:46:27.924841+08:00

CJQ0 started with pid=54, OS id=6653

2018-01-23T23:46:31.705550+08:00

Unable to obtain current patch information due to error: 20001,

ORA-20001: Latest xml inventory is not loaded into table

ORA-06512: at "SYS.DBMS_QOPATCH", line 777

ORA-06512: at "SYS.DBMS_QOPATCH", line 864

ORA-06512: at "SYS.DBMS_QOPATCH", line 2222

ORA-06512: at "SYS.DBMS_QOPATCH", line 740

ORA-06512: at "SYS.DBMS_QOPATCH", line 2247

===========================================================

Dumping current patch information

===========================================================

Unable to obtain current patch information due to error: 20001

===========================================================

查詢相關sql報錯

SYS@xffdb>select * from OPATCH_XML_INV ;

ERROR:

ORA-29913: error in executing ODCIEXTTABLEFETCH callout

ORA-29400: data cartridge error

KUP-04004: error while reading file /u03/app/oracle/product/12.2.0.1/dbhome/QOpatch/qopiprep.bat

no rows selected

Elapsed: 00:00:00.58

SYS@xffdb>select xmltransform(dbms_qopatch.get_opatch_lsinventory(), dbms_qopatch.GET_OPATCH_XSLT()) from dual ;

ERROR:

ORA-20001: Latest xml inventory is not loaded into table

ORA-06512: at "SYS.DBMS_QOPATCH", line 777

ORA-06512: at "SYS.DBMS_QOPATCH", line 864

ORA-06512: at "SYS.DBMS_QOPATCH", line 2222

ORA-06512: at "SYS.DBMS_QOPATCH", line 740

ORA-06512: at "SYS.DBMS_QOPATCH", line 2247

no rows selected

Elapsed: 00:00:00.63

datapatch -prereq報錯

[oracle@xifenfei ~]$ $ORACLE_HOME/OPatch/datapatch -prereq

SQL Patching tool version 12.2.0.1.0 Production on Tue Jan 23 18:11:32 2018

Copyright (c) 2012, 2017, Oracle. All rights reserved.

Connecting to database...OK

Note: Datapatch will only apply or rollback SQL fixes for PDBs

that are in an open state, no patches will be applied to closed PDBs.

Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation

(Doc ID 1585822.1)

Queryable inventory could not determine the current opatch status.

Execute 'select dbms_sqlpatch.verify_queryable_inventory from dual'

and/or check the invocation log

/u03/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_4909_2018_01_23_18_11_32/sqlpatch_invocation.log

for the complete error.

Prereq check failed, exiting without installing any patches.

Please refer to MOS Note 1609718.1 and/or the invocation log

/u03/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_4909_2018_01_23_18_11_32/sqlpatch_invocation.log

for information on how to resolve the above errors.

SQL Patching tool complete on Tue Jan 23 18:11:45 2018

分析qopiprep.bat文件

cd $ORACLE_HOME

PATH=/bin:/usr/bin

export PATH

# sed tried to convert from one encoding to other in presence of LC_ALL

# or LANG settings. Since opatch returning UTF-8 based encoding we do not

# need such a conversion. So safely skip it

LANG=en_US.UTF-8

export LANG

LC_ALL=''

export LC_ALL

# Option: "-retry 0" avoids retries in case of locked inventory.

# Option: "-invPtrLoc" is required for non-central-inventory

# locations. $OPATCH_PREP_LSINV_OPTS which may set by users

# in the environment to configure special OPatch options

# ("-jdk" is another good candidate that may require configuration!).

# Option: "-all" gives information on all Oracle Homes

# installed in the central inventory. With that information, the

# patches of non-RDBMS homes could be fetched.

DBSID=$ORACLE_SID

ORABASE=`$ORACLE_HOME/bin/orabasehome`

rm -rf $ORABASE/rdbms/log/xml_file_$DBSID.xml

$ORACLE_HOME/OPatch/opatch lsinventory -xml $ORABASE/rdbms/log/xml_file_$DBSID.xml -retry 0 -invPtrLoc $ORACLE_HOME/oraInst.loc >> $ORABASE/rdbms/log/stout_$DBSID.txt

cat $ORABASE/rdbms/log/xml_file_$DBSID.xml | sed 's/^ *//' | tr '\n' ' '

echo "UIJSVTBOEIZBEFFQBL"

rm $ORABASE/rdbms/log/xml_file_$DBSID.xml

rm $ORABASE/rdbms/log/stout_$DBSID.txt

這里主要是$ORACLE_HOME/OPatch/opatch lsinventory可能異常,測試該功能

qopatch_log日志

[oracle@xifenfei ~]$ tail -f /u03/app/oracle/product/12.2.0.1/dbhome/QOpatch/qopatch_log.log

LOG file opened at 01/23/18 18:48:55

KUP-05007: Warning: Intra source concurrency disabled because the preprocessor option is being used.

Field Definitions for table OPATCH_XML_INV

Record format DELIMITED BY NEWLINE

Data in file has same endianness as the platform

Reject rows with all null fields

Fields in Data Source:

XML_INVENTORY CHAR (100000000)

Terminated by "UIJSVTBOEIZBEFFQBL"

Trim whitespace same as SQL Loader

KUP-04004: error while reading file /u03/app/oracle/product/12.2.0.1/dbhome/QOpatch/qopiprep.bat

KUP-04017: OS message: Error 0

KUP-04017: OS message: LsInventorySession failed: RawInventory gets null OracleHomeInfo

cat: /u03/app/oracle/product/12.2.0.1/dbhome/rdbms/log/xml_file_xffdb.xml: No such file or direc

KUP-04118: operation "pipe read", location "skudmir:2"

opatch lsinventory驗證

[oracle@xifenfei ~]$ /u03/app/oracle/product/12.2.0.1/dbhome/OPatch/opatch lsinventory

Oracle Interim Patch Installer version 12.2.0.1.6

Copyright (c) 2018, Oracle Corporation. All rights reserved.

Oracle Home : /u03/app/oracle/product/12.2.0.1/dbhome

Central Inventory : /u01/app/oraInventory

from : /u03/app/oracle/product/12.2.0.1/dbhome/oraInst.loc

OPatch version : 12.2.0.1.6

OUI version : 12.2.0.1.4

Log file location : /u03/app/oracle/product/12.2.0.1/dbhome/cfgtoollogs/opatch/opatch2018-01-23_23-50-29PM_1.log

List of Homes on this system:

Home name= OraDB12Home1, Location= "/u01/app/oracle/product/12.2.0/dbhome_1"

LsInventorySession failed: RawInventory gets null OracleHomeInfo

OPatch failed with error code 73

現在到這一步,可以確定判斷opatch lsinventory運行異常,導致DBMS_QOPATCH無法正常工作,而引起opatch異常的原因是由于RawInventory gets null OracleHomeInfo

分析inventory.xml 文件

[oracle@xifenfei ContentsXML]$ cat inventory.xml

12.2.0.1.0

2.1.0.6.0

因為該機器上安裝過三個版本的oracle,12.2 beta,11.2.0.4,12.2.0.1,現在oracle home只有第一個beta的,因此這個部分肯定異常,導致后面的12.2正式版無法獲取到oraclehome

重建oraInventory

[oracle@xifenfei app]$ cd $ORACLE_HOME/oui/bin

[oracle@xifenfei bin]$ ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u01/app/oracle/product/12.2.0/dbhome_1" ORACLE_HOME_NAME="OraDB12betaHome1"

Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 3935 MB Passed

The inventory pointer is located at /etc/oraInst.loc

'AttachHome' was successful.

[oracle@xifenfei bin]$ ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u02/app/oracle/product/11.2.0.4/dbhome" ORACLE_HOME_NAME="OraDb11g_home1"

Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 3935 MB Passed

The inventory pointer is located at /etc/oraInst.loc

'AttachHome' was successful.

[oracle@xifenfei bin]$ ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u03/app/oracle/product/12.2.0.1/dbhome" ORACLE_HOME_NAME="OraDb122g_home1"

Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 3935 MB Passed

The inventory pointer is located at /etc/oraInst.loc

'AttachHome' was successful.

--驗證inventory.xml 文件

[oracle@xifenfei ContentsXML]$ cat inventory.xml

12.2.0.1.4

2.1.0.6.0

驗證opatch lsinventory

[oracle@xifenfei bin]$ opatch lsinv

Oracle Interim Patch Installer version 12.2.0.1.6

Copyright (c) 2018, Oracle Corporation. All rights reserved.

Oracle Home : /u03/app/oracle/product/12.2.0.1/dbhome

Central Inventory : /u01/app/oraInventory

from : /u03/app/oracle/product/12.2.0.1/dbhome/oraInst.loc

OPatch version : 12.2.0.1.6

OUI version : 12.2.0.1.4

Log file location : /u03/app/oracle/product/12.2.0.1/dbhome/cfgtoollogs/opatch/opatch2018-01-24_00-19-55AM_1.log

Lsinventory Output file location : /u03/app/oracle/product/12.2.0.1/dbhome/cfgtoollogs/opatch/lsinv/lsinventory2018-01-24_00-19-55AM.txt

--------------------------------------------------------------------------------

Local Machine Information::

Hostname: xifenfei

ARU platform id: 226

ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 12c 12.2.0.1.0

There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

--------------------------------------------------------------------------------

OPatch succeeded.

驗證dbms_qopatch工作正常

[oracle@xifenfei ContentsXML]$ $ORACLE_HOME/OPatch/datapatch -prereq

SQL Patching tool version 12.2.0.1.0 Production on Wed Jan 24 00:21:48 2018

Copyright (c) 2012, 2017, Oracle. All rights reserved.

Connecting to database...OK

Note: Datapatch will only apply or rollback SQL fixes for PDBs

that are in an open state, no patches will be applied to closed PDBs.

Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation

(Doc ID 1585822.1)

Determining current state...done

Adding patches to installation queue and performing prereq checks...done

Installation queue:

For the following PDBs: CDB$ROOT PDB$SEED

Nothing to roll back

Nothing to apply

SQL Patching tool complete on Wed Jan 24 00:21:55 2018

SYS@xffdb>select dbms_sqlpatch.verify_queryable_inventory from dual;

VERIFY_QUERYABLE_INVENTORY

--------------------------------------------------------------------------------------------------

OK

Elapsed: 00:00:01.03

SYS@xffdb>select xmltransform(dbms_qopatch.get_opatch_lsinventory(), dbms_qopatch.GET_OPATCH_XSLT()) from dual ;

XMLTRANSFORM(DBMS_QOPATCH.GET_OPATCH_LSINVENTORY(),DBMS_QOPATCH.GET_OPATCH_XSLT())

----------------------------------------------------------------------------------------------------------

Oracle Querayable Patch Interface 1.0

-----------------------------------------

Elapsed: 00:00:01.09

SYS@xffdb>

通過修復錯誤的oraInventory解決ORA-20001問題

總結

以上是生活随笔為你收集整理的oracle重建orainventory,重建oraInventory解决ORA-20001的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。