Upgrading To Oracle RAC 11g On Oracle Enterprise Linux: by Vincent Chan
Upgrading To Oracle RAC 11g On Oracle Enterprise Linux: by Vincent Chan
Enterprise Linux
Learn how to upgrade Oracle RAC 10g Release 2 to Oracle RAC 11g on Oracle
Enterprise Linux 5, step by step.
By Vincent Chan
Oracle has recently released its much-anticipated Oracle Database 11g, the next
generation of grid computing. This release brings a significant advancement in grid
computing, packed with incredible new features that further improve database availability
and manageability, performance monitoring, diagnostics, and the database upgrade
procedure. Key features such as Oracle Real Application Testing, Physical Standby with
Real Time Query, new partitioning schemes, and Result Cache are some of the few
impressive innovations.
There are basically three approaches to upgrade Oracle RAC 10g to Oracle RAC 11g:
The recommended approach is to use DBUA to upgrade your database and Automatic
Storage Management (ASM). DBUA performs a lot of the manual tasks, which
significantly simplifies the upgrade process. In this guide, we will describe the upgrade
procedure using DBUA.
Overview
This guide is structured into the following steps:
1. Preliminary Installation
2. Upgrade Oracle Clusterware
3. Install Oracle Database 11g Release 1 software
4. Upgrade Oracle Database
5. Upgrade Oracle ASM
6. Explore Oracle Database 11g
An overview of our Oracle RAC 10g environment:
Oracle
Host
Clusterware Oracle ASM Home Oracle Home
Name
Home
merlin1 /u02/crs/oracle /u01/app/oracle/product/10.2.0/db_1 /u01/app/oracle/product/10.2.0/db_1
merlin2 /u02/crs/oracle /u01/app/oracle/product/10.2.0/db_1 /u01/app/oracle/product/10.2.0/db_1
Oracle
Host
Clusterware Oracle ASM Home Oracle Home
Name
Home
merlin1 /u02/crs/oracle /u01/app/oracle/product/11.1.0/asm /u01/app/oracle/product/11.1.0/db_1
merlin2 /u02/crs/oracle /u01/app/oracle/product/11.1.0/asm /u01/app/oracle/product/11.1.0/db_1
You'll install the software in the Oracle Clusterware Home, Oracle ASM Home and
Oracle Home on each node for redundancy and higher availability.
1. Preliminary Installation
Perform a full backup
Backup your Oracle RAC 10g environment before upgrading to Oracle RAC 11g.
Install the following packages as the root user if they are not already installed on the
RAC nodes. These packages can be extracted from Enterprise-R5-GA-Server-i386-
disc2.iso and Enterprise-R5-GA-Server-i386-disc3.iso.
1. compat-libstdc++-33-3.2.3-61.i386.rpm
2. elfutils-libelf-devel-0.125-3.e15.i386.rpm
3. gcc-4.1.1-52.e15.i386.rpm
4. gcc-c++-4.1.1-52.e15.i386.rpm
5. glibc-devel-2.5-12.i386.rpm
6. libaio-devel-0.3.106-3.2.i386.rpm
7. libstdc++-devel-4.1.1-52.e15.i386.rpm
8. sysstat-7.0.0-3.e15.i386.rpm
9. unixODBC-2.2.11-7.1.i386.rpm
10. unixODBC-devel-2.2.11-7.1.i386.rpm
After extracting the packages execute the command below as the root user.
# ls -1
elfutils-libelf-devel-0.125-3.e15.i386.rpm
libaio-devel-0.3.106-3.2.i386.rpm
unixODBC-2.2.11-7.1.i386.rpm
unixODBC-devel-2.2.11-7.1.i386.rpm
#
# rpm -Uvh *.rpm
The minimum kernel parameters requirements are listed below. If necessary, configure
the appropriate parameters in /etc/sysctl.conf on both nodes.
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
Prior to upgrading to Oracle RAC 11g, the Oracle Clusterware must be at least version
10.2.0.3 or 10.2.0.2 with CRS Bundle Patch #2 (reference Bug 5256865) if you would
like to do a rolling upgrade. The 10.2.0.3 patchset (5337014) can be downloaded from
Oracle Metalink.
Refer to Oracle Metalink Note 419058.1 or information on Oracle 10.2.0.3 patch set for
Linux x86.
merlin1-> crsctl query crs activeversion
CRS active version on the cluster is [10.2.0.3.0]
Cluster Verification Utility (CVU) reduces the complexity and time it takes to install
RAC. The tool scans all the required components in the cluster environment to ensure all
criteria are met for a successful installation.
Download and uncompress the Oracle Clusterware 11.1.0.6 software from OTN to a
temporary directory and execute runcluvfy.sh.
Verify all pre-requisites are met. You can ignore the "Package existence checked failed"
for openmotif-2.2.3-3.RHEL3.
Execute the preupdate.sh script on each node to prepare the clusterware home for
upgrade. The script stops the Oracle Clusterware stack and changes the permission of
files in the Oracle Clusterware Home directory.
You are only required to run the Oracle Universal Installer (OUI) on one node. The OUI
will automatically install the existing binary software on each node.
merlin1-> /stage/clusterware/runInstaller
On merlin1,
# /u02/crs/oracle/install/rootupgrade
Checking to see if Oracle CRS stack is already up...
On merlin2,
# /u02/crs/oracle/install/rootupgrade
Checking to see if Oracle CRS stack is already up...
7. Return to the Execute Configuration scripts screen on merlin1 and click on "OK."
8. Configuration Assistants: Verify that all checks are successful. The OUI does a
Clusterware post-installation check at the end. If the CVU fails, correct the
problem and re-run the following command as the oracle user:
Check passed.
Check passed.
Check passed.
At this stage, the Oracle Clusterware has been upgraded to Oracle Clusterware 11g and
all cluster resources should be running.
merlin1-> $ORA_CRS_HOME/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application ONLINE ONLINE merlin1
ora....b1.inst application ONLINE ONLINE merlin1
ora....b2.inst application ONLINE ONLINE merlin2
ora....SM1.asm application ONLINE ONLINE merlin1
ora....N1.lsnr application ONLINE ONLINE merlin1
ora....in1.gsd application ONLINE ONLINE merlin1
ora....in1.ons application ONLINE ONLINE merlin1
ora....in1.vip application ONLINE ONLINE merlin1
ora....SM2.asm application ONLINE ONLINE merlin2
ora....N2.lsnr application ONLINE ONLINE merlin2
ora....in2.gsd application ONLINE ONLINE merlin2
ora....in2.ons application ONLINE ONLINE merlin2
ora....in2.vip application ONLINE ONLINE merlin2
As the oracle user, create the new Oracle home on both nodes.
mkdir -p /u01/app/oracle/product/11.1.0/db_1
merlin1-> /stage/database/runInstaller
Prior to running the Database Upgrade Assistant (DBUA), execute the pre-database
upgrade checks, utlu111i.sql to verify that all pre-requisites are met. As part of the
upgrade process, the DBUA changes the cluster_database parameter automatically from
true to false. Re-execute the pre-database upgrade script after making the necessary
modifications.
Modify the ORACLE_HOME to reflect the new Oracle Database 11g directory on both
nodes.
merlin1-> . ./.profile
merlin1-> which dbua
/u01/app/oracle/product/11.1.0/db_1/bin/dbua
merlin1-> dbua
Figure 1
Figure 2
6. Diagnostic Destination:
a. Oracle Base: /u01/app/oracle
b. Diagnostic Destination: /u01/app/oracle
Figure 3
7. Recovery Configuration:
a. Select Specify Flash Recovery Area.
b. Flash Recovery Area: +RECOVERYDEST.
c. Flash Recovery Area Size: 2048 MB.
8. Recompile Invalid Objects: Select Recompile invalid objects at the end of
upgrade.
9. Summary: Click Finish.
Figure 4
Figure 5
18 rows selected.
merlin1-> $ORA_CRS_HOME/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application ONLINE ONLINE merlin1
ora....b1.inst application ONLINE ONLINE merlin1
ora....b2.inst application ONLINE ONLINE merlin2
ora....SM1.asm application ONLINE ONLINE merlin1
ora....N1.lsnr application ONLINE ONLINE merlin1
ora....in1.gsd application ONLINE ONLINE merlin1
ora....in1.ons application ONLINE ONLINE merlin1
ora....in1.vip application ONLINE ONLINE merlin1
ora....SM2.asm application ONLINE ONLINE merlin2
ora....N2.lsnr application ONLINE ONLINE merlin2
ora....in2.gsd application ONLINE ONLINE merlin2
ora....in2.ons application ONLINE ONLINE merlin2
ora....in2.vip application ONLINE ONLINE merlin2
SQL> select name, value from v$parameter where name like '%dump_dest'
or name like 'diag%';
NAME VALUE
-------------------- --------------------------------------------------
background_dump_dest /u01/app/oracle/diag/rdbms/devdb/devdb1/trace
user_dump_dest /u01/app/oracle/diag/rdbms/devdb/devdb1/trace
core_dump_dest /u01/app/oracle/diag/rdbms/devdb/devdb1/cdump
diagnostic_dest /u01/app/oracle
At this point, your ASM home is still running off the Oracle Database 10g Home.
As the oracle user on both nodes, create the new ASM home
mkdir /u01/app/oracle/product/11.1.0/asm
and modify the ORACLE_HOME variable in the shell profile to reflect the new ASM
home.
ORACLE_HOME=/u01/app/oracle/product/11.1.0/asm
merlin1-> . ./.profile
merlin1-> /stage/database/runInstaller
Upgrade ASM
As the oracle user on merlin1, stop the database and start up the DBUA.
merlin1-> srvctl stop database -d devdb
merlin1-> /u01/app/oracle/product/11.1.0/asm/bin/dbua
Figure 6
Figure 7
As the final step, to utilize the new features of Oracle Database 11g, the database
compatibility parameter and the disk group compatibility attributes have to be changed to
11.1.0.
On devdb1 instance,
On ASM1 instance,
SQL> select name,compatibility,database_compatibility from
v$asm_diskgroup;
Diskgroup altered.
Diskgroup altered.
Diskgroup altered.
Diskgroup altered.
Table created.
PARTITION_NAME HIGH_VALUE
--------------- ---------------
P1 100
1 row created.
PARTITION_NAME HIGH_VALUE
--------------- ---------------
P1 100
SYS_P81 200
COUNT(*)
----------
1
Partitioning by date
Table created.
1 row created.
PARTITION_NAME HIGH_VALUE
--------------
-----------------------------------------------------------------------
---------
P1 TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD
HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
SYS_P42 TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD
HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
COUNT(*)
----------
1
Reference Partitioning partitions a child table based on the partitioning scheme of the
parent table.
SQL> create table patients (
2 patientid number not null,name varchar2(10), address varchar2(15)
3 )
4 partition by range (patientid)
5 (partition p1 values less than (100),
6 partition p2 values less than (200))
7 /
Table created.
SQL> alter table patients
2 add constraint patients_pk primary key (patientid);
Table altered.
Table created.
SQL> select dbms_metadata.get_ddl('TABLE','INVOICES','VCHAN') from dual;
DBMS_METADATA.GET_DDL('TABLE','INVOICES','VCHAN')
-----------------------------------------------------------------------
CREATE TABLE "VCHAN"."INVOICES"
( "INVOICENO" NUMBER,
"AMOUNT" NUMBER,
"PATIENTID" NUMBER NOT NULL ENABLE,
CONSTRAINT "INVOICES_FK" FOREIGN KEY ("PATIENTID")
REFERENCES "VCHAN"."PATIENTS" ("PATIENTID") ENABLE
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT)
PARTITION BY REFERENCE ("INVOICES_FK")
(PARTITION "P1"
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS" NOCOMPRESS ,
PARTITION "P2"
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS" NOCOMPRESS )
1 row created.
1 row created.
COUNT(*)
----------
1
COUNT(*)
----------
0
1 row created.
1 row created.
COUNT(*)
----------
1
COUNT(*)
----------
1
Table Compression in Oracle Database 11g supports conventional DML and drop
column operations. Compressed data are not uncompressed during reading and thus
queries on compressed data are noticeably faster since there are fewer data block reads.
SQL> create tablespace tbs1 datafile
'/u01/app/oracle/oradata/db11g/tbs1_01.dbf' size 500M;
Tablespace created.
Tablespace created.
Table created.
Table created.
System altered.
System altered.
Elapsed: 00:00:8.07
SQL> commit;
Commit complete.
Elapsed: 00:00:00.07
System altered.
Elapsed: 00:00:41.79
SQL> commit;
Commit complete.
Elapsed: 00:00:00.04
SEGMENT_NAME EXTENTS
------------------------------ ----------
MYTABLE_COMPRESS 53
MYTABLE_NOCOMPRESS 88
TABLESPACE_NAME BYTES/1024/1024
------------------------------ ---------------
TBS1 461.9375
TBS2 363.9375
Table altered.
Elapsed: 00:00:21.04
Conclusion:
As illustrated in this guide, the upgrade procedure is simpler and more streamlined with
each database release. For a detailed installation instruction, please refer to the Oracle
Database Upgrade Guide 11g Release 1. Hopefully this guide has provided you a concise
method of upgrading your RAC environment. Now that you have upgraded to Oracle
Database 11g, start unleashing the power of the next generation database.