Archive for the ‘Oracle Queries’ Category

HOW TO RECOVER DELETED ORACLE DATAFILES WITH NO DOWNTIME

April 11th, 2021, posted in Oracle Queries
Share

So you have accidentally removed a datafile from your production database? First thing, DON’T PANIC !! There’s an easy way to recover deleted datafiles, for as long as your database remains up. The procedure below works on linux, however this method conceivably can work for other platforms.

This procedure will even work if your database is in NOARCHIVELOG mode.

You may have reached this posting through Google, and in a rush to get the solution right away, so here it is.

The recovery is done in two phases.

Phase 1: instant recovery to prevent Oracle errors (like ORA-27041 “unable to open file”, ORA-01110, ORA-01116)

  1. Find the PID of DBWRITER for the right database.
    ps -ef | grep dbw0_SID_OF_YOUR_DB
    oracle   12272     1  0 10:55 ?        00:00:00 ora_dbw0_test
    oracle   12941 11501  0 12:36 pts/0    00:00:00 grep dbw0_test
  2. List the deleted file handles for that DBWRITER process.
    ls -l /proc/_PID_OF_DBWRITER/fd | grep deleted
    
    lrwx------  1 oracle oinstall 64 Oct 15 11:24 10 -> /home/oracle/product/10.2.0.2/dbs/lkinsttest (deleted)
    lrwx------  1 oracle oinstall 64 Oct 15 11:24 23 -> /ra5a/orabkp/test/TEST/datafile/o1_mf_lost_3k6xzjpm_.dbf (deleted)
  3. Create a symbolic link to your datafile with the original name.
    ln -s /proc/PID_OF_DBWRITER/fd/23 /ra5a/orabkp/test/TEST/datafile/o1_mf_lost_3k6xzjpm_.dbf

    That’s all. Now you are no longer going to get errors. However, if your database goes down now, you will lose that datafile for good.

Phase 2: restore the file

ARCHIVELOG database

  1. (Optional.) Issue a checkpoint. This is to reduce the recovery time when bringing the file online, depending on activity for that datafile. Unfortunately, you can’t checkpoint a single file, so the checkpoint may take some time.
    alter system checkpoint;
  2. Backup the datafile with rman. Why rman? It’s much easier then you think. Total downtime is about one second for inactive datafiles, and more for active ones (with writes).
    rman target /
    report schema;
    backup as copy datafile YOUR_DATAFILE_NUMBER format '/location_of_your_database/new_name_for_File.dbf';
    sql 'alter database datafile YOUR_DATAFILE_NUMBER offline';
    switch datafile YOUR_DATAFILE_NUMBER to copy;
    recover datafile YOUR_DATAFILE_NUMBER;
    sql 'alter database datafile YOUR_DATAFILE_NUMBER online';
    exit;

NOARCHIVELOG database

  1. Make the tablespace with that datafile read only
    select distinct tablespace_name from dba_data_files where file_name = 'YOUR_DELETED_FILE';
    alter tablespace THE_TABLESPACE read only;
  2. Copy the file from the symlink to a new name
    cp SIM_LINK_DATA_FILE NEW_NAME_FOR_DATAFILE.dbf
  3. WARNING: Ensure your copy is complete! Then, crash the database.
    /*WAIT FOR COPY!!!*/
    shutdown abort;
  4. Remove the now invalid symlink, and rename the datafile to its original name. Be careful not to remove the wrong file now — that would be a disaster:
    rm -i SIM_LINK_DATA_FILE
    mv NEW_NAME_FOR_DATAFILE.dbf SIM_LINK_DATA_FILE
  5. Startup your database normally and make the tablespace read/write.
    startup
    alter tablespace THE_TABLESPACE read write;

I hope this helps you to get out of a nasty situation.

Here’s both cases fully captured from terminal. Note, I am using Oracle-managed files. This doesn’t change the steps.

/ra5a/orabkp/test/TEST/datafile> sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Oct 15 12:31:55 2007

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Release 10.2.0.2.0 - 64bit Production

SQL> 
SQL> select tablespace_name, file_name from dba_data_files

TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------------------------------------
USERS                          /ra5a/orabkp/test/TEST/datafile/o1_mf_users_3k6xgwhb_.dbf
SYSAUX                         /ra5a/orabkp/test/TEST/datafile/o1_mf_sysaux_3k6xgwdf_.dbf
UNDOTBS1                       /ra5a/orabkp/test/TEST/datafile/o1_mf_undotbs1_3k6xgwg9_.dbf
SYSTEM                         /ra5a/orabkp/test/TEST/datafile/o1_mf_system_3k6xgwd4_.dbf
EXAMPLE                        /ra5a/orabkp/test/TEST/datafile/o1_mf_example_3k6xjdjw_.dbf
LOST                           /ra5a/orabkp/test/TEST/datafile/o1_mf_lost_3k74mq08_.dbf

6 rows selected.

SQL> select tablespace_name, table_name from dba_tables where owner = 'TESTING';

TABLESPACE_NAME                TABLE_NAME
------------------------------ ------------------------------
LOST                           LOST_TABLE

SQL> connect testing/testing
SQL> select count(*) from lost_table;

  COUNT(*)
----------
     50070

SQL> alter system flush buffer_cache;

System altered.

SQL> select count(*) from lost_table;

  COUNT(*)
----------
     50070

SQL> Disconnected from Oracle Database 10g Release 10.2.0.2.0 - 64bit Production

/ra5a/orabkp/test/TEST/datafile> ls -lF
total 1015132
-rw-r-----  1 oracle oinstall 157294592 Oct 15 12:22 o1_mf_example_3k6xjdjw_.dbf
-rw-r-----  1 oracle oinstall 104865792 Oct 15 12:22 o1_mf_lost_3k74mq08_.dbf
-rw-r-----  1 oracle oinstall 241180672 Oct 15 12:32 o1_mf_sysaux_3k6xgwdf_.dbf
-rw-r-----  1 oracle oinstall 503324672 Oct 15 12:32 o1_mf_system_3k6xgwd4_.dbf
-rw-r-----  1 oracle oinstall  20979712 Oct 15 10:17 o1_mf_temp_3k6xj9xn_.tmp
-rw-r-----  1 oracle oinstall  26222592 Oct 15 12:32 o1_mf_undotbs1_3k6xgwg9_.dbf
-rw-r-----  1 oracle oinstall   5251072 Oct 15 12:22 o1_mf_users_3k6xgwhb_.dbf

/ra5a/orabkp/test/TEST/datafile> rm o1_mf_lost_3k74mq08_.dbf
/ra5a/orabkp/test/TEST/datafile> sqlplus testing/testing

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Oct 15 12:35:24 2007

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Release 10.2.0.2.0 - 64bit Production

SQL> select count(*) from lost_table;

  COUNT(*)
----------
     50070

SQL> alter system flush buffer_cache;

System altered.

SQL> select count(*) from lost_table;
select count(*) from lost_table
*
ERROR at line 1:
ORA-01116: error in opening database file 6
ORA-01110: data file 6:
'/ra5a/orabkp/test/TEST/datafile/o1_mf_lost_3k74mq08_.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

SQL> 
SQL> Disconnected from Oracle Database 10g Release 10.2.0.2.0 - 64bit Production

/ra5a/orabkp/test/TEST/datafile> ps -ef|grep dbw0_test
oracle   12272     1  0 10:55 ?        00:00:00 ora_dbw0_test
oracle   12941 11501  0 12:36 pts/0    00:00:00 grep dbw0_test
/ra5a/orabkp/test/TEST/datafile> ls -l /proc/12272/fd|grep deleted
lrwx------  1 oracle oinstall 64 Oct 15 11:24 10 -> /home/oracle/product/10.2.0.2/dbs/lkinsttest (deleted)
lrwx------  1 oracle oinstall 64 Oct 15 12:17 26 -> /ra5a/orabkp/test/TEST/datafile/o1_mf_lost_3k74mq08_.dbf (deleted)

/ra5a/orabkp/test/TEST/datafile> ln -s /proc/12272/fd/26 /ra5a/orabkp/test/TEST/datafile/o1_mf_lost_3k74mq08_.dbf

