Pages

Wednesday, July 24, 2019

Patching RAC Database, and Upgradation from 10.2.0.1 to 10.2.0.4.

Patching RAC Database, and Upgradation from 10.2.0.1 to 10.2.0.4.


In Oracle10g RAC upgradation, 1st upgrade clusterware software, 2nd upgrade ASM home and 3rd upgrade Database home.

1.Upgrade Clusterware software (CRS_HOME)
2.Upgrade ASM Home (ASM_HOME)
3.Upgrade Database Home (RDBMS_HOME)
4.Then finally upgrade the RAC Database (Manual or DBCA)

Upgrading Clusterware Software:
Unzip the patch for 10.2.0.4 p6810189_10204_Linux-x86.zip.
$ unzip p6810189_10204_Linux-x86

Manage your data with TimeZone before upgrade
From 9i onwards Oracle has 2 datatypes that may have data stored affected by a update of the RDBMS DST (Daylight Saving Time) definitions, those are TIMESTAMP WITH LOCAL TIME ZONE (TSLTZ) and TIMESTAMP WITH TIME ZONE(TSTZ). If you have TZ data stored in your database you need to go through the following steps to ensure the integrity of your data while the database upgrade.
SQL> select version from v$timezone_file;
If this gives 4 then you may simply proceed with the upgrade.If this gives lower then 4, perform the following steps
Unzip the utlzpv4
SQL> @utltzpv4.sql
After successful execution
SQL> select * from sys_tzuv2_temptab;

Clusterware Patchset Installation:
Rolling Upgrade (No Downtime) for clusterware:
Node 1:
Shut down all processes in the Oracle home on node1 that might be accessing a database.
$ emctl stop dbconsole
Shut down all services
$ srvctl stop service -d orcl
Shut down all Oracle RAC instances on the node1
$ srvctl stop instance -d orcl -i orcl1
If an ASM instance is running, then shut down the ASM instance on the node1
$ srvctl stop asm -n rac1
Stop all node applications on the node1
$ srvctl stop nodeapps -n rac1
If the database is on Instance1,Relocate database to second instance.
#. /crs_relocate ora.orcl.db

Installing Clusterware patchsetup:
Before runInstaller,check whether all the services are down or not on node1.
#crsctl stat res –t
$ Cd Disk1 (p6810189_10204_Linux-x86 patchset directory)
$ . /runInstaller
Oracle universal Installer : Welcome
Next
Oracle universal Installer: Specify Home details
Name: Oracrs10g_home (cluster home)
Path: /u01/crs10g
Oracle universal Installer: Specify Hardware Cluster Installation Mode
Select All node click next
Oracle universal Installer: Install
On node1:
# CRS_home/bin/crsctl stop crs
Run the root102.sh script to automatically start the Oracle Clusterware on the patched node:
# CRS_home/install/root102.sh
On node2:
# CRS_home/bin/crsctl stop crs
Run the root102.sh script to automatically start the Oracle Clusterware on the patched node:
# CRS_home/install/root102.sh
After applying patch on node2, All resources are back now in ONLINE state on both nodes.
#crsctl stat res –t

Oracle RAC Patchset Installation:
Check the version of RAC database:
[oracle@rac1 OPatch]$. /opatch lsinventory
Shut down all processes in the Oracle home on both nodes.
$ emctl stop dbconsole
Shut down all services in the Oracle home on both nodes.
$ srvctl stop service –d orcl –s racdb
Shut down all Oracle RAC instances on the nodes.
$ srvctl stop database –d racdb
If an ASM instance is running, then shut down the ASM instance on the node1
$ srvctl stop asm -n rac1
$ srvctl stop asm -n rac2
Stop the listeners
$ srvctl stop listener –n rac1
$ srvctl stop listener –n rac2

Patchset installation on ASM Home:
$cd patchset_directory/Disk1
$. /runInstaller
Oracle universal Installer : Welcome
Next
Oracle universal Installer: Specify Home details
Name: Oraasm10g_home (ASM home)
Path: /u01/app/oracle/product/10.2.0/asm_1
Oracle universal Installer: Specify Hardware Cluster Installation Mode
Select All node click next
Oracle universal Installer: Install
On node1:
Log in as “root” user
#/oracle/product/10.2.0/asm/root.sh
On node2:
Log in as “root” user
#/oracle/product/10.2.0/asm/root.sh
Now check the patch version:
[oracle@rac1 OPatch]$ ./opatch version

Patchset installation on RDBMS Home:
$cd patchset_directory/Disk1
$. /runInstaller
Oracle universal Installer : Welcome
Next
Oracle universal Installer: Specify Home details
Name: OraDB10g_home (RDBMS home)
Path: /u01/app/oracle/product/10.2.0/db_1
Oracle universal Installer: Specify Hardware Cluster Installation Mode
Select All node click next
Oracle universal Installer: Install
On node1:
Log in as “root” user
#/oracle/product/10.2.0/asm/root.sh
On node2:
Log in as “root” user
#/oracle/product/10.2.0/asm/root.sh

Upgrading a RAC Database(Manually):
Log in as the Oracle user.
$ srvctl start listener -n RAC1
$ srvctl start asm –n RAC1
SQL> STARTUP NOMOUNT
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;
SQL> SHUTDOWN
SQL> STARTUP UPGRADE
SQL> SPOOL patch.log
SQL> $ORACLE_HOME/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
Run the utlrp.sql script to recompile all invalid PL/SQL packages
SQL> $ORACLE_HOME/rdbms/admin/utlrp.sql
When the 10.2.0.4 patch set is applied to an Oracle Database 10g Standard Edition database, there may be 54 invalid objects after the utlrp.sql script runs. These objects belong to the unsupported components and do not affect the database operation.
Now check the status of all the components after the upgrade.
SQL> select comp_name, version, status from sys.dba_registry;
the status of all the components should be VALID for a successful upgrade.

For RAC database:
SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;
SQL> SHUTDOWN
SQL> STARTUP

Start any database services
$ srvctl start service -d orcl1 -s serv1

No comments:

Post a Comment