Professional Documents
Culture Documents
Application Clusters
D17276GC10
Edition 1.0
December 2004
D40140
Authors Copyright © 2004, Oracle. All rights reserved.
All other products or company names are used for identification purposes only, and
may be trademarks of their respective owners.
Contents
I Introduction
Overview I-2
What Is a Cluster? I-3
What Is Oracle Real Application Clusters? I-4
Why Use RAC? I-5
Clusters and Scalability I-6
Levels of Scalability I-7
Scaleup and Speedup I-8
Speedup/Scaleup and Workloads I-9
A History of Innovation I-10
Course Objectives I-11
Typical Schedule I-12
iii
2 RAC Installation and Configuration (Part I)
Objectives 2-2
Oracle Database 10g RAC Installation: New Features 2-3
Oracle Database 10g RAC Installation: Outline 2-5
Preinstallation Tasks 2-6
Hardware Requirements 2-7
Network Requirements 2-8
RAC Network Software Requirements 2-9
Package Requirements 2-10
hangcheck-timer Module Configuration 2-11
Required UNIX Groups and Users 2-12
The oracle User Environment 2-13
User Shell Limits 2-14
Configuring User Equivalency 2-15
Required Directories for the Oracle Database Software 2-17
Linux Kernel Parameters 2-19
Cluster Setup Tasks 2-21
Obtaining OCFS 2-22
Installing the OCFS RPM Packages 2-23
Starting ocfstool 2-24
Generating the ocfs.conf File 2-25
Preparing the Disks 2-26
Loading OCFS at Startup 2-27
Mounting OCFS on Startup 2-28
Using Raw Partitions 2-30
Binding the Partitions 2-31
Raw Device Mapping File 2-33
Installing Cluster Ready Services 2-35
Specifying the Inventory Directory 2-36
File Locations and Language Selection 2-37
Cluster Configuration 2-38
Private Interconnect Enforcement 2-39
Oracle Cluster Registry File 2-40
Voting Disk File 2-41
Summary and Install 2-42
Running the root.sh Script on All Nodes 2-43
Verifying the CRS Installation 2-44
Summary 2-46
Practice 2: Overview 2-47
iv
3 RAC Installation and Configuration (Part II)
Objectives 3-2
OUI Database Configuration Options 3-3
Install the Database Software 3-4
Specify File Locations 3-5
Specify Cluster Installation 3-6
Select Installation Type 3-7
Products Prerequisite Check 3-8
Select Database Configuration 3-9
Check Summary 3-10
The root.sh Script 3-11
Launching the VIPCA with root.sh 3-12
VIPCA Network Interface Discovery 3-13
VIP Configuration Data and Summary 3-14
Installation Progress 3-15
End of Installation 3-16
Database Preinstallation Tasks 3-17
Creating the Cluster Database 3-19
Node Selection 3-20
Select Database Type 3-21
Database Identification 3-22
Cluster Database Management Method 3-23
Passwords for Database Schema Owners 3-24
Storage Options for Database Files 3-25
Database File Locations 3-27
Flash Recovery Area 3-28
Database Components 3-29
Database Services 3-30
Initialization Parameters 3-31
Database Storage Options 3-32
Create the Database 3-33
Monitor Progress 3-34
Manage Default Accounts 3-35
Postinstallation Tasks 3-36
Patches and the RAC Environment 3-37
Inventory List Locks 3-38
Summary 3-39
Practice 3: Overview 3-40
v
4 RAC Database Instances Administration
Objectives 4-2
The EM Cluster Database Home Page 4-3
Cluster Database Instance Home Page 4-5
Cluster Home Page 4-6
The Configuration Section 4-7
Operating System Details Page 4-8
Performance and Targets Pages 4-9
Starting and Stopping RAC Instances 4-10
Starting and Stopping RAC Instances with EM 4-11
Starting and Stopping RAC Instances with SQL*Plus 4-12
Starting and Stopping RAC Instances with SRVCTL 4-13
RAC Initialization Parameter Files 4-14
SPFILE Parameter Values and RAC 4-15
EM and SPFILE Parameter Values 4-16
RAC Initialization Parameters 4-18
Parameters Requiring Identical Settings 4-20
Parameters Requiring Unique Settings 4-21
Adding a Node to a Cluster 4-22
Adding a Node to an Existing Cluster 4-23
Adding the RAC Software to the New Node 4-25
Reconfigure the Listeners 4-27
Add an Instance by Using DBCA 4-28
Deleting Instances from a RAC Database 4-29
Node Addition and Deletion and the SYSAUX Tablespace 4-31
Quiescing RAC Databases 4-32
How SQL*Plus Commands Affect Instances 4-33
Administering Alerts with Enterprise Manager 4-34
Viewing Alerts 4-35
Blackouts and Scheduled Maintenance 4-37
Summary 4-39
vi
Oracle Linux ASMLib Installation 5-11
ASM Library Disk Creation 5-13
ASM Administration 5-15
ASM Instance Functionalities 5-16
ASM Instance Creation 5-17
ASM Instance Initialization Parameters 5-18
RAC and ASM Instances Creation 5-19
ASM Instance Initialization Parameters and RAC 5-20
Discovering New ASM Instances with EM 5-21
Accessing an ASM Instance 5-22
Dynamic Performance View Additions 5-23
ASM Home Page 5-24
ASM Performance Page 5-25
ASM Configuration Page 5-26
Starting Up an ASM Instance 5-27
Shutting Down an ASM Instance 5-28
ASM Administration 5-29
ASM Disk Group 5-30
Failure Group 5-31
Disk Group Mirroring 5-32
Disk Group Dynamic Rebalancing 5-33
ASM Administration Page 5-34
Create Disk Group Page 5-35
ASM Disk Groups with EM in RAC 5-36
Disk Group Performance Page and RAC 5-37
Create or Delete Disk Groups 5-38
Adding Disks to Disk Groups 5-39
Miscellaneous Alter Commands 5-40
Monitoring Long-Running Operations Using V$ASM_OPERATION 5-42
ASM Administration 5-43
ASM Files 5-44
ASM File Names 5-45
ASM File Name Syntax 5-46
ASM File Name Mapping 5-48
ASM File Templates 5-49
Template and Alias: Examples 5-50
Retrieving Aliases 5-51
SQL Commands and File Naming 5-52
DBCA and Storage Options 5-53
Database Instance Parameter Changes 5-54
vii
Summary 5-56
Practice 5 Overview 5-57
7 Services
Objectives 7-2
Traditional Workload Dispatching 7-3
Grid Workload Dispatching 7-4
What Is a Service? 7-5
High Availability of Services in RAC 7-6
Possible Service Configuration with RAC 7-7
Service Attributes 7-8
Service Types 7-9
Creating Services 7-10
Creating Services with DBCA 7-11
Creating Services with SRVCTL 7-13
Preferred and Available Instances 7-14
Everything Switches to Services 7-15
Using Services with Client Applications 7-16
Using Services with Resource Manager 7-17
Services and Resource Manager with EM 7-18
Services and Resource Manager: Example 7-19
Using Services with Scheduler 7-20
viii
Services and Scheduler with EM 7-21
Services and Scheduler: Example 7-23
Using Services with Parallel Operations 7-24
Using Services with Metric Thresholds 7-25
Changing Service Thresholds Using EM 7-26
Services and Metric Thresholds: Example 7-27
Service Aggregation and Tracing 7-28
Cluster Database: Top Services 7-29
Service Aggregation Configuration 7-30
Service Aggregation: Example 7-31
The trcsess Utility 7-32
Service Performance Views 7-33
Managing Services 7-34
Managing Services with EM 7-36
Managing Services: Example 7-38
Summary 7-39
Practice 7 Overview 7-40
ix
TAF Verification 8-24
FAN Connection Pools and TAF Considerations 8-25
Restricted Session and Services 8-26
Summary 8-27
Practice 8 Overview 8-28
x
Typical Latencies for RAC Operations 10-6
Wait Events for RAC 10-7
Wait Event Views 10-8
Global Cache Wait Events: Overview 10-9
2-way Block Request: Example 10-11
3-way Block Request: Example 10-12
2-way Grant: Example 10-13
Considered “Lost” Blocks: Example 10-14
Global Enqueue Waits: Overview 10-15
Session and System Statistics 10-16
Most Common RAC Tuning Tips 10-17
Index Block Contention Considerations 10-19
Oracle Sequences and Index Contention 10-20
Undo Block Considerations 10-21
High-Water Mark Considerations 10-22
Cluster Database Performance Page 10-23
Cluster Cache Coherency Page 10-25
Database Locks Page 10-26
Automatic Workload Repository: Overview 10-27
AWR Tables 10-28
AWR Snapshots in RAC 10-29
Generating and Viewing AWR Reports 10-30
AWR Reports and RAC: Overview 10-31
Statspack and AWR 10-33
Automatic Database Diagnostic Monitor 10-34
ADDM Problem Classification 10-35
RAC-Specific ADDM Findings 10-36
ADDM Analysis: Results 10-37
ADDM Recommendations 10-38
Summary 10-39
Practice 10: Overview 10-40
xi
Data Guard Broker (DGB) and CRS Integration 11-11
Data Guard Broker Configuration Files 11-12
Hardware Assisted Resilient Data 11-13
Rolling Patch Upgrade Using RAC 11-14
Rolling Release Upgrade Using SQL Apply 11-15
Database High Availability Best Practices 11-16
Extended RAC: Overview 11-17
Extended RAC Connectivity 11-18
Extended RAC Disk Mirroring 11-19
Additional Data Guard Benefits 11-20
Using Distributed Transactions with RAC 11-21
Using a Test Environment 11-22
Summary 11-23
Appendix A: Practices
Appendix B: Solutions
xii
________________
Appendix A
Practices
________________
Conventions
For most of these practice exercises, you will be using various Oracle tools (OUI, DBCA,
EMCA, and so on), and telnet sessions. Your instructor will give you details about your nodes
and accounts, as well as the SIDs of your instances. When working on these practices, you must
use the provided values to prevent interference with your fellow students or other classes.
As indicated by your instructor, you will be paired with another student, and both of you will
access the same cluster. We hope that you will coordinate the lab work with your coworker, and
that you will form a great team.
Each cluster is composed of two machines with names similar to the following: ed-toraclin1a,
and ed-toraclin1b.
In the above example, 1a represents the first node (a) of the first cluster (1), and 1b represents
the second node (b) of the first cluster (1).
To ease the connection to your cluster during certain labs, you will also be able to use a
simplified version of the machine names: rac1a, rac1b, ...
We highly recommend that you do not hesitate to look at the proposed solutions before you start
a particular lab. When possible, we also provide a set of lab and solution scripts that can help
you resolve a lab. If you get stuck on some of the questions, and you want to use a script, make
sure you execute it on the right node of your cluster, and connected as the right user.
The lab and solution scripts are located either in the $HOME/labs directory or $HOME/solutions
directory of each node, and each solution script’s name as the following form:
lab | sol_<lesson number>_<lab number>_<step number><sequence letter>_<n1 | n2>_<w1 | w2
| …>_<DB name>, where:
• n1 represents the first node, and n2 represents the second node.
• wn represents the telnet window n.
In addition, whenever this guide references a database name like RDBA, you should
replace the last letter with your corresponding letter.
Note: If you want to execute the proposed solution scripts, make sure that you execute them
from the $HOME/solutions directory of the oracle user, or from the $HOME/labs directory of
the oracle user.
For most of these practice exercises, you will be using various Oracle graphical tools (OUI,
DBCA, EMCA, and so on), and telnet sessions. Your instructor will give you details about your
node names and accounts, as well as the SIDs of your instances. When working on these
practices, you must use the provided values to prevent interference with your fellow students or
other classes.
Note: The solutions provided are not necessarily based on your assigned account, so you should
substitute your designated user, database, instance, and related information as appropriate.
1. Using a telnet session, connect as user root to your first RAC node. Make sure that you have
enough memory, swap space, and temporary space to install your CRS and RAC software on
both nodes.
3. Make sure that you can reach each node from the other one. Do this for both nodes.
4. Make sure that the required OS packages are loaded with a sufficient compatibility version.
Check for this on both nodes.
5. Make sure that the hangcheck timer is started and properly configured on each node.
6. Make sure that the oracle and nobody users and the oinstall and dba groups exist.
Check for this on both nodes.
7. Edit the.bash_profile file of the oracle user, and set the environment variables. Do this
on both nodes.
8. As the root user, make sure that you have the following lines in your
/etc/security/limits.conf file:
• * soft nproc 2047
• * hard nproc 16384
• * soft nofile 1024
• * hard nofile 65536
In addition, check to see that you have the following entry in your /etc/pam.d/login file:
session required /lib/security/pam_limits.so. Check the values above on
the second node also.
10. Connect as user oracle to the first node. Check that you can use the rsh command to connect
to the other node of your cluster without being prompted for a password. Do this from the
second node also.
11. Connect as user root on the first node. Change directory to /u01, and create the app directory.
Make sure that it is owned by oracle and the group is oinstall. Change the effective user
to oracle, and create the /u01/app/oracle directory. Do this on both nodes.
12. Connect as user root on the first node. Check that the Linux kernel parameters are set to at least
the following values:
• semmsl 250
• semmns 32000
• semopm 100
• semmni 128
• shmall 2097152
• shmmax Half the size of physical memory
• shmmni 4096
• file-max 65536
• ip_local_port_name 1024-65000
When finished, do the same for the second node.
Note: The solutions provided are not necessarily based on your assigned account, so you should
substitute your designated user, database, instance, and related information as appropriate.
1. Connect as user root on the first node, and change your directory to the /stage directory.
Make sure that you have a subdirectory called ocfs. Then change your directory to the ocfs
subdirectory, and see that you have the following .rpm files. These files are downloaded from
the OTN Web site, and you may need different ones depending on your machine. Check the
OCFS Web pages on the OTN Web site for more information:
• ocfs-EL
• ocfs-support
• ocfs-tools
When finished, do the same for the second node.
2. Use the rpm command to install the following OCFS packages from the /stage/ocfs
directory:
• ocfs-support
• ocfs-n-EL (single processor module) or ocfs-n-EL-smp (multiprocessor
module)
• ocfs-tools
Install the ocfs-support rpm first, the OCFS kernel module rpm second, and the ocfs-
tools rpm third. Note in the example, the single processor OCFS kernel module is used. When
finished, repeat the steps on the second node.
3. Launch the ocfstool utility as the root user. Use it to generate the OCFS configuration file,
/etc/ocfs.conf. Then exit the utility, and check the ocfs.conf file that is generated.
When done, perform the same steps on the second node.
4. Ensure that OCFS is automatically started by the system at the next reboot.
Repeat this step on the second node.
5. In order that the two nodes do not need to be rebooted, manually execute the load_ocfs
command as the root user to load the OCFS module. Note that you may get warnings
depending on the kernel version used by your Linux system. If the kernel version you are using is
greater than the corresponding OCFS rpms, a forced load is done automatically. However, the
reverse is not true.
Repeat this step on the second node.
6. Using the fdisk command, ensure that a partition called sda1 exists on your shared disk,
/dev/sda. The fdisk command must be run as the root user.
Note: There is no need to do this on the second node because it is the shared disk!
7. As the root user, create a new directory called /ocfs, and make sure that it is owned by the
oracle user and the associated group is dba. Adjust the permissions appropriately.
Repeat these actions on the second node.
9. The OCFS volume must be mounted on both nodes. Again, you can use ocfstool to do this.
This step must be performed on both nodes.
10. On both nodes, make sure that the /ocfs directory is mounted automatically during the next
reboot of the system. On both nodes, edit the /etc/fstab file to mount the OCFS volume
whenever the system boots.
When you have finished this step on the first node, go to your second node and repeat step 10.
Note: The solutions provided are not necessarily based on your assigned account, so you should
substitute your designated user, database, instance, and related information as appropriate.
In this practice, you will install Oracle Cluster Ready Services on both nodes. The CRS software
is located in the /stage directory under the crs10g_10.1.0.2.0 subdirectory. The CRS
software is installed by using the Oracle Universal Installer (OUI). This is done on the first
node only.
1. Before the OUI can be started, prepare the system to enable nonroot users to redirect the
display of graphical applications.
In this practice, you use the Oracle Universal Installer (OUI) to install the Oracle Database 10g RAC
software on both nodes in your cluster.
2. Use the OUI to install the database software on both nodes in your cluster.
3. The VIP Configuration Assistant (VIPCA) is launched from the root.sh script on the first
node.
4. After the VIP configuration finishes on the first node, run the root.sh script on the second
node.
5. Before continuing with database creation, make sure that all the nodeapps are running.
In this practice, you create a RAC database by using the Database Configuration Assistant (DBCA).
2. If DBCA reports an EM “Null argument” configuration error, you will have to correct this by
running emca manually.
For most of these practice exercises, you will be using Enterprise Manager Database Control.
Your instructor will give you details about your nodes and accounts, as well as the SIDs of your
instances. When working on these practices, you must use the provided values to prevent
interference with your fellow students or other classes.
Note: The solutions provided are not necessarily based on your assigned account, so you should
substitute your designated user, database, instance, and related information as appropriate.
1. Connect as user oracle to the first node by using a telnet session. Determine the following:
• List of processes associated with the instance on the first node. (For example, RDBA1,
RDBB1, etc.)
• List of processes running CRS
• Notification Server processes
When finished, perform the same for the second node.
2. Using the same telnet session, execute the ocrdump command. When executed, look at the
generated file to determine the list of components that are maintained in the OCR.
3. On the first node, execute the following command: evmwatch -A -t "@timestamp @@".
Create a second telnet session connected as user oracle on the first node. In the second session,
kill the SMON process on node 1 (1 in this example) when finished, what do you observe in the
first session?
After a few moments, determine the list of processes running 1. What is your conclusion?
Note: Once done, type [CTRL] [C] in the first session to stop the evmwatch command.
4. Create two SQL*Plus sessions connected as SYSDBA to each instance. Determine the following
for each instance:
• The database name
• The instance name
• The instance number
• The thread
• The instance status
• The list of redo log groups and their corresponding thread and members
• The undo tablespaces
What do you observe when looking at the status of each instance?
2. In this practice you will use EM Dbconsole to stop and start your database.
Unless specified otherwise, you must log in as root on a terminal session through VNC on the first
node of your cluster (rac1).
Before starting this lab, execute the setup_asm_partitions.sh script located in your labs
directory.
1. Change your current directory to /stage/asmlib. Make sure that the following RPMs are in
that directory:
• oracleasm-support-1.0.2-1.i386.rpm
• oracleasm-2.4.21-EL-1.0.0-1.i686.rpm
• oracleasmlib-1.0.0-1.i386.rpm
Use the rpm –i command to install each of the RPMs above in that order.
3. Use the fdisk /dev/sda command to look at the shared devices that are available to you. Then, use
the /etc/init.d/oracleasm createdisk command to create six ASM disks called VOL1,
VOL2, …, VOL6, respectively. For that, use the last six shared devices available to you.
4. Telnet to the second node (rac2), and connect as root. When on rac2, install and configure the
ASMLib driver like you did previously on rac1.
1. Connected as user oracle from a terminal window on your VNC session, you now create ASM
instances in your cluster. Execute the dbca command. Make sure that on the Welcome screen,
the Oracle Real Application Clusters Database option is selected. Then, click Next.
2. On the Operations screen, select the Create a Database option. When finished, click Next.
3. On the Node Selection screen, select both nodes by using the Select All button. Then, click Next.
4. On the Database Templates screen, select the General Purpose option. Then, click Next.
5. On the Database Identification screen, specify the Global Database Name. Then, click Next.
6. On the Management Options screen, deselect the Configure the Database with Enterprise Manager
check box. When finished, click Next.
7. On the Database Credentials screen, select the Use the Same Password for All Accounts option, and
specify and confirm the passward for the SYS user. Use oracle as the password. When finished, click
Next.
8. On the Storage Options screen, select the Automatic Storage Management (ASM) option. Click Next.
9. On the Create ASM Instance screen, select the Create initialization parameter file (IFILE) option, and
click ASM Parameters. On the ASM Parameters screen, set the asm_diskstring value to
ORCL:VOL*. Then make sure that you specify oracle as the password for SYS when back to the
Create ASM Instance screen. When finished, click Next.
10. In the warning dialog box, click OK to start the ASM instance creation process.
11. When on the ASM Disk Groups screen, create a new ASM disk group called DBG1 by using the first
four candidate disks. Make sure that the disk group that you create uses the Normal redundancy policy.
When finished, click Next.
12. When on the Database File Locations screen, click Cancel to cancel the session and exit from dbca.
13. Using terminal sessions, and still connected as oracle, make sure that both ASM instances are started. If
an ASM instance is down, set its corresponding SID, and use SQL*Plus to start it up. Do that
from the corresponding node.
1. Make sure that the asm1_target_RDBA.xml file is in your labs directory on rac1,
and that asm2_target_RDBA.xml is in your labs directory on rac2. See that their
content is correct.
2. On both nodes, check that you do not have any ASM target already registered in Database
Control.
3. Go back to your terminal window, and use the emctl tool to add the new target and stop the
agent. Then use emctl to restart the agent and the DB console. Perform this on both nodes.
4. Log in again by using Database Control. Make sure that both ASM instances are now
recognized as Database Control targets on both nodes.
5. Use Database Control from rac1 to create a new ASM disk group called FRAG1. This disk
group is used to migrate the flash recovery area to ASM. Make sure that this disk group uses
the remaining two candidate ASM disks, and is using the Normal redundancy policy.
1. Connected as user oracle in your terminal emulator window on rac1, make sure that your
ASM instance is started up, and list the processes associated to it. Then determine the
characteristics of:
• The mounted disk groups
• The associated ASM disks
• The associated ASM files
2. Connected as SYSDBA under SQL*Plus in another terminal emulator window, determine the list
of disk groups that are visible from your database instance. Then list the processes associated to
your database instance. When done, create a new tablespace called TBSASM that is stored inside
the ASM disk group DGROUP1, and which has only one 500 MB data file. When finished,
determine the list of processes associated to your database instance again, and list the data files
associated to your database. What do you observe?
3. Back on your ASM instance, using SQL*Plus, determine the number of bytes written on the
DBG1 disk group. Then use Database Control to determine the amount of disk space used by
TBSASM on each ASM disk. What is your conclusion?
4. Using Database Control, drop the ASM disk called VOL4. Using Database Control, look at the
performance charts relating to disk groups. What are your conclusions?
6. Using Database Control, navigate to the Add Disks page. Execute the lab_05_04_06.sql script
from your terminal window on rac1. As soon as the execution of the script is started, add the ASM disk,
which was dropped at step four, to DBG1. What do you observe, and what are your conclusions?
Unless specified otherwise, you must log in as SYSDBA either through Database Control or through
SQL*Plus.
1. Use Database Control to create two new redo log groups in your database. The two groups must
pertain to the thread number three, and each group must have only one 10240 KB member called
redo05.log and redo06.log, respectively. Make sure that the members are created in the
/ocfs/oradata/RACDB directory.
3. Use the SRVCTL control utility to stop the RDBB2 instance, and start it up again. What
happens and why?
If necessary, fix the situation.
4. Revert to the original situation where RDBB2 was using the redo thread two, and destroy
redo thread number three. Make sure that in the end both instances are up and running and
managed by CRS.
1. Connected as SYSDBA under SQL*Plus in your database instance on rac1, create a new
tablespace called TBSASMMIG. This tablespace must contain only one 10 MB file stored in your
file system (not using ASM). Create a table called T2 stored in TBSASMMIG. Insert one row
inside T2.
2. From your database instance, migrate TBSASMMIG to ASM storage. When done, check that the
migration is successful.
3. Using Database Control, determine the name of the files created in DBG1 from the ASM pages.
4. From your database instance, clean up your environment by dropping the TBSASMMIG tablespace,
including its contents and data file. Perform the same with the TBSASM tablespace. Also, remove
the file system file that was originally created to store TBSASMMIG. When finished, verify by
using the ASM pages of Database Control that the ASM files are removed.
The first step in creating a service configuration is to plan services for each application or application
function that is using Oracle RAC 10g.
In this practice, you create the following configuration:
1. Use DBCA to create the two services above. With DBCA, you can specify the service names as
well as their preferred and available instances.
2. After you have created your services, make sure that they are taken into account by CRS. Use the
crs_stat command from one of the nodes, and then use the SRVCTL command.
3. Make sure that DBCA has added your services to the tnsnames.ora files on both nodes, and
that the listeners are aware of their existence.
4. Connect as SYSDBA under each instance, look at the current value of the SERVICE_NAMES
initialization parameter, and check that it is set correctly.
5. Using Database Control, how can you check that the services are currently running as expected?
6. Using a telnet session connected as user oracle to the first node, kill the SMON process of the
RDBB1 instance. After a while, use SRVCTL to determine the status of your database. Open a
second terminal window by using user oracle on the second node, and look at the current
value of the SERVICE_NAMES initialization parameter. What do you observe?
7. Using Database Control, check that both services are running on RDBB2.
8. Using Database Control, create a new user called JFV identified by the password JFV. The
default tablespace of this user should be USERS, and its temporary tablespace TEMP. Make sure
that you grant this user with the CONNECT, RESOURCE, and DBA roles. Then, from rac1, using
SQL*Plus, connect to SERV1 with user JFV. When connected, determine on which instance
your session is currently running. Then, execute the following query:
select count(*) from dba_objects,dba_objects,dba_objects
9. After a while, go to the EM Top Consumers page from the Cluster Database page from rac2,
and check that SERV1 is using more and more resources. Check statistics on your service with
v$service_stats from a SQL*Plus session connected as SYSDBA.
11. What happens to your already connected SERV1 session running on the second instance? If your
session is still executing the query, stop its execution by pressing [Ctrl] + [C].
12. Using Database Control, create the HIGH_PRIORITY and STANDARD_PRIORITY consumer
groups. Make sure that you map HIGH_PRIORITY to SERV1, and STANDARD_PRIORITY to
SERV2.
13. Using a SQL*Plus session, check the mappings that you just defined, and make sure that you
grant PUBLIC the right to switch to HIGH_PRIORITY. You will no longer use
STANDARD_PRIORITY in this practice.
14. Using Database Control, create a resource plan called SERVICE_PLAN. Make sure that this plan
is defined to dedicate 70% of the CPU to the HIGH_PRIORITY consumer group, and 30% to
the OTHERS group. After you have created the plan, see that it is activated on both instances.
15. From a telnet session on the first node, connected as user oracle, change your directory to the
labs directory. From there, execute the lab_07_01_15_n1_RDBB.sh script. This script
generates a workload on the first instance. It starts two sessions that use SERV1, and two
sessions that use RDBB1. How would you verify that the resource plan is followed?
17. Set alert thresholds for your service SERV1 by using DB Control. Specify the values defined at
the beginning of this practice.
18. Use SQL*Plus to connect to RDBB1 by using SERV1, and execute the lab_07_01_18.sql
script, connected as user JFV. Observe the graph. What is your conclusion?
19. Use Database Control to remove the thresholds that you specified during this practice.
Unless specified otherwise, you must log in as SYSDBA either through Database Control or
through SQL*Plus.
2. Using SRVCTL, change your service configuration to have RDBB1 and RDBB2 as the preferred
instances for SERV1, and start SERV1.
5. From a terminal window, and connected as user JFV in SQL*Plus, execute the
createfan.sql script. This script creates a simple table used by the following scripts of this
practice. This script is located in your $HOME/labs directory.
6. Connected as user oracle on the first terminal window on the first node, execute the
sess_count_n1_RDBB.sh script located in your $HOME/labs directory. Then, connected
as user oracle on the second terminal window, execute the startfanload.sh script.
Looking at the first session, what is your conclusion?
Note: When the workload is correctly balanced on both nodes, stop the workload by executing
the stopfanlod.sh script from the third terminal window. Then you can also stop the
sessions count by pressing [Ctrl] + [C] in the first session.
7. How would you make sure that the initial connection load is balanced on each instance?
9. Reconfigure SERV1 so that RACDB1 is its preferred instance and RACDB2 is its available
instance, and start SERV1.
12. Using srvctl, make sure that you reassign SERV1 to its preferred instance.
For this practice, you must start four terminal windows. You must connect as user oracle in each
of them, and start two of them on rac1 and the remaining two on rac2. Open the four terminal
windows now. For convenience, the first terminal window is called TW1R1. Start it on rac1. The
second one is called TW2R1. Start it also on rac1. The last two are called TW3R2 and TW4R2,
respectively. Start both on rac2.
IMPORTANT NOTE: Before continuing, execute the callout_setup.sh script from TW1R1,
and then from TW3R2. This script is located on your $HOME/labs directory.
1. Write a shell script that is able to trap FAN events generated by CRS.
The events that need to be trapped must be for the RDBB database, and the event types that need
to be trapped are SERVICEMEMBER (up/down), SERVICE (up/down), and INSTANCE
(up/down).
The callout script should create a file that logs the events that are trapped. The log file must be
located in the $ORA_CRS_HOME/racg/log directory.
Make sure that the callout script is deployed on both nodes.
Note: You can use TW1R1 for this step.
3. From TW1R1, stop the SERV1 service by using srvctl. When finished, look at terminal
windows TR2R1 and TW4R2, and then look at the generated log files in the
$ORA_CRS_HOME/racg/log directory by using TW1R1 and TW3R2. What do you
observe?
4. From TW1R1, stop the SERV2 service by using srvctl. When finished, look at terminal
windows TR2R1 and TW4R2, and then look at the generated log files in the
$ORA_CRS_HOME/racg/log directory by using TW1R1 and TW3R2. What do you
observe?
5. From TW1R1, start both SERV1 and SERV2 services by using srvctl. When finished, look at
terminal windows TW2R1 and TW4R2, and then look at the generated log files in the
$ORA_CRS_HOME/racg/log directory by using TW1R1 and TW3R2. What do you
observe?
Note: When finished, type [CTRL] [C] in both TW2R1 and TW4R2 to stop the evmwatch
commands.
1. Using srvctl from rac1, add two new services to your database, and start them. The first one
is called AP and has RDBB1 and RDBB2 as its preferred instances. Its transparent application
failover policy is BASIC. The second one is called ERP, and has its preferred instance as RDBB1
and its available instance as RDBB2. Its transparent application failover policy is defined to be
PRECONNECT.
2. Using SQL*Plus from rac1, verify that both services are started correctly on their
corresponding instances. What do you observe?
3. In order to be able to connect to your database by using the AP and ERP services, what must you
do next?
4. Connect to the database by using the AP service from the second node (rac2). Use user JFV to
connect. Check which instance you are currently connected to. Also check which TAF policy
you are using. How many sessions are started on each instance to support your connection?
5. Still connected as user JFV from your second node, insert a row into the FAN table, and commit
your modification. From another telnet session, kill all the server processes started on the
instance to which you are connected. Go back to your session and try to insert a new row in the
FAN table. What happens and why?
8. Exit from the SQL*Plus session that is connected as user JFV, and perform steps 4 through 7
again. This time use the ERP service instead of AP, and make sure that you also identify which
service is used when you are asked to determine the failover method used by your session. What
do you observe?
10. Exit from all your SQL*Plus sessions, and kill the SMON process of RDBB1. Wait for CRS to
restart RDBB1, and look at the service repartition across both instances for the ERP service. What
is your conclusion?
11. Use srvctl to stop and remove both the AP and ERP services from your cluster.
1. In this practice, you place the database in ARCHIVELOG mode and enable Flashback Recovery
options. In addition, you set persistent RMAN configuration parameters that are RAC friendly.
When the parameters have been saved, initiate a full cluster database backup.
2. From a terminal window, start an RMAN session, and adjust the following RMAN properties to
take advantage of your RAC environment:
• Disk parallelism
• Disk channels
• Snapshot controlfile name
3. Make a whole database backup including archived log files using Database Control.
Unless specified otherwise, you must log in as SYSDBA either through Database Control or through
SQL*Plus. Before starting this lab, it is recommended that you stop your database as well Database
Control. Once done, restart your database, as well Database Control. Make sure that this done on
both nodes. This will ensure that you will see performance graphics that are very close to the ones
shown in this solution.
1. Execute the lab_10_01_01.sql script to create the necessary objects used throughout this
practice.
3. Connected as user JFV to your database from both nodes, execute the lab_10_01_03_n1.sh
script from the first node, and lab_10_01_03_n2.sh from the second node. Do not wait;
proceed with the next step.
4. Using Database Control, determine the list of blocking locks in your database.
5. While the script are still executing, look at the Sessions: Waiting and Working graphic. Then,
drill down to the Cluster wait class for the first node. What are your conclusions?
6. Using Database Control look at the Cluster Cache Coherency page. What are your conclusions?
7. While the scripts are still executing, look at the Sessions: Waiting and Working graphic. Then,
drill down to the Application wait class for the first node. What are your conclusions?
9. Using Database Control, review the latest ADDM run. What are your conclusions?
12. Connected as user JFV to your database from both nodes, execute the lab_10_01_12_n1.sh
script from the first node and lab_10_01_12_n2.sh from the second node. Do not wait;
proceed with the next step.
13. While the scripts are still executing, look at the Sessions: Waiting and Working graphic. Then,
drill down to the Cluster wait class for the first node. What are your conclusions?
14. When both scripts are done, force the creation of an AWR snapshot by using Database Control.
15. Using Database Control, review the latest ADDM run. What are your conclusions?
16. Execute the lab_10_01_16.sql script to create the necessary objects used for the rest of this
practice.
17. Connected as user JFV to your database from both nodes, execute the lab_10_01_17_n1.sh
script from the first node and lab_10_01_17_n2.sh from the second node. Do not wait;
proceed with the next step.
18. Until the scripts are executed, look at the Sessions: Waiting and Working graphic. What are
your conclusions?
19. When both scripts are done, force the creation of an AWR snapshot by using Database Control.
20. Using Database Control, review the latest ADDM run. What are your conclusions?
1. From rac1, connect to RDBB1 as SYSDBA under SQL*Plus. Before migrating your database to
ASM, create PFILE as a backup of SPFILE of your database.
3. See that you no longer have any connection to your database, and stop your database by using srvctl.
4. Make sure that you create a backup of one of the control files. Although this is not mandatory, it is the
best practice.
5. Using Recovery Manager, restore an existing control file to ASM. When finished, back up your
database to ASM as a copy of the existing one, and switch the control file pointers to the backup.
Finally, recover your database.
6. Using SQL*Plus, open your database, add a new temp file to ASM, and delete the old one.
7. Using SQL*Plus, add two new redo log groups for each thread. Make sure that those new groups are
stored in ASM and all have the same size. Then, remove the old groups from each thread. When finished,
see that both instances are shut down.
Solutions
______________
Conventions
For most of these practice exercises, you will be using various Oracle tools (OUI, DBCA,
EMCA, and so on), and telnet sessions. Your instructor will give you details about your nodes
and accounts, as well as the SIDs of your instances. When working on these practices, you must
use the provided values to prevent interference with your fellow students or other classes.
As indicated by your instructor, you will be paired with another student, and both of you will
access the same cluster. We hope that you will coordinate the lab work with your coworker, and
that you will form a great team.
Each cluster is composed of two machines with names similar to the following: ed-toraclin1a,
and ed-toraclin1b.
In the above example, 1a represents the first node (a) of the first cluster (1), and 1b represents
the second node (b) of the first cluster (1).
To ease the connection to your cluster during certain labs, you will also be able to use a
simplified version of the machine names: rac1a, rac1b, ...
We highly recommend that you do not hesitate to look at the proposed solutions before you start
a particular lab. When possible, we also provide a set of lab and solution scripts that can help
you resolve a lab. If you get stuck on some of the questions, and you want to use a script, make
sure you execute it on the right node of your cluster, and connected as the right user.
The lab and solution scripts are located either in the $HOME/labs directory or $HOME/solutions
directory of each node, and each solution script’s name as the following form:
lab | sol_<lesson number>_<lab number>_<step number><sequence letter>_<n1 | n2>_<w1 | w2
| …>_<DB name>, where:
• n1 represents the first node, and n2 represents the second node.
• wn represents the telnet window n.
In addition, whenever this guide references a database name like RDBA, you should
replace the last letter with your corresponding letter.
Note: If you want to execute the proposed solution scripts, make sure that you execute them
from the $HOME/solutions directory of the oracle user, or from the $HOME/labs directory of
the oracle user.
For most of these practice exercises, you will be using various Oracle graphical tools (OUI,
DBCA, EMCA, and so on), and telnet sessions. Your instructor will give you details about your
node names and accounts, as well as the SIDs of your instances. When working on these
practices, you must use the provided values to prevent interference with your fellow students or
other classes.
Note: The solutions provided are not necessarily based on your assigned account, so you should
substitute your designated user, database, instance, and related information as appropriate.
1. Using a telnet session, connect as user root to your first RAC node. Make sure that you have
enough memory, swap space, and temporary space to install your CRS and RAC software on
both nodes.
Note: After you have checked the first node, check the second node.
a. Run the redhat-config-network command from a terminal session through VNC connected
as root. Make sure that at least two Ethernet devices are active.
b. One at a time, select each Ethernet device that you will use, and make sure that they are activated
when the computer starts.
d. Make sure to select the Activate device when computer starts check box. Make note of the IP
address and Subnet Mask address.
f. Make sure that the host names and associated IP addresses are correctly configured in the
/etc/hosts file. See that the private interconnect as well as VIP names are also correctly
configured. Repeat these steps on the second RAC node.
Note: After you have checked the first node, check the second node.
From your first node, ping the second node using both its public and private names.
Note: After you have checked the first node, check the second node.
Run the rpm command and grep for compat and gcc. Check that your package versions are at the
same level or higher than those shown below.
Note: After you have checked the first node, check the second node.
Run the lsmod command as root and grep for hang. Make sure that the hangcheck module is loaded
automatically at boot by checking the /etc/rc.local file.
Note: After you have checked the first node, check the second node.
Use the grep command to search the /etc/passwd and /etc/group files for the required users and
groups.
Note: After you have checked the first node, check the second node.
Use the su command to change to the oracle user and then use the cat or view commands to review
the parameter values in the .bash_profile file. Exit back to the root shell when finished.
Note: After you have checked the first node, check the second node. Make sure the ORACLE_SID ends in “2”.
In our example, the ORACLE_SID on the second node should be RDBB2. On your nodes however, please use the
names assigned to you by your instructor.
Use the cat or view commands to review the parameter values in the /etc/security/limits.conf
file. Check the values on the second node also.
Note: After you have checked the first node, check the second node.
Use the cat command to check that the /etc/hosts.equiv file has the correct entries. If it does not, use
vi to add the entries.
Note: After you have checked the first node, check the second node.
10. Connect as user oracle to the first node. Check that you can use the rsh command to connect
to the other node of your cluster without being prompted for a password. Do this from the
second node also.
Note: After you have checked the first node, check the second node.
11. Connect as user root on the first node. Change directory to /u01, and create the app directory.
Make sure that it is owned by oracle and the group is oinstall. Change the effective user
to oracle, and create the /u01/app/oracle directory. Do this on both nodes.
Run the sysctl command and grep for shm, sem, file-max, and ip_local, respectively. Make sure
that the values are at least as large as those above.
Note: After you have checked the first node, check the second node.
Note: The solutions provided are not necessarily based on your assigned account, so you should
substitute your designated user, database, instance, and related information as appropriate.
1. Connect as user root on the first node, and change your directory to the /stage directory.
Make sure that you have a subdirectory called ocfs. Then change your directory to the ocfs
subdirectory, and see that you have the following .rpm files. These files are downloaded from
the OTN Web site, and you may need different ones depending on your machine. Check the
OCFS Web pages on the OTN Web site for more information:
• ocfs-EL
• ocfs-support
• ocfs-tools
When finished, do the same for the second node.
Note: When you have checked the first node, check the second node.
2. Use the rpm command to install the following OCFS packages from the /stage/ocfs
directory:
• ocfs-support
• ocfs-n-EL (single processor module) or ocfs-n-EL-smp (multiprocessor
module)
• ocfs-tools
Install the ocfs-support rpm first, the OCFS kernel module rpm second, and the ocfs-
tools rpm third. Note in the example, the single processor OCFS kernel module is used. When
finished, repeat the steps on the second node.
b. Use the rpm command with the –qa options and grep for ocfs to ensure that the rpms are
correctly installed before continuing. Do this on both nodes.
a. Enter ocfstool at the root prompt, and then click Tasks. On the Tasks menu, click Generate
Config.
d. Exit ocfstool and view the generated OCFS configuration file (/etc/ocfs.conf), using the
cat command.
View the /etc/rc5.d/S24ocfs file with the more command. This file is resposible for loading the ocfs
module.
5. In order that the two nodes do not need to be rebooted, manually execute the load_ocfs
command as the root user to load the OCFS module. Note that you may get warnings
depending on the kernel version used by your Linux system. If the kernel version you are using is
greater than the corresponding OCFS rpms, a forced load is done automatically. However, the
reverse is not true.
Repeat this step on the second node.
As the root user, load the OCFS kernel module by executing the load_ocfs command.
As the root user, execute the fdisk command by using /dev/sda as an argument to the command.
To view the partitions on the disk, press the P key. Your output should look similar to that shown below.
Note that there are extra partitions in the example. This is normal; they will be used in a future practice.
Press w to sync the disk. To quit fdisk, press q.
7. As the root user, create a new directory called /ocfs, and make sure that it is owned by the
oracle user and the associated group is dba. Adjust the permissions appropriately.
Repeat these actions on the second node.
Create the /ocfs directory by using the mkdir command as the root user. Use the chown command
to change ownership as shown. Use the chmod command, and set the permissions to 775.
a. As the root user, execute the mkfs.ocfs command. The options and values used with the
command are described below:
-F Force format (Overwrites any existing OCFS volumes)
-b Block size (128)
-L Volume label (ocfs)
-m Mount point (/ocfs)
-u User id (500-oracle)
-g Group id (502-dba)
-p Permissions (0775)
9. The OCFS volume must be mounted on both nodes. Again, you can use ocfstool to do this.
This step must be performed on both nodes.
a. Start ocfstool as root on the first node. Click the Mount button, and wait for the operation to
complete.
Note: Repeat the operations in step 9 on the second node in your cluster.
10. On both nodes, make sure that the /ocfs directory is mounted automatically during the next
reboot of the system. On both nodes, edit the /etc/fstab file to mount the OCFS volume
whenever the system boots.
When you have finished this step on the first node, go to your second node and repeat step 10.
Use the vi command to edit the /etc/fstab file, and add the following line:
/dev/sda1 /ocfs _netdev
Note: The solutions provided are not necessarily based on your assigned account, so you should
substitute your designated user, database, instance, and related information as appropriate.
In this practice, you will install Oracle Cluster Ready Services on both nodes. The CRS software
is located in the /stage directory under the crs10g_10.1.0.2.0 subdirectory. The CRS
software is installed by using the Oracle Universal Installer (OUI). This is done on the first
node only.
1. Before the OUI can be started, prepare the system to enable nonroot users to redirect the
display of graphical applications.
1. As the root user, execute the xhost + command to enable the graphical application to display
properly when being run by a nonroot user such as oracle.
c. If ORACLE_BASE has been properly set in the oracle users .bash_profile file, the inventory
directory points to /u01/app/oracle/oraInventory. If it does not, enter the correct value.
The oinstall group should appear in the Operating System group name field. Click Next to
continue.
g. The Language Selection screen appears. By default, English is the only selected language.
i. The Cluster Configuration screen appears with the default Cluster Name of crs.
k. On the Private Interconnect Enforcement screen, you must choose the Ethernet interface and IP
addresses to be used as interconnects on both nodes.
n. The Interface Type for the interconnect should now be Private. Click the Next button to continue.
p. After creating the OCR directory, return to the Oracle Cluster Registry screen, and enter
/ocfs/OCR/ocr.dbf in the OCR Location field. Click the Next button to continue.
r. After creating the CSS directory, return to the Voting Disk screen, and enter
/ocfs/CSS/vdisk.dbf in the Voting Disk location field. Click the Next button to continue.
v. After the orainstRoot.sh script has been run on both nodes, click Continue to close the dialog
box.
x. The Install screen enables you to monitor the progress of the installation and the actions being
performed by the OUI.
z. Before the installation is complete, a dialog box appears prompting you to run root.sh on both
nodes.
bb. When the root.sh script finishes running on the first node, open a terminal window on the second
node as root, and run /u01/app/oracle/product/10.1.0/crs_1/root.sh there.
In this practice, you use the Oracle Universal Installer (OUI) to install the Oracle Database 10g RAC
software on both nodes in your cluster.
1. Go to the database software staging location, and start the OUI.
2. Use the OUI to install the database software on both nodes in your cluster.
a. The first screen to appear is the Welcome screen. Click Next to continue.
c. The Cluster Installation Mode screen appears. By default, the first node is always selected.
e. On the Select Installation Type screen, select the Enterprise Edition installation. Click Next to
continue.
g. On the Select Database configuration screen, click the Do not create a starter database button.
i. Take a few moments and review the installation settings on the Summary page. Click Install when
you are ready to proceed with the installation.
k. When the installation progress reaches 100%, the OUI copies the installed files remotely from the
first node to the second node.
3. The VIP Configuration Assistant (VIPCA) is launched from the root.sh script on the first
node.
c. Choose the adapter that is associated with your host address. In this example, the adapter is eth1.
When you have done this, click Next to continue.
e. Carefully review the information on the Summary page. Click Finish to complete the VIP
configuration.
a. After the VIP configuration is completed, open a terminal window on the second node, and run
/u01/app/oracle/product/10.1.0/db_1/root.sh as the root user.
c. When the End of Installation screen appears, click the Exit button.
In this practice, you create a RAC database by using the Database Configuration Assistant (DBCA).
a. As the oracle user, change directory to $ORACLE_HOME/bin, and execute DBCA by using the
-datafileDestination argument. The directory passed with this argument is
/ocfs/oradata. This simplifies the installation process by enabling the DBCA to put the data files
on the shared disk.
d. The Node Selection screen appears. By default, the local node is always selected.
f. On the Database Templates page, choose the General Purpose template. Click Next to continue.
h. On the Management Options page, make sure that Configure the Database with Enterprise
Manager and Use Database Control for Database Management are both selected. Click Next to
continue.
j. On the Storage Options page, choose Cluster File System, and then click Next to continue.
l. On the Recovery Configuration page, select Specify Flash Recovery Area. The Flash Recovery
Area should be /ocfs/flash_recovery_area and the Flash Recovery Area Size should be
2048 megabytes. Click Next to continue.
n. There is no need to configure additional services at this time. When the Database Services screen
appears, click Next to continue.
p. Review the information on the Database Storage page. Expand each storage component in the left-
hand window. The corresponding values are displayed in the right-hand window. Click Next to
continue.
r. Review the data on the Summary page. Displayed here are common options, initialization parameters,
and database files.
v. A dialog box appears noting the start of the cluster database instances, 1 and 2 in this example. When
the instances have been started, close the dialog box and exit the DBCA. The cluster database has
been sucessfully created.
As the oracle user, change directory to $ORACLE_HOME/bin and run emca –c –x , then emca –
c –r and enter the appropriate data.
$ cd $ORACLE_HOME/bin
$ ./emca -c -x RDBB
$ ./emca -c -r
-----------------------------------------------------------------
-----------------------------------------------------------------
Do you wish to continue? [yes/no]: yes
Nov 4, 2004 6:11:12 AM oracle.sysman.emcp.EMConfig updateReposVars
INFO: Updating file …
Nov 4, 2004 6:11:31 AM oracle.sysman.emcp.EMConfig startOMS
INFO: Starting the DBConsole in all cluster nodes. This will take a while
...
Nov 4, 2004 6:14:46 AM oracle.sysman.emcp.EMConfig perform
INFO: DBConsole is started successfully
Nov 4, 2004 6:14:46 AM oracle.sysman.emcp.EMConfig perform
INFO: >>>>>>>>>>> The Enterprise Manager URL is
http://edtdr1rac1a:5500/em <<<
Enterprise Manager configuration is completed successfully
FINISHED EMCA at Thu Nov 04 06:14:46 EST 2004
For most of these practice exercises, you will be using Enterprise Manager Database Control.
Your instructor will give you details about your nodes and accounts, as well as the SIDs of your
instances. When working on these practices, you must use the provided values to prevent
interference with your fellow students or other classes.
Note: The solutions provided are not necessarily based on your assigned account, so you should
substitute your designated user, database, instance, and related information as appropriate.
1. Connect as user oracle to the first node by using a telnet session. Determine the following:
• List of processes associated with the instance on the first node. (For example, RDBA1,
RDBB1, etc.)
• List of processes running CRS
• Notification Server processes
When finished, perform the same for the second node.
$ ps –ef|grep –i crs|more
ps -ef|grep -i ons
Repeat the commands executed above on your second node. Look for processes associated with the second
instance and the CRS stack running there.
$ ps –ef | grep RDB2 | more
$ ps –ef | grep crs | more
2. Using the same telnet session, execute the ocrdump command. When executed, look at the
generated file to determine the list of components that are maintained in the OCR.
$ ocrdump
$ more OCRDUMPFILE
[SYSTEM]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, O
THER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}
[SYSTEM.css]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, O
THER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}
[SYSTEM.css.interfaces]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_CREATE_
SUB_KEY, OTHER_PERMISSION : PROCR_READ, USER_NAME : oracle, GROUP_NAME : oinstall}
[SYSTEM.css.interfaces.global]
UNDEF :
[SYSTEM.css.interfaces.global.eth0]
...
[DATABASE]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_CREATE_
SUB_KEY, OTHER_PERMISSION : PROCR_CREATE_SUB_KEY, USER_NAME : root, GROUP_NAME :
root}
[DATABASE.NODEAPPS]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_CREATE_SUB_KEY, GROUP_PERMISSION : PROCR_CRE
ATE_SUB_KEY, OTHER_PERMISSION : PROCR_CREATE_SUB_KEY, USER_NAME : oracle, GROUP_
NAME : oinstall}
[DATABASE.NODEAPPS.edtdr1rac1a]
ORATEXT : edtdr1rac1a
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_ALL_ACC
ESS, OTHER_PERMISSION : PROCR_ALL_ACCESS, USER_NAME : root, GROUP_NAME : root}
[DATABASE.NODEAPPS.edtdr1rac1a.ORACLE_HOME]
ORATEXT : /u01/app/oracle/product/10.1.0/db_1
...
[CRS]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, O
THER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}
[CRS.CUR]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, O
THER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}
[CRS.CUR.ora!edtdr1rac1a!vip]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, O
THER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}
[CRS.CUR.ora!edtdr1rac1a!vip.ACTION_SCRIPT]
ORATEXT : /u01/app/oracle/product/10.1.0/crs_1/bin/racgwrap
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, O
THER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}
[CRS.CUR.ora!edtdr1rac1a!vip.ACTIVE_PLACEMENT]
ORATEXT : 1
...
3. On the first node, execute the following command: evmwatch -A -t "@timestamp @@".
Create a second telnet session connected as user oracle on the first node. In the second session,
kill the SMON process on node 1 (1 in this example) when finished, what do you observe in the
first session?
After a few moments, determine the list of processes running 1. What is your conclusion?
Note: Once done, type [CTRL] [C] in the first session to stop the evmwatch command.
Answer: As soon as the SMON process is killed, CRS detects it, and starts up the 1 instance
again. This is done automatically.
$ kill –9 7738
$ ps -ef | grep 1
oracle 30943 1 0 06:11 ? 00:00:00 /u01/app/oracle/product/10.1.0/p
oracle 8964 1 0 06:47 ? 00:00:00 ora_pmon_RDBB1
oracle 8966 1 0 06:47 ? 00:00:00 ora_diag_RDBB1
oracle 8969 1 1 06:47 ? 00:00:00 ora_lmon_RDBB1
oracle 8971 1 0 06:47 ? 00:00:00 ora_lmd0_RDBB1
oracle 8973 1 0 06:47 ? 00:00:00 ora_lms0_RDBB1
oracle 8975 1 0 06:47 ? 00:00:00 ora_lms1_RDBB1
oracle 8977 1 0 06:47 ? 00:00:00 ora_mman_RDBB1
oracle 8979 1 0 06:47 ? 00:00:00 ora_dbw0_RDBB1
oracle 8981 1 0 06:47 ? 00:00:00 ora_lgwr_RDBB1
oracle 8983 1 0 06:48 ? 00:00:00 ora_ckpt_RDBB1
oracle 8985 1 0 06:48 ? 00:00:00 ora_smon_RDBB1
oracle 8987 1 0 06:48 ? 00:00:00 ora_reco_RDBB1
oracle 8989 1 0 06:48 ? 00:00:00 ora_cjq0_RDBB1
oracle 8991 1 0 06:48 ? 00:00:00 ora_d000_RDBB1
oracle 8993 1 0 06:48 ? 00:00:00 ora_s000_RDBB1
oracle 8996 1 0 06:48 ? 00:00:00 ora_lck0_RDBB1
oracle 9019 1 0 06:48 ? 00:00:00 ora_qmnc_RDBB1
oracle 9022 1 0 06:48 ? 00:00:00 ora_mmon_RDBB1
oracle 9025 1 0 06:48 ? 00:00:00 ora_mmnl_RDBB1
oracle 9053 1 0 06:48 ? 00:00:00 ora_pz99_RDBB1
oracle 9072 1 0 06:48 ? 00:00:00 /u01/app/oracle/product/10.1.0/t
oracle 9073 9072 0 06:48 ? 00:00:00 /u01/app/oracle/product/10.1.0/t
oracle 9075 9073 0 06:48 ? 00:00:00 /u01/app/oracle/product/10.1.0/t
oracle 9086 1 1 06:48 ? 00:00:00 oracle1 (LOCAL=NO)
oracle 9100 9073 0 06:48 ? 00:00:00 /u01/app/oracle/product/10.1.0/t
oracle 9101 9073 0 06:48 ? 00:00:00 /u01/app/oracle/product/10.1.0/t
oracle 9109 1 0 06:48 ? 00:00:00 ora_q000_RDBB1
$ sqlplus /nolog
SQL> connect sys/oracle@RDBB1 as sysdba
SQL> select name from v$database;
NAME
---------
RDBB
NAME
---------
RDBB
b. Start the first instance only, then start the second instance.
$ srvctl start instance -d RDBB -i RDBB1
$ srvctl start instance -d RDBB -i RDBB2
c. After stopping the database, start the first instance in MOUNT mode, then start the second instance and
open the database.
$ srvctl stop database -d RDBB
$ srvctl start instance -d RDBB -i RDBB1 -o mount
$ srvctl start instance -d RDBB -i RDBB2 -o open
2. In this practice you will use EM Dbconsole to stop and start your database.
a. From the Cluster Database home page, click the Shutdown button.
b. On the Specify Credentials page, enter the operating system name and password, oracle/oracle
then click Continue.
e. Click the Immediate button on the Advanced Options page and click OK. What is the default
option?
h. The next screen will allow you to restart the cluster database. Click the Startup button.
l. Make sure the Open the Database button is selected and click OK.
o. When the database has bee started, log back into Dbconsole.
Unless specified otherwise, you must log in as root on a terminal session through VNC on the first
node of your cluster (rac1).
Before starting this lab, execute the setup_asm_partitions.sh script located in your labs
directory.
1. Change your current directory to /stage/asmlib. Make sure that the following RPMs are in
that directory:
• oracleasm-support-1.0.2-1.i386.rpm
• oracleasm-2.4.21-EL-1.0.0-1.i686.rpm
• oracleasmlib-1.0.0-1.i386.rpm
Use the rpm –i command to install each of the RPMs above in that order.
1. Connected as user oracle from a terminal window on your VNC session, you now create ASM
instances in your cluster. Execute the dbca command. Make sure that on the Welcome screen,
the Oracle Real Application Clusters database option is selected. Then, click Next.
1. Make sure that the asm1_target_RDBA.xml file is in your labs directory on rac1,
and that asm2_target_RDBA.xml is in your labs directory on rac2. See that their
content is correct.
2. On both nodes, check that you do not have any ASM target already registered in Database
Control.
a. Connect as SYSDBA through Database Control on rac1, and then click the Cluster link in the
General section of the Cluster Database page.
c. On the Targets page, check that all targets are currently up and running, and that you do not have any
ASM target.
3. Go back to your terminal window, and use the emctl tool to add the new target and stop the
agent. Then use emctl to restart the agent and the DB console. Perform this on both nodes.
4. Log in again by using Database Control. Make sure that both ASM instances are now
recognized as Database Control targets on both nodes.
a. Connect as SYSDBA through Database Control on rac1, and then click the Cluster link in the
General section of the Cluster Database page.
c. On the Targets page, check that all targets are currently up and running, and that you have both ASM
instances recognized.
5. Use Database Control from rac1 to create a new ASM disk group called FRAG1. This disk
group is used to migrate the flash recovery area to ASM. Make sure that this disk group uses
the remaining two candidate ASM disks, and is using the Normal redundancy policy.
c. On the Automatic Storage Management Login page, specify SYS for the username and oracle for its
password. Then, click Login.
e. On the Create Disk Group page, specify FRAG1 in the Name field, and select the remaining two
candidate disks. Deselect the Automatically Mount During Startup option if already set, and select the
Mount this disk group on all ASM instances in the cluster option. Also, select the NORMAL
redundancy policy. When finished, click OK.
1. Connected as user oracle in your terminal emulator window on rac1, make sure that your
ASM instance is started up, and list the processes associated to it. Then determine the
characteristics of:
• The mounted disk groups
• The associated ASM disks
• The associated ASM files
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL>
SQL> host ps -ef | grep _+ASM1
oracle 19676 1 0 Sep02 ? 00:00:00 asm_pmon_+ASM1
oracle 19678 1 0 Sep02 ? 00:00:00 asm_diag_+ASM1
oracle 19681 1 0 Sep02 ? 00:00:01 asm_lmon_+ASM1
oracle 19683 1 0 Sep02 ? 00:00:00 asm_lmd0_+ASM1
oracle 19685 1 0 Sep02 ? 00:00:00 asm_lms0_+ASM1
oracle 19687 1 0 Sep02 ? 00:00:00 asm_mman_+ASM1
oracle 19689 1 0 Sep02 ? 00:00:00 asm_dbw0_+ASM1
oracle 19691 1 0 Sep02 ? 00:00:00 asm_lgwr_+ASM1
oracle 19693 1 0 Sep02 ? 00:00:00 asm_ckpt_+ASM1
oracle 19695 1 0 Sep02 ? 00:00:00 asm_smon_+ASM1
oracle 19697 1 0 Sep02 ? 00:00:05 asm_rbal_+ASM1
oracle 19700 1 0 Sep02 ? 00:00:00 asm_lck0_+ASM1
oracle 1977 1 0 06:10 ? 00:00:03 asm_pz99_+ASM1
oracle 2017 1 0 06:10 ? 00:00:02 asm_pz98_+ASM1
oracle 18825 18817 0 09:47 pts/0 00:00:00 /bin/bash -c ps -ef | grep
_+ASM1
oracle 18827 18825 0 09:47 pts/0 00:00:00 grep _+ASM1
SQL>
SQL> select * from v$asm_diskgroup;
6 rows selected.
SQL>
SQL> select group_number,file_number,bytes,type,striped
2 from v$asm_file;
no rows selected
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -
Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC1A solutions]$
2. Connected as SYSDBA under SQL*Plus in another terminal emulator window, determine the list
of disk groups that are visible from your database instance. Then list the processes associated to
your database instance. When done, create a new tablespace called TBSASM that is stored inside
the ASM disk group DGROUP1, and which has only one 500 MB data file. When finished,
determine the list of processes associated to your database instance again, and list the data files
associated to your database. What do you observe?
Answer: As soon as the new tablespace is created, the ASM processes are started on the database
instance. They are used to communicate with the ASM instance.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> select * from v$asm_diskgroup;
SQL>
SQL> host ps -ef | grep _RDBB1
oracle 9319 1 0 Sep02 ? 00:00:00 ora_pmon_RDBB1
oracle 9321 1 0 Sep02 ? 00:00:00 ora_diag_RDBB1
oracle 9323 1 0 Sep02 ? 00:00:04 ora_lmon_RDBB1
oracle 9325 1 0 Sep02 ? 00:00:05 ora_lmd0_RDBB1
oracle 9328 1 0 Sep02 ? 00:00:05 ora_lms0_RDBB1
oracle 9330 1 0 Sep02 ? 00:00:04 ora_lms1_RDBB1
oracle 9332 1 0 Sep02 ? 00:00:00 ora_mman_RDBB1
oracle 9334 1 0 Sep02 ? 00:00:01 ora_dbw0_RDBB1
oracle 9336 1 0 Sep02 ? 00:00:01 ora_lgwr_RDBB1
oracle 9338 1 0 Sep02 ? 00:00:00 ora_ckpt_RDBB1
oracle 9340 1 0 Sep02 ? 00:00:08 ora_smon_RDBB1
oracle 9342 1 0 Sep02 ? 00:00:00 ora_reco_RDBB1
oracle 9344 1 0 Sep02 ? 00:00:01 ora_cjq0_RDBB1
oracle 9346 1 0 Sep02 ? 00:00:00 ora_d000_RDBB1
oracle 9348 1 0 Sep02 ? 00:00:00 ora_s000_RDBB1
oracle 9351 1 0 Sep02 ? 00:00:05 ora_lck0_RDBB1
oracle 9370 1 0 Sep02 ? 00:00:00 ora_qmnc_RDBB1
oracle 9374 1 0 Sep02 ? 00:00:09 ora_mmon_RDBB1
oracle 9377 1 0 Sep02 ? 00:00:00 ora_mmnl_RDBB1
oracle 9471 1 0 Sep02 ? 00:00:00 ora_q001_RDBB1
oracle 9502 1 0 Sep02 ? 00:00:08 ora_pz99_RDBB1
oracle 3392 1 0 06:12 pts/0 00:00:00
/u01/app/oracle/product/10.1.0/db_1/perl/bin/perl /p
oracle 6956 1 0 06:23 ? 00:00:00 ora_pz98_RDBB1
oracle 22572 1 3 10:04 ? 00:00:00 ora_j000_RDBB1
oracle 22581 22574 0 10:04 pts/0 00:00:00 /bin/bash -c ps -ef | grep
_RDBB1
oracle 22583 22581 0 10:04 pts/0 00:00:00 grep _RDBB1
SQL>
SQL> create tablespace tbsasm
2 datafile '+DBG1' size 500M;
Tablespace created.
SQL>
SQL> host ps -ef | grep _RDBB1
oracle 9319 1 0 Sep02 ? 00:00:00 ora_pmon_RDBB1
oracle 9321 1 0 Sep02 ? 00:00:00 ora_diag_RDBB1
oracle 9323 1 0 Sep02 ? 00:00:04 ora_lmon_RDBB1
oracle 9325 1 0 Sep02 ? 00:00:05 ora_lmd0_RDBB1
oracle 9328 1 0 Sep02 ? 00:00:05 ora_lms0_RDBB1
oracle 9330 1 0 Sep02 ? 00:00:04 ora_lms1_RDBB1
oracle 9332 1 0 Sep02 ? 00:00:00 ora_mman_RDBB1
oracle 9334 1 0 Sep02 ? 00:00:01 ora_dbw0_RDBB1
oracle 9336 1 0 Sep02 ? 00:00:01 ora_lgwr_RDBB1
oracle 9338 1 0 Sep02 ? 00:00:00 ora_ckpt_RDBB1
oracle 9340 1 0 Sep02 ? 00:00:08 ora_smon_RDBB1
oracle 9342 1 0 Sep02 ? 00:00:00 ora_reco_RDBB1
oracle 9344 1 0 Sep02 ? 00:00:01 ora_cjq0_RDBB1
SQL>
SQL> col file_name format a46
SQL>
SQL> select file_name,tablespace_name
2 from dba_data_files;
FILE_NAME TABLESPACE_NAME
---------------------------------------------- ------------------------------
/ocfs/oradata/RDBB/users01.dbf USERS
/ocfs/oradata/RDBB/sysaux01.dbf SYSAUX
/ocfs/oradata/RDBB/undotbs01.dbf UNDOTBS1
/ocfs/oradata/RDBB/system01.dbf SYSTEM
/ocfs/oradata/RDBB/example01.dbf EXAMPLE
/ocfs/oradata/RDBB/undotbs02.dbf UNDOTBS2
+DBG1/rdbb/datafile/tbsasm.256.1 TBSASM
7 rows selected.
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -
Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC1A solutions]$
3. Back on your ASM instance, using SQL*Plus, determine the number of bytes written on the
DBG1 disk group. Then use Database Control to determine the amount of disk space used by
TBSASM on each ASM disk. What is your conclusion?
Answer: You can see that the disk activity is almost equally distributed across all ASM disks
during the creation of the tablespace. After the tablespace has been created, the free space is
almost the same on each ASM disk. This is because ASM tries to stripe ASM extents across all
ASM disks.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> col name format a20
SQL> col failgroup format a20
SQL>
SQL> select name,free_mb,failgroup,bytes_read,bytes_written
2 from v$asm_disk;
6 rows selected.
SQL>
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -
Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC1A solutions]$
a. Connect as SYSDBA through Database Control on rac1. Click the Administration tab on the
Automatic Storage Management page. On the Administration page, click the link
corresponding to the DBG1 diskgroup.
b. On the Disk Group: DBG1 page, you can see that the used space is uniformly distributed over
the four ASM disks.
Answer: You can see that the disk activity is almost equally distributed across all remaining
ASM disks during the drop operation.
a. Connect as SYSDBA through Database Control on rac1. Click the Administration tab on the
Automatic Storage Management page. On the Administration page, click the link
corresponding to the DBG1 diskgroup. When on the Disk Group: DBG1 page, select the ASM
disk called VOL4 in the Member Disks table. When finished, click Delete.
c. Back on the Disk Group: DBG1 page, refresh your screen many times by using the refresh
button of your browser. You should see the space used on VOL4 diminishing, while the space
used on the other disks is rising. After a while, you should no longer see VOL4 on the page. This
is because of the ongoing rebalance operation.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> drop table t purge;
Table dropped.
SQL>
SQL> create table t(c number) tablespace tbsasm;
Table created.
SQL>
1 row created.
SQL> commit;
Commit complete.
SQL>
SQL> insert into t select * from t;
1 row created.
SQL> /
2 rows created.
SQL> /
4 rows created.
SQL> /
8 rows created.
SQL> /
16 rows created.
SQL> /
32 rows created.
SQL> /
64 rows created.
SQL> /
SQL> /
SQL> /
SQL>
SQL> /
SQL> /
SQL> /
SQL> /
SQL> /
SQL>
SQL> /
SQL> /
SQL> /
SQL> /
SQL>
SQL> commit;
Commit complete.
SQL>
SQL> insert into t select * from t;
SQL>
SQL> commit;
Commit complete.
SQL>
SQL> set timing on
SQL>
SQL> SELECT count(distinct DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
2 FROM t;
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
---------------------------------------------------------------
1589
Elapsed: 00:00:21.81
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -
Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC1A solutions]$
Answer: While the ASM disk is added to DBG1, you can continue to execute queries against
that disk group without experiencing any interruption. Because of this, the time to execute the
queries may be longer during the add operation, but you are not blocked.
a. Click the General tab to go to the Disk Group: DBG1 page. Click Add Disks. This takes you to
the Add Disks page. On that page, select ORCL:VOL4, but do not click OK. Go to your
terminal window, and start the execution of the script.
b. When the script starts, go back quickly to the Add Disks page, and click OK.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> set timing on
SQL>
SQL> SELECT count(distinct DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
2 FROM t;
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
---------------------------------------------------------------
1589
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
---------------------------------------------------------------
1589
Elapsed: 00:00:29.30
SQL>
SQL> SELECT count(distinct DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
2 FROM t;
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
---------------------------------------------------------------
1589
Elapsed: 00:00:25.39
SQL>
SQL> SELECT count(distinct DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
2 FROM t;
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
---------------------------------------------------------------
1589
Elapsed: 00:00:22.48
SQL>
SQL> SELECT count(distinct DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
2 FROM t;
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
---------------------------------------------------------------
1589
Elapsed: 00:00:18.55
SQL>
SQL> SELECT count(distinct DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
2 FROM t;
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
---------------------------------------------------------------
1589
Elapsed: 00:00:17.33
SQL>
SQL> SELECT count(distinct DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
2 FROM t;
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
---------------------------------------------------------------
1589
Elapsed: 00:00:18.39
SQL>
SQL> SELECT count(distinct DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
2 FROM t;
COUNT(DISTINCTDBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID,'SMALLFILE'))
---------------------------------------------------------------
1589
c. While the script executes, refresh your Add Disks page multiple times by using the refresh
button of your browser. Perform this until the rebalance operation finishes.
Unless specified otherwise, you must log in as SYSDBA either through Database Control or through
SQL*Plus.
1. Use Database Control to create two new redo log groups in your database. The two groups must
pertain to the thread number three, and each group must have only one 10240 KB member called
redo05.log and redo06.log, respectively. Make sure that the members are created in the
/ocfs/oradata/RACDB directory.
a. Connect as SYSDBA through Database Control, and navigate to the Administration tab on the
Database Control home page.
b. On the Administration page, click the Redo Log Groups link.
c. On the Redo Log Groups page, click the Create button.
d. On the Create Redo Log Group page, leave the current value of the Group# field as is it is (5). Make
sure that the File size field is set to 10240 KB. Set the Thread# field to 3. Then set the File Name field in
the Redo Log Members section to redo05.log. Make sure that the File Directory field in the Redo Log
Members section is set to /ocfs/oradata/RDBB/.
e. Click OK.
f. Go back to the Redo Log Groups page, and click the Create button.
g. On the Create Redo Log Group page, leave the current value of the Group# field as is it is (6). Make sure
that the File size field is set to 10240 KB. Set the Thread# field to 3. Then set the File Name field in the
Redo Log Members section to redo06.log. See that the File Directory field in the Redo Log Members
section is set to /ocfs/oradata/RDBB/.
a. Connect as SYSDBA through Database Control, and navigate to the Administration tab on the
Database Control home page.
b. On the Administration page, click the Initialization Parameters link in the Database section.
c. On the Initialization Parameters page, click the SPFile tab.
d. Click the Show All button.
e. Make sure that the Apply changes in SPFile mode to the current running instance(s). For static
parameters, you must restart the database check box is deselected.
f. Scroll down the page to the end, and select 3 in the Value field for the RDBB2.thread field.
3. Use the SRVCTL control utility to stop the RDBB2 instance, and start it up again. What
happens and why?
If necessary, fix the situation.
Answer: Although it is possible to stop the RDBB2 instance, it is not possible to start it up again
because the redo thread number three is not enabled yet. To enable the redo thread number three,
you can connect to the first instance and issue the ALTER DATABASE ENABLE THREAD 3
command. Then you can start up the RDBB2 instance again.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
Database altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC2A labs]$ srvctl start instance -d RDBB -i RDBB2
[oracle@EDTDR1RAC2A labs]$
4. Revert to the original situation where RDBB2 was using the redo thread two, and destroy
redo thread number three. Make sure that in the end both instances are up and running and
managed by CRS.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
System altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC2A labs]$ srvctl stop instance -d RDBB -i RDBB2
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
Database altered.
Database altered.
Database altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC2A labs]$
[oracle@EDTDR1RAC2A labs]$ crs_stat
NAME=ora.RDBB.RDBB1.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2a
NAME=ora.RDBB.RDBB2.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2b
NAME=ora.RDBB.db
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2a
NAME=ora.edtdr1rac2a.ASM1.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2a
NAME=ora.edtdr1rac1a.LISTENER_EDTDR1RAC2A.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2a
NAME=ora.edtdr1rac2a.gsd
TYPE=application
TARGET=ONLINE
NAME=ora.edtdr1rac2a.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2a
NAME=ora.edtdr1rac2a.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2a
NAME=ora.edtdr1rac2b.ASM2.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2b
NAME=ora.edtdr1rac1b.LISTENER_EDTDR1RAC2B.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2b
NAME=ora.edtdr1rac2b.gsd
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2b
NAME=ora.edtdr1rac2b.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2b
NAME=ora.edtdr1rac2b.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac2b
[oracle@EDTDR1RAC2A labs]$
1. Connected as SYSDBA under SQL*Plus in your database instance on rac1, create a new
tablespace called TBSASMMIG. This tablespace must contain only one 10 MB file stored in your
file system (not using ASM). Create a table called T2 stored in TBSASMMIG. Insert one row
inside T2.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> create tablespace tbsasmmig
2 datafile '/ocfs/oradata/RDBB/asmmig1.dbf' size 10M;
Tablespace created.
SQL>
SQL> col file_name format a52
SQL> col tablespace_name format a10
SQL>
SQL> select file_name,tablespace_name
2 from dba_data_files;
FILE_NAME TABLESPACE
---------------------------------------------------- ----------
/ocfs/oradata/RDBB/users01.dbf USERS
/ocfs/oradata/RDBB/sysaux01.dbf SYSAUX
/ocfs/oradata/RDBB/undotbs01.dbf UNDOTBS1
/ocfs/oradata/RDBB/system01.dbf SYSTEM
/ocfs/oradata/RDBB/example01.dbf EXAMPLE
/ocfs/oradata/RDBB/undotbs02.dbf UNDOTBS2
+DBG1/rdbb/datafile/tbsasm.256.1 TBSASM
/ocfs/oradata/RDBB/asmmig1.dbf TBSASMMIG
8 rows selected.
SQL>
SQL> create table t2(c number) tablespace tbsasmmig;
Table created.
SQL>
SQL> insert into t2 values(1);
1 row created.
SQL>
SQL> commit;
Commit complete.
SQL>
2. From your database instance, migrate TBSASMMIG to ASM storage. When done, check that the
migration is successful.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
RMAN> exit
FILE_NAME TABLESPACE
---------------------------------------------------- ----------
/ocfs/oradata/RDBB/users01.dbf USERS
/ocfs/oradata/RDBB/sysaux01.dbf SYSAUX
/ocfs/oradata/RDBB/undotbs01.dbf UNDOTBS1
/ocfs/oradata/RDBB/system01.dbf SYSTEM
/ocfs/oradata/RDBB/example01.dbf EXAMPLE
/ocfs/oradata/RDBB/undotbs02.dbf UNDOTBS2
+DBG1/rdbb/datafile/tbsasm.256.1 TBSASM
+DBG1/rdbb/datafile/tbsasmmig.257.1 TBSASMMIG
8 rows selected.
C
----------
1
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC2A solutions]$
3. Using Database Control, determine the name of the files created in DBG1 from the ASM pages.
a. On the Cluster Database Home page, click the Cluster link in the General section.
b. On the Cluster page, click the Targets tab.
c. On the Targets page, click the +ASM1 link.
d. On the Automatic Storage Management:+ASM1 Home page, click the Administration tab.
e. On the Automatic Storage Management Login page, enter SYS in the Username field, and oracle in
the Password field. Click Login.
f. On the Automatic Storage Management:+ASM1 Administration page, click the DBG1 link.
g. On the Disk Group:DBG1 page, click the Files tab.
h. On the Files page, click the Expand All link, and here you can see all the related files.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> drop tablespace tbsasmmig including contents and datafiles;
Tablespace dropped.
SQL>
SQL> drop tablespace tbsasm including contents and datafiles;
Tablespace dropped.
SQL>
SQL> host rm /ocfs/oradata/RDBB/asmmig1.dbf
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC2A solutions]$
The first step in creating a service configuration is to plan services for each application or application
function that is using Oracle RAC 10g.
1. Use DBCA to create the two services above. With DBCA, you can specify the service names as
well as their preferred and available instances.
b. On the Welcome screen, select the Oracle Real Application Clusters database option.
e. Click Next.
f. On the List of cluster databases screen, select your database.
NAME=ora.RDBB.RDBB1.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.RDBB.RDBB2.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.RDBB.SERV1.RDBB1.sa
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.RDBB.SERV1.RDBB1.srv
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.RDBB.SERV2.RDBB2.sa
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.RDBB.SERV2.RDBB2.srv
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.RDBB.SERV2.cs
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.RDBB.db
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.ASM1.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.LISTENER_EDTDR1RAC1A.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.gsd
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1b.ASM2.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.edtdr1rac1b.LISTENER_EDTDR1RAC1B.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.edtdr1rac1b.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.edtdr1rac1b.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
[oracle@EDTDR1RAC1A labs]$
[oracle@EDTDR1RAC1A labs]$ srvctl status service -d RDBB -s SERV1
Service SERV1 is running on instance(s) RDBB1
[oracle@EDTDR1RAC1A labs]$ srvctl status service -d RDBB -s SERV2
Service SERV2 is running on instance(s) RDBB2
[oracle@EDTDR1RAC1A labs]$
3. Make sure that DBCA has added your services to the tnsnames.ora files on both nodes, and
that the listeners are aware of their existence.
RDBB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
(INSTANCE_NAME = RDBB1)
)
)
RDBB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
)
)
SERV2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
SERV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SERV1)
)
)
LISTENERS_RDBB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
)
RDBB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
(INSTANCE_NAME = RDBB2)
)
)
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vip-
RAC1A)(PORT=1521)))
Services Summary...
Service "+ASM1" has 1 instance(s).
Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:7 refused:0 state:ready
LOCAL SERVER
Service "RDBB" has 2 instance(s).
Instance "RDBB1", status READY, has 2 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=EDTDR1RAC1A)(PORT=1521))
"DEDICATED" established:11 refused:0 state:ready
LOCAL SERVER
Instance "RDBB2", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:1 refused:0 state:ready
REMOTE SERVER
RDBB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
(INSTANCE_NAME = RDBB1)
)
)
RDBB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
)
)
SERV2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
SERV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SERV1)
)
)
LISTENERS_RDBB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
)
RDBB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
(INSTANCE_NAME = RDBB2)
)
)
[oracle@EDTDR1RAC1A labs]$
4. Connect as SYSDBA under each instance, look at the current value of the SERVICE_NAMES
initialization parameter, and check that it is set correctly.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining
options
5. Using Database Control, how can you check that the services are currently running as expected?
e. On the Cluster Managed Database Services page, select one of the services that you want to
check, and click the Manage Service button. Choose SERV1.
f. On the Cluster Managed Database Service: SERV1 page, you can now see the details broken down
per instance.
Answer: Immediately after the SMON process is killed, CRS automatically moves the SERV1
service to its available instance RDBB2. Although CRS also restarts RDBB1, SERV1 does not fall
back to RDBB1.
7. Using Database Control, check that both services are running on RDBB2.
a. On the Cluster Managed Database Services page, click SERV1 in the Service Name column.
8. Using Database Control, create a new user called JFV identified by the password JFV. The
default tablespace of this user should be USERS, and its temporary tablespace TEMP. Make sure
that you grant this user with the CONNECT, RESOURCE, and DBA roles. Then, from rac1, using
SQL*Plus, connect to SERV1 with user JFV. When connected, determine on which instance
your session is currently running. Then, execute the following query:
select count(*) from dba_objects,dba_objects,dba_objects
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining
INSTANCE_NAME
----------------
HOST_NAME
----------------------------------------------------------------
RDBB2
EDTDR1RAC1B
9. After a while, go to the EM Top Consumers page from the Cluster Database page from rac2,
and check that SERV1 is using more and more resources. Check statistics on your service with
v$service_stats from a SQL*Plus session connected as SYSDBA.
From the Cluster Home page on rac2, click the Performance tab. On the middle of the Performance page,
click the Top Consumers link. On the Top Consumers Overview page, refresh the page several times.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining
options
SQL>
SQL> select stat_name, value from v$service_stats where service_name =
'SERV1';
STAT_NAME VALUE
---------------------------------------------------------------- ----------
logons cumulative 1
user calls 23
DB time 282813818
DB CPU 259309478
parse count (total) 102
parse time elapsed 131637
execute count 604
sql execute elapsed time 282737128
opened cursors cumulative 93
session logical reads 10657
physical reads 704
STAT_NAME VALUE
---------------------------------------------------------------- ----------
physical writes 0
redo size 520
user commits 1
workarea executions - optimal 29
workarea executions - onepass 0
workarea executions - multipass 0
session cursor cache hits 0
user rollbacks 0
db block changes 4
gc cr blocks received 0
gc cr block receive time 0
STAT_NAME VALUE
---------------------------------------------------------------- ----------
gc current blocks received 39
gc current block receive time 6
cluster wait time 16
concurrency wait time 1
application wait time 0
user I/O wait time 47
28 rows selected.
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -
Pn
10. Using Database Control, relocate SERV1 to its preferred instance RDBB1.
a. On the Cluster Managed Database Service page, select SERV1, and click Manage Service.
b. On the Cluster Managed Database Service: SERV1 page, select the instance that is currently running
SERV1 (RDBB2), and click Relocate.
c. On the Relocate Service from Instance: RDBB2 page, click OK to relocate SERV1 to RDBB1.
Note: Relocating a service stops the service on the preferred or available instance it is running on and starts it
on the available or preferred instance that you specify. This feature can be used to perform manual load
balancing of services. You may only relocate a started service from a preferred instance to an available
instance where the service is stopped, or from an available instance to a preferred instance where the service is
stopped.
11. What happens to your already connected SERV1 session running on the second instance? If your
session is still executing the query, stop its execution by pressing [Ctrl] + [C].
Answer: You can see that although the service has been switched to RDBB1, your session is still
executing under SERV1 on RDBB2. So, if you want to manually relocate a service, you must
make sure that no session is currently connected.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining
options
USERNAME SERVICE_NAME
------------------------------ ------------------------------
SYSMAN RDBB
SYSMAN RDBB
JFV SERV1
SYS$USERS
DBSNMP SYS$USERS
DBSNMP SYS$USERS
SYS$BACKGROUND
SYSMAN RDBB
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
USERNAME SERVICE_NAME
------------------------------ ------------------------------
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
USERNAME SERVICE_NAME
------------------------------ ------------------------------
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
SYS$BACKGROUND
28 rows selected.
INSTANCE_NAME
----------------
HOST_NAME
----------------------------------------------------------------
RDBB2
EDTDR1RAC1B
SQL>
m. On the Resource Consumer Group Mapping page, click the Add Another Row button in the Service
Name Map section.
n. Select the STANDARD_PRIORITY value from the Consumer Group drop-down menu of the Service
Name Map section. Select the SERV2 value from the Service Name drop-down menu of the Service
Name Map section.
o. On the Resource Consumer Group Mapping page, click the Apply button.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
14. Using Database Control, create a resource plan called SERVICE_PLAN. Make sure that this plan
is defined to dedicate 70% of the CPU to the HIGH_PRIORITY consumer group, and 30% to
the OTHERS group. After you have created the plan, see that it is activated on both instances.
g. Click OK.
h. Back on the Create Resource Plan page, enter 70 in the Level 1 field of the HIGH_PRIORITY
consumer group in the Selected Groups/Subplans table. Then enter 30 in the Level 1 field of the
OTHER_GROUPS consumer group in the Selected Groups/Subplans table.
15. From a telnet session on the first node, connected as user oracle, change your directory to the
labs directory. From there, execute the lab_07_01_15_n1_RDBB.sh script. This script
generates a workload on the first instance. It starts two sessions that use SERV1, and two
sessions that use RDBB1. How would you verify that the resource plan is followed?
e. Execute the lab_07_01_15_n1_RDBB.sh script from a telnet session, connected as user oracle on
rac1.
f. On the Resource Monitors page, click Refresh several times until you reach almost 70% for SERV1.
e. Click OK.
a. On the Cluster Database: RDBB Home page, click the RDBB_RDBB1 link in the Instances section of
the page.
b. On the Cluster Database Instance: RDBB_RBB1 page, click the Manage Metrics link in the Related
Links section.
c. On the Manage Metrics page, click the Edit Thresholds button.
d. On the Edit Thresholds page, select the metric called Service Response Time (per user call)
(microseconds).
f. On the Specify Multiple Thresholds: Service Response Time (per user call) (microseconds) page,
enter SERV1 in the Service Name field, 40000000 in the Warning Threshold field, and 100000000
in the Critical Threshold field.
g. Click OK.
18. Use SQL*Plus to connect to RDBB1 by using SERV1, and execute the lab_07_01_18.sql
script, connected as user JFV. Observe the graph. What is your conclusion?
Answer: You must see that the metric passes the warning threshold. Soon after, you must see an
alert raised on the DB Console.
a. Execute the script. It takes a while to complete. Do not wait its end. Look at the corresponding threshold
history by using Database Control.
SQL> @lab_07_01_18.sql
SQL>
SQL> connect jfv/jfv@SERV1
Connected.
SQL>
SQL>
SQL> DECLARE
2 t number;
3 BEGIN
4 for i in 1..10000 loop
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC1A labs]$
b. On the Cluster Database Instance: RDBB_RDBB1 Home page, click the All Metrics link in the
Related Links section.
c. On the All Metrics page, expand the Database Services folder. Then, click the Service Response Time
(per user call) (microseconds) link.
d. On the Service Response Time (per user call) (microseconds) page, click the SERV1 link.
e. On the Service Response Time (per user call) (microseconds): Service Name SERV1 page, select Real
Time: 30 Seconds Refresh from the View Data drop-down list. Then monitor the Metric Value graph.
a. On the Cluster Database: RDBB Home page, click the RDBB_RDBB1 link in the Instances section of
the page.
b. On the Cluster Database Instance: RDBB_RBB1 page, click the Manage Metrics link in the Related
Links section.
c. On the Manage Metrics page, click the Edit Thresholds button.
d. On the Edit Thresholds page, remove the thresholds that you previously set for the metric called Service
Response Time (per user call) (microseconds).
Unless specified otherwise, you must log in as SYSDBA either through Database Control or
through SQL*Plus.
2. Using SRVCTL, change your service configuration to have RDBB1 and RDBB2 as the preferred
instances for SERV1, and start SERV1.
NAME=ora.RDBB.RDBB1.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.RDBB.RDBB2.inst
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.RDBB.SERV1.RDBB1.srv
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.RDBB.SERV1.RDBB2.srv
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.RDBB.SERV1.cs
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.RDBB.SERV2.RDBB2.sa
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
Oracle Database 10g: Real Application Clusters B-197
NAME=ora.RDBB.SERV2.RDBB2.srv
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.RDBB.SERV2.cs
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.RDBB.db
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.ASM1.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.LISTENER_EDTDR1RAC1A.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.gsd
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1a.vip
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1a
NAME=ora.edtdr1rac1b.ASM2.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.edtdr1rac1b.LISTENER_EDTDR1RAC1B.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.edtdr1rac1b.gsd
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.edtdr1rac1b.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on edtdr1rac1b
NAME=ora.edtdr1rac1b.vip
TYPE=application
[oracle@EDTDR1RAC1A solutions]$
[oracle@EDTDR1RAC1A solutions]$ sqlplus / as sysdba @sol_08_01_03_n1_RDBB.sql
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> show parameter service
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
RDBB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
(INSTANCE_NAME = RDBB1)
)
)
RDBB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
)
)
SERV2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SERV2)
)
)
SERV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SERV1)
)
)
LISTENERS_RDBB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
)
[oracle@EDTDR1RAC1A labs]$
5. From a terminal window, and connected as user JFV in SQL*Plus, execute the
createfan.sql script. This script creates a simple table used by the following scripts of this
practice. This script is located in your $HOME/labs directory.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> connect jfv/jfv
Connected.
SQL>
SQL> drop table fan purge;
drop table fan purge
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL>
SQL> create table fan(c number);
Table created.
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -
Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC1A solutions]$
Note: When the workload is correctly balanced on both nodes, stop the workload by executing
the stopfanlod.sh script from the third terminal window. Then you can also stop the
sessions count by pressing [Ctrl] + [C] in the first session.
Answer: At the beginning, one of the nodes gets almost all connections. After a while,
connections are spread across both nodes.
RDBB1 RDBB2
----- -----
15 13
15 13
15 13
15 13
15 13
After startfanload!
18 13
19 13
29 13
30 13
34 13
35 13
35 13
35 13
34 13
35 13
35 13
33 13
20 26
18 30
17 31
16 32
15 32
16 32
15 30
15 33
16 30
17 30
16 32
16 32
15 33
15 33
16 32
16 32
16 32
15 33
15 33
17 31
16 32
16 32
After stopfanload!
33 13
24 13
21 13
15 13
15 13
15 13
15 13
15 13
15 13
15 13
15 13
14 13
14 13
14 13
15 13
14 13
15 13
14 13
15 13
14 13
[oracle@EDTDR1RAC1A labs]$
7. How would you make sure that the initial connection load is balanced on each instance?
PREFER_LEAST_LOADED_NODE_LISTENER_EDTDR1RAC1A=OFF
~
~
"listener.ora" 20L, 583C written
[oracle@EDTDR1RAC1A admin]$
[oracle@EDTDR1RAC1A admin]$ lsnrctl reload LISTENER_EDTDR1RAC1A
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vip-RAC1A)(PORT=1521)))
The command completed successfully
[oracle@EDTDR1RAC1A admin]$
LISTENER_EDTDR1RAC1B =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 144.23.230.181)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
PREFER_LEAST_LOADED_NODE_LISTENER_EDTDR1RAC1B=OFF
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vip-RAC1B)(PORT=1521)))
The command completed successfully
[oracle@EDTDR1RAC1B admin]$
Answer: In this case, the number of sessions is spread almost evenly across the two instances
from the very beginning.
RDBB1 RDBB2
----- -----
15 13
15 13
15 13
15 13
After startfanload!
15 32
16 32
17 31
17 31
18 30
18 30
17 30
19 29
19 29
19 29
19 29
19 29
19 29
21 27
23 25
24 24
29 19
31 17
35 13
31 17
31 17
29 19
26 21
25 23
24 24
21 26
Oracle Database 10g: Real Application Clusters B-206
18 28
18 30
16 30
16 27
17 31
17 31
19 29
19 29
22 26
22 26
21 26
23 25
23 25
24 24
25 23
26 22
26 22
26 22
26 22
24 22
21 24
21 22
16 31
16 31
15 33
15 33
15 33
17 31
17 31
17 31
19 29
19 29
19 29
20 28
21 27
21 27
21 27
22 25
22 25
20 23
After stopfanload!
18 23
17 19
16 18
15 16
15 13
15 13
15 13
15 13
14 13
15 13
[oracle@ed-toraclin1a labs]$
[oracle@EDTDR1RAC1A labs]$
9. Reconfigure SERV1 so that RACDB1 is its preferred instance and RACDB2 is its available
instance, and start SERV1.
[oracle@EDTDR1RAC1A labs]$
[oracle@EDTDR1RAC1A labs]$ srvctl stop service -d RDBB -s SERV1 -f
[oracle@EDTDR1RAC1A labs]$ srvctl modify service -d RDBB -s SERV1 -n -i RDBB1 -a
RDBB2
[oracle@EDTDR1RAC1A labs]$ srvctl start service -d RDBB -s SERV1
[oracle@EDTDR1RAC1A labs]$
Answer: All connections are directed only to instance one, which is the preferred instance.
RDBB1 RDBB2
----- -----
15 13
15 13
15 13
15 13
After startfanload!
20 13
23 13
35 13
35 13
After stopfanload!
28 13
26 13
28 13
28 13
27 13
24 13
22 13
21 13
15 13
14 13
15 13
15 13
14 13
15 13
14 13
15 13
14 13
15 13
14 13
[oracle@ed-toraclin1a labs]$
11. Perform step six again. After you start the execution of the startfanload script, wait for a
while, and then kill the SMON process of the RDBB1 instance from another terminal window.
You can use the kill_smon_n1_RDBB.sh script for that. This script is located in your
$HOME/labs directory. What do you observe?
Answer: All of a sudden, the session count drops on the first node, and at the same time, sessions
are no longer able to connect to the service for a while. This is because SERV1 is failing over to
RDBB2. When that is done by CRS, the listeners know the new instance on which SERV1 is
available. At that point, the number of connections on RDBB2 starts to rise. Meanwhile, the
number of connections also starts to rise on the first instance. This means that CRS has also
restarted RDBB1.
RDBB1 RDBB2
----- -----
13 14
13 14
13 14
13 14
13 14
After startfanload!
18 14
33 14
33 14
32 14
33 14
21 14
27 14
30 14
33 14
20 14
2 15
1 15
1 15
1 15
1 16
1 17
1 17
1 17
1 17
Oracle Database 10g: Real Application Clusters B-210
1 17
1 17
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
0 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 18
1 35
1 36
1 35
1 38
1 38
1 38
1 36
1 38
1 34
1 38
1 38
1 29
1 38
1 38
1 38
1 38
1 38
1 38
1 29
1 38
1 38
1 38
2 38
2 38
2 36
After stopfanload!
2 31
1 31
After kill_smon1!
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
[oracle@EDTDR1RAC1A labs]$
12. Using srvctl, make sure that you reassign SERV1 to its preferred instance.
IMPORTANT NOTE: Before continuing, execute the callout_setup.sh script from TW1R1,
and then from TW3R2. This script is located on your $HOME/labs directory.
1. Write a shell script that is able to trap FAN events generated by CRS.
The events that need to be trapped must be for the RDBB database, and the event types that need
to be trapped are SERVICEMEMBER (up/down), SERVICE (up/down), and INSTANCE
(up/down).
The callout script should create a file that logs the events that are trapped. The log file must be
located in the $ORA_CRS_HOME/racg/log directory.
Make sure that the callout script is deployed on both nodes.
TW2R1!
TW4R2!
3. From TW1R1, stop the SERV1 service by using srvctl. When finished, look at terminal
windows TR2R1 and TW4R2, and then look at the generated log files in the
$ORA_CRS_HOME/racg/log directory by using TW1R1 and TW3R2. What do you
observe?
Answer: You can see that on both nodes, CRS is aware of the shutdown of SERV1. However,
only one log file is generated. The log file is generated on rac1 only because SERV1 is running
on its preferred instance RDBB1.
TW1R1!
TW2R1!
TW4R2!
TW1R1!
TW3R2!
Answer: You can see that on both nodes, CRS is aware of the shutdown of SERV2. However,
only the log file on rac2 shows the shutdown of SERV2. This is because SERV2 is running on
its preferred instance RDBB2.
TW1R1!
TW2R1!
TW1R1!
TW3R2!
[oracle@EDTDR1RAC1B log]$ ls
crsevtco.log
[oracle@EDTDR1RAC1B log]$ more crsevtco.log
SERVICEMEMBER VERSION=1.0 service=SERV2 database=RDBB instance=RDBB2 host=edtdr1
rac1b status=down reason=user timestamp=10-Sep-2004 04:40:40
Oracle Database 10g: Real Application Clusters B-218
SERVICE VERSION=1.0 service=SERV2 database=RDBB instance= host=edtdr1rac1b statu
s=down reason=user timestamp=10-Sep-2004 04:40:50
[oracle@EDTDR1RAC1B log]$
5. From TW1R1, start both SERV1 and SERV2 services by using srvctl. When finished, look at
terminal windows TW2R1 and TW4R2, and then look at the generated log files in the
$ORA_CRS_HOME/racg/log directory by using TW1R1 and TW3R2. What do you
observe?
Note: When finished, type [CTRL] [C] in both TW2R1 and TW4R2 to stop the evmwatch
commands.
Answer: You can see that on both nodes, CRS is aware of the startup of both services. Each
startup appears in a different log file based on the preferred instance.
TW1R1!
[oracle@EDTDR1RAC1A log]$ srvctl start service -d RDBB -s SERV1
[oracle@EDTDR1RAC1A log]$ srvctl start service -d RDBB -s SERV2
[oracle@EDTDR1RAC1A log]$
TW2R1!
TW4R2!
TW1R1!
TW3R2!
[oracle@EDTDR1RAC1B log]$ more crsevtco.log
SERVICEMEMBER VERSION=1.0 service=SERV2 database=RDBB instance=RDBB2 host=edtdr1
rac1b status=down reason=user timestamp=10-Sep-2004 04:40:40
SERVICE VERSION=1.0 service=SERV2 database=RDBB instance= host=edtdr1rac1b statu
s=down reason=user timestamp=10-Sep-2004 04:40:50
SERVICE VERSION=1.0 service=SERV2 database=RDBB instance= host=edtdr1rac1b statu
s=up reason=user timestamp=10-Sep-2004 04:45:59
SERVICEMEMBER VERSION=1.0 service=SERV2 database=RDBB instance=RDBB2 host=edtdr1
rac1b status=up reason=user timestamp=10-Sep-2004 04:45:59
[oracle@EDTDR1RAC1B log]$
1. Using srvctl from rac1, add two new services to your database, and start them. The first one
is called AP and has RDBB1 and RDBB2 as its preferred instances. Its transparent application
failover policy is BASIC. The second one is called ERP, and has its preferred instance as RDBB1
and its available instance as RDBB2. Its transparent application failover policy is defined to be
PRECONNECT.
2. Using SQL*Plus from rac1, verify that both services are started correctly on their
corresponding instances. What do you observe?
Answer: AP is started on both instances. ERP is started on its preferred instance RDBB1, and
ERP_PRECONNECT is started on RDBB2.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> show parameter service
Answer: Add corresponding TNS name entries for the two new services on both nodes. This is
not done automatically if you are not using DBCA.
RDBB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
(INSTANCE_NAME = RDBB1)
)
)
RDBB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RDBB)
)
)
SERV2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SERV2)
)
)
SERV1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1A)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = vip-RAC1B)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SERV1)
)
)
LISTENERS_RDBB =
AP =
(DESCRIPTION=(FAILOVER=ON)(LOAD_BALANCE=ON)
(ADDRESS=(PROTOCOL=TCP)(HOST=vip-RAC1A)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=vip-RAC1B)(PORT=1521))
(CONNECT_DATA =
(SERVICE_NAME = AP)
(FAILOVER_MODE =
(TYPE=SESSION)
(METHOD=BASIC)
)))
ERP =
(DESCRIPTION=(FAILOVER=ON)(LOAD_BALANCE=ON)
(ADDRESS=(PROTOCOL=TCP)(HOST=vip-RAC1A)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=vip-RAC1B)(PORT=1521))
(CONNECT_DATA =
(SERVICE_NAME = ERP)
(FAILOVER_MODE = (BACKUP=ERP_PRECONNECT)
(TYPE=SESSION)
(METHOD=PRECONNECT)
)))
ERP_PRECONNECT =
(DESCRIPTION=(FAILOVER=ON)(LOAD_BALANCE=ON)
(ADDRESS=(PROTOCOL=TCP)(HOST=vip-RAC1A)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=vip-RAC1B)(PORT=1521))
(CONNECT_DATA = (SERVICE_NAME = ERP_PRECONNECT)))
[oracle@EDTDR1RAC1A labs]$
Answer: Only one session is created to support your connection. Note that this session can be
started on either RDBB1 or RDBB2. In this example, it is started on RDBB2, and no
corresponding session on RACDB1 exists.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
INSTANCE_NAME
----------------
RDBB2
SQL>
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
no rows selected
SQL>
Answer: Because your server process has been killed, you are no longer able to execute correctly
a SQL statement from your session.
1 row created.
SQL> commit;
Commit complete.
SQL>
SQL>
Answer: This time it is possible to execute again a SQL command because you have been
automatically failed over to an instance that offers the AP service.
1 row created.
SQL> commit;
Commit complete.
SQL>
INSTANCE_NAME
----------------
RDBB2
SQL>
8. Exit from the SQL*Plus session that is connected as user JFV, and perform steps 4 through 7
again. This time use the ERP service instead of AP, and make sure that you also identify which
service is used when you are asked to determine the failover method used by your session. What
do you observe?
Answer: Because your server process has been killed in the previous step, you are no longer able
to execute correctly a SQL statement from your session. The next time you insert, it is possible to
execute again a SQL command because you have been automatically failed over to the RACDB2
instance that offers the ERP_PRECONNECT service.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
RDBB1
SQL> col service_name format a15
SQL> select failover_type,failover_method,failed_over,service_name
2 from v$session where username='JFV';
SQL>
1 row created.
SQL> commit;
Commit complete.
SQL>
SQL>
1 row created.
SQL> commit;
Commit complete.
SQL>
INSTANCE_NAME
----------------
RDBB2
SQL>
10. Exit from all your SQL*Plus sessions, and kill the SMON process of RDBB1. Wait for CRS to
restart RDBB1, and look at the service repartition across both instances for the ERP service. What
is your conclusion?
Answer: ERP failed over to RDBB2, and thus ERP_PRECONNECT is now available on RDBB1.
11. Use srvctl to stop and remove both the AP and ERP services from your cluster.
1. In this practice, you place the database in ARCHIVELOG mode and enable Flashback Recovery
options. In addition, you set persistent RMAN configuration parameters that are RAC friendly.
When the parameters have been saved, initiate a full cluster database backup.
a. From a terminal session, create two directories, /ocfs/ARCHIVE1 and /ocfs/ARCHIVE2 as the
oracle user.
$ cd /ocfs
$ mkdir ARCHIVE1 ARCHIVE2
$ ls -la
total 65671
drwxrwxr-x 1 oracle dba 131072 Nov 4 10:00 .
drwxr-xr-x 24 root root 4096 Nov 4 09:34 ..
drwxr-xr-x 1 oracle oinstall 131072 Nov 4 13:28 ARCHIVE1
drwxr-xr-x 1 oracle oinstall 131072 Nov 4 13:28 ARCHIVE2
drwxrwxr-x 1 oracle dba 131072 Nov 4 11:20 CSS
drwxr-xr-x 1 oracle oinstall 131072 Nov 4 12:07 flash_recovery_area
drwxrwxr-x 1 oracle dba 131072 Nov 4 11:18 OCR
drwxr-xr-x 1 oracle oinstall 131072 Nov 4 12:08 oradata
b. Log in to Database Control, and click the Maintenance folder tab. Click Configure Recovery
Settings under Backup/Recovery. Click the ARCHIVELOG mode button. Add your database
name to the beginning of the archive log file name format string, %t_%s_%r.dbf in the example
below. Enter /ocfs/ARCHIVE1 for the value of LOG_ARCHIVE_DEST_1 and enter
/ocfs/ARCHIVE2 for the value of LOG_ARCHIVE_DEST_2. Delete entry 10.
d. When the Confirmation screen appears, click the Yes button to initiate shutdown and restart of your
cluster database. This is needed for the changes to take effect.
e. On the Specify Credentials page, supply the username and password of the operating system user
(oracle/oracle) and Oracle database user (sys/oracle) to be used to shutdown and restart
the database. Click Continue.
h. Log in to Database Control, and click the Maintenance folder tab. Click Configure Recovery
Settings under Backup/Recovery. Verify that the database is in ARCHIVELOG mode and that the
ARCHIVE_LOG_DEST_ parameters are properly set.
$ sqlplus /nolog
2. From a terminal window, start an RMAN session, and adjust the following RMAN properties to
take advantage of your RAC environment:
• Disk parallelism
• Disk channels
• Snapshot controlfile name
a. Execute the rman command, and connect as sys to your RAC database. View the current values of
the RMAN configuration with the show all command. $ rman
RMAN> connect target sys/oracle@RDBB
connected to target database: (DBID=775469082)
$ mkdir /ocfs/flash_recovery_area/RDBB/backupset
a. On the Database Control home page, click the Maintenance folder tab, and click Schedule Backup
under Backup/Recovery. Select Customized for Backup Strategy, and click the Whole Database
button beside Object Type. Provide the operating system username and password
(oracle/oracle) to be used, and click Next.
b. On the Options page, click the Use as the base of an incremental backup strategy button. Select
Online Backup for Backup mode, and click Back up all archived logs on disk and Delete all
archived logs from disk after they are successfully backup up under Advanced. Click Next to
continue.
d. On the Job Schedule page, select Immediately for the start time. Click Next to continue.
e. Make sure that the information entered on the Review page is correct. /backupset Click Submit Job.
g. You can drill down on the Job Name and watch the RMAN code for each job if you would like.
a. On your first node, start a SQL*Plus session and create a table called DEPARTMENTS 2 from the
HR.DEPARTMENTS table. Get a row count from the newly created table. Perform three log
switches, then determine the current sequence.
$ sqlplus /nolog
SQL> connect / as sysdba
COUNT(*)
----------
27
System altered.
System altered.
b. Insert 3 records into the DEPARTMENTS2 table. Commit the work and get another row count of
the table. Perform a log switch when finished and then take note of the current log file sequence.
SQL> commit;
COUNT(*)
----------
30
c. Exit SQL*Plus and delete all archived log files under ARCHIVE_LOG_DEST_1
(/ocfs/ARCHIVE1) and then stop the database. Restart the database in MOUNT mode and
perform recovery.
SQL> exit
$ rm /ocfs/ARCHIVE1/*
$ srvctl stop database -d RDBB
$ srvctl start database -d RDBB -o mount
$ rman target sys/oracle@RDBB
RMAN> run {
2> set until logseq 41 thread 1; *** use the active seq# - 1 on thread 1 (42 –1) from solutions step
a.
3> set autolocate on; *** for the logseq value
4> allocate channel c1 type disk;
5> restore database;
6> recover database;
7> }
allocated channel: c1
channel c1: sid=261 devtype=DISK
RMAN> exit
d. Stop the second instance and open the database with the resetlogs option. Get a row count
from the DEPARTMENTS2 table to verify the recovery and then restart the instance on the
second node.
Database altered.
COUNT(*)
----------
27
SQL> exit
$ srvctl start instance -d RDBB -i RDBB2
a. Stop your database. Restart the first instance in MOUNT mode and place the database in
NOARCHIVELOG mode.
$ srvctl stop database -d RDBB
$ srvctl start instance -d RDBB -i RDBB1 -o mount
b. Shut down the instance and restart the database. Ensure the database is in NORCHIVELOG mode
using SQL*Plus.
LOG_MODE
------------
NOARCHIVELOG
Using the ocrconfig command, locate the most recent automatic backups of the cluster registry.
$ ocrconfig -showbackup
As the oracle user, create a directory in /ocfs/OCR called backup. After this, make the new
directory the cluster registry auto backup location.
$ mkdir /ocfs/OCR/backup
$ ocrconfig –backuploc /ocfs/OCR/backup
$ ls -la /ocfs/OCR/backup/ocr.dbf.bk
-rw-r--r-- 1 oracle oinstall 94227 Oct 9 17:31 /ocfs/OCR/backup/ocr.dbf.bk
Unless specified otherwise, you must log in as SYSDBA either through Database Control or through
SQL*Plus. Before starting this lab, it is recommended that you stop your database as well Database
Control. Once done, restart your database, as well Database Control. Make sure that this done on
both nodes. This will ensure that you will see performance graphics that are very close to the ones
shown in this solution.
1. Execute the lab_10_01_01.sql script to create the necessary objects used throughout this
practice.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> drop sequence s;
drop sequence s
*
ERROR at line 1:
ORA-02289: sequence does not exist
SQL>
SQL> create table s(sn number);
Table created.
Table created.
Index created.
SQL>
SQL>
SQL> insert into s values(1);
1 row created.
SQL> commit;
Commit complete.
SQL>
SQL> begin
2 for i in 1..90000 loop
3 insert into t values (i,'initial');
4 end loop;
5 end;
6 /
SQL>
SQL> connect / as sysdba
Connected.
SQL>
SQL> exec dbms_advisor.set_default_task_parameter('ADDM','DB_ACTIVITY_MIN',30);
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@ed-toraclin4a solutions]$
a. On the Cluster Database Home page, click the first instance in the Instances section at the bottom of the
page.
b. On the Cluster Database Instance Home page, click the Administration tab.
c. In the Workload section, click the Automatic Workload Repository link.
d. On the Automatic Workload Repository page, click the Snapshots link representing the number of
snapshots retained thus far.
e. On the Snapshots page, click the Create button.
f. On the Confirmation page, click the Yes button.
-- On first instance:
declare
v number;
begin
for i in 1..40000 loop
lock table s in exclusive mode;
select sn into v from s;
insert into t values(v,'first');
update s set sn=sn+1;
commit;
end loop;
end;
/
-- On second instance:
declare
v number;
begin
for i in 1..40000 loop
lock table s in exclusive mode;
select sn into v from s;
insert into t values(v,'second');
update s set sn=sn+1;
commit;
end loop;
end;
/
4. Using Database Control, determine the list of blocking locks in your database.
Answer: By using the drilldown method of Database Control, you can quickly identify the top
waiting SQL statements and the top waiting sessions on both instances. Here it appears that an
UPDATE statement on table S is causing most of the waits for the Cluster wait class.
d. On the Active Sessions By Instance: Cluster page, you must see that the number of active sessions is
almost the same on both nodes. Click the RDBD1 link. This takes you to the Active Sessions Waiting:
Cluster page of the first node.
f. Back on the Active Sessions Waiting: Cluster page, click the link corresponding to the top waiting
session in the Top Waiting Sessions section. This takes you to the Session Details page, which shows
you the corresponding details.
Answer: The Cluster Cache Coherency page cleary shows that there are a lot of blocks
transferred per second on the system. This represents more than 17% of the total logical reads.
This is reflected in both the Block Access Statistics section and the Cache Coherency vs.
Session Logical Reads graphic.
Answer: By using the drilldown method of Database Control, you can quickly identify the top
waiting SQL statements and the top waiting sessions on both instances. Here it appears that a
LOCK statement on table S is causing most of the waits for the Application wait class.
c. In the Sessions: Waiting and Working graphic, click the Application link on the right. This takes you to
the Active Sessions By Instance: Application page.
e. On the Active Sessions Waiting: Application page, you can see the most important wait events causing
most of the waits in the Application wait class on RDBD1. In the Top Waiting SQL section, click the
SQL identifier that uses most of the resources (100% in this example). This takes you to the SQL Details
page for the corresponding statement. You must see that the script running on RDBD1 is executing a
LOCK statement on table S that causes most of the Application waits.
a. On the Cluster Database Home page, click the first instance in the Instances section at the bottom of the
page.
b. On the Cluster Database Instance Home page, click the Administration tab.
c. In the Workload section, click the Automatic Workload Repository link.
d. On the Automatic Workload Repository page, click the Snapshots link representing the number of
snapshots retained thus far.
e. On the Snapshots page, click the Create button.
f. On the Confirmation page, click the Yes button.
9. Using Database Control, review the latest ADDM run. What are your conclusions?
Answer: Looking at the last ADDM run on the first instance, it is clear that table S is locked
during a significant part of the database time. By looking at the scripts, you realize that this table
is used as a sequence generator, and must be locked each time a session needs a new value from
the sequence.
d. On the Automatic Database Diagnostic Monitor (ADDM) page, select the Contention on table lock
waits was cossuming significant database time link in the Finding column. This takes you to the
corresponding Performance Finding Details page.
10. Execute the lab_10_01_10.sql script to create the necessary objects used for the rest of this
practice.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> connect jfv/jfv
Connected.
Table dropped.
Table dropped.
SQL>
SQL>
SQL> create table t(c number, d varchar2(20));
Table created.
Index created.
SQL>
SQL> create sequence s
2 start with 1
3 increment by 1
4 nomaxvalue
5 nocache;
Sequence created.
SQL>
SQL> begin
2 for i in 1..90000 loop
3 insert into t values (i,'initial');
4 end loop;
5 end;
6 /
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@ed-toraclin4a solutions]$
a. On the Cluster Database Home page, click the first instance in the Instances section at the bottom of the
page.
b. On the Cluster Database Instance Home page, click the Administration tab.
c. In the Workload section, click the Automatic Workload Repository link.
12. Connected as user JFV to your database from both nodes, execute the lab_10_01_12_n1.sh
script from the first node and lab_10_01_12_n2.sh from the second node. Do not wait;
proceed with the next step.
-- On first instance:
begin
for i in 1..40000 loop
insert into t values(s.nextval,'first');
commit;
end loop;
end;
/
-- On second instance:
begin
for i in 1..40000 loop
insert into t values(s.nextval,'second');
commit;
end loop;
end;
/
13. While the scripts are still executing, look at the Sessions: Waiting and Working graphic. Then,
drill down to the Cluster wait class for the first node. What are your conclusions?
Answer: This time, looking at the Sessions: Waiting and Working graphic, it is clear that there
are no significant Application waits. Cluster is now the class on which most of the waits are
occurring. Using the drilldown method of Database Control, you can quickly identify the top
waiting SQL statements on both instances. Here it appears that an INSERT statement on table T
is causing most of the waits for the Cluster wait class.
d. On the Active Sessions By Instance: Cluster page, you must see that the number of active sessions is
almost the same on both nodes and is higher than the previous run. Click the RDBD1 link. This takes you
to the Active Sessions Waiting: Cluster page of the first node.
f. After a while, you can see that both scripts are executed by looking at the Sessions: Waiting and
Working graphic again.
a. On the Cluster Database Home page, click the first instance in the Instances section at the bottom of the
page.
b. On the Cluster Database Instance Home page, click the Administration tab.
c. In the Workload section, click the Automatic Workload Repository link.
d. On the Automatic Workload Repository page, click the Snapshots link representing the number of
snapshots retained thus far.
e. On the Snapshots page, click the Create button.
f. On the Confirmation page, click the Yes button.
15. Using Database Control, review the latest ADDM run. What are your conclusions?
Answer: Looking at the last ADDM run on the first instance, it is clear that the INSERT
statement is causing most waits. As shown by the ADDM report, this is probably because of the
cache misses for S.
a. On the Cluster Database Home page, click the Advisor Central link.
b. On the Advisor Central page, make sure that the Advisory Type field is set to All Types and that the
Advisor Runs field is set to Last Run.
c. In the Results table, select the latest ADDM run corresponding to Instance Number 1. Then, click View
Result. This takes you to the Automatic Database Diagnostic Monitor (ADDM) page.
f. Go back to the Automatic Database Diagnostic Monitor (ADDM) page. Then, click the SQL
statements consuming significant database time were found link in the Finding column. This takes
you to the corresponding Performance Finding Details page.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL>
SQL> drop table s purge;
drop table s purge
*
ERROR at line 1:
ORA-00942: table or view does not exist
Sequence dropped.
Table dropped.
SQL>
SQL> create table t(c number,d varchar2(20));
Table created.
Index created.
SQL>
SQL> create sequence s
2 start with 1
3 increment by 1
4 nomaxvalue
5 cache 90000;
Sequence created.
SQL>
SQL> begin
2 for i in 1..90000 loop
3 insert into t values (i,'initial');
4 end loop;
5 end;
6 /
SQL>
SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@ed-toraclin4a solutions]$
-- On first instance:
begin
for i in 1..40000 loop
insert into t values(s.nextval,'first');
commit;
end loop;
end;
/
-- On second instance:
begin
for i in 1..40000 loop
insert into t values(s.nextval,'second');
commit;
end loop;
end;
/
18. Until the scripts are executed, look at the Sessions: Waiting and Working graphic. What are
your conclusions?
Answer: This time, looking at the Sessions: Waiting and Working graphic, it is clear that there
are no significant waits. The sequence has a big enough cache value to avoid the most significant
waits.
a. On the Cluster Database Home page, click the first instance in the Instances section at the bottom of the
page.
b. On the Cluster Database Instance Home page, click the Administration tab.
c. In the Workload section, click the Automatic Workload Repository link.
d. On the Automatic Workload Repository page, click the Snapshots link representing the number of
snapshots retained thus far.
e. On the Snapshots page, click the Create button.
f. On the Confirmation page, click the Yes button.
Answer: Looking at the last ADDM run on the first instance, it is clear that there is no longer
any significant issues relating to sequences.
a. On the Cluster Database Home page, click the Advisor Central link.
b. On the Advisor Central page, make sure that the Advisory Type field is set to All Types and that the
Advisor Runs field is set to Last Run.
c. In the Results table, select the latest ADDM run corresponding to Instance Number 1. Then, click View
Result. This takes you to the Automatic Database Diagnostic Monitor (ADDM) page.
1. From rac1, connect to RDBB1 as SYSDBA under SQL*Plus. Before migrating your database to
ASM, create PFILE as a backup of SPFILE of your database.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
File created.
SQL>
SQL> host cat $ORACLE_HOME/dbs/initRDBB.ora
*.background_dump_dest='/u01/app/oracle/admin/RDBB/bdump'
*.cluster_database_instances=2
*.cluster_database=true
*.compatible='10.1.0.2.0'
*.control_files='/ocfs/oradata/RDBB/control01.ctl','/ocfs/oradata/RDBB/control0'
*.core_dump_dest='/u01/app/oracle/admin/RDBB/cdump'
*.db_block_size=8192
*.db_cache_size=25165824
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='RDBB'
*.db_recovery_file_dest='/ocfs/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=RDBBXDB)'
RDBB1.instance_number=1
RDBB2.instance_number=2
*.java_pool_size=50331648
*.job_queue_processes=10
*.large_pool_size=8388608
*.open_cursors=300
*.pga_aggregate_target=25165824
*.processes=250
*.remote_listener='LISTENERS_RDBB'
*.remote_login_passwordfile='exclusive'
RDBB1.resource_manager_plan=''
RDBB2.resource_manager_plan=''
*.shared_pool_size=99614720
*.sort_area_size=65536
RDBB1.thread=1
RDBB2.thread=2
*.undo_management='AUTO'
RDBB1.undo_tablespace='UNDOTBS1'
RDBB2.undo_tablespace='UNDOTBS2'
*.user_dump_dest='/u01/app/oracle/admin/RDBB/udump'
SQL>
System altered.
System altered.
System altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC1A labs]$
3. See that you no longer have any connection to your database, and stop your database by using srvctl.
4. Make sure that you create a backup of one of the control files. Although this is not mandatory, it is the
best practice.
5. Using Recovery Manager, restore an existing control file to ASM. When finished, back up your
database to ASM as a copy of the existing one, and switch the control file pointers to the backup.
Finally, recover your database.
RMAN>
RMAN> ALTER DATABASE MOUNT;
database mounted
released channel: ORA_DISK_1
RMAN>
RMAN> BACKUP AS COPY DATABASE FORMAT '+DBG1';
RMAN>
RMAN> SWITCH DATABASE TO COPY;
RMAN>
RMAN> RECOVER DATABASE;
RMAN>
RMAN> exit
6. Using SQL*Plus, open your database, add a new temp file to ASM, and delete the old one.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
Database altered.
TABLESPACE_NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
7 rows selected.
SQL>
SQL> ALTER TABLESPACE temp ADD TEMPFILE;
Tablespace altered.
NAME
--------------------------------------------------------------------------------
/ocfs/oradata/RDBB/temp01.dbf
+DBG1/rdbb/tempfile/temp.265.1
Database altered.
SQL>
7. Using SQL*Plus, add two new redo log groups for each thread. Make sure that those new groups are
stored in ASM and all have the same size. Then, remove the old groups from each thread. When finished,
see that both instances are shut down.
From rac1!
SQL>
Database altered.
Database altered.
Database altered.
Database altered.
SQL> declare
2 stmt varchar2(1024):='alter database drop logfile group 2';
3 asalc varchar2(1024):='alter system switch logfile';
4 begin
5 for i in 1 .. 5 loop
6 begin
7 execute immediate stmt;
8 exit;
9 exception
10 when others then execute immediate asalc;
11 end;
12 end loop;
13 end;
14 /
From rac2!
SQL> startup
ORACLE instance started.
SQL>
SQL> declare
2 stmt varchar2(1024):='alter database drop logfile group 4';
3 asalc varchar2(1024):='alter system switch logfile';
4 begin
5 for i in 1 .. 5 loop
6 begin
7 execute immediate stmt;
8 exit;
9 exception
10 when others then execute immediate asalc;
11 end;
12 end loop;
13 end;
14 /
SQL>
SQL> select thread#,group#,status from v$log order by 1;
SQL>
SQL> col member format a50
SQL> select group#,member from v$logfile order by 1;
GROUP# MEMBER
---------- --------------------------------------------------
5 +DBG1/rdbb/onlinelog/group_5.267.3
5 +FRAG1/rdbb/onlinelog/group_5.257.3
6 +DBG1/rdbb/onlinelog/group_6.268.3
6 +FRAG1/rdbb/onlinelog/group_6.258.3
7 +DBG1/rdbb/onlinelog/group_7.269.1
7 +FRAG1/rdbb/onlinelog/group_7.259.1
8 +DBG1/rdbb/onlinelog/group_8.266.1
8 +FRAG1/rdbb/onlinelog/group_8.256.1
SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pn
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@EDTDR1RAC1B labs]$
RAC on Windows
Installation
________________________
Installing Oracle Database 10g on Windows Using Real Application Clusters
(RAC) and Automated Storage Management (ASM)
Purpose
This appendix describes how to install Oracle Database 10g on a Windows two-node cluster by
using Real Application Clusters (RAC) and Automated Storage Management (ASM). The
example in this lesson uses Oracle Database 10g Standard Edition; however, the installation
process is similar to that of Oracle Database 10g Enterprise Edition.
Topics
I. Overview
II. Prerequisites
To make sure that the installation is successful, you must check the following requirements:
• Software
• Web browser
• Hardware
• Disk space
• Network
The software requirements for Oracle Database 10g Real Application Clusters are:
Requirement Value
System architecture 32-bit
Operating system Windows 2000 with service pack 1 or later, or Windows Server 2003
Network protocol TCP/IP
To check that the requirements above have been met, perform the following steps:
2. You notice that the operating system requirements have been met.
Note: To perform the installation, you need the CD-ROMs for Oracle Cluster Services and
Oracle Database 10g.
The following Web browsers are supported for iSQL*Plus and Oracle Enterprise Manager
Database Control:
• Netscape Navigator 4.78, 4.79, 7.01, or 7.1.0
• Microsoft Internet Explorer 5.5 with service pack 1
• Microsoft Internet Explorer 6.0 with service pack 2
To check that the requirements above have been met, perform the following steps:
1. Open your browser, and select Help > About <your browser>.
2. You notice that a supported Web browser version has been installed.
To ensure that both nodes in the cluster meet the minimum requirements to install Oracle
Database 10g Real Application Clusters, perform the following steps:
1. Check that the physical RAM size is at least 512 MB. Click Start > Settings > Control
Panel. Double-click System.
To support your RAC database, your database files must be stored on disks that are shared by
both nodes in your cluster. Any shared disks supported by your hardware vendor, other than
Network Attached Storage (NAS), can be used. The shared disks must be attached to both nodes
in your cluster, and both nodes must be able to read and write to them. For performance and
availability reasons, you must use at least two shared disks for your database files.
The requirements for Oracle Real Application Clusters 10g installation and database creation
are:
1. Open My Computer, right-click the drive that you are verifying, and click Properties.
The two nodes in the cluster must be able to communicate with each other and with external
clients by using the TCP/IP protocol. Communication between clients and the nodes in the
cluster is across the public network. Both nodes need a network adapter configured for the public
network.
To enable availability and failover, a virtual IP (VIP) address is also required for each of your
nodes. A VIP address can be moved between nodes in case of a failure. CRS manages the VIP
addresses for you.
To support a VIP address, both nodes require an unused IP address that is compatible with the
public network's subnet and netmask. The VIP address and host name must also be registered in
the domain name system (DNS).
For communications between the instances running on the two nodes, a private network is
required. This private network connects only the nodes in the cluster and cannot be accessed
from outside the cluster. Both nodes need a separate network adapter configured for this private
network.
Both nodes must meet the following public and private network requirements:
3. An IP address and host name registered in the DNS for the public network interface
4. A private IP address and, optionally, a private host name for each private network interface
Note: Oracle recommends that you use private network IP addresses for these interfaces; for
example, 10.*.*.* or 192.168.*.*. You can use the
%SystemRoot%\system32\drivers\etc\hosts file on both nodes to associate private
host names with private IP addresses.
To configure or determine the IP addresses associated with your cluster nodes, perform the
following steps:
1. Determine the IP addresses and names for your two public and two virtual IP addresses. On
the first node, click Start > Run. Enter cmd and press [Enter].
In this window, you can see the public and private network interface names, the public and
virtual IP addresses, and the private IP address for node one.
3. Switch to your other node and perform steps 1 and 2 again. You see the public and private
network interface names, the public and virtual IP addresses, and the private IP address for
node two. Make sure that the interface names match those on node one.
To configure the disk system, you must perform the following tasks:
• Disable write caching
• Prepare disks for Cluster Ready Services
• Prepare disks for data storage
1. Click Start > Settings > Control Panel > Administrative Tools > Computer Management
> Device Manager > Disk Drives. Right-click the first disk drive, and select Properties.
Cluster Ready Services (CRS) provides overall management of the cluster activities. It requires
the following key files to be located in logical drives on shared disks:
• Oracle Cluster Registry
• Voting disk
From one of the existing nodes of the cluster, perform the following steps:
1. Click Start > Settings > Control Panel > Administrative Tools > Computer Management.
Expand Storage and select Disk Management.
4. The partition type that you want to create is Logical Drive. Click Next.
6. Select the Do not assign a drive letter or drive path option, and click Next.
10. Check the two nodes in the cluster to make sure that the partitions are visible on both nodes,
and that none of the Oracle partitions have drive letters assigned.
You must configure disk storage for use with Automatic Storage Management (ASM). ASM
storage consists of one or more disk groups, each of which spans multiple disks. To prepare the
shared disks that you identified in the prerequisites listed at the beginning of the section titled
“Disk Space,” you must create two or more logical drives, each on a different shared disk, for a
total of at least 7 GB. To prepare each logical drive, perform the following steps:
1. In this example, because only one disk is available, two additional logical drives are created
on Disk1. All the partitions that you create for your ASM disk groups must be of at least 7
GB, must be of equal size, and must include as much free space on the disk as possible.
Repeat the steps that you performed in the previous section to create the two logical drives.
Note: The amount of disk space to be used is in megabytes. So you must enter the amount
accordingly.
Note: If this is the first installation of any Oracle product, the Specify Inventory directory page
appears, which provides the location where Oracle inventory of installed products is stored.
Accept the default and click Next.
Note: You may need to click Next more than once to go to the next page.
To enable disk discovery during database installation, the logical drives used to store your
database files must be stamped with an ASM header using asmtoolg. All disk names created
by the tool begin with the prefix ORCLDISK for identification purposes. To stamp the logical
drives for ASM, perform the following steps:
1. Run <CRS_home>\BIN\asmtoolg.exe.
3. On the Stamp Disks page, select a disk to stamp and optionally modify the prefix. Then click
Next.
5. Click Finish.
To install Oracle Database 10g with RAC, perform the following steps:
Note: If the Oracle Universal Installer detects a network problem on any node that you have
included in this installation, then a warning is displayed. To resolve problems, examine the
installation log file: \Program
Files\Oracle\Inventory\logs\installActions<date_time>.log
Note: The other options are supported only by the Enterprise Edition.
Note: Make sure that your public NIC is selected for this purpose. If you select your private
NIC, your cluster will not function correctly.
26. The installation is successful. Click Exit and then Yes to terminate the Oracle Universal
Installer.
To verify the path names on both nodes, perform the following steps:
1. Click Start > Settings > Control Panel > System > Advanced > Environment Variables.
Select the Path variable. Make sure that the value is set to <Oracle Home>\bin. If the
variable does not contain the value, add the value to the start of the path variable definition.