/ra5a/orabkp/test/TEST/datafile> ls -lF
total 912620
-rw-r-----  1 oracle oinstall 157294592 Oct 15 12:22 o1_mf_example_3k6xjdjw_.dbf
lrwxrwxrwx  1 oracle oinstall        17 Oct 15 12:37 o1_mf_lost_3k74mq08_.dbf -> /proc/12272/fd/26
-rw-r-----  1 oracle oinstall 241180672 Oct 15 12:32 o1_mf_sysaux_3k6xgwdf_.dbf
-rw-r-----  1 oracle oinstall 503324672 Oct 15 12:32 o1_mf_system_3k6xgwd4_.dbf
-rw-r-----  1 oracle oinstall  20979712 Oct 15 10:17 o1_mf_temp_3k6xj9xn_.tmp
-rw-r-----  1 oracle oinstall  26222592 Oct 15 12:32 o1_mf_undotbs1_3k6xgwg9_.dbf
-rw-r-----  1 oracle oinstall   5251072 Oct 15 12:22 o1_mf_users_3k6xgwhb_.dbf

/ra5a/orabkp/test/TEST/datafile> sqlplus testing/testing

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Oct 15 12:38:18 2007

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Release 10.2.0.2.0 - 64bit Production

SQL> select count(*) from lost_table;

  COUNT(*)
----------
     50070

SQL> alter system flush buffer_cache;

System altered.

SQL> select count(*) from lost_table;

  COUNT(*)
----------
     50070

SQL> 
SQL> Disconnected from Oracle Database 10g Release 10.2.0.2.0 - 64bit Production

/ra5a/orabkp/test/TEST/datafile> rman target /

Recovery Manager: Release 10.2.0.2.0 - Production on Mon Oct 15 12:39:48 2007

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

connected to target database: TEST (DBID=1934173752)

RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    480      SYSTEM               ***     /ra5a/orabkp/test/TEST/datafile/o1_mf_system_3k6xgwd4_.dbf
2    25       UNDOTBS1             ***     /ra5a/orabkp/test/TEST/datafile/o1_mf_undotbs1_3k6xgwg9_.dbf
3    230      SYSAUX               ***     /ra5a/orabkp/test/TEST/datafile/o1_mf_sysaux_3k6xgwdf_.dbf
4    5        USERS                ***     /ra5a/orabkp/test/TEST/datafile/o1_mf_users_3k6xgwhb_.dbf
5    150      EXAMPLE              ***     /ra5a/orabkp/test/TEST/datafile/o1_mf_example_3k6xjdjw_.dbf
6    100      LOST                 ***     /ra5a/orabkp/test/TEST/datafile/o1_mf_lost_3k74mq08_.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       /ra5a/orabkp/test/TEST/datafile/o1_mf_temp_3k6xj9xn_.tmp

RMAN> backup as copy datafile 6 format '/ra5a/orabkp/test/TEST/datafile/lost.dbf';

Starting backup at 2007-10-15 12:40:45
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=154 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00006 name=/ra5a/orabkp/test/TEST/datafile/o1_mf_lost_3k74mq08_.dbf
output filename=/ra5a/orabkp/test/TEST/datafile/lost.dbf tag=TAG20071015T124045 recid=13 stamp=636036046
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2007-10-15 12:40:46

RMAN> sql 'alter database datafile 6 offline';

sql statement: alter database datafile 6 offline

RMAN> switch datafile 6 to copy;

datafile 6 switched to datafile copy "/ra5a/orabkp/test/TEST/datafile/lost.dbf"

RMAN> recover datafile 6;

Starting recover at 2007-10-15 12:41:07
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 2007-10-15 12:41:07

RMAN> sql 'alter database datafile 6 online';

sql statement: alter database datafile 6 online

RMAN> 

Recovery Manager complete.

