Practical Guide Rac
Practical Guide Rac
Practical Guide Rac
A practical guide to 10g RAC installation and configuration - Its REAL easy!
Gavin Soorma, Emirates Airline
Paper# 106
Architecture
Note that the Oracle home that you use in phase one is a home for the CRS software which must be different from the Oracle home that you use in phase two for the installation of the Oracle database software with RAC components. The CRS preinstallation starts the CRS processes in preparation for installing Oracle Database 10g with RAC
Choose a Storage Option for Oracle CRS, Database and Recovery Files
All instances in RAC environments share the control file, server parameter file, redo log files, and all datafiles. These files reside on a shared cluster file system or on shared disks. Either of these types of file configurations are accessed by all the cluster database instances. Each instance also has its own set of redo log files. During failures, shared access to redo log files enables surviving instances to perform recovery. The following table shows the storage options supported for storing Oracle Cluster Ready Services (CRS) files, Oracle database files, and Oracle database recovery files. Oracle database files include datafiles, control files, redo log files, the server parameter file, and the password file. Oracle CRS files include the Oracle Cluster Registry (OCR) and the CRS voting disk.
File Types Supported Storage Option Automatic Storage Management Cluster file system (OCFS) Shared raw partitions NFS file system CRS No Yes Yes Yes Database Yes Yes Yes Yes Recovery Yes Yes No Yes
Paper# 106
Architecture
For the private network, the interconnect must preferably be a Gigabit Ethernet switch that supports TCP/IP. This is used for Cache Fusion inter-node connection
Architecture
Without using VIPs, clients connected to a node that died will often wait a 10 minute TCP timeout period before getting an error
IP Address Requirements
Before starting the installation, you must identify or obtain the following IP addresses for each node: An IP address and an associated host name registered in the domain name service (DNS) for each public network interface One unused virtual IP address and an associated virtual host name registered in DNS that you will configure for the primary public network interface The virtual IP address must be in the same subnet as the associated public interface. After installation, you can configure clients to use the virtual host name or IP address. If a node fails, its virtual IP address fails over to another node. A private IP address and optional host name for each private interface
# /sbin/ifconfig eth1 Link encap:Ethernet inet 10.20.176.73 HWaddr 00:09:6B:E6:59:0D Bcast:10.20.176.255 Mask:255.255.255.0
Paper# 106
Architecture
eth3
racdb1:/opt/oracle>cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. #127.0.0.1 itlinuxbl53.hq.emirates.com itlinuxbl53 localhost.localdomain localhost 57.12.70.59 itlinuxbl54.hq.emirates.com itlinuxbl54 57.12.70.58 itlinuxbl53.hq.emirates.com itlinuxbl53 10.20.176.74 itlinuxbl54-pvt.hq.emirates.com itlinuxbl54-pvt 10.20.176.73 itlinuxbl53-pvt.hq.emirates.com itlinuxbl53-pvt 57.12.70.80 itlinuxbl54-vip.hq.emirates.com itlinuxbl54-vip 57.12.70.79 itlinuxbl53-vip.hq.emirates.com itlinuxbl53-vip
Paper# 106
Architecture
Generating public/private dsa key pair. Enter file in which to save the key (/opt/oracle/.ssh/id_dsa): Created directory '/opt/oracle/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /opt/oracle/.ssh/id_dsa. Your public key has been saved in /opt/oracle/.ssh/id_dsa.pub. The key fingerprint is: 2e:c2:b8:28:98:72:4f:b8:82:a6:4a:4b:40:d3:d5:b1 [email protected]
#/opt/oracle/.ssh>cp $HOME/authorized_keys . #/opt/oracle/.ssh>ls -lrt total 12 -rw-r--r-1 oracle dba -rw------1 oracle dba -rw-r--r-1 oracle dba
624 Jan 29 14:20 id_dsa.pub 668 Jan 29 14:20 id_dsa 624 Jan 29 14:21 authorized_keys
:/opt/oracle/.ssh>cat id_dsa.pub >> authorized_keys :/opt/oracle/.ssh>ls -lrt total 12 -rw-r--r-1 oracle dba -rw------1 oracle dba -rw-r--r-1 oracle dba
624 Jan 29 14:20 id_dsa.pub 668 Jan 29 14:20 id_dsa 1248 Jan 29 14:21 authorized_keys
Copy this file back to the first host itlinuxbl53.hq.emirates.com and overwrite existing authorized keys on that server with the contents of the authorized_keys file that was generated on the host itlinuxbl54.hq.emirates.com
Verify that the User Equivalency has been properly set up on itlinuxbl53.hq.emirates.com
Architecture
[root@hqlinux05 root]# uname a Linux itlinuxbl54.hq.emirates.com 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:32:18 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux
http://oss.oracle.com/projects/ocfs/files/RedHat/RHEL3/x86_64/1.0.14-1/
Install the OCFS RPMs for SMP kernels ON ALL NODES TO BE PART OF THE CLUSTER:
[root@itlinuxbl54 recyclebin]# rpm -ivh ocfs-support-1.1.5-1.x86_64.rpm Preparing... ########################################### [100%] 1:ocfs-support ########################################### [100%] [root@itlinuxbl54 recyclebin]# rpm -ivh ocfs-tools-1.0.10-1.x86_64.rpm Preparing... ########################################### [100%] 1:ocfs-tools ########################################### [100%] [root@itlinuxbl54 recyclebin]# rpm -ivh ocfs-2.4.21-EL-smp-1.0.14-1.x86_64.rpm Preparing... ########################################### [100%] 1:ocfs-2.4.21-EL-smp ########################################### [100%]
To configure, format and mount the Oracle Cluster File System we will use the GUI tool ocfstool which needs to be launched from a X-term ON BOTH NODES
We first generate the configuration file /etc/ocfs.conf by selecting the Generate Config option from the Tasks menu. We then select the private interface eth1 using the default port of 7000. Enter the name of the private node as shown below:
Paper# 106
Architecture
[root@itlinuxbl53 etc]# cat /etc/ocfs.conf # # ocfs config # Ensure this file exists in /etc # node_name = itlinuxbl53.hq.emirates.com ip_address = 10.20.176.73 ip_port = 7000 comm_voting = 1 guid = 5D9FF90D969078C471310016353C6B23
Paper# 106
Architecture
[root@itlinuxbl53 /]# /sbin/load_ocfs /sbin/modprobe ocfs node_name=itlinuxbl53.hq.emirates.com ip_address=10.20.176.73 cs=1783 guid=5D9FF90D969078C471310016353C6B23 ip_port=7000 comm_voting=1 [root@itlinuxbl53 /]# /sbin/lsmod |grep ocfs ocfs 325280 3
Create the mount points and directories for the OCR and Voting disk
[root@itlinuxbl53 root]# mkdir /ocfs/ocr [root@ itlinuxbl53 root]# mkdir /ocfs/vote [root@ itlinuxbl53 root]# mkdir /ocfs/oradata [root@ itlinuxbl53 root]# chown oracle:dba /ocfs/*
Paper# 106
Architecture
10
Paper# 106
Architecture
11
Paper# 106
Architecture
After formatting the OCFS shared storage, we will now mount the cluster file system. This can be done either from the command line or by using the same GUI ocfstool.
12
Paper# 106
Architecture
Installing and Configuring Automatic Storage Management (ASM) Disks using the ASMLIBs
Download ands install the latest Oracle ASM RPMs from Note: Make sure that you download the right ASM driver for your kernel.
root@itlinuxbl53 recyclebin]# rpm -ivh oracleasm-support-2.0.1-1.x86_64.rpm Preparing... ########################################### [100%] 1:oracleasm-support ########################################### [100%] [root@itlinuxbl53 recyclebin]# rpm -ivh oracleasm-2.4.21-37.ELsmp-1.0.4-1.x86_64.rpm Preparing... ########################################### [100%] 1:oracleasm-2.4.21-37.ELs########################################### [100%] [root@itlinuxbl53 recyclebin]# rpm -ivh oracleasmlib-2.0.1-1.x86_64.rpm Preparing... ########################################### [100%] 1:oracleasmlib ########################################### [100%] [root@itlinuxbl53 recyclebin]# rpm -qa |grep asm oracleasm-2.4.21-37.ELsmp-1.0.4-1 hpasm-7.5.1-8.rhel3 oracleasm-support-2.0.1-1 oracleasmlib-2.0.1-1 http://otn.oracle.com/tech/linux/asmlib/index.html.
13
Paper# 106
Architecture
loaded on boot and what permissions it will have. The current values will be shown in brackets ('[]'). Hitting <ENTER> without typing an answer will keep that current value. Ctrl-C will abort. Default user to own the driver interface [oracle]: Default group to own the driver interface [dba]: Start Oracle ASM library driver on boot (y/n) [y]: Fix permissions of Oracle ASM disks on boot (y/n) [y]: Writing Oracle ASM library driver configuration Scanning system for ASM disks
[ [
OK OK
] ]
[root@itlinuxbl53 init.d]# ./oracleasm createdisk VOL1 Marking disk "/dev/sddlmab1" as an ASM disk:
[root@itlinuxbl53 init.d]# ./oracleasm createdisk VOL2 /dev/sddlmac1 Marking disk "/dev/sddlmac1" as an ASM disk: [ OK ] [root@itlinuxbl53 init.d]# ./oracleasm createdisk VOL3 /dev/sddlmaf1 Marking disk "/dev/sddlmaf1" as an ASM disk: [ OK ] [root@itlinuxbl53 init.d]# ./oracleasm listdisks VOL1 VOL2 VOL3 [root@itlinuxbl53 init.d]# ./oracleasm querydisk VOL1 Disk "VOL1" is a valid ASM disk on device [253, 17]
On other RAC nodes we need to ensure that the same ASM disks are also visible to the s
[root@itlinuxbl54 init.d]# ./oracleasm scandisks Scanning system for ASM disks: [root@itlinuxbl54 init.d]# ./oracleasm listdisks VOL1 VOL2 VOL3 [ OK ]
14
Paper# 106
Architecture
CRS is the clusterware layer provided by Oracle to enable RAC to function by clustering together nodes on a supported operating system. CRS consists of the major components which run as daemons on Unix or services on Windows: ocssd is the cluster synchronization service daemon (CSS) which in single-instance environment handles the interaction between ASM instances and regular instances. In a RAC environment, it maintains information on nodes and instances that are part of the cluster at any given time as well as maintaining the heartbeat between the nodes in the cluster. crsd daemon is primarily responsible for starting and stopping services and relocating them to other nodes in the event of a node failure. It is also responsible for backing up the Oracle Cluster Registry (OCR) evmd is the event manager daemon CRS needs to be installed before the Oracle RDBMS is installed and needs to be installed into its own home. As part of the installation, we need to provide a separate location for the OCR and the voting disk used by the CRS. These files need to be installed on a shared storage as all nodes in the cluster need to have access to these files. The OCR and CRS Voting Disk cannot be installed on ASM disks they need to be installed on raw devices or OCFS. In our case we will use the Oracle Cluster File System for the same. The OCR contains metadata about the cluster for example, information about databases that are part of the cluster as well as instances part of the database. The voting disk is used to resolve split-brain scenarios - it contains information to resolve conflicts that may arise if nodes in the cluster lose network connections via the interconnect with other nodes in the cluster.
Architecture
The RPMs for cluvfy need to be installed from the Oracle 10g Release 2 Clusterware software media as shown below
[root@itlinuxbl53 root]# cd /opt/oracle/cluster_cd/clusterware/rpm [root@itlinuxbl53 rpm]# ls cvuqdisk-1.0.1-1.rpm [root@itlinuxbl53 rpm]# export CVUQDISK_GRP=dba [root@itlinuxbl53 rpm]# rpm -ivh cvuqdisk-1.0.1-1.rpm Preparing... 1:cvuqdisk ########################################### [100%] ########################################### [100%]
For example, we can run the cluster verify utility just before we start the installation of the Oracle 10g Release Clusterware to confirm that we have fulfilled all the requirements at the hardware and operating system level.
./runcluvfy.sh stage -post hwos -n itlinuxbl53 -verbose Performing post-checks for hardware and operating system setup Checking node reachability... Check: Node reachability from node "itlinuxbl53" Destination Node -----------------------------------itlinuxbl53 Reachable? -----------------------yes
Result: Node reachability check passed from node "itlinuxbl53". Checking user equivalence... Check: User equivalence for user "oracle" Node Name -----------------------------------itlinuxbl53 Comment -----------------------passed
16
Paper# 106
Architecture
Checking node connectivity... Interface information for node "itlinuxbl53" Interface Name -----------------------------eth1 eth3 IP Address -----------------------------10.20.176.73 57.12.70.58 Subnet ---------------10.20.176.0 57.12.70.0
Check: Node connectivity of subnet "10.20.176.0" Result: Node connectivity check passed for subnet "10.20.176.0" with node(s) itlinuxbl53. Check: Node connectivity of subnet "57.12.70.0" Result: Node connectivity check passed for subnet "57.12.70.0" with node(s) itlinuxbl53. Suitable interfaces for VIP on subnet "57.12.70.0": itlinuxbl53 eth3:57.12.70.58 Suitable interfaces for the private interconnect on subnet "10.20.176.0": itlinuxbl53 eth1:10.20.176.73 Result: Node connectivity check passed. Checking shared storage accessibility... Disk -----------------------------------/dev/sddlmaa /dev/sddlmab /dev/sddlmac /dev/sddlmaf Sharing Nodes (1 in count) -----------------------itlinuxbl53 itlinuxbl53 itlinuxbl53 itlinuxbl53
Shared storage check was successful on nodes "itlinuxbl53". Post-check for hardware and operating system setup was successful.
17
Paper# 106
Architecture
In order for the OUI to install the software remotely on other nodes in the cluster, the oracle user account needs to be able to ssh to all other RAC nodes without being asked for a password or passphrase. On the terminal where you are going to launch the installer run the following commands:
[oracle@itlinuxbl53 oracle]$ssh-x oracle [oracle@itlinuxbl53 oracle]$ssh-agent $SHELL [oracle@itlinuxbl53 oracle]$ssh add
Before launching the installer, a good practice would be to check if user equivalence has been configured correctly by running some commands on the remote host. On the Specify Cluster Configuration screen, we will need to specify the name we are going to use for our cluster as well as the public, private and virtual names that have been assigned to the nodes that are going to make up our 10g RAC cluster. We need to ensure that the name hostnames that are present in the /etc/hosts file are specified.
18
Paper# 106
Architecture
19
Paper# 106
Architecture
In the Specify Network Interface Usage screen we will specify which network interface card we will use for the interconnect traffic between the cluster nodes as well as for public network traffic. We will select Public for the interface eth3 and Private for the interface eth1.
20
Paper# 106
Architecture
We need to specify the location of the Oracle Cluster Registry files (OCR). These files need to be stored on shared storage and contain important information or the metadata about the RAC database instance as well as nodes that make up the cluster. We need about 100MB for the OCR files and in our case we will be using the OCFS file system to store the OCR files. In Oracle 10g Release 2, we can provide an additional mirrored location for the OCR file which will provide us redundancy and avoid a single point of failure. In this example, we are using external redundancy option which means the OCR file is not mirrored and we should use our own mechanisms to backup the OCR file.
21
Paper# 106
Architecture
The Voting Disk is another important file that contains important information about cluster membership and is used by the CRS to avoid spilt-brain scenarios should any node in the cluster lose network contact via the interconnect with other nodes in the cluster. The Voting Disk also needs to be located on shared storage as all nodes in the cluster needs to have access to the Voting disk files. In our example, we will be using the OCFS file system that we earlier had created. The Voting disk files are typically about 20MB and in Oracle 10g Release 2, we are able to specify two additional locations for the Voting Disk file to provide redundancy.
22
Paper# 106
Architecture
After completing the installation of the Oracle 10g Clusterware on the local node, the OUI will also copy the Oracle home to other remotes nodes in the cluster
23
Paper# 106
Architecture
At the end of the CRS Installation, we will be prompted to run the root.sh from the ORA_CRS_HOME/bin directory. This must be done on each node, one node at a time. 24 Paper# 106
Architecture
[root@itlinuxbl53 crs]# ./root.sh WARNING: directory '/opt/oracle/product/10.2.0' is not owned by root WARNING: directory '/opt/oracle/product' is not owned by root WARNING: directory '/opt/oracle' is not owned by root
25
Paper# 106
Architecture
WARNING: directory '/opt' is not owned by root Checking to see if Oracle CRS stack is already configured Setting the permissions on OCR backup directory Setting up NS directories Oracle Cluster Registry configuration upgraded successfully WARNING: directory '/opt/oracle/product/10.2.0' is not owned by root WARNING: directory '/opt/oracle/product' is not owned by root WARNING: directory '/opt/oracle' is not owned by root WARNING: directory '/opt' is not owned by root 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: itlinuxbl53 itlinuxbl53-pvt itlinuxbl53 node 2: itlinuxbl54 itlinuxbl54-pvt itlinuxbl54 Creating OCR keys for user 'root', privgrp 'root'.. Operation successful. Now formatting voting device: /ocfs/vote/vote01.dbf Format of 1 voting devices complete. Startup will be queued to init within 90 seconds. Adding daemons to inittab Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. itlinuxbl53 CSS is inactive on these nodes. itlinuxbl54 Local node checking complete. Run root.sh on remaining nodes to start CRS daemons.
We will now run the root.sh on the other node in the cluster, ITLINUXBL54. Note, the output of the root.sh is different that the other node. The VIPCA (Virtual IP Configuration Assistant) is launched silently when the root.sh script is run on this node. In the earlier 10g release, the VIPCA used to be launched as part of the Oracle Software installation process
crs]# ./root.sh '/opt/oracle/product/10.2.0' is not owned by root '/opt/oracle/product' is not owned by root '/opt/oracle' is not owned by root '/opt' is not owned by root Oracle CRS stack is already configured
[root@itlinuxbl54 WARNING: directory WARNING: directory WARNING: directory WARNING: directory Checking to see if
Setting the permissions on OCR backup directory Setting up NS directories Oracle Cluster Registry configuration upgraded successfully WARNING: directory '/opt/oracle/product/10.2.0' is not owned by root WARNING: directory '/opt/oracle/product' is not owned by root WARNING: directory '/opt/oracle' is not owned by root WARNING: directory '/opt' is not owned by root
26
Paper# 106
Architecture
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: itlinuxbl53 itlinuxbl53-pvt itlinuxbl53 node 2: itlinuxbl54 itlinuxbl54-pvt itlinuxbl54 clscfg: Arguments check out successfully. NO KEYS WERE WRITTEN. Supply -force parameter to override. -force is destructive and will destroy any previous cluster configuration. Oracle Cluster Registry for cluster has already been initialized Startup will be queued to init within 90 seconds. Adding daemons to inittab Expecting the CRS daemons to be up within 600 seconds. CSS is active on these nodes. itlinuxbl53 itlinuxbl54 CSS is active on all nodes. Waiting for the Oracle CRSD and EVMD to start Oracle CRS stack installed and running under init(1M) Running vipca(silent) for configuring nodeapps Creating Creating Creating Starting Starting Starting Done. VIP GSD ONS VIP GSD ONS application application application application application application resource resource resource resource resource resource on on on on on on (2) (2) (2) (2) (2) (2) nodes... nodes... nodes... nodes... nodes... nodes...
27
Paper# 106
Architecture
We should also confirm if the CRS related processes like the Event Manager Daemon (EMD), Oracle Notification Services (ONS) and Cluster synchronization service daemon (CSS) are running
[root@itlinuxbl53 crs]# ps -ef |grep crs /opt/oracle/product/10.2.0/crs/log/itlinuxbl53/evmd; exec /opt/oracle/product/10.2.0/crs/bin/evmd ' root 28972 1 0 11:54 ? 00:00:00 /opt/oracle/product/10.2.0/crs/bin/crsd.bin reboot oracle 29261 28960 0 11:55 ? 00:00:00 /opt/oracle/product/10.2.0/crs/bin/evmd.bin root 29362 29297 0 11:55 ? 00:00:00 /bin/su -l oracle -c /bin/sh -c 'ulimit -c unlimited; cd /opt/oracle/product/10.2.0/crs/log/itlinuxbl53/cssd; /opt/oracle/product/10.2.0/crs/bin/ocssd || exit $?' oracle 29363 29362 0 11:55 ? 00:00:00 /bin/sh -c ulimit -c unlimited; cd /opt/oracle/product/10.2.0/crs/log/itlinuxbl53/cssd; /opt/oracle/product/10.2.0/crs/bin/ocssd || exit $? oracle 29398 29363 0 11:55 ? 00:00:00 /opt/oracle/product/10.2.0/crs/bin/ocssd.bin oracle 15416 29261 0 12:08 ? 00:00:00 /opt/oracle/product/10.2.0/crs/bin/evmlogger.bin -o /opt/oracle/product/10.2.0/crs/evm/log/evmlogger.info -l /opt/oracle/product/10.2.0/crs/evm/log/evmlogger.log oracle 16178 1 0 12:08 ? 00:00:00 /opt/oracle/product/10.2.0/crs/opmn/bin/ons -d oracle 16179 16178 0 12:08 ? 00:00:00 /opt/oracle/product/10.2.0/crs/opmn/bin/ons d
We can also use the crsctl command to check the health and availability of the CRS stack.
28
Paper# 106
Architecture
We can also check the location of the voting disk using the crsctl command
css votedisk
located 1 votedisk(s).
The ocrcheck command can also be used to check the integrity of the Cluster Registry
[root@itlinuxdevblade08 bin]# ./ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 262144 Used space (kbytes) : 4352 Available space (kbytes) : 257792 ID : 375460566 Device/File Name : /ocfs/ocr/rac_ocr01.dbf Device/File integrity check succeeded
racdb1:/opt/oracle/product/10.2.0/crs/bin>./crsctl query crs activeversion CRS active version on the cluster is [10.2.0.1.0]
29
Paper# 106
Architecture
Launch the Oracle Universal Installer only on ONE node Use the same terminal that was prepared earlier for ssh and the CRS installation and choose the Custom option
30
Paper# 106
Architecture
The OUI will now detect that the node is cluster aware because the CRS stack is now active. Ensure that all the nodes in the cluster are listed and since we are not doing a local install but a cluster install, ensure that both the nodes listed have been checked off.
31
Paper# 106
Architecture
In this case study, we will be creating the database at a later stage after the software has been installed, that is why we have chosen the Custom option We will only be installing the RDBMS Software at this stage on all nodes in the cluster.
32
Paper# 106
Architecture
Similar to the CRS Installation in the earlier stage, once the OUI completes the installation on the local node, it will copy the Oracle Home to other remote nodes in the cluster.
33
Paper# 106
Architecture
At the end of the Oracle Software installation, we are prompted to run the root.sh on each node in the cluster. Again, like as in the CRS installation, we need to run the root.sh on each node in the cluster one at a time.
34
Paper# 106
Architecture
35
Paper# 106
Architecture
36
Paper# 106
Architecture
ASM
DBCA will create two ASM instances one on each node in the cluster. In our case it will create ASM instance with SID +ASM1 on ITLINUXBL53 and instance +ASM2 on ITLINUIXBL54. The spfile will be exist on the shared storage in our case the OCFS file system.
37
Paper# 106
Architecture
38
Paper# 106
Architecture
After the ASM instance has started, we now need to create the ASM disk groups using the ASM volumes we had earlier defined VOL1, VOL2 and VOL3. We can either create new disk groups or add disks to an existing disk group. In our case we will be creating an ASM disk group DG1 using the ASM volume VOL1 At this stage we will not be using the other two volumes VOL2 and VOL3
39
Paper# 106
Architecture
40
Paper# 106
Architecture
41
Paper# 106
Architecture
42
Paper# 106
Architecture
After the ASM instance has been created and the disk groups allocated, we will now create the RAC database using the DBCA
43
Paper# 106
Architecture
The DBCA will create two instances one on each node in the cluster. We need to ensure that all the nodes that are part of the cluster are selected.
44
Paper# 106
Architecture
Note; what we are specifying is not the SID of the RAC database, but the SID prefix which in this case is racdb. DBCA will create two instances, one on each node in the cluster with the SIDs racdb1 and racdb2
45
Paper# 106
Architecture
While choosing the storage options for the Database files, DBCA gives us three options the raw devices, a cluster file system which in our case is OCFS or ASM. We will choose the Automatic Storage Management option as the common shared location for all database files and will use the ASM Disk Group DG1 that was earlier created. Note:ASM disk groups are denoted with a + sign before the Disk Group name
46
Paper# 106
Architecture
47
Paper# 106
Architecture
48
Paper# 106
Architecture
The DBCA will call the catclust.sql script located at $ORACLE_HOME/rdbms/admin The catclust.sql will create the cluster specific data dictionary views
49
Paper# 106
Architecture
The spfile for the racdb database is located on the ASM disk +DG1 The spfile will have init.ora parameters that are common to both RAC instances racdb1 and racdb2 as well as some parameters that are specific to each database instance.
50
Paper# 106
Architecture
51
Paper# 106
Architecture
A Service is associated with an application on the front end that connects to the database on the back end. Users of the application need not care which instance of the RAC cluster or node they are connecting to for the end user it is totally transparent. Services can be used to make logical groups of consumers who share common attributes like workload, a database schema or some common application functionality. For example we can have two services like Finance and HR accessing the same 11i Applications database. Using services, the DBA has the ability to isolate workloads and manage them independently. Using services, the DBA can determine which node or nodes in the cluster the application runs on and also prioritize resources among services. We can set the service to run on a node as well as disable it from running on a particular node. We can set it to Preferred meaning that the service will primarily run only on that instance or we can set it to Available meaning that the service will only run on the instance if the Preferred instance fails. We can also configure the TAF policy to either Basic or Pre-Connect. Basic will establish the connection only at failover time whereas Pre-Connect will establish one connection to the preferred instance and another one to the instance that we have defined as Available In this example, we will be creating a service called racdb_itlinuxbl53. This service will be configured with the preferred node as ITLINUXBL53 and the available node as ITLINUXBL54
52
Paper# 106
Architecture
53
Paper# 106
Architecture
54
Paper# 106
Architecture
55
Paper# 106
Architecture
56
Paper# 106
Architecture
57
Paper# 106
Architecture
racdb2:/opt/oracle/product/10.2.0/db/bin>srvctl status asm -n itlinuxbl53 ASM instance +ASM1 is running on node itlinuxbl53. racdb2:/opt/oracle/product/10.2.0/db/bin>srvctl status asm -n itlinuxbl54 ASM instance +ASM2 is running on node itlinuxbl54. racdb2:/opt/oracle/product/10.2.0/db/bin>srvctl config database -d racdb itlinuxbl53 racdb1 /opt/oracle/product/10.2.0/db itlinuxbl54 racdb2 /opt/oracle/product/10.2.0/db racdb2:/opt/oracle/product/10.2.0/db/bin>srvctl status database -d racdb Instance racdb1 is not running on node itlinuxbl53 Instance racdb2 is not running on node itlinuxbl54 racdb2:/var/opt/oracle>srvctl racdb2:/var/opt/oracle>srvctl Instance racdb1 is running on Instance racdb2 is running on start database -d racdb status database -d racdb node itlinuxbl53 node itlinuxbl54
racdb2:/var/opt/oracle>srvctl config service -d racdb racdb_blade53 PREF: racdb1 AVAIL: racdb2 racdb_blade54 PREF: racdb2 AVAIL: racdb1 racdb2:/var/opt/oracle>srvctl status service -d racdb -s racdb_blade53 Service racdb_blade53 is running on instance(s) racdb1
58
Paper# 106
Architecture
scope=both sid='*';
System altered. SQL> alter system set log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST' scope=both sid='*'; System altered. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down.
Note: At this stage the other RAC instance on ITLINUXBL54, racdb2 is also shut down
SQL> startup mount; ORACLE instance started. Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers 419430400 2021216 247466144 163577856 6365184 bytes bytes bytes bytes bytes
59
Paper# 106
Architecture
Database mounted.
SQL> alter database archivelog; Database altered. SQL> alter database open; Database altered. After the RAC instance racdb1 has been started on ITLINUXBL53, we now connect to the RAC instance racdb2
SQL> startup mount; ORACLE instance started. Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers Database mounted. SQL> alter database open; Database altered. SQL> archive log list Database log mode Automatic archival Archive destination Oldest online log sequence Next log sequence to archive Current log sequence Archive Mode Enabled USE_DB_RECOVERY_FILE_DEST 15 16 16 419430400 2021216 226494624 184549376 6365184 bytes bytes bytes bytes bytes
Each RAC instance has its own thread of online redo log files and when we connect to the other RAC instance, racdb1, note that the current log sequence number differs from that of RAC instance racdb2. While the archive log files of each RAC instance can be stored in a location local to the specific node, we are storing the archive log files that are generated from both RAC instances in a common shared location (the ASM Disk Group +DG1).
60
Paper# 106
Architecture
Since we have already designated the Flash Recovery Area to reside on the ASM disk group +DG1, we will specify the location for the parameter log_archive_dest_1 as USE_DB_RECOVERY_FILE_DEST In performing a recovery, Oracle will need access to the archive log files generated by each individual RAC instance that is part of the cluster.
We are now connected to the RAC instance racdb1 note that the current log sequence here is 18 while in RAC instance racdb2, the current log sequence is 16.
SQL> archive log list Database log mode Automatic archival Archive destination Oldest online log sequence Next log sequence to archive Current log sequence
SQL> select * from v$log; GROUP# THREAD# SEQUENCE# STATUS ---------- ---------- ---------- ---------------1 1 18 CURRENT 2 1 17 INACTIVE 3 2 15 INACTIVE 4 2 16 CURRENT
61
Paper# 106
Architecture
We have defined a service called racdb_blade53 which we will be using to demonstrate the TAF capability of RAC. This service has been defined with the Preferred node ITLINUXBL53 and the Available node IT:INUXBL54. We will initially connect to RAC instance racdb1 as this is the preferred node for the service. We will then simulate a failure by crashing the instance racdb1 and observing how the client connection gets seamlessly transferred to the other available node that has been defined for the service which is in this case ITLINUXBL54. Note the tnsnames.ora entry for the service racdb_blade53 and the fact that the hostnames by been defined by the Virtual IPs and not the actual hostnames
RACDB_BLADE53 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = itlinuxbl53-vip)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = itlinuxbl54-vip)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb_blade53.hq.emirates.com) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5) ) ) )
62
Paper# 106
Architecture
Establish a client connection using the service racdb_blade53 Note: we are connected to instance racdb1 on node ITLINUXBL54
racdb1:/opt/oracle/product/10.2.0/db/network/admin>sqlplus system/oracle@racdb_blade53 SQL*Plus: Release 10.2.0.1.0 - Production on Mon Feb 5 09:56:09 2007 Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP and Data Mining options SQL> select host_name from v$instance; HOST_NAME ---------------------------------------------------------------itlinuxbl53.hq.emirates.com
From another session we will simulate a failure by crashing the instance We will kill both the pmon as well as the smon background processes
egrep "pmon|smon" 0 Feb01 ? 00:00:47 0 Feb01 ? 00:00:11 0 09:14 ? 00:00:01 0 09:14 ? 00:00:00 0 09:58 pts/4 00:00:00 asm_pmon_+ASM1 asm_smon_+ASM1 ora_pmon_racdb1 ora_smon_racdb1 egrep pmon|smon
#/opt/oracle>ps -ef | oracle 25672 1 oracle 25694 1 oracle 23349 1 oracle 23376 1 oracle 27803 26853
We will run the same command that we earlier executed and note that now the service racdb_blade53 has been transferred over to the other node in the cluster which is ITLINUXBL54
63
Paper# 106