Connection to an Oracle® database is established using a "service". You can also set up "DTP services" in an Oracle® Real Application Clusters environment.
This offers the following options for live operation:
automatic error detection
automatic failover.
If an instance fails, a new transaction is redirected to another instance of the service. No administrator intervention is required.Load distribution as soon as the connection is established
Creating a DTP service (Oracle ® )
Use the command "srvctl add service" to add a new service for the database and assign
it to an instance of the database.Example:
Two "DTP services" are to be created with the following options for the RAC database
dbracutm
with the instancesracutm1
andracutm2
:-d
Name of the database
-s
Name of the (DTP) service
-r
Name of the first instance
-a
Name of the second instance
-P
Failover method
"srvctl add service -d dbracutm -s racutmS12 -r racutm1 -a racutm2 -P BASIC"
and
"srvctl add service -d dbracutm -s racutmS21 -r racutm2 -a racutm1 -P BASIC"
The service
racutmS12
connects to the instanceracutm1
and to the instanceracutm2
in the event of a failover. In the same way, the serviceracutmS21
connects to the instanceracutm2
and to the instanceracutm1
in the event of a failover.Convert the services to "DTP services“ using SQLPLUS:
SQL> connect .... SQL> execute dbms_service.modify_service ( service_name => 'racutmS12', dtp => true ); SQL> execute dbms_service.modify_service ( service_name => 'racutmS21', dtp => true ); SQL> exit
You can start, stop and administer the (DTP) services with "srvctl commands". See also the Oracle® "Administration and Deployment Guide".
The DTP service must be started on the node on which the instance of the RAC DB system that is primarily assigned to it is running, i.e. the DTP serviceracutmS21
, which is primarily assigned to the instanceracutm2
, must be started on the node on which this instance is running.Enter the service in the file tnsnames.ora with a net_service_name:
Example
RACUTMS1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST=server1) (PORT=1521)) (ADDRESS = (PROTOCOL = TCP) (HOST=server2) (PORT=1521)) ) (CONNECT_DATA = (SERVICE_NAME = racutmS12.domain_name ) ) (FAIL_OVER = ON) )
In the Openstring in the start parameters, assign this net_service_name (in this case RACUTMS1) to the operand "SqlNet".