/ra5a/orabkp/test/TEST/datafile> ls -lF
total 1015132
-rw-r-----  1 oracle oinstall 104865792 Oct 15 12:41 lost.dbf
-rw-r-----  1 oracle oinstall 157294592 Oct 15 12:22 o1_mf_example_3k6xjdjw_.dbf
lrwxrwxrwx  1 oracle oinstall        17 Oct 15 12:37 o1_mf_lost_3k74mq08_.dbf -> /proc/12272/fd/26
-rw-r-----  1 oracle oinstall 241180672 Oct 15 12:32 o1_mf_sysaux_3k6xgwdf_.dbf
-rw-r-----  1 oracle oinstall 503324672 Oct 15 12:38 o1_mf_system_3k6xgwd4_.dbf
-rw-r-----  1 oracle oinstall  20979712 Oct 15 10:17 o1_mf_temp_3k6xj9xn_.tmp
-rw-r-----  1 oracle oinstall  26222592 Oct 15 12:38 o1_mf_undotbs1_3k6xgwg9_.dbf
-rw-r-----  1 oracle oinstall   5251072 Oct 15 12:22 o1_mf_users_3k6xgwhb_.dbf

/ra5a/orabkp/test/TEST/datafile> rm o1_mf_lost_3k74mq08_.dbf
/ra5a/orabkp/test/TEST/datafile> sqlplus testing/testing

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Oct 15 12:42:03 2007

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Release 10.2.0.2.0 - 64bit Production

SQL> select count(*) from lost_table;

  COUNT(*)
----------
     50070

SQL> alter system flush buffer_cache;

System altered.

SQL> select count(*) from lost_table;

  COUNT(*)
----------
     50070


Share

How To Update EBS XML Publisher Temporary Directory

January 5th, 2021, posted in Oracle EBS Application, Oracle Queries
Share
SQL> select value from apps.XDO_CONFIG_VALUES WHERE  property_code = 'SYSTEM_TEMP_DIR';
VALUE
--------------------------------------------------------------------------------
/u1/appl/SHAIK1/wrongdir_tmp



SQL> update apps.XDO_CONFIG_VALUES set value='/u01/share/temp' WHERE  property_code = 'SYSTEM_TEMP_DIR';
1 row updated.


SQL> commit;
Commit complete.



SQL> select value from apps.XDO_CONFIG_VALUES WHERE  property_code = 'SYSTEM_TEMP_DIR';
VALUE
--------------------------------------------------------------------------------
/u01/share/temp

Reference:-
How To Find the EBS XML Publisher Temporary Directory Via SQL? (Doc ID 1189723.1)

 

https://sites.google.com/site/shareapps4u/learning-topic/xml-publisher/how-to-use-xml-bursting-to-send-xml-report-via-email?tmpl=%2Fsystem%2Fapp%2Ftemplates%2Fprint%2F&showPrintDialog=1

Share

TSPITR Issue By Doing Mount Clone Database

November 15th, 2020, posted in Oracle EBS Application, Oracle Queries
Share

alter database mount clone database is a statement that forces all datafiles to be put OFFLINE when mounting the target instance.ORA-19588: archived log RECID 1003 STAMP 2001986 is no longer valid,oracle error,imam dba,dba imam,immam dba,dba immam,rman error
You’ll see it’s being used in the background when you run RMAN commands like:

transport tablespace
recover tablespace .. auxiliary destination ..
“recover table”  (12c feature)

In my case, i was trying to recover an 11.2.0.4 dropped table using “Tablespace Point In Time Recovery” by following the MOS note “How to Recover From a DROP / TRUNCATE / DELETE TABLE with RMAN (Doc ID 223543.1)“. The basic steps are:

– create pfile
– restore controlfile
– mount with “alter database mount clone database;”
– restore and recover a subset of the database with an RMAN script similar to:

RMAN> connect target /
        run {
        allocate channel c1 device type DISK;
        set until time "to_date( '13-01-2016 13:50', 'DD-MM-YYYY HH24:MI')";
        set newname for datafile 1 to "+RECO";
        set newname for datafile 3 to "+RECO";
        set newname for datafile 4 to "+RECO";
        set newname for datafile 23 to "+RECO";
        restore tablespace SYSTEM, UNDOTBS01, UNDOTBS02, TOOLS;
        switch datafile all;
        sql "alter database datafile 1,3,4,23 online";
        recover database skip forever tablespace TEMP,INDX,USERS,etc.;
        sql "alter database rename file ''+RECO/xxx/onlinelog/group_1.281.739547347'' to ''+RECO''";
        sql "alter database rename file ''+RECO/xxx/onlinelog/group_2.282.739547353'' to ''+RECO''";
        sql "alter database rename file ''+RECO/xxx/onlinelog/group_3.283.739547359'' to ''+RECO''";
        sql "alter database rename file ''+RECO/xxx/onlinelog/group_4.284.739547365'' to ''+RECO''";
release channel c1;
}

