프린트 하기

OS환경 : Oracle Linux 7.5 (64bit)


DB 환경 : Oracle Database 19.7.0.0


에러 : Prereq check failed, exiting without installing any patches.

기존 경로 : /app/oracle/product/19ora

변경 경로 : /app/oracle/product/19orcl

https://positivemh.tistory.com/574 이후 제대로 변경이 안된 경우 에러


오라클 19c 홈경로(엔진경로) 변경 후 $ORACLE_HOME/OPatch 에서 아래 명령 실행시 발생한 에러

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ cd $ORACLE_HOME/OPatch
$ ./datapatch -prereq
SQL Patching tool version 19.7.0.0.0 Production on Tue Jun  2 13:42:44 2020
Copyright (c) 20122020, Oracle.  All rights reserved.
 
Log file for this invocation: /app/oracle/cfgtoollogs/sqlpatch/sqlpatch_37271_2020_06_02_13_42_44/sqlpatch_invocation.log
 
Connecting to database...OK
Gathering database info...done
Error: prereq checks failed!
verify_queryable_inventory returned ORA-20001: Latest xml inventory is not loaded into table
Prereq check failed, exiting without installing any patches.
 
Please refer to MOS Note 1609718.1 and/or the invocation log
/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_37271_2020_06_02_13_42_44/sqlpatch_invocation.log
for information on how to resolve the above errors.
 
SQL Patching tool complete on Tue Jun  2 13:42:53 2020



db 기동 시 alert log

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2020-06-02T13:44:06.184822+09:00
QPI: opatch file present, opatch
QPI: qopiprep.bat file present
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 2327
ORA-06512: at "SYS.DBMS_QOPATCH", line 854
ORA-06512: at "SYS.DBMS_QOPATCH", line 937
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.DBMS_QOPATCH", line 932
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-29400: data cartridge error
KUP-04095: preprocessor command /app/oracle/product/19orcl/QOpatch/qopiprep.bat encountered error "LsInventorySession failed: RawInventory gets null OracleHomeInfo
"
ORA-06512: at "SYS.DBMS_QOPATCH", line 919
ORA-06512: at "SYS.DBMS_QOPATCH", line 2286
ORA-06512: at "SYS.DBMS_QOPATCH", line 817
ORA-06512: at "SYS.DBMS_QOPATCH", line 2309
 
===========================================================
Dumping current patch information
===========================================================
Unable to obtain current patch information due to error: 20001
===========================================================

또는 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
2020-06-02T13:44:06.184822+09:00
QPI: opatch file present, opatch
QPI: OPATCH_SCPT_DIR not present:/app/oracle/product/19orcl/rdbms/log
Unable to obtain current patch information due to error: 20013, ORA-20013: DBMS_QOPATCH ran mostly in non install area
ORA-06512: at "SYS.DBMS_QOPATCH", line 2327
ORA-06512: at "SYS.DBMS_QOPATCH", line 854
ORA-06512: at "SYS.DBMS_QOPATCH", line 634
ORA-06512: at "SYS.DBMS_QOPATCH", line 2309
 
===========================================================
Dumping current patch information
===========================================================
Unable to obtain current patch information due to error: 20013
===========================================================



db 기동시 OPatch 정보를 읽어들이지 못하는 상태



해결 방법 : 수동으로 OPatch 관련 디렉토리 경로 변경

현재 OPatch 관련 디렉토리 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SQL> 
set lines 200
set pages 1000
col directory_name for a30
col directory_path for a40
select directory_name, directory_path 
from dba_directories
where directory_name in ('OPATCH_SCRIPT_DIR','OPATCH_LOG_DIR','OPATCH_INST_DIR')
/
 
DIRECTORY_NAME               DIRECTORY_PATH
------------------------------ ----------------------------------------
OPATCH_INST_DIR            /app/oracle/product/19ora/OPatch
OPATCH_SCRIPT_DIR           /app/oracle/product/19ora/rdbms/log
OPATCH_LOG_DIR               /app/oracle/product/19ora/QOpatch

디렉토리가 현재 변경한 엔진 경로가 아닌 이전 경로의 하위경로(OPatch, rdbms/log, QOpatch 등)을 바라보고 있음



정상경로로 변경

