Rac Faq: Ác Ác Ác Ác Ác Ác Ác Ác Ác Ác Ác
Rac Faq: Ác Ác Ác Ác Ác Ác Ác Ác Ác Ác Ác
Rac Faq: Ác Ác Ác Ác Ác Ác Ác Ác Ác Ác Ác
Oracle Real Application Clusters (RAC) FAQ - previously called Oracle Parallel Server (OPS):
Contents
[hide]
y y y y y y y y y y y
1 What is RAC and how is it different from non RAC databases? 2 Can any application be deployed on RAC? 3 Do you need special hardware to run RAC? 4 How many OCR and voting disks should one have? 5 How does one convert a single instance database to RAC? 6 How does one stop and start RAC instances? 7 Can I test if a database is running in RAC mode? 8 How can I keep track of active instances? 9 How does one setup SQL*Net for RAC? 10 Can one see how connections are distributed across the nodes? 11 What is pinging and why is it so bad?
[edit] What is RAC and how is it different from non RAC databases?
RAC stands for Real Application Clusters. It allows multiple nodes in a clustered system to mount and open a single database that resides on shared disk storage. Should a single system (node) fail, the database service will still be available on the remaining nodes. A non-RAC database is only available on a single system. If that system fails, the database service will be down (single point of failure).
Applications with 'hot' blocks (the same data blocks continuously accessed by processes on different nodes) may not work well. This is because data blocks will constantly be moved from one Oracle Instance to another. In such cases the application may need to be partitioned based on function or data to eliminate the contention.
A dedicated network interconnect - might be as simple as a fast network connection between nodes; and A shared disk subsystem.
Windows Clusters Linux Clusters Unix Clusters like SUN PDB (Parallel DB). IBM z/OS in SYSPLEX HP Serviceguard extension for RAC
[edit] How many OCR and voting disks should one have?
For redundancy, one should have at least two OCR disks and three voting disks (raw disk partitions). These disk partitions should be spread across different physical disks.
One can also use dbca and enterprise manager to convert the database to RAC mode. For prior releases, follow these steps:
y
y y
Enable RAC - On Unix this is done by relinking the Oracle software. Make the software available on all computer systems that will run RAC. This can be done by copying the software to all systems or to a shared clustered file system. Each instance requires its own set of Redo Log Files (called a thread). Create additional log files:
SQL> CONNECT SYS AS SYSBDA SQL> STARTUP EXCLUSIVE SQL> ALTER DATABASE ADD LOGFILE SQL> GROUP G4 ('RAW_FILE1') SQL> GROUP G5 ('RAW_FILE2') SQL> GROUP G6 ('RAW_FILE3') THREAD 2 SIZE 500k, SIZE 500k, SIZE 500k;
Each instance requires its own set of Undo segments (rollback segments). To add undo segments for New Nodes:
CLUSTER_DATABASE = TRUE (PARALLEL_SERVER = TRUE prior to Oracle9i). INSTANCE_NUMBER = 1 THREAD = 1 UNDO_TABLESPACE = undots1 (or ROLLBACK_SEGMENTS if you use UNDO_MANAGEMENT=manual) # Include %T for the thread in the LOG_ARCHIVE_FORMAT string. # Set LM_PROCS to the number of nodes * PROCESSES # etc.... y
Create the dictionary views needed for RAC by running catclust.sql (previously called catparr.sql):
CLUSTER_DATABASE=TRUE (PARALLEL_SERVER=TRUE) parameter needs to be set before a database can be started in cluster mode. In Oracle 10g one can use the srvctl utility to start instances and listener across the cluster from a single node. Here are some examples:
$ $ $ $ $ $ srvctl srvctl srvctl srvctl srvctl srvctl status database -d RACDB start database -d RACDB start instance -d RACDB -i RACDB1 start instance -d RACDB -i RACDB2 stop database -d RACDB start asm -n node2
Before Oracle 8.0, use the following command sequence from each node (using the old server manager):
SVRMGR> connect INTERNAL SVRMGR> set retries 5 SVRMGR> startup parallel retry
You can also use the SET INSTANCE instanceN command to switch between instances (if defined in TNSNAMES.ORA).
Another method is to look at the database parameters. For example, from SQL*Plus:
If the value of CLUSTER_DATABASE is FALSE then database is not running in RAC Mode.
[edit] Can one see how connections are distributed across the nodes?
Select from gv$session. Some examples:
SELECT inst_id, count(*) "DB Sessions" FROM gv$session WHERE type = 'USER' GROUP BY inst_id;