Useful Queries on 12c CDB PDB Datapatch

I found some useful queries to check on 12c CDB PDB datapatch.  ( you might be aware of this may be )

In CDB

SQL> ALTER SESSION SET container = cdb$root;

In PDB

SQL> alter session set container=pdb3;

SQL> select owner, directory_name, directory_path from dba_directories where directory_name like ‘OPATCH%’ order by 2;
SQL> set serverout on
SQL> exec dbms_qopatch.get_sqlpatch_status;

inventory information

SQL> set pagesize 0

SQL> set long 1000000

SQL> select xmltransform(dbms_qopatch.get_opatch_install_info, dbms_qopatch.get_opatch_xslt) “Home and Inventory” from dual;

Check Patch Applied or not.

Lets check for the latest PSU.

SQL> select patch_id, patch_uid, version, status, description from dba_registry_sqlpatch where bundle_series = ‘PSU’;

SQL> select xmltransform(dbms_qopatch.is_patch_installed(‘21359755’), dbms_qopatch.get_opatch_xslt) “Patch installed?” from dual;

The equivalent of opatch lsinventory -detail …

SQL> select xmltransform(dbms_qopatch.get_opatch_lsinventory, dbms_qopatch.get_opatch_xslt) from dual;

set heading off long 50000 pages 9999 lines 180 trims on tab off
select xmltransform(dbms_qopatch.get_opatch_count, dbms_qopatch.get_opatch_xslt) from dual;
select xmltransform(dbms_qopatch.get_opatch_list, dbms_qopatch.get_opatch_xslt) from dual;
select xmltransform(dbms_qopatch.get_pending_activity, dbms_qopatch.get_opatch_xslt) from dual;

set serverout on
exec dbms_qopatch.get_sqlpatch_status;

Hope this helps

 

Advertisements

Author: jee

Oracle Engineered Guy work for Oracle Corp. Techno-addict for Exadata, SuperCluster, ODA, RAC, ASM, HA.Fusion Music Enthusiast,Son,Husband,Father, Information-news- Freak, Optimist, Humanist. Interests : Technology, Innovation, Sharing interesting content. Views expressed on this account are my own and don't necessarily reflect the views of Oracle & its affiliates.