1
2
3
4
SQL>
create or replace directory OPATCH_INST_DIR as '/app/oracle/product/19orcl/OPatch';
create or replace directory OPATCH_LOG_DIR as '/app/oracle/product/19orcl/QOpatch';
create or replace directory OPATCH_SCRIPT_DIR as '/app/oracle/product/19orcl/rdbms/log';



다시 OPatch 관련 디렉토리 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SQL> 
set lines 200
set pages 1000
col directory_name for a30
col directory_path for a40
select directory_name, directory_path 
from dba_directories
where directory_name in ('OPATCH_SCRIPT_DIR','OPATCH_LOG_DIR','OPATCH_INST_DIR')
/
 
DIRECTORY_NAME               DIRECTORY_PATH
------------------------------ ----------------------------------------
OPATCH_INST_DIR            /app/oracle/product/19orcl/OPatch
OPATCH_SCRIPT_DIR           /app/oracle/product/19orcl/rdbms/log
OPATCH_LOG_DIR               /app/oracle/product/19orcl/QOpatch



db 재기동

1
2
3
4
5
6
7
8
9
10
11
12
13
14
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area 1660940992 bytes
Fixed Size            8897216 bytes
Variable Size          956301312 bytes
Database Buffers      687865856 bytes
Redo Buffers            7876608 bytes
Database mounted.
Database opened.



datapatch -prereq 명령 실행

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$ cd $ORACLE_HOME/OPatch
$ ./datapatch -prereq
SQL Patching tool version 19.7.0.0.0 Production on Tue Jun  2 14:10:13 2020
Copyright (c) 20122020, Oracle.  All rights reserved.
 
Log file for this invocation: /app/oracle/cfgtoollogs/sqlpatch/sqlpatch_36058_2020_06_02_14_10_13/sqlpatch_invocation.log
 
Connecting to database...OK
Gathering database info...done
Determining current state...done
 
Current state of interim SQL patches:
Interim patch 30805684 (OJVM RELEASE UPDATE19.7.0.0.200414 (30805684)):
  Binary registry: Installed
  SQL registry: Applied successfully on 31-MAY-20 02.43.03.638505 PM
 
Current state of release update SQL patches:
  Binary registry:
    19.7.0.0.0 Release_Update 200404035018: Installed
  SQL registry:
    Applied 19.7.0.0.0 Release_Update 200404035018 successfully on 31-MAY-20 02.43.03.629765 PM
 
Adding patches to installation queue and performing prereq checks...done
Installation queue:
  No interim patches need to be rolled back
  No release update patches need to be installed
  No interim patches need to be applied
 
SQL Patching tool complete on Tue Jun  2 14:11:12 2020



원인 : 잘못 설정된 OPatch Directory 경로

잘못 설정된 OPatch Directory 경로



참고

보통은 [ https://positivemh.tistory.com/577 오라클 19c 홈경로(엔진경로) 변경 후 기동시 alert log ] 처럼

이렇게 이전 엔진경로와 신규 엔진경로를 알아서 변경함

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2020-05-31T12:05:03.163983+09:00
QPI : Found directory objects and ORACLE_HOME out of sync
QPI : Trying to patch with the current ORACLE_HOME
QPI: ------QPI Old Directories -------
QPI: OPATCH_SCRIPT_DIR:/app/oracle/product/19/db_1/QOpatch
QPI: OPATCH_LOG_DIR:/app/oracle/product/19/db_1/rdbms/log
QPI: OPATCH_INST_DIR:/app/oracle/product/19/db_1/OPatch
QPI: op_scpt_path /app/oracle/product/19c/QOpatch
QPI: Found QPI install at :/app/oracle/product/19c/QOpatch
QPI: Self adjusting the directories
QPI: ------QPI New Directories-------
QPI: OPATCH_SCRIPT_DIR:/app/oracle/product/19c/QOpatch
QPI: OPATCH_LOG_DIR:/app/oracle/product/19c/rdbms/log
QPI: OPATCH_INST_DIR:/app/oracle/product/19c/OPatch
QPI: opatch file present, opatch
QPI: qopiprep.bat file present



참조 : Doc. 1602089.1, Doc. 2033620.1, Doc. 2260075.1