Tuesday, 2 June 2020

PL/SQL: ORA-00904: "PATCH_DIRECTORY": invalid identifier & PL/SQL: ORA-00904: "INSTALL_ID": invalid identifier During datapatch

Symptoms:During datapatch below error reported
    Error at line 89: Warning: Package Body created with compilation errors.
    Error at line 95: 311/9    PL/SQL: SQL Statement ignored
    Error at line 96: 313/24   PL/SQL: ORA-00904: "PATCH_DIRECTORY": invalid identifier
    Error at line 97: 951/5    PL/SQL: SQL Statement ignored
    Error at line 98: 951/20   PL/SQL: ORA-00904: "INSTALL_ID": invalid identifier
Prereq check failed, exiting without installing any patches.

Cause:DBMS_SQLPATCH PackageBody Is Invalid status
SQL>select OWNER, OBJECT_NAME, OBJECT_TYPE, STATUS from dba_objects where OBJECT_NAME='DBMS_SQLPATCH';

OWNER OBJECT_NAME OBJECT_TYPE STATUS
------  ----------------        ---------------    ------
SYS DBMS_SQLPATCH PACKAGE BODY      INVALID

Fix:

SQL>select name from v$database;

NAME
---------
TESTDB

SQL> set linesize 400
col ACTION_TIME for a30
col DESCRIPTION for a70
col BUNDLE_SERIES for a20
select patch_id,action,status,action_time,description,bundle_series from DBA_REGISTRY_SQLPATCH;

 PATCH_ID ACTION STATUS  ACTION_TIME                 DESCRIPTION
 -------- ------ ------- ---------------------------- ------------------------------------------------------
  21076681 APPLY SUCCESS 30-APR-17 09.36.19.247000 PM bundle:PSU
  17030189 APPLY SUCCESS 30-APR-17 09.36.19.247000 PM sqlpatch
  25433286 APPLY SUCCESS 22-MAY-17 07.23.52.903000 AM WINDOWS DB BUNDLE PATCH 12.1.0.2.170228(64bit):25433286
  26994216 APPLY SUCCESS 06-DEC-17 04.41.39.935000 PM WINDOWS DB BUNDLE PATCH 12.1.0.2.171130(64bit):26994216
oracle@oractest1.lfnet.se-TESTDB] /u01/app/oracle/product/12.1.0/dbhome_1/OPatch > ./datapatch -verbose
SQL Patching tool version 12.1.0.2.0 Production on Tue May 12 09:26:21 2020
Copyright (c) 2012, 2016, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/cfgtoollogs/sqlpatch/sqlpatch_20923_2020_05_12_09_26_21/sqlpatch_invocation.log

Connecting to database...OK
Bootstrapping registry and package to current versions...done
  Error in bootstrap log /u01/app/cfgtoollogs/sqlpatch/sqlpatch_20923_2020_05_12_09_26_21/bootstrap1_TESTDB.log:
    Error at line 89: Warning: Package Body created with compilation errors.
    Error at line 95: 311/9    PL/SQL: SQL Statement ignored
    Error at line 96: 313/24   PL/SQL: ORA-00904: "PATCH_DIRECTORY": invalid identifier
    Error at line 97: 951/5    PL/SQL: SQL Statement ignored
    Error at line 98: 951/20   PL/SQL: ORA-00904: "INSTALL_ID": invalid identifier
Prereq check failed, exiting without installing any patches.

Please refer to MOS Note 1609718.1 and/or the invocation log
/u01/app/cfgtoollogs/sqlpatch/sqlpatch_20923_2020_05_12_09_26_21/sqlpatch_invocation.log
for information on how to resolve the above errors.

SQL Patching tool complete on Tue May 12 09:26:24 2020
[oracle@oractest1-TESTDB] /u01/app/oracle/product/12.1.0/dbhome_1/OPatch > echo $ORACLE_SID
TESTDB
[oracle@oractest1-TESTDB] /u01/app/oracle/product/12.1.0/dbhome_1/OPatch > sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue May 12 09:27:16 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL>select OWNER, OBJECT_NAME, OBJECT_TYPE, STATUS from dba_objects where OBJECT_NAME='DBMS_SQLPATCH';

OWNER OBJECT_NAME OBJECT_TYPE STATUS
-----   -------------- ------------  ------
SYS DBMS_SQLPATCH PACKAGE BODY  INVALID
SYS DBMS_SQLPATCH PACKAGE  VALID
PUBLIC DBMS_SQLPATCH SYNONYM  VALID