After completing the required steps, recovery raised the following error:

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup

Of course i got the error when tried to open with resetlogs. After struggling with possible causes, i found an internal support note similar with my issue: “ORA-1547 After Recovery When Database Was Mounted As Clone (Doc ID 252181.1)“. The interesting part was this note was published at Oct 23, 2003 for versions 8.1.7.4 to 9.2.0.4 and the fix was:

Use the following workaround until the bug gets resolved :
Do not mount the database as CLONE as in :
SQL> alter database mount clone database;
but mount is as normal database with :
SQL> alter database mount;

But there’s no bug number stated in the note. Even i thought that mysterious bug must have been fixed many years ago, desperation made me try the workaround with mounting the instance with “alter database mount” and manually taking the required datafiles offline. Suprisingly it worked and i was able to open the database with resetlogs.

As a result, it’s fine for me that RMAN uses “mount clone database” statement internally, however when I’ll do TSPITR again you can be sure that I’ll mount the instance with the way I used to !!

Share

Check Patches Applied in Oracle Database

October 12th, 2020, posted in Oracle Queries
Share

Patches Applied in Oracle Database,Check Patches in Oracle Database,Check Patches Database,Patches Database,

How to Check Latest Patch Applied To The Database

1. Listing Applied Patches

To print a summary of installed patches, you can can use opatch lspatches command.

[[email protected] admin]$ $ORACLE_HOME/OPatch/opatch lspatches
30503372;OJVM PATCH SET UPDATE 11.2.0.4.200114
29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455)
30310975;DATABASE PATCH FOR EXADATA (Jan 2020 - 11.2.0.4.200114) : (30310975)

2. Using opatch lsinventory

 [[email protected] ~]$  $ORACLE_HOME/OPatch/opatch lsinventory|grep "Patch description"
 Patch description:  "Database PSU 12.1.0.2.190716, Oracle JavaVM Component (JUL2019)"
 Patch description:  "Database Patch Set Update : 12.1.0.2.190716 (29494060)"

3. Get detailed info Using opatch lsinventory

[[email protected] ~]$ $ORACLE_HOME/OPatch/opatch lsinventory

 Oracle Interim Patch Installer version 12.2.0.1.17
 Copyright (c) 2019, Oracle Corporation.  All rights reserved.
 Oracle Home       : /scratch/u01/app/oracle/product/12.1.0/dbhome_1
 Central Inventory : /scratch/u01/app/oraInventory
    from           : /scratch/u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
 OPatch version    : 12.2.0.1.17
 OUI version       : 12.1.0.2.0
 Log file location : /scratch/u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2019-10-12_11-28-58AM_1.log
 Lsinventory Output file location : /scratch/u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2019-10-12_11-28-58AM.txt
 
 Local Machine Information::
 Hostname: orahowdb
 ARU platform description:: Linux x86-64
 Installed Top-level Products (1):
 Oracle Database 12c                                                  12.1.0.2.0
 There are 1 products installed in this Oracle Home.
 Interim patches (2) :
 Patch  29774383     : applied on Wed Sep 04 03:44:12 PDT 2019
 Unique Patch ID:  22961858
 Patch description:  "Database PSU 12.1.0.2.190716, Oracle JavaVM Component (JUL2019)"
    Created on 7 Jun 2019, 10:02:47 hrs PST8PDT
    Bugs fixed:
      29774383, 29774367, 29251241, 29254615, 19165673, 28790654, 28915933
      28440711, 28502128, 28502113, 27923320, 27952584, 27952577, 27642235
      27475603, 27461789, 27461842, 25649873, 27001733, 27000663, 27000690
      26635845, 26637592, 26570171, 26027162, 26023002, 26023025, 25437695
      25494413, 25494379, 24917972, 25067795, 24534298, 25076732, 25076756
      24315824, 21659726, 24448240, 24448282, 23177536, 22675136, 23265914
      23265965, 23727148, 22674709, 22670413, 22670385, 21188537, 22139226
      22118835, 22118851, 21555660, 21811517, 19623450, 21566993, 21566944
      19176885, 21068507, 21047803, 21047766, 20415564, 20408829, 20408866
      19877336, 19855285, 19909862, 19895362, 19895326, 19153980, 19231857
      19223010, 19245191, 19699946
 
