Monday, August 20, 2012

Applying PSU Patch on the grid ASM and db with oracle restart before Upgrade to 11.2.0. 3



Applying the PSU Patchs on the grid ASM and db  with oracle restart environment before starting the Upgrade

Here we upgrade the 11.2.0.2 grid infrastructure  ASM with oracle restart and database to 11.2 .0.3
Before starting the upgrade we need to apply the PSU[patch set update] patches on the grid home and the oracle home for applying the  PSU patches we need the latest OPatch .. we can download the latest OPatch from the MOS

we can download the  p6880880_112000_Linux-x86-64.zip for the OPatch from the MOS

Upgrading the OPatch with the latest  version of OPatch available from MOS

Step1
Backup the $ORACLE_HOME/OPatch  in to the new directory OPatch_bkp

cp -r OPatch/ OPatch_bkp

[oracle@fahdb dbhome_1]$ ll OP*
OPatch:
total 140
drwxr-xr-x 3 oracle oinstall  4096 Aug 20 00:55 crs
drwxr-xr-x 2 oracle oinstall  4096 Aug 20 00:55 docs
-rw-rw-r-- 1 oracle oinstall 23695 Mar 21 23:24 emdpatch.pl
drwxr-xr-x 2 oracle oinstall  4096 Feb 20 21:58 fmw
drwxr-xr-x 2 oracle oinstall  4096 Aug 20 00:55 jlib
drwxr-xr-x 5 oracle oinstall  4096 Aug 20 00:55 ocm
-rwx--x--- 1 oracle oinstall 31471 Mar 21 23:24 opatch
-rwxrwxr-x 1 oracle oinstall 18425 Mar 21 23:24 opatch.bat
-rwxrwxr-x 1 oracle oinstall 10056 Mar 21 23:24 opatchdiag
-rwxrwxr-x 1 oracle oinstall  9352 Mar 21 23:24 opatchdiag.bat
-rw-rw-r-- 1 oracle oinstall    49 Mar 21 23:24 opatch.ini
-rw-rw-r-- 1 oracle oinstall  2576 Mar 21 23:24 opatch.pl
drwxr-xr-x 4 oracle oinstall  4096 Aug 20 00:55 opatchprereqs
drwxrwxr-x 3 oracle oinstall  4096 Mar 21 23:25 oplan
-rw-rw-r-- 1 oracle oinstall  2913 Mar 21 23:24 README.txt

OPatch_bkp:
total 80
drwxr-xr-x 3 oracle oinstall  4096 Aug 20 00:54 crs
drwxr-xr-x 2 oracle oinstall  4096 Aug 20 00:54 docs
-rw-r--r-- 1 oracle oinstall 23695 Aug 20 00:54 emdpatch.pl
drwxr-xr-x 2 oracle oinstall  4096 Aug 20 00:54 fmw
drwxr-xr-x 2 oracle oinstall  4096 Aug 20 00:54 jlib
drwxr-xr-x 2 oracle oinstall  4096 Aug 20 00:54 ocm
-rwxr-xr-x 1 oracle oinstall 22150 Aug 20 00:54 opatch
-rw-r--r-- 1 oracle oinstall    49 Aug 20 00:54 opatch.ini
-rw-r--r-- 1 oracle oinstall  2590 Aug 20 00:54 opatch.pl
drwxr-xr-x 4 oracle oinstall  4096 Aug 20 00:54 opatchprereqs

Step2
And remove the contents from the OPatch  directory and 
cd $ORACLE_HOME/OPatch
rm -rf *

Step3
unzip the p6880880_112000_Linux-x86-64.zip in the oracle home and the grid home where we need the latest version of the OPatch
make sure you are in the ORACLE_HOME and the unzip the OPatch

unzip /home/oracle/p6880880_112000_Linux-x86-64.zip

Step4
Check the verion of the OPatch

[oracle@fahdb ~]$ /u01/app/oracle/oracle/product/11.2.0/dbhome_1/OPatch/opatch version

OPatch Version: 11.2.0.3.0

OPatch succeeded.

NOTE:

The above mentioned steps are normal process of upgrading the Opatch please read the latest patch README according to nay specific change for that patch  

Creating the OCM Response file [ocm.rsp]


Step 1
we need to create the response file for the oracle configuration manager if you have installed on your system

Go to the Opatch directory and then find the ocm/bin

[oracle@fahdb bin]$ pwd
/u01/app/oracle/oracle/product/11.2.0/dbhome_1/OPatch/ocm/bin

