RAC connection management

Source: Internet
Author: User

For RAC, when an Oracle Instance fails, the application has several high-availability technologies to ensure availability. These technologies are transparent to the client, and the client may not be able to perceive the instance failure.

1. Transparent Application Failover (TAF)

Ii. Fast Connection Failover (FCF ).

When a node fails, TAF allows the database session to use OCI libraries for fail over to another surviving node. However, if the application uses JDBC thin driver, TAF cannot be used.

Failover Modes:

Session failover

Select failover

None (default)

1. select mode allows the query to be executed on the new node again, discard the rows that have been fetch, and continue to return the results to the client.

2. The none mode explicit declaration does not use TAF

3. TAF cannot restore any DML transaction, and the transaction will be rolled back on another node.

Failover Methods:

Basic

Preconnect

1. the Basic option means that the client creates a new connection after the instance fails. This method may cause the performance of the other node to degrade when the node fails, because many sessions will be reconnected to the surviving nodes.

2. The client generates a preconnected session as a backup to accelerate failover when the instance fails.

TAF is the client-side feature. We need to configure it in the client Tnsnames. ora or server through service.

1. Client implementation

In RAC, the typical configurations in tnsnames. ora are as follows:

  1. LEO1=
  2. (DESCRIPTION_LIST=
  3. (LOAD_BALANCE=Off)
  4. (FAILOVER=On)
  5. (DESCRIPTION=
  6. (ADDRESS_LIST=
  7. (LOAD_BALANCE=OFF)
  8. (FAILOVER=ON)
  9. (ADDRESS= (PROTOCOL=TCP)(HOST=Node1.Chinamobile.com )(PORT=1521))
  10. )
  11. (CONNECT_DATA=
  12. (SERVICE_NAME=Leo)
  13. (INSTANCE_NAME=Leo1)
  14. (FAILOVER_MODE= (TYPE=Session)(METHOD=Basic)(RETRIES=4)(DELAY=1))
  15. )
  16. )
  17. (DESCRIPTION=
  18. (ADDRESS_LIST=
  19. (LOAD_BALANCE=OFF)
  20. (FAILOVER=ON)
  21. (ADDRESS= (PROTOCOL=TCP)(HOST=Node2.Chinamobile.com )(PORT=1521))
  22. )
  23. (CONNECT_DATA=
  24. (SERVICE_NAME=Leo)
  25. (INSTANCE_NAME=Leo2)
  26. (FAILOVER_MODE= (TYPE=Session)(METHOD=Basic)(RETRIES=4)(DELAY=1))
  27. )
  28. )
  29. )

2. server implementation

  1. Srvctl add service-d leo-s cmcc-q TRUE-p basic-e SESSION-z 4-w 5 specific usage parameters are as follows:
  2. Usage: srvctl add service-d<Db_unique_name>-S<Service_name>{-R"<Preferred_list>"[-"<Available_list>"] [-P {BASIC | NONE | PRECONNECT}]
  3. |-G<Pool_name>[-C {UNIFORM | SINGLETON}]} [-k<Net_num>] [-L [PRIMARY] [, PHYSICAL_STANDBY] [, LOGICAL_STANDBY] [, SNAPSHOT_STANDBY]
  4. [-Y {AUTOMATIC | MANUAL}] [-q {TRUE | FALSE}] [-x {TRUE | FALSE}] [-j {SHORT | LONG}] [-B {NONE | SERVICE_TIME | THROUGHPUT}]
  5. [-E {NONE | SESSION | SELECT}] [-m {NONE | BASIC}] [-z<Failover_retries>] [-W<Failover_delay>] [-T<Edition>] [-F]
  6. -D<Db_unique_name>Unique name for the database
  7. -S<Service>Service name
  8. -R"<Preferred_list>"Comma separated list of preferred instances
  9. -"<Available_list>"Comma separated list of available instances
  10. -G<Pool_name>Server pool name
  11. -C {UNIFORM | SINGLETON} Service runs on every active server in the server pool hosting this service (UNIFORM) or just one server (SINGLETON)
  12. -K<Net_num>Network number (default number is 1)
  13. -P {NONE | BASIC | PRECONNECT} TAF policy specification
  14. -L<Role>Role of the service (primary, physical_standby, logical_standby, snapshot_standby)
  15. -Y<Policy>Management policy for the service (AUTOMATIC or MANUAL)
  16. -E<FailoverType>Failover type (NONE, SESSION, or SELECT)
  17. -M<FailoverMethod>Failover method (NONE or BASIC)
  18. -W<Integer>Failover delay
  19. -Z<Integer>Failover retries
  20. -T<Edition>Edition (or "" for empty edition value)
  21. -J<Clb_goal>Connection Load Balancing Goal (SHORT or LONG). Default is LONG.
  22. -B<RuntimeLoad Balancing Goal>Runtime Load Balancing Goal (SERVICE_TIME, THROUGHPUT, or NONE)
  23. -X<DistributedTransaction Processing>Distributed Transaction Processing (TRUE or FALSE)
  24. -Q<AQHA specifications>Aq ha configurations (TRUE or FALSE)
  25. Usage: srvctl add service-d<Db_unique_name>-S<Service_name>-U {-r"<New_pref_inst>"|-"<New_avail_inst>"} [-F]
  26. -D<Db_unique_name>Unique name for the database
  27. -S<Service>Service name
  28. -U Add a new instance to service configuration
  29. -R<New_pref_inst>Name of new preferred instance
  30. -<New_avail_inst>Name of new available instance
  31. -F Force the add operation even though a listener is not configured for a network
  32. -H Print usage
  33. Fast Connection Failover and Fast Application Notification

FAN is a message publishing mechanism that publishes messages to the client at instance up/down to reconfigure the cluster. FCF is transparent through FAN.
Instance failure failover.

Client drivers supported by FCF:

Java Database Connection Driver (JDBC)
Oracle Universal Connection Pool UCP
Clients using the Oracle Call Interface
Oracle Data Providers for. Net

When the db_domain parameter is set in 11R2 (11.2.0.1), FCF will be invalid, bug: 8779597

For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.