Home » Server Options » RAC & Failsafe » How to create a service that fails over in a 2 node admin-managed RAC (12.1.0.2 SE2, rh 7.3)
|
|
Re: How to create a service that fails over in a 2 node admin-managed RAC [message #668298 is a reply to message #668193] |
Sat, 17 February 2018 03:51   |
 |
juniordbanewbie
Messages: 250 Registered: April 2014
|
Senior Member |
|
|
Dear John,
yes are you right.
this is how I resolve my issues.
create two service which has preferred and available instances opposite of each other
srvctl add service -db dwhdb -service auto_failover -preferred dwhdb1 -available dwhdb2 -tafpolicy BASIC -failovertype SESSION -verbose
srvctl add service -db dwhdb -service auto_failover_pre_2 -preferred dwhdb2 -available dwhdb1 -tafpolicy BASIC -failovertype SESSION -verbose
from the 32 bit client server
in $ORACLE_HOME/network/admin/tnsnames.ora
insert the following network service name
dwhdb =
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = rh73-12102-scan.moonlight.com)(PORT = 1521))
(CONNECT_DATA=
(SERVICE_NAME=auto_failover.moonlight.com)
(INSTANCE_NAME=dwhdb1)))
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = rh73-12102-scan.moonlight.com)(PORT = 1521))
(CONNECT_DATA=
(SERVICE_NAME=auto_failover.moonlight.com)
(INSTANCE_NAME=dwhdb2)))
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = rh73-12102-scan.moonlight.com)(PORT = 1521))
(CONNECT_DATA=
(SERVICE_NAME=auto_failover_pre_2.moonlight.com)
(INSTANCE_NAME=dwhdb2)))
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = rh73-12102-scan.moonlight.com)(PORT = 1521))
(CONNECT_DATA=
(SERVICE_NAME=auto_failover.moonlight.com)
(INSTANCE_NAME=dwhdb1)))
)
instance name has to be added due to sqlplus internal error state 2130 ORA-24315:Illegal Attribute Type (Doc ID 1060880.1)
I wonder if thing can be so complicated I were to implement this in a policy manged db rather the admin managed db.
thanks
[Updated on: Sat, 17 February 2018 03:51] Report message to a moderator
|
|
|
|
Re: How to create a service that fails over in a 2 node admin-managed RAC [message #668325 is a reply to message #668299] |
Sun, 18 February 2018 23:04   |
 |
juniordbanewbie
Messages: 250 Registered: April 2014
|
Senior Member |
|
|
Dear John,
set linesize 100;
SET TRIMSPOOL ON
col failover_type for a33;
col FAILOVER_METHOD for a20;
col failed_over for a20;
select FAILOVER_TYPE,FAILOVER_METHOD,FAILED_OVER from v$session where sid in (select distinct sid from v$mystat)
union select name,'(DB NAME)',null from v$database
union select instance_name,host_name,null from v$instance
union select machine,to_char(sid),osuser from v$session where sid in (select distinct sid from v$mystat)
union SELECT sys_context('userenv','service_name'), 'service_name', null FROM dual
union SELECT to_char(systimestamp,'YYYY-MM-DD HH24:MI:SS.FF TZR'), 'current_time_stamp', null FROM dual order by 1;
output as below:
FAILOVER_TYPE FAILOVER_METHOD FAILED_OVER
--------------------------------- -------------------- --------------------
2018-02-19 03:44:42.459847 +01:00 current_time_stamp
dwhDB (DB NAME)
dwhProdApp1 156 oracle
SESSION BASIC NO
auto_failover.moonlight.com service_name
dwhdb1 dwhProdDB1
6 rows selected.
SYSTEM@dwhprodapp1 auto_failover>host ssh root@dwhProdDB1 systemctl reboot
SYSTEM@dwhprodapp1 auto_failover>/
select FAILOVER_TYPE,FAILOVER_METHOD,FAILED_OVER from v$session where sid in (select distinct sid from v$mystat)
*
ERROR at line 1:
ORA-25408: can not safely replay call
SYSTEM@dwhprodapp1 auto_failover>/
FAILOVER_TYPE FAILOVER_METHOD FAILED_OVER
--------------------------------- -------------------- --------------------
2018-02-19 03:46:50.380190 +01:00 current_time_stamp
dwhDB (DB NAME)
dwhProdApp1 547 oracle
SESSION BASIC YES
auto_failover.moonlight.com service_name
dwhdb2 dwhProdDB2
SYSTEM@dwhprodapp1 auto_failover>host ping -c 3 dwhProdDB1
SYSTEM@dwhprodapp1 auto_failover>host ssh root@dwhProdDB2 systemctl reboot
6 rows selected.
SYSTEM@dwhprodapp1 auto_failover>/
select FAILOVER_TYPE,FAILOVER_METHOD,FAILED_OVER from v$session where sid in (select distinct sid from v$mystat)
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 12773
Session ID: 547 Serial number: 8463
SYSTEM@dwhprodapp1 auto_failover>/
ERROR:
ORA-03114: not connected to ORACLE
as you can observe the session cannot failover when to dwhproddb1 when dwhproddb2 is down.
there is no doubt when I did a srvctl status service -db dwhdb -service "auto_failover,auto_failover_pre_2", the services are in dwhproddb1, so do you consider it a bug?
that's why I implement an alternative, which is to make it work
dwhdb =
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = rh73-12102-scan.moonlight.com)(PORT = 1521))
(CONNECT_DATA=
(SERVICE_NAME=auto_failover.moonlight.com)
(INSTANCE_NAME=dwhdb1)))
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = rh73-12102-scan.moonlight.com)(PORT = 1521))
(CONNECT_DATA=
(SERVICE_NAME=auto_failover.moonlight.com)
(INSTANCE_NAME=dwhdb2)))
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = rh73-12102-scan.moonlight.com)(PORT = 1521))
(CONNECT_DATA=
(SERVICE_NAME=auto_failover_pre_2.moonlight.com)
(INSTANCE_NAME=dwhdb2)))
(DESCRIPTION=
(ADDRESS=(PROTOCOL = TCP)(HOST = rh73-12102-scan.moonlight.com)(PORT = 1521))
(CONNECT_DATA=
(SERVICE_NAME=auto_failover_pre_2.moonlight.com)
(INSTANCE_NAME=dwhdb1)))
)
however i discover even my implementation run into problem when I stop listener in dwhproddb1, it has this error:
ORA-12521: TNS:listener does not currently know of instance requested in
connect descriptor
however it can connect successfully when I up listener in dwhproddb1 and down listener dwhproddb2
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sun May 04 00:44:44 CDT 2025
|