[oracle@fahdb bin]$ ls
emocmrsp

Step2
Run the emocmrsp to generate a new response file 
[oracle@fahdb bin]$ ./emocmrsp                                                
  OCM Installation Response Generator 10.3.4.0.0 - Production                   
  Copyright (c) 2005, 2010, Oracle and/or its affiliates.  All rights reserved.                                                                              
  Provide your email address to be informed of security issues, install and  initiate Oracle Configuration Manager. Easier for you if you    use your My Oracle Support Email address/User Name. Visit http://www.oracle.com/support/policies.html for details.                    Email address/User Name:  bpalaneandavar@a-bits.biz
Password (optional):                            
 The OCM configuration responsefile (ocm.rsp) was successfully created

Step3
Check the File has been created on the same location
[oracle@fahdb bin]$ ll                                                      
 total 16                                                                    
 -rwxrw---- 1 oracle oinstall 9063 Nov 27  2009 emocmrsp                    
 -rw-r--r-- 1 oracle oinstall 2969 Aug 20 11:45 ocm.rsp                      

NOTE:
we can use the same response file for different patchs if you MOS details are changed then you can proceed with creating the new ocm.rsp file


Applying the PSU patches according the  version  we have the source as 11.2.0. 2 and to be upgraded to 11.2.0.3 

we are applying the patch on 11.2.0.2 home [both the grid and the oracle home] we are applying the patch 12539000 as the pre reqiust

For grid apply the patch as the root 

Check the oracle HAS  is running in the system if not the patch will fail HAS should be up and running for applying the patch
any database which is using the ASM should be shutdown The LISTENER,ASM,CRS shoud be up for applying the patch


[root@fahdb 12539000]# /u01/app/oracle/grid/11.2.0/grid/OPatch/opatch auto /home/grid/12539000/ -oh /u01/app/oracle/grid/11.2.0/grid/
Executing /usr/bin/perl /u01/app/oracle/grid/11.2.0/grid/OPatch/crs/patch112.pl -patchdir /home/grid -patchn 12539000 -oh /u01/app/oracle/grid/11.2.0/grid/ -paramfile /u01/app/oracle/grid/11.2.0/grid/crs/install/crsconfig_params
opatch auto log file location is /u01/app/oracle/grid/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2012-08-20_00-27-44.log
Detected Oracle Restart install
Using configuration parameter file: /u01/app/oracle/grid/11.2.0/grid/crs/install/crsconfig_params
OPatch  is bundled with OCM, Enter the absolute OCM response file path:
/u01/app/oracle/grid/11.2.0/grid/OPatch/ocm/bin/ocm.rsp
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
Clusterware is either  not running or not configured. You have the following 2 options
1. Configure and Start the Clusterware on this node and re-run the tool
2. or Run the tool with the -och <CRS_HOME_PATH> option and then invoke  tool with -oh <comma seperated ORACLE_HOME_LIST> to patch the RDBMS home

[grid@fahdb ~]$ crsctl start has
CRS-4123: Oracle High Availability Services has been started.

[grid@fahdb ~]$ crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       fahdb
ora.FLASH.dg
               ONLINE  ONLINE       fahdb
ora.LISTENER.lsnr
               ONLINE  ONLINE       fahdb
ora.asm
               ONLINE  ONLINE       fahdb                    Started
ora.ons
               OFFLINE OFFLINE      fahdb
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       fahdb
ora.diskmon
      1        ONLINE  ONLINE       fahdb
ora.evmd
      1        ONLINE  ONLINE       fahdb
ora.fahdb.db
      1        OFFLINE OFFLINE

[root@fahdb 12539000]# /u01/app/oracle/grid/11.2.0/grid/OPatch/opatch auto /home/grid/12539000/ -oh /u01/app/oracle/grid/11.2.0/grid/
Executing /usr/bin/perl /u01/app/oracle/grid/11.2.0/grid/OPatch/crs/patch112.pl -patchdir /home/grid -patchn 12539000 -oh /u01/app/oracle/grid/11.2.0/grid/ -paramfile /u01/app/oracle/grid/11.2.0/grid/crs/install/crsconfig_params
opatch auto log file location is /u01/app/oracle/grid/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2012-08-20_00-56-16.log
Detected Oracle Restart install
Using configuration parameter file: /u01/app/oracle/grid/11.2.0/grid/crs/install/crsconfig_params
OPatch  is bundled with OCM, Enter the absolute OCM response file path:
/u01/app/oracle/grid/11.2.0/grid/OPatch/ocm/bin/ocm.rsp
Enter 'yes' if you have unzipped this patch to an empty directory to proceed  (yes/no):yes
The opatch minimum version  check for patch /home/grid/12539000/etc failed  for /u01/app/oracle/grid/11.2.0/grid
The opatch minimum version  check for patch /home/grid/12539000/files failed  for /u01/app/oracle/grid/11.2.0/grid
Opatch version check failed for oracle home  /u01/app/oracle/grid/11.2.0/grid
Opatch version  check failed
update the opatch version for the failed homes and retry

