[11:34:11oracle@node1~]crs_stat-t
NameTypeTargetStateHost
------------------------------------------------------------
ora.dba.dbapplicationONLINEONLINEnode2
ora....l1.instapplicationONLINEONLINEnode1
ora....l2.instapplicationONLINEONLINEnode2
ora.dba.rac.csapplicationONLINEONLINEnode2
ora....ll1.srvapplicationONLINEONLINEnode1
ora....ll2.srvapplicationONLINEONLINEnode2
ora....SM1.asmapplicationONLINEONLINEnode1
ora....E1.lsnrapplicationONLINEONLINEnode1
ora.node1.gsdapplicationONLINEONLINEnode1
ora.node1.onsapplicationONLINEONLINEnode1
ora.node1.vipapplicationONLINEONLINEnode1
ora....SM2.asmapplicationONLINEONLINEnode2
ora....E2.lsnrapplicationONLINEONLINEnode2
ora.node2.gsdapplicationONLINEONLINEnode2
ora.node2.onsapplicationONLINEONLINEnode2
ora.node2.vipapplicationONLINEONLINEnode2
查看集群资源信息
[12:59:42oracle@node2~]srvctlconfigdatabase-ddba-a
node1null1/u01/app/oracle/product/10.2.0/db_1
node2null2/u01/app/oracle/product/10.2.0/db_1
DB_NAME:dba
ORACLE_HOME:/u01/app/oracle/product/10.2.0/db_1
SPFILE:+DATA/dba/spfilenull.ora
DOMAIN:wang.com
DB_ROLE:null
START_OPTIONS:null
POLICY:AUTOMATIC
ENABLEFLAG:DBENABLED
查看连接信息
[13:01:55oracle@node2~]srvctlconfigdatabase-ddba-t
Exampleclient-sideTNSentryforservicerac:
rac=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db_vip)(PORT=dedicated_port))(CONNECT_DATA=(SERVICE_NAME=rac.wang.com)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))))
Exampleclient-sideTNSentryforservicename:
name=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db_vip)(PORT=dedicated_port))(CONNECT_DATA=(SERVICE_NAME=name.wang.com)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))))
查看服务信息
[13:02:20oracle@node2~]srvctlconfigservice-ddba-a
racPREF:null2null1AVAIL:TAF:basic
namePREF:null2null1AVAIL:TAF:basic
[13:02:45oracle@node2~]srvctlconfigservice-ddba-srac
racPREF:null2null1AVAIL:
[13:03:01oracle@node2~]srvctlconfigservice-ddba-srac-a
racPREF:null2null1AVAIL:TAF:basic
查看ASM信息
[13:05:41oracle@node2~]srvctlconfigasm-nnode1
+ASM1/u01/app/oracle/product/10.2.0/db_1
[13:05:44oracle@node2~]
[13:05:53oracle@node2~]srvctlconfigasm-nnode2
+ASM2/u01/app/oracle/product/10.2.0/db_1
[13:05:56oracle@node2~]
查看监听信息
[13:05:57oracle@node2~]srvctlconfiglistener-nnode2
node2LISTENER_NODE2
[13:06:15oracle@node2~]
[13:06:16oracle@node2~]srvctlconfiglistener-nnode1
node1LISTENER_NODE1
查看数据库状态
[13:08:40oracle@node2~]srvctlstatusdatabase-ddba
Instancenull1isrunningonnodenode1
Instancenull2isrunningonnodenode2
[13:08:43oracle@node2~]srvctlstatusdatabase-ddba-v
Instancenull1isrunningonnodenode1withonlineservicesracname
Instancenull2isrunningonnodenode2withonlineservicesracname
查看监听状态
[13:09:27oracle@node2~]srvctlstatusinstance-ddba-inull1,null2
Instancenull1isrunningonnodenode1
Instancenull2isrunningonnodenode2
[13:09:40oracle@node2~]srvctlstatusinstance-ddba-inull1,null2-v
Instancenull1isrunningonnodenode1withonlineservicesracname
Instancenull2isrunningonnodenode2withonlineservicesracname
查看节点应用状态
[13:10:29oracle@node2~]srvctlstatusnodeapps-nnode1
VIPisrunningonnode:node1
GSDisrunningonnode:node1
Listenerisrunningonnode:node1
ONSdaemonisrunningonnode:node1
[13:11:44oracle@node2~]srvctlstatusnodeapps-nnode2
VIPisrunningonnode:node2
GSDisrunningonnode: node2
Listenerisrunningonnode:node2
ONSdaemonisrunningonnode:node2
查看节点ASM状态
[13:11:47oracle@node2~]srvctlstatusasm-nnode1
ASMinstance+ASM1isrunningonnodenode1.
[13:12:26oracle@node2~]srvctlstatusasm-nnode2
ASMinstance+ASM2isrunningonnodenode2.
测试TAF
设定服务TAF模式为BASIC
RAC=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=node2-vip)(PORT=1521))
(LOAD_BALANCE=yes)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=rac.wang.com)
(FAILOVER_MODE=
(TYPE=SELECT)
(METHOD=BASIC)
(RETRIES=180)
(DELAY=5)
)
)
)
查看集群状态
[11:55:50oracle@node2dbs]crs_stat-t
NameTypeTargetStateHost
------------------------------------------------------------
ora.dba.dbapplicationONLINEONLINEnode2
ora....name.csapplicationONLINEONLINEnode2
ora....ll1.srvapplicationONLINEONLINEnode1
ora....ll2.srvapplicationONLINEONLINEnode2
ora....l1.instapplicationONLINEONLINEnode1
ora....l2.instapplicationONLINEONLINEnode2
ora.dba.rac.csapplicationONLINEONLINEnode2
ora....ll1.srvapplicationONLINEONLINEnode1
ora....ll2.srvapplicationONLINEONLINEnode2
ora....SM1.asmapplicationONLINEONLINEnode1
ora....E1.lsnrapplicationONLINEONLINEnode1
ora.node1.gsdapplicationONLINEONLINEnode1
ora.node1.onsapplicationONLINEONLINEnode1
ora.node1.vipapplicationONLINEONLINEnode1
ora....SM2.asmapplicationONLINEONLINEnode2
ora....E2.lsnrapplicationONLINEONLINEnode2
ora.node2.gsdapplicationONLINEONLINEnode2
ora.node2.onsapplicationONLINEONLINEnode2
ora.node2.vipapplicationONLINEONLINEnode2
连接数据库进行长事务查询
[11:59:41oracle@node1~]sqlplussys/oracle@racassysdba
SQL*Plus:Release10.2.0.1.0-ProductiononThuMay2711:59:562010
Copyright(c)1982,2005,Oracle.Allrightsreserved.
Connectedto:
OracleDatabase10gEnterpriseEditionRelease10.2.0.1.0-64bitProduction
WiththePartitioning,RealApplicationClusters,OLAPandDataMiningoptions
SYS@NODE2:null2>showparameterservice_name
NAMETYPEVALUE
-----------------------------------------------------------------------------
service_namesstringdba.wang.com,rac,name
SYS@NODE2:null2>
SYS@NODE2:null2>showparameterdb_name;
NAMETYPEVALUE
-----------------------------------------------------------------------------
db_namestringdba
SYS@NODE2:null2>
SYS@NODE2:null2>showparameterinstance_name;
NAMETYPEVALUE
-----------------------------------------------------------------------------
instance_namestringnull2
SYS@NODE2:null2>select*fromdba_objects;
在事务执行过程中关闭当前所连接的实例
[12:00:47oracle@node2admin]srvctlstopinstance-inull2-ddba-oabort
可观察到该长事务中断若干秒后继续查询
2005-10-2221:50:512005-10-2221:51:002005-10-22:21:50:51VALIDNNN
观察集群状态
[oracle@node1~]$crs_stat-t
NameTypeTargetStateHost
------------------------------------------------------------
ora.dba.dbapplicationONLINEONLINEnode2