Sie sind auf Seite 1von 2

Transparent Application Failover (TAF) setup and testing - Oracle 10g RAC After you have 2 or 3 nodes of Oracle

10g RAC up and running, you need to setup Transparent Application Failover (TAF) so that when one of you RAC node is down the application connections stay connected to the running nodes. 1. Setup a new service called "appcon", by running dbca 2. At Welcome, select "Oracle Real Application Cluster database", click Next 3. Select "Service Management", click Next 4. Select your RACDB databse, click Next 5. Click Add and enter service name: appcon 6. Select Preferred instance "RACDB3" and check the rest as Available 7. Select TAF Policy: BASIC 8. Click Finish 9. Add "appcon" to your tnsnames.ora file appcon = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.domain.com)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.domain.com)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = rac3-vip.domain.com)(PORT = 1521)) (LOAD_BALANCE = yes) (FAILOVER = true) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = appcon) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 20) (DELAY = 5) ) ) ) 10. Test connection: $ sqlplus system/manager@appcon select instance_number,instance_name,host_name from v$instance; INSTANCE_NUMBER INSTANCE_NAME HOST_NAME --------------- ---------------- ------------------------------------1 RACDB3 rac3.domain.com select failover_type,failover_method,failed_over from v$session where username='SYSTEM'; FAILOVER_TYPE FAILOVER_M FAI ------------- ---------- --SELECT BASIC YES 11. Now try shutdown RACDB3 instance: $ srvctl stop instance -d RACDB -i RACDB3 select instance_number,instance_name,host_name from v$instance; INSTANCE_NUMBER INSTANCE_NAME HOST_NAME

--------------- ---------------- ------------------------------------1 RACDB1 rac1.domain.com 12. After you restarted the database instance RACDB3, the service does not automatically relocate to the preferred database instance. You have to manually relocate the service back on RACDB3: $ srvctl start instance -d RACDB -i RACDB3 $ srvctl relocate service -d RACDB -s appcon -i RACDB1 -t RACDB3 13. Your sqlplus connection stays connected to the instance RACDB1 and you have reconnect. Then it will connect to the preferred instance again. Now check the service names on each database instance to see which one is the preferred instance: SQL> show parameters service_name NAME TYPE VALUE ------------------------------------ ----------- -----------------------------service_names string appcon, RACDB

Das könnte Ihnen auch gefallen