Configure TAF PRECONNECT configuration on server-side
[oracle@srv1 ~]$ srvctl add service -db rac -service pretaf -preferred rac1 -available rac2 -tafpolicy PRECONNECT
[oracle@srv1 ~]$ srvctl start service -db rac -service pretaf
[oracle@srv1 ~]$ srvctl status service -db rac -service pretaf
Service pretaf is running on instance(s) rac1
[oracle@srv1 ~]$ srvctl config service -db rac -service pretaf
Service name: pretaf
Server pool:
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
TAF failover retries:
TAF failover delay:
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: PRECONNECT
Edition:
Pluggable database name:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Replay Initiation Time: 300 seconds
Session State Consistency:
GSM Flags: 0
Service is enabled
Preferred instances: rac1
Available instances: rac2
[oracle@srv1 ~]$
[oracle@srv1 ~]$ srvctl add service -db rac -service pretaf -preferred rac1 -available rac2 -tafpolicy PRECONNECT
[oracle@srv1 ~]$ srvctl start service -db rac -service pretaf
[oracle@srv1 ~]$ srvctl status service -db rac -service pretaf
Service pretaf is running on instance(s) rac1
[oracle@srv1 ~]$ srvctl config service -db rac -service pretaf
Service name: pretaf
Server pool:
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
TAF failover retries:
TAF failover delay:
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: PRECONNECT
Edition:
Pluggable database name:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Replay Initiation Time: 300 seconds
Session State Consistency:
GSM Flags: 0
Service is enabled
Preferred instances: rac1
Available instances: rac2
[oracle@srv1 ~]$
[oracle@srv1 ~]$ srvctl config service -d rac -s pretaf_preconnect
Service name: pretaf_preconnect
Server pool:
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
TAF failover retries:
TAF failover delay:
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: PRECONNECT
Edition:
Pluggable database name:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Replay Initiation Time: 300 seconds
Session State Consistency:
GSM Flags: 0
Service is enabled
Preferred instances: rac1
Available instances: rac2
[oracle@srv1 ~]$
C:\Users\varunyadav>sqlplus sys/system123@rac as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Jun 5 20:20:32 2019
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SQL> col name format a20
SQL> col failover_method format a20
SQL> col failover_type format a20
SQL> SELECT NAME, FAILOVER_METHOD, FAILOVER_TYPE FROM DBA_SERVICES WHERE NAME LIKE 'pretaf%';
NAME FAILOVER_METHOD FAILOVER_TYPE
-------------------- -------------------- --------------------
pretaf
pretaf_preconnect
SQL>
col username format a10
col service_name format a20
SELECT INST_ID, SERVICE_NAME, FAILOVER_TYPE,FAILOVER_METHOD, FAILED_OVER FROM GV$SESSION;
INST_ID SERVICE_NAME FAILOVER_TYPE FAILOVER_M FAI
---------- -------------------- ------------- ---------- ---
1 pretaf SELECT PRECONNECT NO
1 pretaf_preconnect NONE NONE NO
[oracle@srv1 ~]$ pkill -9 -f ora_pmon_rac1
col username format a10
col service_name format a20
SELECT INST_ID, SERVICE_NAME, FAILOVER_TYPE,FAILOVER_METHOD, FAILED_OVER FROM GV$SESSION;
INST_ID SERVICE_NAME FAILOVER_TYPE FAILOVER_M FAI
---------- -------------------- ------------- ---------- ---
2 pretaf_preconnect SELECT PRECONNECT YES
srvctl stop service -database rac -service pretaf
srvctl remove service -database rac -service pretaf
tnsnames.ora
PRETAF =
(DESCRIPTION =
(FAILOVER = ON)
(ADDRESS = (PROTOCOL = tcp)(HOST = srv-scan.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = pretaf)
(FAILOVER_MODE =
(BACKUP = pretaf_preconnect)
(TYPE = select)
(METHOD = preconnect)
)
)
)
PRETAF_PRECONNECT =
(DESCRIPTION =
(FAILOVER = ON)
(ADDRESS = (PROTOCOL = tcp)(HOST = srv-scan.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = pretaf_preconnect)
)
)
col username format a10
col service_name format a20
SELECT INST_ID, SERVICE_NAME, FAILOVER_TYPE,FAILOVER_METHOD, FAILED_OVER FROM GV$SESSION;
INST_ID SERVICE_NAME FAILOVER_TYPE FAILOVER_M FAI
---------- -------------------- ------------- ---------- ---
1 pretaf SELECT PRECONNECT NO
1 pretaf_preconnect NONE NONE NO
[oracle@srv1 ~]$ pkill -9 -f ora_pmon_rac1
col username format a10
col service_name format a20
SELECT INST_ID, SERVICE_NAME, FAILOVER_TYPE,FAILOVER_METHOD, FAILED_OVER FROM GV$SESSION;
INST_ID SERVICE_NAME FAILOVER_TYPE FAILOVER_M FAI
---------- -------------------- ------------- ---------- ---
2 pretaf_preconnect SELECT PRECONNECT YES
srvctl stop service -database rac -service pretaf
srvctl remove service -database rac -service pretaf
tnsnames.ora
PRETAF =
(DESCRIPTION =
(FAILOVER = ON)
(ADDRESS = (PROTOCOL = tcp)(HOST = srv-scan.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = pretaf)
(FAILOVER_MODE =
(BACKUP = pretaf_preconnect)
(TYPE = select)
(METHOD = preconnect)
)
)
)
PRETAF_PRECONNECT =
(DESCRIPTION =
(FAILOVER = ON)
(ADDRESS = (PROTOCOL = tcp)(HOST = srv-scan.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = pretaf_preconnect)
)
)
No comments:
Post a Comment