0% found this document useful (0 votes)
152 views

Upgrading To Oracle RAC 11g On Oracle Enterprise Linux: by Vincent Chan

The document provides steps to upgrade an Oracle RAC 10g database to Oracle RAC 11g using the Database Upgrade Assistant (DBUA) utility. It describes downloading required software, verifying prerequisites, upgrading the Oracle Clusterware to version 10.2.0.3, running the DBUA to upgrade the database and ASM, and exploring new features of Oracle 11g.

Uploaded by

Sathish Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views

Upgrading To Oracle RAC 11g On Oracle Enterprise Linux: by Vincent Chan

The document provides steps to upgrade an Oracle RAC 10g database to Oracle RAC 11g using the Database Upgrade Assistant (DBUA) utility. It describes downloading required software, verifying prerequisites, upgrading the Oracle Clusterware to version 10.2.0.3, running the DBUA to upgrade the database and ASM, and exploring new features of Oracle 11g.

Uploaded by

Sathish Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 27

Upgrading to Oracle RAC 11g on Oracle

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

Published October 2007

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:

• Using Oracle Database Upgrade Assistant (DBUA) utility


• Manual upgrade
• Exporting the Oracle 10g database and importing into Oracle 11g database

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.

Downloads for this guide:

• Oracle Clusterware Release 1 (11.1.0.6.0) for Linux x86


• Oracle Database 11g Release 1 (11.1.0.6.0) for Linux x86

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:

Instance Database Clusterware File Database File


Host Name
Name Name Storage Storage
merlin1 devdb1 devdb Raw ASM
merlin2 devdb2 devdb Raw ASM

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 Clusterware Files Device Name


Oracle Cluster Registry /dev/sdb1
Voting Disk /dev/sdc1

And an overview of the Oracle RAC 11g environment:

Host Instance Database Clusterware File Database File


Name Name Name Storage Storage
merlin1 devdb1 devdb Raw ASM
merlin2 devdb2 devdb Raw ASM

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

Oracle Clusterware Files Device Name


Oracle Cluster Registry /dev/sdb1
Voting Disk /dev/sdc1

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 additional software packages

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

Verify kernel parameters

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

2. Upgrade Oracle Clusterware


Upgrade Oracle Clusterware to version 10.2.0.3

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]

Oracle Clusterware pre-installation checks

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.

/stage/clusterware/runcluvfy.sh stage -pre crsinst -n all -verbose >


/tmp/prechecks.log

Verify all pre-requisites are met. You can ignore the "Package existence checked failed"
for openmotif-2.2.3-3.RHEL3.

Stop all database resources.


merlin1-> srvctl stop database -d devdb
merlin1-> srvctl stop asm -n merlin1
merlin1-> srvctl stop asm -n merlin2
merlin1-> srvctl stop nodeapps -n merlin1
merlin1-> srvctl stop nodeapps -n merlin2
merlin1-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....N1.lsnr application OFFLINE OFFLINE
ora....in1.gsd application OFFLINE OFFLINE
ora....in1.ons application OFFLINE OFFLINE
ora....in1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....N2.lsnr application OFFLINE OFFLINE
ora....in2.gsd application OFFLINE OFFLINE
ora....in2.ons application OFFLINE OFFLINE
ora....in2.vip application OFFLINE OFFLINE

Prepare the Oracle Clusterware Home for upgrade

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.

As the root user on each node,


# cd /stage/clusterware/upgrade
# ./preupdate.sh -crshome /u02/crs/oracle -crsuser oracle
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is down now.

Upgrade the Oracle Clusterware

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.

As the oracle user on merlin1,

merlin1-> /stage/clusterware/runInstaller

1. Welcome: Click on Next.


2. Specify Home Details: Verify the correct CRS_Home directory (/u02/crs/oracle)
is displayed.
3. Specify Hardware Cluster Installation Mode: Verify all nodes are selected.
4. Product-Specific Prerequisite Checks: Verify overall result is successful.
5. Summary: Click on Install.
6. Execute Configuration scripts: Execute the scripts below as the root user
sequentially, one at a time. Do not proceed to the next script until the current
script completes.
a. Execute /u02/crs/oracle/install/rootupgrade on merlin1.
b. Execute /u02/crs/oracle/install/rootupgrade on merlin2.

On merlin1,

# /u02/crs/oracle/install/rootupgrade
Checking to see if Oracle CRS stack is already up...

