Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle 11gR2 RAC Service-Side TAF configuration example

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Service-Side TAF

Reference for the configuration of Service-Side TAF:

How To Configure Server Side Transparent Application Failover [ID 460982.1]

Service-SideTAF can be seen as a variant of TAF. First, Service-SideTAF is also TAF, which has all the characteristics of TAF. Secondly, this TAF is configured on the server, unlike TAF on the client.

Client-Side TAF is configured by modifying the tnsnames.ora file on the client side. If many clients use this database, then every smile adjustment needs to change all the computers, which is both inefficient and error-prone. Service-Side TAF saves the configuration of FAIL_MODE in the database by combining Service, and saves all the TAF configuration in the data dictionary, thus saving the configuration work of the client. Now the TNS file of the client does not need any configuration options of TAF.

In terms of configuration parameters, Service-Side TAF has an additional concept of Instance Role (instance role) compared to TAF. The so-called instance role is that when there are multiple Instance participating in a Service, you can configure which Instance to use first to provide services to users. There are two optional roles for users.

PREFERRED: the preferred instance, and the instance with this role will be preferred to provide services.

AVAILABLE: backup instance. Users will first connect to the Instance of PREFFERRED. When the Instance of PREFERRED is not available, it will be transferred to the Instance of AVAILBALE.

Service must be configured to use Server-Side TAF. Service can be created when the database is created or modified after the database is created, either using the dbca configuration wizard or from the command line.

The server does not need to configure the client to implement taf

Method 1. Client configuration (METHOD = basic) saves resources and wastes time

ORCL =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.171.4) (PORT = 1521))

(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.171.5) (PORT = 1521))

(LOAD_BALANCE = yes)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

(FAILOVER_MODE =

(TYPE = session)

(METHOD = basic)

(RETRIES = 180)

(DELAY = 5)

)

)

)

Method 2. Client configuration (METHOD = preconnect) saves time and wastes resources

Orcl1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.171.4) (PORT = 1521))

(LOAD_BALANCE = yes)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

(FAILOVER_MODE =

(TYPE = select)

(METHOD = preconnect)

(BACKUP = orcl2)

)

)

)

Orcl2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.171.5) (PORT = 1521))

(LOAD_BALANCE = yes)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

(FAILOVER_MODE =

(TYPE = select)

(METHOD = preconnect)

(BACKUP = orcl1)

)

)

)

Since the client is too troublesome to change, now let's see how to configure the server directly without changing the client.

1. Configure Service with the srvctl command

[oracle@rac1] $srvctl add service-d orcl-s taf-r "orcl1,orcl2"-P BASIC

Orcl here is database name,orcl1 and orcl2 is instance name.

Delete service

# srvctl remove service-d orcl-s taf

two。 Start the taf service

[oracle@rac1] srvctl start service-d orcl-s taf

2.1 automatically run service when the database is running

Srvctl enable service-d orcl-s taf

Check the operation of service

[oracle@rac1] srvctl config service-d orcl

4.5. Add parameters to service:

SQL > execute dbms_service.modify_service (service_name = > 'taf'-

, aq_ha_notifications = > true-

, failover_method = > dbms_service.failover_method_basic-

, failover_type = > dbms_service.failover_type_select-

, failover_retries = > 180-

, failover_delay = > 5-

, clb_goal = > dbms_service.clb_goal_long)

Delete service information from the data dictionary

Begin

Dbms_service.delete_service (service_name= > 'taf')

End

/

5. Confirm the modified parameters

Col name format a15

Col failover_method format A11 heading 'METHOD'

Col failover_type format A10 heading 'TYPE'

Col failover_retries format 9999999 heading 'RETRIES'

Col goal format a10

Col clb_goal format a8

Col AQ_HA_NOTIFICATIONS format a5 heading 'AQNOT'

Select name, failover_method,failover_type, failover_retries,goal

Clb_goal,aq_ha_notifications from dba_services where name = 'taf'

6. Check service registration:

[oracle@rac1 ~] $lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0-Production on 13-DEC-2018 14:18:37

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Connecting to (ADDRESS= (PROTOCOL=tcp) (HOST=) (PORT=1521))

STATUS of the LISTENER

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.4.0-Production

Start Date 13-DEC-2018 09:09:32

Uptime 0 days 5 hr. 9 min. 5 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File / u01/app/11.2.0/grid/network/admin/listener.ora

Listener Log File / u01/app/grid/diag/tnslsnr/rac1/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=LISTENER)

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=172.16.171.2) (PORT=1521))

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=172.16.171.4) (PORT=1521))

Services Summary...

Service "+ ASM" has 1 instance (s).

Instance "+ ASM1", status READY, has 1 handler (s) for this service...

Service "orcl" has 1 instance (s).

Instance "orcl1", status READY, has 1 handler (s) for this service...

Service "orclXDB" has 1 instance (s).

Instance "orcl1", status READY, has 1 handler (s) for this service...

Service "taf" has 1 instance (s).

Instance "orcl1", status READY, has 1 handler (s) for this service...

The command completed successfully

7. The client can use Service-SideTAF:

On the client side TNS configuration:

Orcl =

(DESCRIPTION=

(ADDRESS= (PROTOCOL=tcp) (HOST= 172.16.171.6) (PORT=1521))

(CONNECT_DATA=

(SERVER=DEDICATED)

(SERVICE_NAME=taf)

)

)

-- 172.16.171.6 is the address of scan ip

Test.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report