Thursday, February 11, 2016

12c: Upgrading OPatch Version


In order to install any patch (psu or cpu), first we need to check compatibility of "opatch version". If the opatch version is not compatible, we need to upgrade the opatch version

Steps to Upgrade "opatch version"
step1: Backup the OPatch folder under Oracle_Home as follows 
[admind@tnc63 dbhome_1]$ cp -r OPatch OPatch_backup

Step2: Remove the files in the OPatch directory
[admind@tnc63 dbhome_1]$ cd OPatch

[admind@tnc63 OPatch]$ ls -ltr 
total 164
-rw-r----- 1 admind oinstall    27 Nov 13 15:15 version.txt
drwxr-x--- 2 admind oinstall  4096 Nov 13 15:15 scripts
-rw-r----- 1 admind oinstall  2915 Nov 13 15:15 README.txt
-rw-r----- 1 admind oinstall  3177 Nov 13 15:15 operr_readme.txt
-rwxr-x--- 1 admind oinstall  4220 Nov 13 15:15 operr.bat
-rwxr-x--- 1 admind oinstall  3161 Nov 13 15:15 operr
drwxr-x--- 4 admind oinstall  4096 Nov 13 15:15 opatchprereqs
-rwxr-x--- 1 admind oinstall  2652 Nov 13 15:15 opatch.pl
-rwxr-x--- 1 admind oinstall  9445 Nov 13 15:15 opatchdiag.bat
-rwxr-x--- 1 admind oinstall 10125 Nov 13 15:15 opatchdiag
-rwxr-x--- 1 admind oinstall 15277 Nov 13 15:15 opatch.bat
-rwxr-x--- 1 admind oinstall 27214 Nov 13 15:15 opatch
drwxr-x--- 2 admind oinstall  4096 Nov 13 15:15 jlib
-rwxr-x--- 1 admind oinstall 23764 Nov 13 15:15 emdpatch.pl
-rwxr-x--- 1 admind oinstall   645 Nov 13 15:15 datapatch.bat
-rwxr-x--- 1 admind oinstall   607 Nov 13 15:15 datapatch
drwxr-x--- 5 admind oinstall  4096 Nov 13 15:15 ocm
drwxrwxr-x 3 admind oinstall  4096 Nov 13 15:16 oracle_common
drwxr-x--- 3 admind oinstall  4096 Nov 13 15:16 oplan
drwxr-x--- 4 admind oinstall  4096 Nov 13 15:16 opatchauto-dir
-rwxr-x--- 1 admind oinstall   309 Nov 13 15:16 opatchauto
drwxr-x--- 2 admind oinstall  4096 Nov 13 15:16 docs

[admind@tnc63 OPatch]$ rm -rf *
[admind@tnc63 OPatch]$ pwd
/u01/app/admind/product/12.1.0/dbhome_1/OPatch


Step3: Copy the latest released OPatch version for 12.1, which is available for download from My Oracle Support patch 6880880 by selecting the 12.1.0.1.1 release and copy to the ORACLE_HOME

unzip the downloaded patch in oracle_home, when we unzip patch automatically new files will be loaded in OPatch directory 

