Sunteți pe pagina 1din 8

What is Oracle OPatch, How to use OPatch & List patches | EveryDay Practical Solutions...

Page 1 of 8

What is Oracle OPatch, How to use OPatch & List patches


Posted By Sagar Patil Patch is an Oracle supplied utility to assist you with the process of applying interim patches to Oracles software. OPatch is a Java-based utility which requires the Oracle Universal Installer to be installed. It is platform independent and runs on all supported operating systems. OPatch supports the following: * Applying an interim patch. * Rolling back the application of an interim patch. * Detecting conflict when applying an interim patch after previous interim patches have been applied. It also suggests the best options to resolve a conflict. * Reporting on installed products and interim patch. Prior to release 10.2 (OPatch for 10.2 is only compatible with 10.2 and nothing earlier), OPatch was available from MetaLink as a patch in and of itself (p2617419_10102_GENERIC.zip for release 10.1.0.2). With 10.2, OPatch is installed as part of the RDBMS software. Opatch has several options to execute it: * lsinventory = Adding the lsinventory option to opatch produces a report saying the patches that were applied * -report = Will report to screen and will NOT apply the real patch. Using -report is a good way of performing nondestructive testing of the patch installation process. * rollback= Will undo the patch that was applied. Example: opatch rollback id 4667809 Applying a patch is simple as: * opatch lsinventory -> To see he list of patches already installed * opatch apply <patchid> > To REALLY aplply the patch
Example Applying Patch 4751921 After the Patch is Installed: 1.Log in as sys as sysdba. 2. cd $ORACLE_HOME/rdbms/admin 3. spool catpatch_database_name 4. shutdown immediate 5. startup migrate 6. @catpatch.sql ( this takes at least 1 hour ). After catpatch completed, 7. select object_name,owner from dba_objects where ststus=INVALID; ( YOU WILL GET BETWEEN 230-3300 INVALID OBJECTS , DONT PANIC ) 8. @utlrp.sql 9.select object_name,owner from dba_objects where ststus=INVALID;(YOU WILL GET near 0 invalid objects ) 10. shutdown immediate; 11. startup

http://www.oracledbasupport.co.uk/what-is-opatch-how-to-use-opatch-list-patches/

7/31/2012

What is Oracle OPatch, How to use OPatch & List patches | EveryDay Practical Solutions... Page 2 of 8

Listing Patches

All patches that are installed with Oracles OPatch Utility (Oracles Interim Patch Installer) can be listed by invoking the opatch command with the lsinventory option. Here is an example: $ cd $ORACLE_HOME/OPatch $ opatch lsinventory Invoking OPatch 10.2.0.1.0 Oracle interim Patch Installer version 10.2.0.1.0 Copyright (c) 2005, Oracle Corporation. All rights reserved.. Installed Top-level Products (1): Oracle Database 10g 10.2.0.1.0 There are 1 products installed in this Oracle Home. There are no Interim patches installed in this Oracle Home. OPatch succeeded. Another Method using SYS.REGISTRY$HISTORY Table Since January 2006, contains 1 row for most recent CPU patch applied. A method for determining if CPU patch is applied SELECT comments, action_time, id PATCH_NUMBER, version FROM sys.registry$history WHERE action = CPU; COMMENTSACTION_TIMEPATCH_NUMBERVERSION view 42:39.2 6452863 recompilation view 59:20.3 6452863 recompilation view 23:58.7 6452863 recompilation SELECT comments, action_time, id PATCH_NUMBER, version FROM sys.registry$history COMMENTS ACTION_TIMEPATCH_NUMBERVERSION Upgraded from 40:28.8 10.2.0.4.0 10.2.0.1.0 CPUApr2009 46:06.0 410.2.0.4 view recompilation 42:39.2 6452863 CPUOct2009 56:35.7 610.2.0.4 view recompilation 59:20.3 6452863 CPUJan2010 01:47.4 610.2.0.4 view recompilation 23:58.7 6452863
One other useful Opatch feature

http://www.oracledbasupport.co.uk/what-is-opatch-how-to-use-opatch-list-patches/

7/31/2012

What is Oracle OPatch, How to use OPatch & List patches | EveryDay Practical Solutions... Page 3 of 8

Along with the log and inventory files, Opatch output includes a history file, which contains date and action performed information. The history file is named opatch_history.txt and is located in the $OH\cfgtools\opatch directory. As an example of its contents, the rollback help action performed earlier was recorded as:

[oracle@ opatch]$ pwd /u01/app/oracle/product/10.2.0/cfgtoollogs/opatch [oracle@opatch]$ ls -lrt -rw-rr 1 oracle oracle 98608 May 29 2009 opatch2009-05-29_11-37-50AM.log -rw-rr 1 oracle oracle 103814 Dec 142009opatch2009-12-14_20-49-31PM.log -rw-rr 1 oracle oracle5838Mar112010 opatch2010-03-11_16-01-00PM.log -rw-rr 1 oracle oracle 33878 Mar 292010opatch2010-03-29_19-53-07PM.log vi opatch2010-03-29_19-53-07PM.log Applying patch 9173244 INFO:Starting Apply Session at Mon Mar 29 19:53:42 BST 2010 INFO:ApplySession applying interim patch 9173244toOH /u01/app/oracle/product/10.2.0 INFO:Starting to apply patch to local system at Mon Mar 29 19:53:42 BST 2010 INFO:Start the Apply initScript at Mon Mar 29 19:53:42 BST 2010 INFO:Finish the Apply initScript at Mon Mar 29 19:53:42 BST 2010 INFO:OPatch detected ARU_ID/Platform_ID as 226 INFO:Start saving patch at Mon Mar 29 19:53:44 BST 2010 Share this:
Share

