联系:手机/微信(+86 17813235971) QQ(107644445)
标题:ORA-20001: Latest xml inventory is not loaded into table
作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]
12.2数据库启动报ORA-20001错
2018-01-22T04:51:19.574350-05: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 ===========================================================
patch日志
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
DBMS_QOPATCH包是提供PLSQL/SQL接口方式访问数据库补丁安装情况,oracle在启动的时候会去调用这个包查询patch情况,由于ORA-20001 Latest XML inventory is not loaded into table.导致失败,从而出现上述启动错误。
主要相关的sql
CREATE OR REPLACE DIRECTORY "OPATCH_LOG_DIR" AS '/u01/app/oracle/product/11.2.0/dbhome_1/QOpatch'; CREATE OR REPLACE DIRECTORY "OPATCH_SCRIPT_DIR" AS '/u01/app/oracle/product/11.2.0/dbhome_1/QOpatch'; CREATE TABLE "SYS"."OPATCH_XML_INV" ( "XML_INVENTORY" CLOB ) ORGANIZATION EXTERNAL ( TYPE ORACLE_LOADER DEFAULT DIRECTORY "OPATCH_SCRIPT_DIR" ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE CHARACTERSET UTF8 DISABLE_DIRECTORY_LINK_CHECK READSIZE 8388608 preprocessor opatch_script_dir:'qopiprep.bat' BADFILE opatch_script_dir:'qopatch_bad.bad' LOGFILE opatch_log_dir:'qopatch_log.log' FIELDS TERMINATED BY 'UIJSVTBOEIZBEFFQBL' MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL FIELDS ( xml_inventory CHAR(100000000) ) ) LOCATION ( "OPATCH_SCRIPT_DIR":'qopiprep.bat' ) ) REJECT LIMIT UNLIMITED;
解决方案
---方案1 SQL> alter system set "_disable_directory_link_check"=true scope=spfile; System altered. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 2432696320 bytes Fixed Size 8795664 bytes Variable Size 654313968 bytes Database Buffers 1761607680 bytes Redo Buffers 7979008 bytes Database mounted. Database opened. SQL> SELECT a.ksppinm "Parameter", 2 b.ksppstvl "Session Value", 3 c.ksppstvl "Instance Value" 4 FROM x$ksppi a, 5 x$ksppcv b, 6 x$ksppsv c 7 WHERE a.indx = b.indx 8 AND a.indx = c.indx 9 AND a.ksppinm LIKE '/_disable_direc%' escape '/' ; Parameter -------------------------------------------------------------------------------- Session Value -------------------------------------------------------------------------------- Instance Value -------------------------------------------------------------------------------- _disable_directory_link_check TRUE TRUE SQL> exit $ORACLE_HOME/sqlpatch/datapatch ---方案2 SQL> create or replace directory OPATCH_LOG_DIR as '<complete path to QOpatch>'; Directory created. SQL> create or replace directory OPATCH_SCRIPT_DIR as '<complete path to QOpatch>'; Directory created. ---方案3 cd $ORACLE_HOME/sqlpatch ./datapatch -verbose ---方案4 chmod 775 -r $ORACLE_HOME/rdbms/log $ORACLE_HOME/OPatch/datapatch -prereq
参考MOS
Queryable Patch Inventory – Issues/Solutions for ORA-20001: Latest xml inventory is not loaded into table (Doc ID 1602089.1)
12.2:DB Alert.log shows ORA-20001: Latest xml inventory,ORA-06512: at “SYS.DBMS_QOPATCH”,”KUP-04004: error while reading file” (Doc ID 2323937.1)