copying ONS config file to 11.1 CRS home


/bin/cp: `/u02/crs/oracle/opmn/conf/ons.config' and
`/u02/crs/oracle/opmn/conf/ons.config' are the same file
/u02/crs/oracle/opmn/conf/ons.config was copied successfully to
/u02/crs/oracle/opmn/conf/ons.config
WARNING: directory '/u02/crs' is not owned by root
WARNING: directory '/u02' is not owned by root
Oracle Cluster Registry configuration upgraded successfully
Adding daemons to inittab
Attempting to start Oracle Clusterware stack
Waiting for Cluster Synchronization Services daemon to start
Cluster Synchronization Services daemon has started
Waiting for Event Manager daemon to start
Event Manager daemon has started
Cluster Ready Services daemon has started
Oracle CRS stack is running under init(1M)
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10g Release 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: merlin1 merlin1-priv merlin1
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
CRS stack on this node, is successfully upgraded to 11.1.0.6.0
Checking the existence of nodeapps on this node
Creating '/u02/crs/oracle/install/paramfile.crs' with data used for CRS
configuration
Setting CRS configuration values in
/u02/crs/oracle/install/paramfile.crs

On merlin2,

# /u02/crs/oracle/install/rootupgrade
Checking to see if Oracle CRS stack is already up...

copying ONS config file to 11.1 CRS home


/bin/cp: `/u02/crs/oracle/opmn/conf/ons.config' and
`/u02/crs/oracle/opmn/conf/ons.config' are the same file
/u02/crs/oracle/opmn/conf/ons.config was copied successfully to
/u02/crs/oracle/opmn/conf/ons.config
WARNING: directory '/u02/crs' is not owned by root
WARNING: directory '/u02' is not owned by root
Oracle Cluster Registry configuration upgraded successfully
Adding daemons to inittab
Attempting to start Oracle Clusterware stack
Waiting for Cluster Synchronization Services daemon to start
Cluster Synchronization Services daemon has started
Waiting for Event Manager daemon to start
Waiting for Event Manager daemon to start
Event Manager daemon has started
Cluster Ready Services daemon has started
Oracle CRS stack is running under init(1M)
clscfg: EXISTING configuration version 4 detected.
clscfg: version 4 is 11 Release 1.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 2: merlin2 merlin2-priv merlin2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
CRS stack on this node, is successfully upgraded to 11.1.0.6.0
Checking the existence of nodeapps on this node
Creating '/u02/crs/oracle/install/paramfile.crs' with data used for CRS
configuration
Setting CRS configuration values in
/u02/crs/oracle/install/paramfile.crs

merlin1-> $ORA_CRS_HOME/bin/crsctl check crs


Cluster Synchronization Services appears healthy
Cluster Ready Services appears healthy
Event Manager appears healthy
merlin1-> $ORA_CRS_HOME/bin/crsctl query crs softwareversion
Oracle Clusterware version on node [merlin1] is [11.1.0.6.0]
merlin1-> $ORA_CRS_HOME/bin/crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.1.0.6.0]

merlin2-> $ORA_CRS_HOME/bin/crsctl check crs


Cluster Synchronization Services appears healthy
Cluster Ready Services appears healthy
Event Manager appears healthy
merlin2-> $ORA_CRS_HOME/bin/crsctl query crs softwareversion
Oracle Clusterware version on node [merlin2] is [11.1.0.6.0]
merlin2-> $ORA_CRS_HOME/bin/crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.1.0.6.0]

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:

merlin1-> /u02/crs/oracle/bin/cluvfy stage -post crsinst -n


merlin1,merlin2

Performing post-checks for cluster services setup

Checking node reachability...


Node reachability check passed from node "merlin1".

Checking user equivalence...

User equivalence check passed for user "oracle".

Checking Cluster manager integrity...

Checking CSS daemon...

Daemon status check passed for "CSS daemon".

Cluster manager integrity check passed.

Checking cluster integrity...

Cluster integrity check passed

Checking OCR integrity...

Checking the absence of a non-clustered configuration...

All nodes free of non-clustered, local-only configurations.

Uniqueness check for OCR device passed.

Checking the version of OCR...


OCR of correct Version "2" exists.

Checking data integrity of OCR...


Data integrity check for OCR passed.

OCR integrity check passed.

Checking CRS integrity...

Checking daemon liveness...

Liveness check passed for "CRS daemon".

