Oracle Database 11g Release 2 has a new feature named server pools. If a database is created as a policy managed RAC database then policy will dictate where the database instances are placed in the cluster rather than which instances were created on which node at creation time.
Take a cluster of three nodes.
[Oracle OKS] Nodes in cluster: [Oracle OKS] Node 1 (IP 0xc0a80845) Node 2 (IP 0xc0a80846) Node 3 (IP 0xc0a8084a) [Oracle OKS] [Oracle OKS] Node count 3 [Oracle ADVM] Cluster reconfiguration started. [Oracle ADVM] Cluster reconfiguration completed. [Oracle ADVM] Cluster reconfiguration completed. [Oracle OKS] Cluster Membership change setup complete
Create a server pool that encompasses two of these three nodes. The dbca utility can create the server pool for you and create the policy managed instances associated with that server pool.
/opt/oracle/app/oracle/admin/racd3/scripts/racd3_1.sql:
host /opt/oracle/app/oracle/product/11.2.0/dbhome_1/bin/srvctl add srvpool -g c03pool1 -l 0 -u 2 host /opt/oracle/app/oracle/product/11.2.0/dbhome_1/bin/srvctl add database -d racd3 -o /opt/oracle/app/oracle/product/11.2.0/dbhome_1 -p +C03DATA1/racd3/spfileracd3.ora -n racd3 -m example.com -g c03pool1 -a C03DATA1,C03FRA1
/opt/oracle/app/oracle/admin/racd3/scripts/racd3_2.sql:
REM host /opt/oracle/app/oracle/product/11.2.0/dbhome_1/bin/srvctl add srvpool -g c03pool1 -l 0 -u 2 REM host /opt/oracle/app/oracle/product/11.2.0/dbhome_1/bin/srvctl add database -d racd3 -o /opt/oracle/app/oracle/product/11.2.0/dbhome_1 -p +C03DATA1/racd3/spfileracd3.ora -n racd3 -m example.com -g c03pool1 -a C03DATA1,C03FRA1
The above will create a server pool c03pool1 with a policy managed database named racd3 within that pool. The server pool supports two servers. The database requires that the diskgroups +c03data1 and +c03fra1 are available.
Unlike Oracle Database 10g, the instances are no longer tied to their cluster nodes. Thus, instances racd3_1 and racd3_2 do not have to run on cluster nodes 1 and 2 respectively.
[root@h01-c03-test ~]# /opt/oracle/app/11.2.0/grid/bin/srvctl status database -d racd3 Instance racd3_1 is running on node h02-c03-test Instance racd3_2 is running on node h03-c03-test
Now, if a server that hosts one of the database instances becomes unavailable then that instance will relocate to another server in that pool. By default, all servers are in the pool.
Shutdown a node.
[root@h02-c03-test ~]# shutdown -h now Broadcast message from root (pts/0) (Mon Sep 21 16:51:51 2009): The system is going down for system halt NOW! [root@h02-c03-test ~]# Connection to h02-c03-test closed by remote host. Connection to h02-c03-test closed.
The cluster is reconfigured.
[Oracle OKS] Nodes in cluster: [Oracle OKS] Node 1 (IP 0xc0a80845) Node 3 (IP 0xc0a8084a) [Oracle OKS] [Oracle OKS] Node count 2 [Oracle ADVM] Cluster reconfiguration started. [Oracle ADVM] Cluster reconfiguration completed. [Oracle ADVM] Cluster reconfiguration completed.
Database instance racd3_1 relocates to the spare node.
[root@h01-c03-test ~]# /opt/oracle/app/11.2.0/grid/bin/srvctl status database -d racd3 Instance racd3_1 is running on node h01-c03-test Instance racd3_2 is running on node h03-c03-test