Professional Documents
Culture Documents
by Rebecca Schlecht (HP), Rainer Marekwia (Oracle), Jaime Blasco (HP), Roland Knapp
(Oracle)
The latest updated version of this document can always be found at:
http://www.hporaclectc.com/cug/assets/RACupgrade9i-10g.doc
Another new option with Oracle Database 10g with RAC is to use RAC
without a vendor cluster manager. In Phase 3, the steps are described
about how to migrate an Oracle RAC database that uses HP
Serviceguard (Oracle 10g) to use the Oracle integrated clusterware
(Oracle 10g), known as Cluster Ready Services (CRS).
In our example, we used a two node cluster (called “RAC”) on HP-UX with
Serviceguard on nodes ev02 and ev03:
root@ev02:/root$ cmviewcl
CLUSTER STATUS
RAC up
The database files are stored on shared logical volumes (SLVM) in volume
group vg_rac on a DS2405 storage:
root@ev02:/root$ vgdisplay vg_rac
--- Volume groups ---
VG Name /dev/vg_rac
VG Write Access read/write
VG Status available, shared, server
Max LV 255
Cur LV 23
Open LV 23
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 8683
VGDA 4
PE Size (Mbytes) 4
Total PE 17362
Alloc PE 14672
Free PE 2690
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
NODE_NAME ev03
NETWORK_INTERFACE lan0
HEARTBEAT_IP 15.136.26.155
NETWORK_INTERFACE lan1
HEARTBEAT_IP 10.0.0.2
FIRST_CLUSTER_LOCK_PV /dev/dsk/c4t1d0
OPS_VOLUME_GROUP /dev/vg_rac
Oracle 9i Release 9.2 was installed plus the latest available patchset
9.2.0.5:
Make sure that you have the appropriate /etc/hosts entries for all of the
RAC nodes that are part of your Oracle9i RAC environment and make
sure that the entries for the private interconnects are in the /etc/hosts files
on all systems. Also add the virtual IP addresses (VIP) and names to the
/etc/hosts files. The Virtual Interconnect Protocol Configuration Assistant
(VIPCA) uses the virtual IP addresses after you have installed the Oracle
binaries to create the VIP services.
gsdctl stop
Successfully stopped GSD on local node
On all of the nodes, change the owner and access rights of the raw
devices that you want to use for Oracle directly (such as the Oracle
Cluster Registry (OCR), voting disk, disks for ASM, and so on):
for i in 3 4 5 6 7 8 9 10 11 12 13 14
do
remsh ev03 chown oracle:dba /dev/rdsk/c4t"$i"d0
done
The installation steps are similar to the steps that you would follow for a
new Oracle Database 10g installation, except that the installation does
not request an OCR location (Instead, you will use the Oracle9i
srvconfig.loc file and upgrade it to the Oracle Database 10g OCR format).
After the installation is finished, run the root.sh script on all of the nodes
that are part of this cluster upgrade. On node1 run the following
command. Sample output appears after the command:
# ./root.sh
Checking to see if any 9i GSD is up
Checking to see if Oracle CRS stack is already up...
:
Oracle Cluster Registry configuration upgraded successfully
:
Now formatting voting device: /dev/rdsk/c4t3d0
Successful in setting block0 for voting disk.
Format complete.
Adding daemons to inittab
Preparing Oracle Cluster Ready Services (CRS):
Jun 23 04:34:52 ev02 syslog: (Oracle CSSD will be run out of init)
Jun 23 04:34:52 ev02 syslog: (Oracle EVMD will be run out of init)
Jun 23 04:34:52 ev02 syslog: (Oracle CRSD will be run out of init, set
to start boot services)
Expecting the CRS daemons to be up within 600 seconds.
:
CSS is active on these nodes.
ev02
CSS is inactive on these nodes.
ev03
Local node checking complete.
Run the root.sh script on the remaining nodes to start the CRS daemons as
shown in the following example:
On Node 2:
ev03:{/opt/oracle/product/CRS#/root/} $ ./root.sh
Checking to see if any 9i GSD is up
Checking to see if Oracle CRS stack is already up...
:
Oracle Cluster Registry configuration upgraded successfully
:
clscfg: EXISTING configuration version 2 detected.
clscfg: version 2 is 10G Release 1.
Successfully accumulated necessary OCR keys.
:
Oracle Cluster Registry for cluster has already been initialized
Adding daemons to inittab
Preparing Oracle Cluster Ready Services (CRS):
Jun 22 23:39:03 ev03 root: (Oracle CSSD will be run out of init)
Jun 22 23:39:03 ev03 root: (Oracle EVMD will be run out of init)
Jun 22 23:39:04 ev03 root: (Oracle CRSD will be run out of init, set to
start bo
ot services)
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
ev02
ev03
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
During this installation, the Oracle Universal Installer (OUI) will upgrade the
Oracle9i srvconfig.loc file to the Oracle Database 10g OCR format and
change the pointers in /var/opt/oracle accordingly as shown in the
following pre- and post-processing examples:
Before upgrade:
oracle@ev03RAC2:/var/opt/oracle> ls -slrt
total 32
16 -rw-rw-r-- 1 oracle sys 50 Jun 21 06:19 srvConfig.loc
16 -rw-r--r-- 1 root sys 62 Jun 21 22:35 oraInst.loc
oracle@ev03RAC2:/var/opt/oracle> pg srvConfig.loc
srvconfig_loc=/dev/vg_rac/rRAC_raw_srvmconfig_110
After upgrade:
# ll
total 48
-rw-r--r-- 1 root dba 67 Jun 23 04:33 ocr.loc
drwxrwxr-x 5 root sys 96 Jun 23 04:33 oprocd
-rw-r--r-- 1 oracle dba 62 Jun 22 04:35 oraInst.loc
drwxr-xr-x 3 root sys 96 Jun 23 04:33 scls_scr
-rw-r--r-- 1 root dba 24 Jun 23 04:33 srvConfig.loc
# pg srvConfig.loc
srvconfig_loc=/dev/null
# pg ocr.loc
ocrconfig_loc=/dev/vg_rac/rRAC_raw_srvmconfig_110
local_only=FALSE
After the OUI has copied the binaries to the second node, the VIPCA is
started when calling root.sh on the first node (Please make sure that the
VIP name and IP address are in the /etc/hosts file):
# ./root.sh
If you did not have any database listeners configured in the Oracle9i
srvconfig repository, then start the Oracle Database 10g Network
Configuration Assistant (NETCA) ($ORACLE_HOME/bin/netca) to
configure a standard listener in your Oracle Database 10g RAC
environment (see Bug 3724769 B10763 –01), before starting the DBUA:
Also note Bug 3098076, if you see the following Security Exception:
Important Note when running the Database that you want to upgrade in
ARCHIVE LOG mode: The Oracle 10.1.0.2 DBUA turns off archiving during
upgrade (the original archiving mode is restored after the upgrade is
done). This improved upgrade performance. This can cause severe
problems when also using Data Guard or Standby Databases in the
environment. The DBUA gets the information to turn OFF archiving during
the upgrade from a XML file which is generated by a PL/SQL package. As
a workaround, users can make the following simple one word change in
this PL/SQL file to make sure ARCHIVE LOG mode is not disabled during
the upgrade:
The DBUA will set its own environment variables, so you do not have to
change to the new Oracle Database 10g environment yet. Instead, leave
your ORACLE_HOME variable pointing to your Oracle9i environment and
start the Database Upgrade Assistant (DBUA) in the new Oracle Database
10g ORACLE_HOME.
$ /opt/oracle/product/10g/dbua &
The DBUA for RAC uses the following algorithm to discover existing
databases:
To check the status and version of your OCR, run the following command:
oracle@ev03RAC2:/opt/oracle/product/10g/bin> ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 122792
Used space (kbytes) : 1932
Available space (kbytes) : 120860
When asked for a datafile for the Oracle Database 10g SYSAUX
tablespace, use lvcreate to create a raw logical volume for SYSAUX, size
500MB.
If you have not used a binary server parameter file (spfile) with your
Oracle9i RAC database, then you have to create an additional logical
volume to hold the spfile. You will need the spfile later during the
installation.
At the next page, specify “recompile packages” YES and choose the
degree of parallelism.
When asked at the next page to specify an spfile, use a shared logical
volume such as /dev/vg_rac/rRAC_raw_spfile_50.
Next page: Password page, specify one or multiple passwords for your
Oracle Database 10g RAC environment.
Now the individual upgrade steps will be performed and after the
successful upgrade to Oracle Database 10g, the detailed Upgrade Results
will be displayed. The following is an example of these results.
Upgrade Results
Services Configured
Service Name Preferred Instances Available Instances TAF Policy
TAFboth RAC2, RAC1 None
Schalke04 RAC1 RAC2 Basic
Upgrade Details
The following is a summary of the steps performed during the database
upgrade. Log files for all the steps, as well as this summary, are
available in "/opt/oracle/product/admin/rac/upgrade1".
Step Name Log File Name Status
Pre Upgrade PreUpgrade.log Successful
Oracle Server Oracle_Server.log Successful
Enterprise Manager Repository emRepository.log Successful
Post Upgrade PostUpgrade.log Successful*
:
:
Parameters Added:
Name Value
pga_aggregate_target 25165824
large_pool_size 8388608
java_pool_size 50331648
job_queue_processes 1
Parameters Updated:
Name Old Value New Value
shared_pool_size 100663296 301989888
Obsolete Parameters Removed:
max_enabled_roles
Parameters Commented:
Name Value
RAC1.local_listener null
RAC2.local_listener null
Go to top
I. dd if=/dev/zero of=/dev/vg_rac/rRAC_raw_srvmconfig_110
bs=1024000 count=130
II. execute root.sh (both nodes) in CRS_HOME
III. execute root.sh (both nodes) in ORACLE_HOME (calling vipca)
IV. call netca
V. srvctl add database / instances
To create the ASM instances on both nodes, create a password file and
the parameter files init+ASM[1-2].ora in the Oracle Database 10g directory
$ORACLE_HOME/dbs.
Example init+ASM1.ora:
cluster_database=true
+ASM2.instance_number=2
+ASM1.instance_number=1
asm_diskgroups='DG1'
asm_diskstring='/dev/rdsk/*'
background_dump_dest='/opt/oracle/product/admin/ASM/bdump'
core_dump_dest='/opt/oracle/product/admin/ASM/cdump'
instance_type='asm'
large_pool_size=12M
remote_login_passwordfile='exclusive'
user_dump_dest='/opt/oracle/product/admin/ASM/udump'
Now you can start with the RMAN migration of your Oracle Database 10g
RAC environment from shared logical raw devices to ASM. Start up the
Oracle Database 10g RAC instance on one node with the current Oracle
Database 10g initialization parameter file using RMAN:
#rman target /
RMAN will read the controlfile from the existing location to store the
controlfile in ASM:
RMAN> restore controlfile from '/opt/oracle/RAC/control01';
Using the RMAN command shown in the following example, RMAN copies
the datafiles from the shared logical volumes to the ASM diskgroup
(specified with *.db_create_file_dest=+DG1):
At this point, switch your target database to use the datafiles that RMAN
copied to the ASM diskgroup:
Database altered.
The Controlfile(s) and datafiles including the UNDO files are located on
ASM. However, the RMAN “backup as copy command” does not copy
the online redo log files or the temporary files as shown by the output from
the following command:
NAME
-----------------------------------------------------------------------
---------
+DG1/rac/datafile/system.260.1
+DG1/rac/datafile/undo10.258.1
+DG1/rac/datafile/user01.257.1
+DG1/rac/datafile/tools01.261.1
+DG1/rac/datafile/tools02.262.1
+DG1/rac/datafile/undo20.259.1
+DG1/rac/datafile/sysaux.263.1
7 rows selected.
GROUP# MEMBER
---------------------------------------------------------------------
1 /opt/oracle/RAC/redo1_01
2 /opt/oracle/RAC/redo1_02
3 /opt/oracle/RAC/redo1_03
4 /opt/oracle/RAC/redo2_01
5 /opt/oracle/RAC/redo2_02
6 /opt/oracle/RAC/redo2_03
7
6 rows selected.
To also move the redo logs to the ASM disks, you can
• manually add a new log file to every log file group and then drop
the log file located on the shared raw devices after the necessary
log switches. You must do this for both instances.
• Otherwise, you can use the following PL/SQL procedure to perform
the redo log migration:
declare
cursor orlc is select lf.member, l.bytes
from v$log l, v$logfile lf
where l.group# = lf.group#
and lf.type = 'ONLINE'
order by l.thread#, l.sequence#;
type numTab_t is table of number index by binary_integer;
type charTab_t is table of varchar2(1024) index by binary_integer;
byteslist numTab_t;
namelist charTab_t;
procedure migrateorlfile(name IN varchar2, bytes IN number) is
retry number;
stmt varchar2(1024);
als varchar2(1024) := 'alter system switch logfile';
begin
select count(*) into retry from v$logfile;
stmt := 'alter database add logfile size ' || bytes;
execute immediate stmt;
stmt := 'alter database drop logfile ''' || name || '''';
for i in 1..retry loop
begin
execute immediate stmt;
exit;
exception
when others then
if i > retry then
raise;
end if;
execute immediate als;
end;
end loop;
end;
begin
open orlc;
fetch orlc bulk collect into namelist, byteslist;
close orlc;
for i in 1..namelist.count loop
migrateorlfile(namelist(i), byteslist(i));
end loop;
end;
/
After migrating the redo logs from the shared volumes to ASM:
SQL> select * from v$logfile;
Tablespace created.
File created.
Now, optionally, you can delete the old database-files. RMAN can
manage the deletion of the old datafiles, except for the control files and
online redo logs. Therefore, delete the control files and online redo logs
manually as in the following example:
RMAN> run {
# delete datafiles
DELETE COPY OF DATABASE;
HOST 'rm <old_online_redo_logs>';
HOST 'rm <old_control_file_copies>';
}
SPFILE='+DG1/RAC/parameterfile/spfileRAC.ora'
If you use Serviceguard as a cluster manager on HP-UX, then you can see
the following entries in the alert.log file:
This indicates that you are using the vendor cluster manager, HP
Serviceguard.
3.1 Copy the OCR from a Shared Logical Volume to a Raw Device
pg ocr.loc
ocrconfig_loc=/dev/vg_rac/rRAC_raw_srvmconfig_110
local_only=FALSE
Shutdown all instances (both the database instance and the ASM
instances) using the following command:
Shutdown the Oracle cluster services and Serviceguard (cmhaltcl –v) and
add the following comments to the file /etc/inittab in the last 3 entries
Temporarily activate the shared logical volume group to copy the OCR
using the following command example:
dd if=/dev/vg_rac/rRAC_raw_srvmconfig_110 of=/dev/rdsk/c4t13d0
bs=1024000 count=120
Modify the ocr.loc file on both nodes to point to the raw disk instead of
the shared volume. This is an example of a modified ocr.loc file:
ocrconfig_loc=/dev/rdsk/c4t13d0
local_only=FALSE
vgchange -a n vg_rac
cmhaltcl
Before installing a new CRS home, you must de-install the existing CRS
home. You can use the runInstaller provided with the CRS stage area. Also
clean-up the CRS directories on all of the nodes.
(re-installation in existing CRS home returns error with Oracle9i running gsd)
Run the root.sh script after the installation completes on all of the nodes in
your cluster, one at a time. Note, that in contrast to the process stack with
Serviceguard as a cluster manager, you now have an additional process
oprocd running.
You must still re-link the Oracle binaries before starting the instances.
To do this, first re-link with rac_on to use the Oracle stub skgxn library using
the following command:
cd $ORACLE_HOME/rdbms/lib
make –f ins_rdbms.mk rac_on
rm -f /opt/oracle/product/10g/lib/libskgxp10.a
cp /opt/oracle/product/10g/lib//libskgxpu.a
/opt/oracle/product/10g/lib/libskgxp10.a
After re-installing CRS, verify that you are using Oracle’s integrated
clusterware, CRS. Use SQL*Plus to query the x$ksxpia view to see which
cluster manager Oracle is using:
After migrating to Oracle Database 10g, you should see output from the
command as shown in the following example:
The result of this select query enables you to verify that you are using the
Oracle CRS clusterware.