Checking daemon liveness...

Liveness check passed for "CSS daemon".

Checking daemon liveness...

Liveness check passed for "EVM daemon".

Checking CRS health...


CRS health check passed.

CRS integrity check passed.

Checking node application existence...

Checking existence of VIP node application (required)

Check passed.

Checking existence of ONS node application (optional)

Check passed.

Checking existence of GSD node application (optional)

Check passed.

Post-check for cluster services setup was successful.

9. End of Installation: Click Exit.

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

3. Install Oracle Database 11g Release 1 Software


Create the Oracle Home

As the oracle user, create the new Oracle home on both nodes.

mkdir -p /u01/app/oracle/product/11.1.0/db_1

Install the Oracle Database software


Download the Oracle Database software from OTN.
As the oracle user on merlin1,

merlin1-> /stage/database/runInstaller

1. Welcome: Click on Next.


2. Select Installation Type:
a. Select Custom.
3. Specify Home Details:
a. Oracle Base: /u01/app/oracle.
b. Name: OraDb11g_home1
c. Path: /u01/app/oracle/product/11.1.0/db_1
4. Specify Hardware Cluster Installation Mode:
a. Select Cluster Installation.
b. Click on Select All.
5. Product-Specific Prerequisite Checks: Verify overall result is successful.
6. Available Product Components: Select all the required components.
7. Privileged Operating System Groups:
a. Database Administrator (OSDBA) Group: dba.
b. Database Operator (OSOPER) Group: oinstall.
c. ASM administrator (OSASM) Group: dba.
8. Create Database:
a. Select Install database Software only.
9. Summary: Click on Install.
10. Execute Configuration scripts: Execute the scripts below as the root user.
a. Execute /u01/app/oracle/product/11.1.0/db_1/root.sh on merlin1.
b. Execute /u01/app/oracle/product/11.1.0/db_1/root.sh on merlin2.
11. Return to the Execute Configuration scripts screen on merlin1 and click on OK.
12. End of Installation: Click on Exit.

4. Upgrade Oracle Database


Pre-database upgrade checks

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.

Connect as the sys user,

SQL> spool /tmp/utlu111i.log


SQL> @/u01/app/oracle/product/11.1.0/db_1/rdbms/admin/utlu111i
Oracle Database 11.1 Pre-Upgrade Information Tool 08-13-2007
18:03:45
.
**********************************************************************
Database:
**********************************************************************
--> name: DEVDB
--> version: 10.2.0.3.0
--> compatible: 10.2.0.1.0
--> blocksize: 8192
--> platform: Linux IA (32-bit)
--> timezone file: V4
.
**********************************************************************
Tablespaces: [make adjustments in the current environment]
**********************************************************************
--> SYSTEM tablespace is adequate for the upgrade.
.... minimum required size: 743 MB
--> UNDOTBS1 tablespace is adequate for the upgrade.
.... minimum required size: 315 MB
--> SYSAUX tablespace is adequate for the upgrade.
.... minimum required size: 458 MB
--> TEMP tablespace is adequate for the upgrade.
.... minimum required size: 61 MB
--> EXAMPLE tablespace is adequate for the upgrade.
.... minimum required size: 66 MB
.
**********************************************************************
Update Parameters: [Update Oracle Database 11.1 init.ora or spfile]
**********************************************************************
-- No update parameter changes are required.
.
**********************************************************************
Renamed Parameters: [Update Oracle Database 11.1 init.ora or spfile]
**********************************************************************
-- No renamed parameters found. No changes are required.
.
**********************************************************************
Obsolete/Deprecated Parameters: [Update Oracle Database 11.1 init.ora
or spfile]
**********************************************************************
--> "background_dump_dest" replaced by "diagnostic_dest"
--> "user_dump_dest" replaced by "diagnostic_dest"
--> "core_dump_dest" replaced by "diagnostic_dest"
.
**********************************************************************
Components: [The following database components will be upgraded or
installed]
**********************************************************************
--> Oracle Catalog Views [upgrade] VALID
--> Oracle Packages and Types [upgrade] VALID
--> JServer JAVA Virtual Machine [upgrade] VALID
--> Oracle XDK for Java [upgrade] VALID
--> Real Application Clusters [upgrade] VALID
--> Oracle Workspace Manager [upgrade] VALID
--> OLAP Analytic Workspace [upgrade] VALID
--> OLAP Catalog [upgrade] VALID
--> EM Repository [upgrade] VALID
--> Oracle Text [upgrade] VALID
--> Oracle XML Database [upgrade] VALID
--> Oracle Java Packages [upgrade] VALID
--> Oracle interMedia [upgrade] VALID
--> Spatial [upgrade] VALID
--> Data Mining [upgrade] VALID
--> Expression Filter [upgrade] VALID
--> Rule Manager [upgrade] VALID
--> Oracle OLAP API [upgrade] VALID
.
**********************************************************************
Miscellaneous Warnings
**********************************************************************
WARNING: --> The "cluster_database" parameter is currently "TRUE" and
must be
set to "FALSE" prior to running the upgrade.
WARNING: --> Database contains stale optimizer statistics.
.... Refer to the 11g Upgrade Guide for instructions to update
.... statistics prior to upgrading the database.
.... Component Schemas with stale statistics:
.... SYS
WARNING: --> Database contains schemas with objects dependent on
network
packages.
.... Refer to the 11g Upgrade Guide for instructions to configure
Network ACLs.
WARNING: --> EM Database Control Repository exists in the database.
.... Direct downgrade of EM Database Control is not supported. Refer to
the
.... 11g Upgrade Guide for instructions to save the EM data prior to
upgrade.
.

