How to find out if you’re accessing a RAC database

How can you tell if you’re accessing a RAC database? Simple!

You can tell if it is a cluster database by looking to see if the cluster database parameter is set:-

SQL> select name, value from v$parameter where name=’cluster_database’;

NAME VALUE
——————— ———————
cluster_database TRUE

or

set serveroutput on
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;
/

You can tell how many instances are active by:-

SQL> SELECT * FROM V$ACTIVE_INSTANCES;

INST_NUMBER INST_NAME
———– ———————–

1 c1718-6-45:AXIOSS1

2 c1718-6-46:AXIOSS2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s