[admind@tnc63 dbhome_1]$ unzip p6880880_121010_Linux-x86-64.zip
Archive:  p6880880_121010_Linux-x86-64.zip
  inflating: OPatch/opatch           
   creating: OPatch/oracle_common/
   creating: OPatch/oracle_common/modules/
  inflating: OPatch/oracle_common/modules/com.oracle.glcm.common-logging_1.2.0.0.jar  
   creating: OPatch/jlib/
  inflating: OPatch/jlib/opatchsdk.jar  
  inflating: OPatch/jlib/oracle.opatch.classpath.unix.jar  
  inflating: OPatch/jlib/oracle.opatch.classpath.windows.jar  
  inflating: OPatch/jlib/oracle.opatch.classpath.jar  
  inflating: OPatch/jlib/opatch.jar  
  inflating: OPatch/jlib/oracle.opatchcore.classpath.windows.jar  
  inflating: OPatch/jlib/oracle.opatchcore.classpath.jar  
  inflating: OPatch/jlib/oracle.opatchcore.classpath.unix.jar  
  inflating: OPatch/README.txt       
   creating: OPatch/ocm/
  inflating: OPatch/ocm/ocm_platforms.txt  
   creating: OPatch/ocm/doc/
   creating: OPatch/ocm/bin/
  inflating: OPatch/ocm/bin/emocmrsp  
   creating: OPatch/ocm/lib/
  inflating: OPatch/ocm/lib/http_client.jar  
  inflating: OPatch/ocm/lib/jsse.jar  
  inflating: OPatch/ocm/lib/osdt_core3.jar  
  inflating: OPatch/ocm/lib/emocmclnt.jar  
  inflating: OPatch/ocm/lib/log4j-core.jar  
  inflating: OPatch/ocm/lib/xmlparserv2.jar  
  inflating: OPatch/ocm/lib/regexp.jar  
  inflating: OPatch/ocm/lib/jcert.jar  
  inflating: OPatch/ocm/lib/osdt_jce.jar  
  inflating: OPatch/ocm/lib/jnet.jar  
  inflating: OPatch/ocm/lib/emocmclnt-14.jar  
  inflating: OPatch/ocm/lib/emocmcommon.jar  
 extracting: OPatch/ocm/ocm.zip      
  inflating: OPatch/operr.bat        
  inflating: OPatch/datapatch.bat    
  inflating: OPatch/opatch.bat       
   creating: OPatch/docs/
  inflating: OPatch/docs/Prereq_Users_Guide.txt  
  inflating: OPatch/docs/Users_Guide.txt  
  inflating: OPatch/docs/FAQ         
  inflating: OPatch/docs/cversion.txt  
  inflating: OPatch/opatchdiag       
  inflating: OPatch/opatch.pl        
   creating: OPatch/oplan/
  inflating: OPatch/oplan/oplan      
   creating: OPatch/oplan/jlib/
  inflating: OPatch/oplan/jlib/ValidationRules.jar  
  inflating: OPatch/oplan/jlib/automation.jar  
  inflating: OPatch/oplan/jlib/osysmodel-utils.jar  
  inflating: OPatch/oplan/jlib/oracle.oplan.classpath.jar  
  inflating: OPatch/oplan/jlib/Validation.jar  
   creating: OPatch/oplan/jlib/jaxb/
  inflating: OPatch/oplan/jlib/jaxb/activation.jar  
  inflating: OPatch/oplan/jlib/jaxb/jaxb-impl.jar  
  inflating: OPatch/oplan/jlib/jaxb/jsr173_1.0_api.jar  
  inflating: OPatch/oplan/jlib/jaxb/jaxb-api.jar  
   creating: OPatch/oplan/jlib/apache-commons/
  inflating: OPatch/oplan/jlib/apache-commons/commons-cli-1.0.jar  
  inflating: OPatch/oplan/jlib/apache-commons/commons-compress-1.4.jar  
  inflating: OPatch/oplan/jlib/oplan_core.jar  
  inflating: OPatch/oplan/jlib/bundle.jar  
  inflating: OPatch/oplan/jlib/ProductDriver.jar  
 extracting: OPatch/version.txt      
   creating: OPatch/opatchauto-dir/
   creating: OPatch/opatchauto-dir/opatchautocore/
  inflating: OPatch/opatchauto-dir/opatchautocore/oplan.bat  
  inflating: OPatch/opatchauto-dir/opatchautocore/opatchautobinary  
   creating: OPatch/opatchauto-dir/opatchautocore/jlib/
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/osysmodel-utils.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/ValidationRules.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/oplan_sample.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/bundle.jar  
   creating: OPatch/opatchauto-dir/opatchautocore/jlib/apache-commons/
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/apache-commons/commons-cli-1.0.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/apache-commons/commons-compress-1.4.jar  
   creating: OPatch/opatchauto-dir/opatchautocore/jlib/jaxb/
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/jaxb/jaxb-api.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/jaxb/jaxb-impl.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/jaxb/jsr173_1.0_api.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/jaxb/activation.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/oplan_core.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/oracle.oplan.classpath.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/patchsdk.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/Validation.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/OsysModel.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/ProductDriver.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/jlib/automation.jar  
  inflating: OPatch/opatchauto-dir/opatchautocore/oplan  
  inflating: OPatch/opatchauto-dir/opatchautocore/README.html  
  inflating: OPatch/opatchauto-dir/opatchautocore/README.txt  
   creating: OPatch/opatchauto-dir/opatchautodb/
   creating: OPatch/opatchauto-dir/opatchautodb/jlib/
  inflating: OPatch/opatchauto-dir/opatchautodb/jlib/oracle.opatchautodb.classpath.jar  
  inflating: OPatch/opatchauto-dir/opatchautodb/jlib/oracle.opatchautodb.classpath.windows.jar  
 extracting: OPatch/opatchauto-dir/opatchautodb/jlib/opatchauto-core.jar  
  inflating: OPatch/opatchauto-dir/opatchautodb/jlib/oracle.opatchautodb.classpath.unix.jar  
  inflating: OPatch/opatchauto-dir/opatchautodb/jlib/opatchauto-db.jar  
  inflating: OPatch/opatchauto-dir/opatchautodb/jlib/oplan_db.jar  
  inflating: OPatch/opatchauto-dir/opatchautodb/jlib/oracle.oplan.db.classpath.jar  
  inflating: OPatch/opatchauto-dir/opatchautodb/opatchautodbscr  
   creating: OPatch/opatchprereqs/
   creating: OPatch/opatchprereqs/oui/
  inflating: OPatch/opatchprereqs/oui/knowledgesrc.xml  
   creating: OPatch/opatchprereqs/opatch/
  inflating: OPatch/opatchprereqs/opatch/runtime_prereq.xml  
  inflating: OPatch/opatchprereqs/opatch/rulemap.xml  
  inflating: OPatch/opatchprereqs/opatch/opatch_prereq.xml  
  inflating: OPatch/opatchprereqs/prerequisite.properties  
  inflating: OPatch/datapatch        
  inflating: OPatch/operr_readme.txt  
   creating: OPatch/scripts/
  inflating: OPatch/scripts/opatch_wls  
  inflating: OPatch/scripts/opatch_jvm_discovery  
  inflating: OPatch/scripts/opatch_jvm_discovery.bat  
  inflating: OPatch/scripts/opatch_wls.bat  
  inflating: OPatch/operr            
  inflating: OPatch/opatchdiag.bat   
  inflating: OPatch/emdpatch.pl      
  inflating: OPatch/opatchauto       

Step4: Check OPatch version 
[admind@tnc63 dbhome_1]$ opatch version
OPatch Version: 12.1.0.1.10
OPatch succeeded. 

Opatch is upgraded successfully 

-- Nikhil Tatineni--
--12c: Pluggable databases--

Querys to monitor RAC

following few  Query's will help to find out culprits-  Query to check long running transaction from last 8 hours  Col Sid Fo...