Patch  29494060     : applied on Wed Sep 04 02:28:08 PDT 2019
 Unique Patch ID:  22993235
 Patch description:  "Database Patch Set Update : 12.1.0.2.190716 (29494060)"
    Created on 28 Jun 2019, 07:47:40 hrs PST8PDT

    Bugs fixed:
      19309466, 19902195, 18250893, 25437699, 19383839, 19781326, 16756406
      18456643, 26546664, 22364044, 18845653, 19915271, 20172151, 18417036
      19516448, 23713236, 24907917, 24796092, 23140259, 19243521, 19658708
      18272672, 21153266, 19174430, 22243719, 19548064, 26556014, 20493163
      20688221, 21387964, 13542050, 22250006, 22734547, 22243983, 21623164
      19012119, 19932634, 19869255, 22232606, 18681056, 23324000, 25427662
      22068305, 24589081, 19439759, 19303936, 22916353, 24835538, 22353346
      19790243, 21106027, 26444887, 23088803, 22529728, 26256131, 19134173
      24303148, 20447445, 21101873, 21188584, 19390567, 26513709, 25780343
      19769480, 21097043, 21225209, 26245237, 20677396, 19284031, 19450314
      19016730, 22517782, 20919320, 22205263, 22075064, 22551446, 22721409
      18440095, 22496904, 16439813, 18354830, 20596234, 22022760, 20936905
      23197103, 22515353, 21514877, 19809171, 21186167, 26111842, 18990023
      25654936, 21492036, 18705806, 28420042, 19578247, 22024071, 22238921
      22809871, 21184223, 19995869, 23089357, 19404068, 18921743, 19065677
      19018447, 19018206, 18308268, 19777862, 29027694, 22223463, 19304354
      22519146, 19445860, 26654363, 27199245, 22977256, 20890311, 27445727
      21142837, 20869721, 24555417, 22179537, 21756699, 20217801, 18819908
      22760595, 25483815, 23628685, 23007241, 19593445, 21080143, 27351628
      20582405, 24966594, 20031873, 25489367, 18618122, 24737581, 21698350
      26784509, 24739928, 18966843, 19077215, 20704450, 19068970, 20543011
      19023822, 24713381, 20432873, 21756677, 22836801, 20328248, 18674047
      18849537, 20087383, 25459958, 20315311, 22897344, 27534509, 25178179
      19308965, 18948177, 19468991, 20868862, 21780146, 23315153, 20466628
      21756661, 20397490, 19706965, 20302006, 24831514, 23240358, 22178855
      19032777, 20862087, 19329654, 18974476, 20603378, 20859910, 19307662
      26203182, 21847223, 20281121, 22568797, 19075256, 19076343, 18866977
      28026866, 29511611, 22808310, 25635149, 20844426, 20904530, 20441797
      21442094, 25079710, 24674955, 18840932, 18740837, 20294666, 25602488
      21517440, 22062517, 19180394, 27337759, 19174942, 20671094, 21889720
      19450116, 18411216, 20117253, 24386767, 20641666, 19931367, 25264559
      19930276, 22092979, 25616268, 21625179, 20879709, 23003979, 20165574
      28578164, 19272708, 19547370, 22624709, 23084507, 23184263, 20228093
      21281532, 25093872, 19805359, 26324206, 19461270, 19434529, 18799063
      20354900, 20378086, 29388020, 17008068, 21246723, 20831538, 20424899