Related Posts
10G ASH script :True Session Wait Activity in Oracle 10g Top of Page

Leave a Reply
You must be logged in to post a comment. Home

Recent Posts
What patches are applied to my SQL Server How to use SP_CONFIGURE in SQL Server SQL Server Maintenance Scripts : YourSqlDba & SQL Server Maintenance Solution How to create a new named instance under SQL 2005/2008 How to locate SQL server clustered database & it's properties WebSphere

http://www.oracledbasupport.co.uk/what-is-opatch-how-to-use-opatch-list-patches/

7/31/2012

What is Oracle OPatch, How to use OPatch & List patches | EveryDay Practical Solutions... Page 4 of 8

Categories
Jython Scripts Tuning

Recent Posts
RAC IBM Web Server Plug-in Analyzer for WebSphere Application Server Installing Tivoli Common Agent Services Agent/Manager DMGR HA: How to backup websphere deployment manager for a Disaster Recovery Jython Script to list websphere ports Adding Another IBM Http Server Instance at Websphere

Categories
ASM Basic Admin Build/Install ClusterWare CRS Errors FAQ/Concepts OCFS TAF/Failover

Recent Posts
Cloning Oracle Clusterware (Applicable only to 11.2.0.2.0 and not for any previous Releases) 11g RAC | Using Duplicate target database 11g Active Database option Replicating RAC database using RMAN at Remote Server Cleaning up a machine with previous Oracle 11g Clusterware/RAC install ASM ftp/http Access Data Guard

Categories
Administration

Recent Posts
11gR2 RAC-Dataguard Sync issue Between Primary & Standby DataGuard Monitorable (Read-Only) Database Properties

http://www.oracledbasupport.co.uk/what-is-opatch-how-to-use-opatch-list-patches/

7/31/2012

What is Oracle OPatch, How to use OPatch & List patches | EveryDay Practical Solutions... Page 5 of 8

How to Safely Remove a Data Guard Broker Configuration under RAC/NON-RAC setup Script to Collect Data Guard Physical Standby Diagnostic Information [ID 241438.1] Script to Collect Data Guard Primary Site Diagnostic Information [ID 241374.1] J2EE 10g Grid Scripts

Scripts Available for Download


IBM Websphere Scripts
List WAS Resources

SQL Server Scripts


List Size of Databases List Size Of Tables SQL Server e-Business Suite

Categories
Concepts Daily Admin Installation,Upgrade Patching,Cloning

Recent Posts
Change EBS Apps Ports Healthcheck of EBS Components Using AOL An experience with Oracle EBS Patching :Upgrade from 12.0.2 -> 12.0.4 How to bounce & Debug Apache /Forms : Log files Using adadmin to compile an Apps environment TOGAF/ITIL All Posts Login / Register Contact

Contact Me
Your Name (required)

http://www.oracledbasupport.co.uk/what-is-opatch-how-to-use-opatch-list-patches/

7/31/2012

What is Oracle OPatch, How to use OPatch & List patches | EveryDay Practical Solutions... Page 6 of 8

Your Email (required)

Subject

Your Message

Send

About Me
submit

Statistics
Human Visits: 190,980

Categories
open all | close all 9 iAS/10 iAS(2) Advanced Replication(39) Dataguard(24) E Business Suite(21) General DBA Tasks (38) Grid Control(40) Linux/Unix(12)

http://www.oracledbasupport.co.uk/what-is-opatch-how-to-use-opatch-list-patches/

7/31/2012

What is Oracle OPatch, How to use OPatch & List patches | EveryDay Practical Solutions... Page 7 of 8

PLSQL Development(4) RAC(53) RMAN(15) Scripts(7) SQL Server(19) Streams Replication(12) Tuning(36) VMware(1) WebLogic(3) WebSphere(86)

Search Errors
ORAGo

8i R3

9i R1

9i R2

10g R1

10g R2

11g R1

11g

R2

Search Docs
Go

8i R3

9i R1

9i R2

10g R1

10g R2

11g R1

11g

R2

Oracle Documentation
8i R3| 9i R1| 9i R2| 10g R1| 10g R2| 10g DG| 11g R1| 11g R2| 11g DG| AS10g R2| AS10g R3

http://www.oracledbasupport.co.uk/what-is-opatch-how-to-use-opatch-list-patches/

7/31/2012

What is Oracle OPatch, How to use OPatch & List patches | EveryDay Practical Solutions... Page 8 of 8

Copyright 2008 - 2012 PlatingNum Park Corporation. All Rights Reserved.

http://www.oracledbasupport.co.uk/what-is-opatch-how-to-use-opatch-list-patches/

7/31/2012

S-ar putea să vă placă și