PL/SQL procedure successfully completed.

SQL> spool off

Modify the oracle user environment file

Modify the ORACLE_HOME to reflect the new Oracle Database 11g directory on both
nodes.

merlin1-> more .profile


export PS1="`/bin/hostname -s`-> "
export EDITOR=vi
export ORACLE_SID=devdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export ORA_CRS_HOME=/u02/crs/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/loca
l/bin:/usr/X11R6/bin
umask 022

Upgrade the database


As the oracle user, execute dbua on merlin1.

merlin1-> . ./.profile
merlin1-> which dbua
/u01/app/oracle/product/11.1.0/db_1/bin/dbua
merlin1-> dbua

1. Welcome: Click Next.


2. Upgrade Operations: Select Upgrade a Database.
3. Databases: Select devdb.
4. Database Upgrade Assistant: Click Yes to migrate the existing listener.

Figure 1

5. Database Upgrade Assistant: Click on No to upgrade ASM later.

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

10. Progress: Click OK to see the results of the upgrade.


11. Upgrade Results: Click Close.

SQL> select comp_name,version,status from dba_registry;

COMP_NAME VERSION STATUS


--------------------------------------- ---------- ------
Oracle Enterprise Manager 11.1.0.6.0 VALID
OLAP Catalog 11.1.0.6.0 VALID
Spatial 11.1.0.6.0 VALID
Oracle Multimedia 11.1.0.6.0 VALID
Oracle XML Database 11.1.0.6.0 VALID
Oracle Text 11.1.0.6.0 VALID
Oracle Data Mining 11.1.0.6.0 VALID
Oracle Expression Filter 11.1.0.6.0 VALID
Oracle Rule Manager 11.1.0.6.0 VALID
Oracle Workspace Manager 11.1.0.6.0 VALID
Oracle Database Catalog Views 11.1.0.6.0 VALID
Oracle Database Packages and Types 11.1.0.6.0 VALID
JServer JAVA Virtual Machine 11.1.0.6.0 VALID
Oracle XDK 11.1.0.6.0 VALID
Oracle Database Java Packages 11.1.0.6.0 VALID
OLAP Analytic Workspace 11.1.0.6.0 VALID
Oracle OLAP API 11.1.0.6.0 VALID
Oracle Real Application Clusters 11.1.0.6.0 VALID

18 rows selected.

merlin1-> srvctl config database -d devdb


merlin1 devdb1 /u01/app/oracle/product/11.1.0/db_1
merlin2 devdb2 /u01/app/oracle/product/11.1.0/db_1

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

The new diagnostic location

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

5. Upgrade Oracle ASM


A separate ASM home is optional; however having one provides the benefits of being
able to apply patches or patchsets to the Oracle RDBMS home, independently from the
ASM home. Having a separate ASM home and RDBMS home is especially beneficial
when running more than one database instances on the same node. The ASM instance
availability will not be impacted when the Oracle RDBMS home needs to be patched.

At this point, your ASM home is still running off the Oracle Database 10g Home.

merlin1-> srvctl config asm -n merlin1


