why my sessions are not disconnected after service rellocation [message #576269] |
Sat, 02 February 2013 03:36 |
|
piotrtal
Messages: 168 Registered: June 2011 Location: Poland/Czestochowa
|
Senior Member |
|
|
hi, one question
i have 2 nodes RAC with service piodbserv2 which is active only on 2nd node.
client is connected for (100% sure) to piodbserv2 on node2.
i am doing relocation of this service to node1 using -f (force) option:
[oracle@rac1 ~]$ srvctl relocate service -d piodb -s piodbserv2 -i piodb2 -t piodb1 -f
[oracle@rac1 ~]$ srvctl start service -d piodb -s piodbserv2 -i piodb1
PRKP-1064 : Service piodbserv2 is already running on instance piodb1.
[oracle@rac1 ~]$ srvctl start service -d piodb -s piodbserv2 -i piodb2
-f (force) option is described as this which forcibly rellocate users from one to another node simply disconnecting sessions from node2 in my example
but i am surprised because my session is still opened on node2 after piodbserv2 relocation
SQL> select sys_context('userenv','instance') from dual;
SYS_CONTEXT('USERENV','INSTANCE')
-------------------------------------------------------------
2
SQL> select sys_context('userenv','instance') from dual;
SYS_CONTEXT('USERENV','INSTANCE')
-------------------------------------------------------------
2
SQL> select instance_number from v$instance;
INSTANCE_NUMBER
---------------
2
SQL>
the question is: what i am doing wrong?
at this moment piodbserv2 is only on node2.
when i kill my user session and try connect again it will connect to node1.
but i suspected that after forcibly rellocated service, my sessions will be disconnected from node2 forcibly also.
it didn't happen.
|
|
|
Re: why my sessions are not disconnected after service rellocation [message #576270 is a reply to message #576269] |
Sat, 02 February 2013 03:43 |
|
piotrtal
Messages: 168 Registered: June 2011 Location: Poland/Czestochowa
|
Senior Member |
|
|
update:
sorry, my first session log was wrong. this is proper session log:
[oracle@rac1 ~]$ srvctl status service -d piodb
Service piodbserv2 is running on instance(s) piodb1, piodb2
[oracle@rac1 ~]$ srvctl stop service -d piodb -s piodbserv2 -i piodb1
[oracle@rac1 ~]$ srvctl status service -d piodb
Service piodbserv2 is running on instance(s) piodb2
[oracle@rac1 ~]$ srvctl relocate service -d piodb -s piodbserv2 -i piodb2 -t piodb1 -f
[oracle@rac1 ~]$ srvctl status service -d piodb
Service piodbserv2 is running on instance(s) piodb1
after stopping instance2 session is automatically reconnected to node1 and instance1, but i don't want shut down all instance. i just only want relocate service.
[Updated on: Sat, 02 February 2013 03:49] Report message to a moderator
|
|
|
|
|
|
Re: why my sessions are not disconnected after service rellocation [message #576277 is a reply to message #576275] |
Sat, 02 February 2013 04:46 |
|
piotrtal
Messages: 168 Registered: June 2011 Location: Poland/Czestochowa
|
Senior Member |
|
|
yep
my session again from the scratches:
check service presence:
[oracle@rac1 ~]$ srvctl status service -d piodb
Service piodbserv2 is running on instance(s) piodb2
connect to service:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select instance_number from v$instance;
INSTANCE_NUMBER
---------------
2
SQL> select service_name from v$session where sid=sys_context('userenv','sid');
SERVICE_NAME
----------------------------------------------------------------
piodbserv2
trying force rellocation of piodbserv2 from node2 to node1
[oracle@rac1 ~]$ srvctl relocate service -d piodb -s piodbserv2 -i piodb2 -t piodb1 -f
[oracle@rac1 ~]$ srvctl status service -d piodb
Service piodbserv2 is running on instance(s) piodb1
checking session by which i was connected to node2.piodbserv2 again
SQL> select instance_number from v$instance;
INSTANCE_NUMBER
---------------
2
and from now... (to prove that i am conneted to the proper instance i am trying to do failover, by shutting down instance from node2)
[oracle@rac1 ~]$ srvctl stop instance -d piodb -i piodb2
[oracle@rac1 ~]$ srvctl status instance -d piodb -i piodb1,piodb2
Instance piodb1 is running on node rac1
Instance piodb2 is not running on node rac2
and what says my session?
SQL> select instance_number from v$instance;
INSTANCE_NUMBER
---------------
1
... it failovered, but this behavior is obvious.
the thing which i don't understand is why after i did forcible disconnection users by relocating services from n2 to n1 my session still persisted?
[Updated on: Sat, 02 February 2013 04:48] Report message to a moderator
|
|
|
|