Check the version of the opatch 

[root@fahdb 12539000]# /u01/app/oracle/grid/11.2.0/grid/OPatch/o
ocm/            opatch          opatch.bat      opatchdiag      opatchdiag.bat  opatchprereqs/  oplan/
[root@fahdb 12539000]# /u01/app/oracle/grid/11.2.0/grid/OPatch/opatch version
OPatch Version: 11.2.0.3.0

OPatch succeeded.
As the patch need the version higher that the 11.2.0.1 we are with the with the latest version the the patch fails then we need  apply the patch manually

Steps for applying the Patch 12539000 manually 

Unlock the grid from the root

[root@fahdb grid]# cd crs/install/
[root@fahdb install]# ls
cmdllroot.sh             crsconfig_params      crspatch.pm    install.excl        onsconfig      preupdate.sh  rootofs.sh                 s_crsconfig_lib.pm
crsconfig_addparams.sbs  crsconfig_params.sbs  hasdconfig.pl  install.incl        oracss.pm      rootcrs.pl    s_crsconfig_defs
crsconfig_lib.pm         crsdelete.pm          inittab        installRemove.excl  paramfile.crs  roothas.pl    s_crsconfig_fahdb_env.txt
[root@fahdb install]# ./roothas.pl -unlock
Using configuration parameter file: ./crsconfig_params
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'fahdb'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'fahdb'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'fahdb'
CRS-2673: Attempting to stop 'ora.FLASH.dg' on 'fahdb'
CRS-2673: Attempting to stop 'ora.evmd' on 'fahdb'
CRS-2677: Stop of 'ora.FLASH.dg' on 'fahdb' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'fahdb' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'fahdb'
CRS-2677: Stop of 'ora.asm' on 'fahdb' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'fahdb'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'fahdb' succeeded
CRS-2677: Stop of 'ora.cssd' on 'fahdb' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'fahdb'
CRS-2677: Stop of 'ora.evmd' on 'fahdb' succeeded
CRS-2677: Stop of 'ora.diskmon' on 'fahdb' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'fahdb' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully unlock /u01/app/oracle/grid/11.2.0/grid

When you unlock it it will bring down Oracle has[crs]

login with the grid owner and the apply the patch manually

$ORACLE_HOME/OPatch/opatch apply -oh <the oracle home to be patched> -local <patch dir>

                          
 [grid@fahdb 12539000]$ /u01/app/oracle/grid/11.2.0/grid/OPatch/opatch napply -oh /u01/app/oracle/grid/11.2.0/grid -local /home/oracle/12539000                

Oracle Interim Patch Installer version 11.2.0.3.0                            
Copyright (c) 2012, Oracle Corporation.  All rights reserved.                                                                                                                                                                                   Oracle Home       : /u01/app/oracle/grid/11.2.0/grid                            
Central Inventory : /u01/app/oracle/oraInventory                                  
 from           : /u01/app/oracle/grid/11.2.0/grid/oraInst.loc                
OPatch version    : 11.2.0.3.0              
OUI version       : 11.2.0.2.0                                                 
Log file location : /u01/app/oracle/grid/11.2.0/grid/cfgtoollogs/opatch/opatch2012-08-20_02-03-58AM_1.log                                                                                                                                       Verifying environment and performing prerequisite checks...                    
OPatch continues with these patches:   12539000                                                                                                               
Do you want to proceed? [y|n]                                               
 Y                                                                              
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/grid/11.2.0/grid')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '12539000' to OH '/u01/app/oracle/grid/11.2.0/grid'

Patching component oracle.rdbms, 11.2.0.2.0...

Verifying the update...
Patch 12539000 successfully applied.
Log file location: /u01/app/oracle/grid/11.2.0/grid/cfgtoollogs/opatch/opatch2012-08-20_02-03-58AM_1.log

OPatch succeeded.
[grid@fahdb 12539000]$

Login as the oracle database owner and apply the patch mannulay

