Categories: SQL Complex Queries

How to find patches applied on Oracle database ?

In my previous articles I have given the query to find the size of oracle database in multiple ways. There are so many questions still in mind about the oracle patches. Sometimes users are facing the issue in applying the patches on Oracle database and sometimes user will have to find patches applied on Oracle database. In this article I would like to give how to find patches applied on Oracle database with multiple queries or commands.

Multiple ways to find patches applied on Oracle database :

In this section I would like to give the ways to find patches applied on Oracle database with multiple queries or commands. Now a days in latest version of oracle the patches application will be automated but if you are using previous versions you require to find out the patches already applied.

Finding patches applied on Oracle 11 G version :

1. Opatch Utility :

Oracle Patch download and installation is the basic task for every database administrator. DBA can use Oracle opatch utility to know all the Oracle Patch applied to the database. It will also show you the list of all the bug fixed during patching.

User can use the Opatch Utility to find out the patches already applied.

Command used :

cd $ORACLE_HOME/OPatch

opatch lsinventory

Find Patch description on Linux :

$ORACLE_HOME/OPatch/opatch lsinventory|grep “Patch description”

2. Using History table

User can also find out the patches applied using history table.

select * from sys.registry$history;

3. Check the patch details from SQL Plus tool :

SQL plus is mostly used tool for SQL development. Kindly check the following query useful to find out details of the patch on SQL PLUS tool.


SELECT TO_CHAR(action_time, ‘DD-MON-YYYY HH24:MI:SS’) AS Timeofaction, action, version, id, comments, bundle_series FROM sys.registry$history ORDER by action_time;

4.Is_patch_installed procedure

You can use the is_patch_installed procedure for finding out the patch information.

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

User can check the patch number is installed or not with the procedure.

5.Check all applied patches

User can check all applied patches with the SQL.

 set serverout on;
 exec dbms_qopatch.get_sqlpatch_status;

Finding patches applied 12 C version :

1. Same using OPatch version

cd $ORACLE_HOME/OPatch

opatch lsinventory

2. using dba_registry_sqlpatch view:

SQL> select * from dba_registry_sqlpatch;

3. using package dbms_qopatch

SQL> set serverout on

SQL> exec dbms_qopatch.get_sqlpatch_status;

4.Finding out the details of Patch using SQL PLUS

select patch_id, version, status, Action,Action_time from dba_registry_sqlpatch order by action_time;

These are above ways to find out the applied patches on Oracle. With using above queries user can find out the details of the patch.

Amit S

Oracle Consultant with vast experience in Oracle BI and PL/SQL Development. Amiet is the admin head of this website who contributes by preparing tutorials and articles related to database technologies. He is responsible to manage the content and front-end of the website.

Share
Published by
Amit S

Recent Posts

The Essential Guide to Cryptocurrency Exchange Platform Development for Beginners and Beyond

Introduction Cryptocurrencies took the world by storm, setting up a new financial system and breaking…

12 months ago

Top 20 System Administrator Interview Questions and answers

In my previous article I have given Top 20 technical support interview questions with its…

1 year ago

Desktop Support Scenario Based Interview Questions

In my previous articles I have given 15 most asked desktop support interview questions with…

1 year ago

How Do Business Analysts Use SQL for Their Needs?

A business analyst is someone who is versed in processes of data analysis used for…

1 year ago

Top 15 Control-M Interview Questions with Answers

In my previous article I have already given top questions and answers for Desktop support…

1 year ago

Top 20 SQL Interview Questions for Production Support

In my previous article I have given unix production support interview questions and answers. In…

1 year ago