SQL> create table registry$sqlpatch_backup as select * from registry$sqlpatch ;

Table created.

SQL> drop table registry$sqlpatch;

Table dropped.

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

Session altered.


Package created.

No errors.

Synonym created.


Grant succeeded.


Session altered.

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

Session altered.


Table created.


View created.


Synonym created.


Grant succeeded.


PL/SQL procedure successfully completed.


Grant succeeded.


Synonym created.


Session altered.

SQL> @?/rdbms/admin/prvtsqlpatch.plb

Session altered.


PL/SQL procedure successfully completed.


Table created.


Package body created.

No errors.

Session altered.

SQL> 
SQL> alter package SYS.DBMS_SQLPATCH compile body;

Package body altered.

SQL>select OWNER, OBJECT_NAME, OBJECT_TYPE, STATUS from dba_objects where OBJECT_NAME='DBMS_SQLPATCH';

OWNER OBJECT_NAME OBJECT_TYPE STATUS
-----   ---------------- --------------- ------
SYS DBMS_SQLPATCH PACKAGE BODY   VALID
SYS DBMS_SQLPATCH PACKAGE VALID
PUBLIC DBMS_SQLPATCH SYNONYM VALID


SQL>select name from v$database;

NAME
------
TESTDB

SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2.1475E+10 bytes
Fixed Size     7654304 bytes
Variable Size 1.8589E+10 bytes
Database Buffers 2818572288 bytes
Redo Buffers    59453440 bytes
Database mounted.
Database opened.

SQL> select name,open_mode from v$database;

NAME   OPEN_MODE
------ -----------
TESTDB READ WRITE

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
[oracle@oractest1-TESTDB] /u01/app/oracle/product/12.1.0/dbhome_1/OPatch > echo $ORACLE_SID
TESTDB
[oracle@oractest1-TESTDB] /u01/app/oracle/product/12.1.0/dbhome_1/OPatch > ./datapatch -verbose 
SQL Patching tool version 12.1.0.2.0 Production on Tue May 12 09:29:51 2020
Copyright (c) 2012, 2016, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/cfgtoollogs/sqlpatch/sqlpatch_26935_2020_05_12_09_29_51/sqlpatch_invocation.log

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Bundle series PSU:
  ID 190115 in the binary registry and not installed in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  Nothing to roll back
  The following patches will be applied:
    28729169 (DATABASE PATCH SET UPDATE 12.1.0.2.190115)

Installing patches...
Patch installation complete.  Total patches installed: 1

Validating logfiles...
Patch 28729169 apply: SUCCESS
  logfile: /u01/app/cfgtoollogs/sqlpatch/28729169/22626239/28729169_apply_TESTDB_2020May12_09_30_04.log (no errors)
SQL Patching tool complete on Tue May 12 09:30:34 2020
[oracle@oractest1-TESTDB] /u01/app/oracle/product/12.1.0/dbhome_1/OPatch > 
[oracle@oractest1-TESTDB] /u01/app/oracle/product/12.1.0/dbhome_1/OPatch > echo $ORACLE_SID
TESTDB
[oracle@oractest1-TESTDB] /u01/app/oracle/product/12.1.0/dbhome_1/OPatch > sqlplus / as sydba

SQL*Plus: Release 12.1.0.2.0 Production on Tue May 12 09:31:01 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> select name,open_mode from v$database;

NAME   OPEN_MODE
------ ----------
TESTDB READ WRITE

SQL> set linesize 400
col ACTION_TIME for a30
col DESCRIPTION for a70
col BUNDLE_SERIES for a20
select patch_id,action,status,action_time,description from DBA_REGISTRY_SQLPATCH; 

PATCH_ID ACTION STATUS  ACTION_TIME                  DESCRIPTION
-------- ------ ------  ---------------------------- -----------------------------------------
28729169 APPLY  SUCCESS 12-MAY-20 09.30.34.964893 AM DATABASE PATCH SET UPDATE 12.1.0.2.190115

1 comment:

  1. Hi ,
    Greetings from Application Plus Technologies !!
    We are providing training with certification for the below skill set ,
    *Oracle SQL
    * Advance SQL
    *PLSQL
    *Advance PLSQL
    * EBS Technical
    * Fusion technical
    If you are looking for training contact us
    WhatsApp No : 8108735227 / 7499992939
    Official Email : nida.k@applplus .com

    ReplyDelete