24929210, 24560906, 20144308, 21620471, 19670108, 19068610, 20267166
      25123585, 20476175, 18549238, 19297917, 22950945, 19385656, 23528412
      19684504, 19330795, 21174504, 28357401, 20899461, 20557786, 21911701
      19143550, 20118035, 19024808, 25760195, 20009833, 19604659, 16359751
      26039623, 22820579, 19928926, 23314180, 20212067, 24737403, 20480209
      18904062, 29030780, 26430737, 20856766, 17258582, 27169796, 21668627
      20877664, 23272045, 19487147, 23149541, 24577566, 19430401, 19676905
      20925795, 26482376, 21296029, 21629064, 23229229, 22865673, 20708701
      25353983, 19280225, 21315084, 20613079, 19375649, 19213447, 19989009
      18191823, 27314390, 26336977, 25775213, 24393981, 25639019, 17319928
      14705949, 19703301, 28390273, 21626377, 20122715, 6418158, 23105538
      26198926, 19258504, 21188532, 23151677, 24792678, 17890099, 21649497
      26446098, 16887946, 26024732, 18791688, 19721304, 27012701, 19490948
      19619732, 21164318, 23148260, 18090142, 21641760, 19818513, 23002524
      20139391, 24693382, 19978542, 23543183, 22165897, 19373893, 22359063
      19409212, 18373438, 23035249, 20677974, 18990693, 20470877, 21422580
      21632821, 22351572, 20235511, 23220453, 18742258, 18604493, 23008056
      22901797, 18610915, 20978259, 20832516, 24801152, 26089440, 20907061
      19523462, 20505778, 19183343, 21787056, 21273804, 22782647, 25093739
      17835294, 28708023, 24413809, 27846298, 18371441, 26714910, 24385983
      20413820, 24421668, 28986231, 25897615, 25643931, 23195445, 21281607
      20513399, 20558005, 20093776, 18909599, 20618595, 23572982, 19211433
      20331945, 19512341, 22256431, 19637186, 19022470, 18607546, 26875822
      24573817, 23115139, 19649152, 19201867, 21294938, 20898997, 18510194
      21842740, 22454326, 24683149, 19534363, 25489607, 23061702
 
 OPatch succeeded.

3.1: Detailed information on the applied patch.