+ASM1 /u01/app/oracle/product/10.2.0/db_1
merlin1-> srvctl config asm -n merlin2
+ASM2 /u01/app/oracle/product/10.2.0/db_1

Create the ASM 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

Install Oracle Database 11g Release 1 software in ASM home

As the oracle user on merlin1,

merlin1-> . ./.profile
merlin1-> /stage/database/runInstaller

1. Welcome: Click Next.


2. Select Installation Type:
a. Select Enterprise Edition.
3. Specify Home Details:
a. Oracle Base: /u01/app/oracle.
b. Name: OraASM11g_home.
c. Path: /u01/app/oracle/product/11.1.0/asm.
4. Specify Hardware Cluster Installation Mode:
a. Select Cluster Installation.
b. Click Select All.
5. Product-Specific Prerequisite Checks: Verify overall result is successful.
6. Upgrade an Existing Database:
a. Do you want to perform an upgrade now?: No.
7. Select Configuration Option:
a. Select Install Software Only.
8. Privileged Operating System Groups:
a. Database Administrator (OSDBA) Group: dba
b. Database Operator (OSOPER) Group: oinstall
c. ASM administrator (OSASM) Group: dba
9. Summary: Click Install.
10. Execute Configuration scripts: Execute the scripts below as the root user.
a. Execute /u01/app/oracle/product/11.1.0/asm/root.sh on merlin1.
b. Execute /u01/app/oracle/product/11.1.0/asm/root.sh on merlin2.
11. Return to the Execute Configuration scripts screen on merlin1 and click on OK.
12. End of Installation: Click Exit.

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

1. Welcome: Click Next.


2. Upgrade Operations: Select Upgrade Automatic Storage Management
Instance.
3. Summary: Click Finish.

Figure 6
Figure 7

4. Progress: Click OK to see the results of the upgrade.


5. Upgrade Results: Click Close.

merlin1-> srvctl config asm -n merlin1


+ASM1 /u01/app/oracle/product/11.1.0/asm
merlin1-> srvctl config asm -n merlin2
+ASM2 /u01/app/oracle/product/11.1.0/asm
merlin1-> srvctl start database -d devdb
merlin1-> 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
Figure 8

Modify Disk Group Compatibility Attributes and Database Compatibility


parameter.

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,

SQL> show parameter compatible


NAME TYPE VALUE
------------------------ ----------- -------------------------
compatible string 10.2.0.1.0

SQL> alter system set compatible='11.1.0' scope=spfile;


System altered.
On merlin1, restart the database,
merlin1-> srvctl stop database -d devdb
merlin1-> srvctl start database -d devdb

On ASM1 instance,
SQL> select name,compatibility,database_compatibility from
v$asm_diskgroup;

NAME COMPATIBILITY DATABASE_COMPATIBILI


--------------- ------------- --------------------
DG1 10.1.0.0.0 10.1.0.0.0
RECOVERYDEST 10.1.0.0.0 10.1.0.0.0

SQL> alter diskgroup dg1 set attribute 'compatible.asm'='11.1.0';

Diskgroup altered.

SQL> alter diskgroup dg1 set attribute 'compatible.rdbms'='11.1.0';

Diskgroup altered.

SQL> alter diskgroup recoverydest set attribute


'compatible.asm'='11.1.0';

Diskgroup altered.

SQL> alter diskgroup recoverydest set attribute


'compatible.rdbms'='11.1.0';

Diskgroup altered.

SQL> select name,compatibility,database_compatibility from


v$asm_diskgroup;

NAME COMPATIBILITY DATABASE_COMPATIBILI


--------------- ------------- --------------------
DG1 11.1.0.0.0 11.1.0.0.0
RECOVERYDEST 11.1.0.0.0 11.1.0.0.0

6. Explore Oracle Database 11g


This section briefly describes a few of the new features of Oracle Database 11g. A
detailed description of the new features is beyond the scope of this guide. For a more
comprehensive list, see the Oracle Database New Features Guide 11g Release 1 (11.1).

Automatic Memory Management - With Oracle Database 11g, memory management is


further automated with the use of the dynamic parameter, memory_target. You would just
be required to specify the total instance memory size and the database will automatically
manages the memory distribution between the SGA and the PGA. The view,
v$memory_target_advice provides advice on memory tuning.

Interval Partitioning improves partition table manageability by creating new table


partitions automatically when inserted rows exceed the partition ranges.

Partitioning by integer value


