Professional Documents
Culture Documents
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).
2. Can any application be deployed on RAC?
Most applications can be deployed on RAC without any modifications and still scale linearly
(well, almost).
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.
3. Do you need special hardware to run RAC?
RAC requires the following hardware components:
Windows Clusters
Linux Clusters
$ rconfig racconv.xml
One can also use dbca and enterprise manager to convert the database to RAC mode.
For prior releases, follow these steps:
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:
Each instance requires its own set of Undo segments (rollback segments). To add
undo segments for New Nodes:
UNDO_MANAGEMENT = auto
UNDO_TABLESPACE = undots2
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....
Create the dictionary views needed for RAC by running catclust.sql (previously called
catparr.sql):
You can also use the SET INSTANCE instanceN command to switch between instances (if
defined in TNSNAMES.ORA).
7.Can I test if a database is running in RAC mode?
Use the DBMS_UTILITY package to determine if a database is running in RAC mode or not.
Example:
BEGIN
IF dbms_utility.is_cluster_database THEN
dbms_output.put_line('Running in SHARED/RAC mode.');
ELSE
dbms_output.put_line('Running in EXCLUSIVE mode.');
END IF;
END;
/
For Oracle 8i and prior releases:
BEGIN
IF dbms_utility.is_parallel_server THEN
dbms_output.put_line('Running in SHARED/PARALLEL mode.');
ELSE
dbms_output.put_line('Running in EXCLUSIVE mode.');
END IF;
END;
/
Another method is to look at the database parameters. For example, from SQL*Plus:
SQL> show parameter CLUSTER_DATABASE
If the value of CLUSTER_DATABASE is FALSE then database is not running in RAC
Mode.
8.How can I keep track of active instances?
You can keep track of active RAC instances by executing one of the following queries:
SELECT * FROM SYS.V_$ACTIVE_INSTANCES;
SELECT * FROM SYS.V_$THREAD;
To list the active instances from PL/SQL, use DBMS_UTILITY.ACTIVE_INSTANCES().
9. How does one setup SQL*Net for RAC?
See Transparent Application Failover.
10. 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;
With login time (hour):