[oracle@fahdb ~]$  /u01/app/oracle/oracle/product/11.2.0/dbhome_1/OPatch/opatch napply -oh /u01/app/oracle/oracle/product/11.2.0/dbhome_1 -local /home/oracle/12539000  
Oracle Interim Patch Installer version 11.2.0.3.0
Copyright (c) 2012, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oracle/oraInventory
 from           : /u01/app/oracle/oracle/product/11.2.0/dbhome_1/oraInst.loc
 OPatch version    : 11.2.0.3.0
 OUI version       : 11.2.0.2.0
  Log file location : /u01/app/oracle/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2012-08-20_02-09-37AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   12539000

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/oracle/product/11.2.0/dbhome_1')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '12539000' to OH '/u01/app/oracle/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms, 11.2.0.2.0...

Verifying the update...
Patch 12539000 successfully applied.
Log file location: /u01/app/oracle/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2012-08-20_02-09-37AM_1.log

OPatch succeeded.
[oracle@fahdb ~]$

Now we had applied the patch in oracle home and the grid home successfully again we have to lock the roor user by running the scripts

For database
As the root user we need to lock the rdbms first by running the rootadd_rdbms.sh
move to the directory rdbms install and you can find the script 
cd /u01/app/oracle/grid/11.2.0/grid/rdbms/nstall
[root@fahdb install]# ls
config_filemap.sbs  filemap.ora  install.excl  rdbms  rootadd_filemap.sh  rootadd_rdbms.sh  sbs
 [root@fahdb install]# ./rootadd_rdbms.sh

For Grid

[root@fahdb install]# pwd
/u01/app/oracle/grid/11.2.0/grid/crs/install
[root@fahdb install]# ls
cmdllroot.sh             crsconfig_params      crspatch.pm    install.excl        onsconfig      preupdate.sh  rootofs.sh              s_crsconfig_lib.pm crsconfig_addparams.sbs  crsconfig_params.sbs  hasdconfig.pl  install.incl        oracss.pm      rootcrs.pl    s_crsconfig_defs  crsconfig_lib.pm         crsdelete.pm          inittab        installRemove.excl  paramfile.crs  roothas.pl    s_crsconfig_fahdb_env.txt

[root@fahdb install]# ./roothas.pl -patch
Using configuration parameter file: ./crsconfig_params
Undefined subroutine &main::read_file called at crspatch.pm line 86

Error Undefined subroutine &main::read_file
roothas.pl -patch or rootcrs.pl -patch Fails with 'Undefined subroutine' [ID 1268390.1

Step 1
we need to run scrip with the below syntax the perl version which is used by the script is the wrong one so we need to run the script with the blow syntax

$<GRID_HOME>/perl/bin/perl -I$<GRID_HOME>/perl/lib -I$<GRID_HOME>/crs/install $<GRID_HOME>/crs/install/roothas.pl -patch

[root@fahdb install]# which perl
/usr/bin/perl
[root@fahdb install]# /u01/app/oracle/grid/11.2.0/grid/perl/bin/perl -l /u01/app/oracle/grid/11.2.0/grid/perl/lib -l /u01/app/oracle/grid/11.2.0/grid/crs/install/ /u01/app/oracle/grid/11.2.0/grid/crs/install/roothas.pl -patch

Step 2

[root@fahdb install]$ cp crsconfig_lib.pm crsconfig_lib_bkp.pm
[root@fahdb install]$ ls
cmdllroot.sh             crsconfig_lib.pm      crsdelete.pm   inittab       installRemove.excl  paramfile.crs  roothas.pl        s_crsconfig_fahdb_env.txt
crsconfig_addparams.sbs  crsconfig_params      crspatch.pm    install.excl  onsconfig           preupdate.sh   rootofs.sh        s_crsconfig_lib.pm
crsconfig_lib_bkp.pm     crsconfig_params.sbs  hasdconfig.pl  install.incl  oracss.pm           rootcrs.pl     s_crsconfig_defs

[grid@fahdb install]$ vi crsconfig_lib.pm
change the line From  @exp_func = qw(check_CRSConfig validate_olrconfig validateOCR       
                          To    @exp_func = qw(check_CRSConfig validate_olrconfig validateOCR read_file

Step3
Re run the script now

[root@fahdb install]# ./roothas.pl -patch
Using configuration parameter file: ./crsconfig_params
ACFS-9200: Supported
CRS-4123: Oracle High Availability Services has been started.
Now the environment is ready for the upgrading the grid Home

 show parameter memory_max_target which can be upto 1536M  for the safer side 





No comments:

Post a Comment