SQL> create table patients (
2 patientid number not null,name varchar2(10),address varchar2(15)
3 )
4 partition by range (patientid)
5 interval (100)
6 (partition p1 values less than (100))
7 /

Table created.

SQL> select partition_name,high_value


2 from user_tab_partitions
3 where table_name='PATIENTS';

PARTITION_NAME HIGH_VALUE
--------------- ---------------
P1 100

SQL> insert into patients values (100,'ROBERT','4 BORNE AVE');

1 row created.

SQL> select partition_name,high_value


2 from user_tab_partitions
3 where table_name='PATIENTS';

PARTITION_NAME HIGH_VALUE
--------------- ---------------
P1 100
SYS_P81 200

SQL> select count(*) from patients partition (SYS_P81);

COUNT(*)
----------
1

Partitioning by date

SQL> create table userlogs (


2 transid number,
3 transdt date,
4 terminal varchar2(10)
5 )
6 partition by range (transdt)
7 interval (numtoyminterval(1,'YEAR'))
8 (
9 partition p1 values less than (to_date('01-01-2007','mm-dd-
yyyy'))
10 );

Table created.

SQL> select partition_name,high_value


2 from user_tab_partitions
3 where table_name='USERLOGS';
PARTITION_NAME HIGH_VALUE
--------------
-----------------------------------------------------------------------
---------
P1 TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD
HH24:MI:SS', 'NLS_CALENDAR=GREGORIA

SQL> insert into userlogs values (1,'11-AUG-07','XAV0004');

1 row created.

SQL> select partition_name,high_value


2 from user_tab_partitions
3 where table_name='USERLOGS';

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

SQL> select count(*) from userlogs partition (sys_p42);

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.

SQL> create table invoices (


2 invoiceno number,amount number, patientid number not null,
3 constraint invoices_fk
4 foreign key (patientid) references patients
5 )
6 partition by reference (invoices_fk);

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 )

SQL> insert into patients values (1,'TOBY','88 Palace Ave');

1 row created.

SQL> insert into invoices values (150,262.12,1);

1 row created.

SQL> select count(*) from invoices partition (p1);

COUNT(*)
----------
1

SQL> select count(*) from invoices partition (p2);

COUNT(*)
----------
0

SQL> insert into patients values (110,'GILY','512 HILE STREET');

1 row created.

SQL> insert into invoices values (151,500.01,110);

1 row created.

SQL> select count(*) from invoices partition (p1);

COUNT(*)
----------
1

SQL> select count(*) from invoices partition (p2);

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.

SQL> create tablespace tbs2 datafile


'/u01/app/oracle/oradata/db11g/tbs2_01.dbf' size 500M;

Tablespace created.

SQL> create table mytable_compress (col1 varchar2(26),col2


varchar2(26)) tablespace tbs1 compress for all operations;

Table created.

SQL> create table mytable_nocompress (col1 varchar2(26),col2


varchar2(26)) tablespace tbs2;

Table created.

SQL> alter system flush buffer_Cache;

System altered.

SQL> alter system flush shared_pool;

System altered.

SQL> set timing on

SQL> insert into mytable_nocompress


2 select 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','ABCDEFGHIJKLMNOPQRSTUVWXYZ'
3 from (select 1 from dual connect by level <= 2000000);

2000000 rows created.

Elapsed: 00:00:8.07

SQL> commit;

Commit complete.

Elapsed: 00:00:00.07

SQL> alter system flush buffer_Cache;


System altered.

SQL> alter system flush shared_pool;

System altered.

SQL> insert into mytable_compress


2 select 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','ABCDEFGHIJKLMNOPQRSTUVWXYZ'
3 from (select 1 from dual connect by level <= 2000000);

2000000 rows created.

Elapsed: 00:00:41.79

SQL> commit;

Commit complete.

Elapsed: 00:00:00.04

SQL> select segment_name,extents from user_segments where segment_name


like 'MYTABLE%';

SEGMENT_NAME EXTENTS
------------------------------ ----------
MYTABLE_COMPRESS 53
MYTABLE_NOCOMPRESS 88

SQL> select tablespace_name,bytes/1024/1024 from dba_free_space where


tablespace_name like 'TBS%';

TABLESPACE_NAME BYTES/1024/1024
------------------------------ ---------------
TBS1 461.9375
TBS2 363.9375

SQL> alter table mytable_compress drop column col2;

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.

You might also like