[[email protected] ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -details

4: As a sysdba you can also execute below command from the sql prompt to get the patch detail.

SQL> set serverout on;
 SQL> exec dbms_qopatch.get_sqlpatch_status;
 Patch Id : 27338041
         Action : APPLY
         Action Time : 18-APR-2018 15:48:43
         Description : DATABASE PATCH SET UPDATE 12.1.0.2.180417
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/27338041/22036385/27338041_apply_D0
 2NAQCD_CDBROOT_2018Apr18_15_46_27.log
         Status : SUCCESS
 Patch Id : 28259833
         Action : APPLY
         Action Time : 24-OCT-2018 03:29:23
         Description : DATABASE PATCH SET UPDATE 12.1.0.2.181016
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/28259833/22488632/28259833_apply_D0
 2NAQCD_CDBROOT_2018Oct24_03_28_14.log
         Status : SUCCESS
 Patch Id : 28440711
         Action : APPLY
         Action Time : 24-OCT-2018 03:38:12
         Description : Database PSU 12.1.0.2.181016, Oracle JavaVM Component (OCT2018)
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/28440711/22440644/28440711_apply_D0
 2NAQCD_CDBROOT_2018Oct24_03_34_30.log
         Status : SUCCESS
 Patch Id : 28440711
         Action : ROLLBACK
         Action Time : 05-MAR-2019 03:12:23
         Description : Database PSU 12.1.0.2.181016, Oracle JavaVM Component (OCT2018)
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/28440711/22440644/28440711_rollback
 _D02NAQCD_CDBROOT_2019Mar05_03_09_19.log
         Status : SUCCESS
 Patch Id : 28790654
         Action : APPLY
         Action Time : 05-MAR-2019 03:12:23
         Description : Database PSU 12.1.0.2.190115, Oracle JavaVM Component (JAN2019)
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/28790654/22620251/28790654_apply_D0
 2NAQCD_CDBROOT_2019Mar05_03_10_18.log
         Status : SUCCESS
 Patch Id : 28729169
         Action : APPLY
         Action Time : 05-MAR-2019 03:12:23
         Description : DATABASE PATCH SET UPDATE 12.1.0.2.190115
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/28729169/22626239/28729169_apply_D0
 2NAQCD_CDBROOT_2019Mar05_03_10_18.log
         Status : SUCCESS
 Patch Id : 28790654
         Action : ROLLBACK
         Action Time : 30-APR-2019 04:50:11
         Description : Database PSU 12.1.0.2.190115, Oracle JavaVM Component (JAN2019)
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/28790654/22620251/28790654_rollback
 _D02NAQCD_CDBROOT_2019Apr30_04_44_47.log
         Status : SUCCESS
 Patch Id : 29251241
         Action : APPLY
         Action Time : 30-APR-2019 04:50:11
         Description : Database PSU 12.1.0.2.190416, Oracle JavaVM Component (APR2019)
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/29251241/22839506/29251241_apply_D0
 2NAQCD_CDBROOT_2019Apr30_04_46_08.log
         Status : SUCCESS
 Patch Id : 29141015
         Action : APPLY
         Action Time : 30-APR-2019 04:50:11
         Description : DATABASE PATCH SET UPDATE 12.1.0.2.190416
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/29141015/22785785/29141015_apply_D0
 2NAQCD_CDBROOT_2019Apr30_04_46_08.log
         Status : SUCCESS
 Patch Id : 29251241
         Action : ROLLBACK
         Action Time : 04-SEP-2019 04:09:43
         Description : Database PSU 12.1.0.2.190416, Oracle JavaVM Component (APR2019)
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/29251241/22839506/29251241_rollback
 _D02NAQCD_CDBROOT_2019Sep04_04_06_10.log
         Status : SUCCESS
 Patch Id : 29774383
         Action : APPLY
         Action Time : 04-SEP-2019 04:09:43
         Description : Database PSU 12.1.0.2.190716, Oracle JavaVM Component (JUL2019)
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/29774383/22961858/29774383_apply_D0
 2NAQCD_CDBROOT_2019Sep04_04_07_20.log
         Status : SUCCESS
 Patch Id : 29494060
         Action : APPLY
         Action Time : 04-SEP-2019 04:09:43
         Description : DATABASE PATCH SET UPDATE 12.1.0.2.190716
         Logfile :
 /scratch/u01/app/oracle/cfgtoollogs/sqlpatch/29494060/22993235/29494060_apply_D0
 2NAQCD_CDBROOT_2019Sep04_04_07_20.log
         Status : SUCCESS
 PL/SQL procedure successfully completed.

5: To get information on particular patch ID.

SQL> select xmltransform(dbms_qopatch.is_patch_installed('29494060'),dbms_qopatch.get_opatch_xslt) "Patch installed?" from dual;
 Patch installed?
 Patch Information:
          29494060:   applied on 2019-09-04T02:28:08-07:00

6: Patch detail from registry

SQL>  select * from sys.registry$history;
SQL> select * from sys.dba_registry_sqlpatch;
Share

Get Current Patch Set Level of Oracle Applications Products For R12

October 11th, 2020, posted in Oracle EBS Application, Oracle Queries
Share

1) Login to OAM

(Responsibility “Oracle Applications Manager“, menu “OAM Support Cart“)

and Navigate: Support Cart -> Applications Signature -> Collect -> Check “Product Information” box -> Click on “View” (eyeglasses)

In R12

(Responsibility “System Administrator“, Menu “Oracle Application Manager“)
and Navigate : Applications Usage >> Products Installed

This will display the following patchset information :

Application Name
Current Patch Level
Product Version
Status (Installed, Shared Product, Inactive)

2) The patchset level information can be retrieved directly via sqlplus with the following diagnostic script :
$AD_TOP/sql/adutconf.sql

3) Use the below query to pull out the details

SQL>

SELECT fav.application_id,
fav.application_short_name, 
fav.application_name,
fav.basepath,
fav.creation_date,
fpi.status,
fpi.patch_level,
fpi.product_version,
fpi.TABLESPACE,
fpi.index_tablespace,
fpi.temporary_tablespace
FROM fnd_application_vl fav,
fnd_product_installations fpi
WHERE fav.application_id = fpi.application_id(+) 
ORDER BY creation_date DESC
Share