1.创建services,优先连接racdb1,如果racdb1无法连接,则services指向racdb2.[oracle@racnode1 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Fri Jul 19 15:18:09 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
$su - oracle
$srvctl add service -d RACDB -s S_RAC1 -r racdb1 -a racdb2 -P BASIC -y AUTOMATIC -q true -j long -e SELECT -m BASIC -z 3 -w 5
$srvctl start service -d racdb -s s_rac1 -i racdb1
.......
.....
ora.oc4j
1 ONLINE ONLINE racnode1
ora.racdb.db
1 ONLINE ONLINE racnode1 Open
2 ONLINE ONLINE racnode2 Open
ora.racdb.s_rac1.svc
1 ONLINE ONLINE racnode1
ora.racnode1.vip
1 ONLINE ONLINE racnode1
ora.racnode2.vip
.........
services连接racdb1
连接s_rac1
C:\Users\user>sqlplus test/test@192.168.1.151:1521/s_rac1
SQL*Plus: Release 11.2.0.3.0 Production on 星期六 7月 20 15:35:51 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>
SQL> select inst_id,username,program from gv$session where username='TEST';
INST_ID USERNAME PROGRAM
---------- ---------- ----------
1 TEST sqlplus.exe
session test连接racdb1
停止racnode1集群
[root@racnode1 ~]# cd /u01/app/11.2.0/grid/bin
[root@racnode1 bin]# pwd
/u01/app/11.2.0/grid/bin
[root@racnode1 bin]# ./crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'racnode1'
CRS-2673: Attempting to stop 'ora.crsd' on 'racnode1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'racnode1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'racnode1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on 'racnode1'
CRS-2673: Attempting to stop 'ora.cvu' on 'racnode1'
CRS-2673: Attempting to stop 'ora.CRS.dg' on 'racnode1'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'racnode1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'racnode1'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'racnode1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'racnode1'
CRS-2673: Attempting to stop 'ora.oc4j' on 'racnode1'
CRS-2677: Stop of 'ora.DATA.dg' on 'racnode1' succeeded
CRS-2677: Stop of 'ora.cvu' on 'racnode1' succeeded
CRS-2672: Attempting to start 'ora.cvu' on 'racnode2'
CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.scan2.vip' on 'racnode1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.racnode1.vip' on 'racnode1'
CRS-2677: Stop of 'ora.scan2.vip' on 'racnode1' succeeded
CRS-2672: Attempting to start 'ora.scan2.vip' on 'racnode2'
CRS-2677: Stop of 'ora.racnode1.vip' on 'racnode1' succeeded
CRS-2672: Attempting to start 'ora.racnode1.vip' on 'racnode2'
CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.scan3.vip' on 'racnode1'
CRS-2677: Stop of 'ora.scan3.vip' on 'racnode1' succeeded
CRS-2672: Attempting to start 'ora.scan3.vip' on 'racnode2'
CRS-2676: Start of 'ora.cvu' on 'racnode2' succeeded
CRS-2677: Stop of 'ora.registry.acfs' on 'racnode1' succeeded
CRS-2676: Start of 'ora.scan2.vip' on 'racnode2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN2.lsnr' on 'racnode2'
CRS-2676: Start of 'ora.racnode1.vip' on 'racnode2' succeeded
CRS-2672: Attempting to start 'ora.racdb.s_rac1.svc' on 'racnode2'
CRS-2676: Start of 'ora.scan3.vip' on 'racnode2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN3.lsnr' on 'racnode2'
CRS-2676: Start of 'ora.racdb.s_rac1.svc' on 'racnode2' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN3.lsnr' on 'racnode2' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN2.lsnr' on 'racnode2' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'racnode1' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'racnode1' succeeded
CRS-2672: Attempting to start 'ora.oc4j' on 'racnode2'
CRS-2677: Stop of 'ora.CRS.dg' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'racnode1'
CRS-2677: Stop of 'ora.asm' on 'racnode1' succeeded
CRS-2676: Start of 'ora.oc4j' on 'racnode2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'racnode1'
CRS-2677: Stop of 'ora.ons' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'racnode1'
CRS-2677: Stop of 'ora.net1.network' on 'racnode1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'racnode1' has completed
CRS-2677: Stop of 'ora.crsd' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'racnode1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'racnode1'
CRS-2673: Attempting to stop 'ora.evmd' on 'racnode1'
CRS-2673: Attempting to stop 'ora.asm' on 'racnode1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'racnode1'
CRS-2677: Stop of 'ora.asm' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'racnode1'
CRS-2677: Stop of 'ora.evmd' on 'racnode1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'racnode1' succeeded
CRS-2677: Stop of 'ora.drivers.acfs' on 'racnode1' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'racnode1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'racnode1'
CRS-2677: Stop of 'ora.cssd' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'racnode1'
CRS-2673: Attempting to stop 'ora.diskmon' on 'racnode1'
CRS-2677: Stop of 'ora.diskmon' on 'racnode1' succeeded
CRS-2677: Stop of 'ora.crf' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'racnode1'
CRS-2677: Stop of 'ora.gipcd' on 'racnode1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'racnode1'
CRS-2677: Stop of 'ora.gpnpd' on 'racnode1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'racnode1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
.....
ora.oc4j
1 ONLINE ONLINE racnode2
ora.racdb.db
1 OFFLINE OFFLINE
2 ONLINE ONLINE racnode2 Open
ora.racdb.s_rac1.svc
1 ONLINE ONLINE racnode2
ora.racnode1.vip
1 ONLINE INTERMEDIATE racnode2 FAILED OVER
ora.racnode2.vip
1 ONLINE ONLINE racnode2
ora.scan1.vip
1 ONLINE ONLINE racnode2
........
服务资源s_rac1已经漂移到racnode2
SQL> select inst_id,username,program from gv$session where username='TEST';
INST_ID USERNAME
---------- ------------------------------------------------------------
PROGRAM
--------------------------------------------------------------------------------
2 TEST
sqlplus.exe
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21266384/viewspace-766772/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21266384/viewspace-766772/