1)、检查集群状态:
[grid@rac02 ~]$ crsctl check clusterITPUB个人空间"s8{ Y(\ YV-j
CRS-4537: Cluster Ready Services is onlineITPUB个人空间7`${E v9xvsv
CRS-4529: Cluster Synchronization Services is onlineITPUB个人空间&V*DMk"h h%@
CRS-4533: Event Manager is online
2)、所有 实例 —(状态):
M#vxUV:K-?"e-XM0  [grid@rac02 ~]$ srvctl status database -d racdbITPUB个人空间mrE hV8Q
Instance racdb1 is running on node rac01
1FH t+TJ{L:fE0  Instance racdb2 is running on node rac02
3)、检查单个实例状态:ITPUB个人空间;nxDN8jyv ]
[grid@rac02 ~]$ srvctl status instance -d racdb -i racdb1ITPUB个人空间$FY'I*e#y3G
Instance racdb1 is running on node rac01
4)、节点应用程序状态:ITPUB个人空间%x:yT?%Pz
[grid@rac02 ~]$  srvctl status nodeappsITPUB个人空间5w!t k%rWz z
VIP rac01-vip is enabled
!] v$vNCf5VE"MlX0  VIP rac01-vip is running on node: rac01ITPUB个人空间`!FmF VP#`Dy Xj0{
VIP rac02-vip is enabled
A ~8R&m%NJS;N0  VIP rac02-vip is running on node: rac02ITPUB个人空间Nb4i ng']
Network is enabledITPUB个人空间B8j:@bf4n1{
Network is running on node: rac01ITPUB个人空间C~Jw8RG-]8T
Network is running on node: rac02
Dq9D,r/ov2O*d2oo c,s0  GSD is disabled
)~m~7h:wtT&^0  GSD is not running on node: rac01
v~;h2]*WES0  GSD is not running on node: rac02
s*nJ_#e2i$x0  ONS is enabled
&[1bS{ w#u(Z0  ONS daemon is running on node: rac01ITPUB个人空间-K2V k7y;V&oN&?
ONS daemon is running on node: rac02ITPUB个人空间iw7}5o[D*Nvg%|q
eONS is enabledITPUB个人空间 g9N:ZK2yN
eONS daemon is running on node: rac01
7RDDxDK-d0  eONS daemon is running on node: rac02
5)、列出所有的配置数据库:ITPUB个人空间o+z3v-G(]~*l
[grid@rac02 ~]$ srvctl config database
O2h zEJ^0  racdb
6)、数据库配置:
+C5x.y+L#T(g| s {`8|0G0  [grid@rac02 ~]$ srvctl config database -d racdb -a
p f.eC8{2h0  Database unique name: racdbITPUB个人空间2i+K#l6d#BXI7p?
Database name: racdb
(D4Z^.si'F0  Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
v{zi\ ^)Ur0  Oracle user: oracleITPUB个人空间6A2zf\Cv9K'g
Spfile: +RACDB_DATA/racdb/spfileracdb.oraITPUB个人空间LEI/d B6k/lu3LV
Domain: xzxj.edu.cnITPUB个人空间n#Wd{} n/gi uQ
Start options: open
/C^/}Im8gv;zH0  Stop options: immediateITPUB个人空间*byT?7T,\B'g
Database role: PRIMARY
])w]!f*^{0  Management policy: AUTOMATICITPUB个人空间)G`p;pR
pools: racdb
A+L],s%J0  Database instances: racdb1,racdb2ITPUB个人空间(`X.Pc m%sW){ TP
Disk Groups: RACDB_DATA,FRAITPUB个人空间'p^&QM,^D8T
Services:ITPUB个人空间KR;kt(?5`*A
Database is enabledITPUB个人空间eb*z5dJ,@(u
Database is administrator managed
7)、ASM状态以及ASM配置:
[grid@rac02 ~]$ srvctl status asmITPUB个人空间f K_ |+p)X#dJ:{U
ASM is running on rac01,rac02ITPUB个人空间S!M7DNjhh0x{h!oS
[grid@rac02 ~]$ srvctl config asm -aITPUB个人空间8i GO%]#DJ0X*ll6_
ASM home: /u01/app/11.2.0/gridITPUB个人空间_4U8MQL] p.{G'Aq
ASM listener: LISTENER
Inf~b@ ga1]{0  ASM is enabled.
8)、TNS监听器状态以及配置:
NF9sw fE*b0  [grid@rac02 ~]$ srvctl status listener
Z@*}.U~-qE0  Listener LISTENER is enabled
6a,`}$l{ K T0  Listener LISTENER is running on node(s): rac01,rac02
` @;Uey0  [grid@rac02 ~]$ srvctl config listener -aITPUB个人空间3@rh]i1cE
Name: LISTENER
3Q@r3`uyd0  Network: 1, Owner: gridITPUB个人空间4fE*az4A/u#`|
Home: @+ez%ESB3p0  /u01/app/11.2.0/grid on node(s) rac02,rac01
v$MP;S%RN*D$Y0  End points: TCP:1521
9)、SCAN状态以及配置:
Qce4{ u0  [grid@rac02 ~]$ srvctl status scanITPUB个人空间Y-TN!|$T;oYIv
SCAN VIP scan1 is enabled
V5G'V5[*\q[0  SCAN VIP scan1 is running on node rac02
/Np8Lsi~%w0  [grid@rac02 ~]$ srvctl config scanITPUB个人空间oT4S#p0pj$nM*\$x
SCAN name: rac-scan.xzxj.edu.cn, Network: 1/192.168.1.0/255.255.255.0/eth0
-sA{bZ.U3U4yg0  SCAN VIP name: scan1, IP: /rac-scan.xzxj.edu.cn/192.168.1.55
10)、VIP各个节点的状态以及配置:ITPUB个人空间G1oeQd
[grid@rac02 ~]$ srvctl status vip -n rac01
XlP;nf+P%IZ;O0  VIP rac01-vip is enabled
.j:BB5bL0  VIP rac01-vip is running on node: rac01ITPUB个人空间!w kl"HG+z
[grid@rac02 ~]$ srvctl status vip -n rac02
)QD*Pu9T9jz*m0  VIP rac02-vip is enabled
n g,B.k,F0  VIP rac02-vip is running on node: rac02ITPUB个人空间+z2r&@R*oU
[grid@rac02 ~]$  srvctl config vip -n rac01ITPUB个人空间%{$E-u n2U8F3N4y
VIP exists.:rac01
`Yt"l/M1K8l$p0  VIP exists.: /rac01-vip/192.168.1.53/255.255.255.0/eth0
/S7l6]'bi`(nD*s!^(X0  [grid@rac02 ~]$  srvctl config vip -n rac02
3v U#T"sn(b1N0  VIP exists.:rac02
M/olA*Y%v3{AY%Zn)t0  VIP exists.: /rac02-vip/192.168.1.54/255.255.255.0/eth0
ITPUB个人空间W|8Y1QJ~fO~4U
11)、节点应用程序配置 —(VIP、GSD、ONS、监听器)
[grid@rac02 ~]$ srvctl config nodeapps -a -g -s -lITPUB个人空间$bPg's&z6|
-l option has been deprecated and will be ignored.
!i;x+V&WG;k0  VIP exists.:rac01ITPUB个人空间r!ioNr,Li^(O
VIP exists.: /rac01-vip/192.168.1.53/255.255.255.0/eth0ITPUB个人空间(E8W0^d,T!o!Mu n
VIP exists.:rac02
6C+T.X,jY0  VIP exists.: /rac02-vip/192.168.1.54/255.255.255.0/eth0
vG8x:[(DTA0  GSD exists.
"Pw/h1]S@;^kX}0  ONS daemon exists. Local port 6100, remote port 6200ITPUB个人空间)])z1d"G W
Name: LISTENER
*\F#h'hk#k0  Network: 1, Owner: grid
2Fr#NE/Q5dRed^0  Home: z%?.Tt[0  /u01/app/11.2.0/grid on node(s) rac02,rac01ITPUB个人空间j1S(\Nz,Jy
End points: TCP:1521
12)、验证所有集群节点间的时钟同步:
Qw`m$YQg*~4r0  [grid@rac02 ~]$ cluvfy comp clocksync -verbose
B6]yw,gG6x!i0  Verifying Clock Synchronization across the cluster nodes
7CJ&CPvZ5TlX0  Checking if Clusterware is installed on all nodes...
Qbv+DF*m0  Check of Clusterware install passedITPUB个人空间#fQ;A8E#lsv
Checking if CTSS Resource is running on all nodes...
U*B7}_{_0w4R{8C0  Check: CTSS Resource running on all nodesITPUB个人空间n_6s|2u@-M7I'D
Node Name                             StatusITPUB个人空间GM;}8TOC}8O
------------------------------------  ------------------------
:B`?i@HtZ4US0  rac02                                 passedITPUB个人空间U9j.utE3V
Result: CTSS resource check passed
?1t+HD9F*_0  Querying CTSS for time offset on all nodes...
ODC%Nj|S0  Result: Query of CTSS for time offset passed
(]\#d3RP'HD0Wr0  Check CTSS state started...
n|y'Yd*~i,r;A0  Check: CTSS state
IDsB,j)z#a5l(n*l0  Node Name                             StateITPUB个人空间!n@8M-H0TM|o
------------------------------------  ------------------------ITPUB个人空间-{L'YXy
rac02                                 Active
*iPq"x-w/D6g\#z| [0  CTSS is in Active state. Proceeding with check of clock time offsets on all nodes...ITPUB个人空间xmA9Mbd1G[2~0q%]0bY
Reference Time Offset Limit: 1000.0 msecs
7@wPZQb#P0  Check: Reference Time OffsetITPUB个人空间{~\OEe
Node Name     Time Offset               Status
] }R5`F0  ------------  ------------------------  ------------------------
O6u6Wa{ItYh0  rac02         0.0                       passed
2[eA0U(yBm0  Time offset is within the specified limits on the following set of nodes:
M"}\nb2pL3e!Eg0  "[rac02]"ITPUB个人空间P1Vt*O$C6H-r
Result: Check of clock time offsets passedITPUB个人空间o/sj"U7\(R@6KR
Oracle Cluster Time Synchronization Services check passed
kBKc [gV1dF0  Verification of Clock Synchronization across the cluster nodes was successful.
13)、集群中所有正在运行的实例 — ():
SELECT inst_id , instance_number inst_no , instance_name inst_name , parallel , status ,
database_status db_status , active_state state , host_name host FROM gv$instance ORDER BY inst_id;
14)、所有数据库文件及它们所在的 ASM 磁盘组 — (SQL):
15)、ASM 磁盘卷:
16)、启动和停止集群:
以下操作需用root用户执行。ITPUB个人空间7fR[7r$gp+y@5{
(1)、在本地上停止Oracle Clusterware 系统:ITPUB个人空间bL/\{o6fc
[root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster
]7`ye'Wm'r(f0 注:在运行“crsctl stop cluster”命令之后,如果 Oracle Clusterware 的ITPUB个人空间(M2~V _w
资源中有任何一个还在运行,则整个命令失败。使用 -f 选项无条件地停止所有资源并
Z Q9wngZlJR0停止 Oracle Clusterware 系统。
另请注意,可通过指定 -all 选项在集群中所有服务器上停止 Oracle ClusterwareITPUB个人空间%]%w]e c7a(q
系统。如下所示,在rac01和rac02上停止oracle clusterware系统:ITPUB个人空间6Yzq1F @!s&S'l6`b3^'H
[root@rac02 ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster –all
在本地服务器上启动oralce clusterware系统:ITPUB个人空间'}6}f1e5Vp@%kz(Y;~
[root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster
注:可通过指定 -all 选项在集群中所有服务器上启动 Oracle Clusterware 系统。
qisG#oq{*FQeu{0  [root@rac02 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster –all
`B*Z8S\T*EoD$|0  还可以通过列出服务器(各服务器之间以空格分隔)在集群中一个或多个指定的
$e"|n@!yWsl.KFu]"K0服务器上启动 Oracle Clusterware 系统:ITPUB个人空间I+~Jor
[root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster -n rac01 rac02
使用 SRVCTL 启动/停止所有实例:
!_:z;f#eRn)ng0  [oracle@rac01 ~]#srvctl stop database -d racdb
t4mu\4]0`/~0  [oracle@rac01 ~]#srvctl start database -d racdb
在沈阳项目中的命令集锦:---沈洲医院的项目管理ORACL11G RAC FOR LINUX  REDATA 5.5 安装数据库版本为:ORACLE11G RAC
Last login: Mon Nov  4 13:25:59 2013 from 192.168.21.252
[root@hisrac2 ~]# su - grid
[grid@hisrac2 ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[grid@hisrac2 ~]$ srvctl status database -d hisrac
实例 hisrac1 正在节点 hisrac1 上运行
实例 hisrac2 正在节点 hisrac2 上运行
[grid@hisrac2 ~]$ srvctl status instance -d hisrac -i hisrac1
实例 hisrac1 正在节点 hisrac1 上运行
[grid@hisrac2 ~]$ srvctl status instance -d hisrac -i hisrac2
实例 hisrac2 正在节点 hisrac2 上运行
[grid@hisrac2 ~]$ srvctl status nodeapps
VIP hisrac1-vip 已启用
VIP hisrac1-vip 正在节点上运行: hisrac1
VIP hisrac2-vip 已启用
VIP hisrac2-vip 正在节点上运行: hisrac2
网络已启用
网络正在节点上运行: hisrac1
网络正在节点上运行: hisrac2
GSD 已禁用
GSD 没有运行的节点: hisrac1
GSD 没有运行的节点: hisrac2
ONS 已启用
ONS 守护程序正在节点上运行:hisrac1
ONS 守护程序正在节点上运行:hisrac2
eONS 已启用
eONS 守护程序正在节点上运行:hisrac1
eONS 守护程序正在节点上运行:hisrac2
[grid@hisrac2 ~]$ srvctl config database
hisrac
[grid@hisrac2 ~]$ srvctl config database -d hisrac -a
数据库唯一名称: hisrac
数据库名: hisrac
Oracle 主目录: /u01/app/oracle/product/11.2.0/db_1
Oracle 用户: oracle
Spfile: +DATA/hisrac/spfilehisrac.ora
域:
启动选项: open
停止选项: immediate
数据库角色: PRIMARY
管理策略: AUTOMATIC
服务器池: hisrac
数据库实例: hisrac1,hisrac2
磁盘组: DATA,BACK
服务:
数据库已启用
数据库是管理员管理的
[grid@hisrac2 ~]$ srvctl status asm
ASM 正在 hisrac1,hisrac2 上运行
[grid@hisrac2 ~]$ srvctl status asm -a
ASM 正在 hisrac1,hisrac2 上运行
ASM 已启用。
[grid@hisrac2 ~]$ srvctl status listener
监听程序 LISTENER 已启用
监听程序 LISTENER 正在节点上运行: hisrac1,hisrac2
[grid@hisrac2 ~]$ srvctl config listener -a
名称: LISTENER
网络: 1, 所有者: grid
主目录: 节点 hisrac2,hisrac1 上的 /u01/app/11.2.0/grid
端点: TCP:1521
[grid@hisrac2 ~]$ srvctl status scan
SCAN VIP scan1 已启用
SCAN VIP scan1 正在节点 hisrac2 上运行
[grid@hisrac2 ~]$ cluvfy comp clocksync -verbose
验证 各集群节点上的时钟同步
正在检查是否在所有节点上安装了集群件...
集群件的安装检查通过
正在检查 CTSS 资源是否在所有节点上运行...
检查: CTSS 资源是否正在所有节点上运行
节点名                                   状态
------------------------------------  ------------------------
hisrac2                               通过
结果:CTSS 资源检查通过
正在查询所有节点上时间偏移量的 CTSS...
结果:时间偏移量的 CTSS 查询通过
检查 CTSS 状态已启动...
检查: CTSS 状态
节点名                                   状态
------------------------------------  ------------------------
hisrac2                               活动
CTSS 处于活动状态。正在继续检查所有节点上的时钟时间偏移量...
引用时间偏移量限制: 1000.0 毫秒
检查: 引用时间偏移量
节点名           时间偏移量                     状态
------------  ------------------------  ------------------------
hisrac2       0.0                       通过
以下节点集的时间偏移量在指定的限制之内:
"[hisrac2]"
结果:时钟时间偏移量检查通过
Oracle 集群时间同步服务检查已通过
各集群节点上的时钟同步 的验证成功。
[grid@hisrac2 ~]$
Last login: Mon Nov  4 13:25:59 2013 from 192.168.21.252
[root@hisrac2 ~]# su - grid
[grid@hisrac2 ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[grid@hisrac2 ~]$ srvctl status database -d hisrac
实例 hisrac1 正在节点 hisrac1 上运行
实例 hisrac2 正在节点 hisrac2 上运行
[grid@hisrac2 ~]$ srvctl status instance -d hisrac -i hisrac1
实例 hisrac1 正在节点 hisrac1 上运行
[grid@hisrac2 ~]$ srvctl status instance -d hisrac -i hisrac2
实例 hisrac2 正在节点 hisrac2 上运行
[grid@hisrac2 ~]$ srvctl status nodeapps
VIP hisrac1-vip 已启用
VIP hisrac1-vip 正在节点上运行: hisrac1
VIP hisrac2-vip 已启用
VIP hisrac2-vip 正在节点上运行: hisrac2
网络已启用
网络正在节点上运行: hisrac1
网络正在节点上运行: hisrac2
GSD 已禁用
GSD 没有运行的节点: hisrac1
GSD 没有运行的节点: hisrac2
ONS 已启用
ONS 守护程序正在节点上运行:hisrac1
ONS 守护程序正在节点上运行:hisrac2
eONS 已启用
eONS 守护程序正在节点上运行:hisrac1
eONS 守护程序正在节点上运行:hisrac2
[grid@hisrac2 ~]$ srvctl config database
hisrac
[grid@hisrac2 ~]$ srvctl config database -d hisrac -a
数据库唯一名称: hisrac
数据库名: hisrac
Oracle 主目录: /u01/app/oracle/product/11.2.0/db_1
Oracle 用户: oracle
Spfile: +DATA/hisrac/spfilehisrac.ora
域:
启动选项: open
停止选项: immediate
数据库角色: PRIMARY
管理策略: AUTOMATIC
服务器池: hisrac
数据库实例: hisrac1,hisrac2
磁盘组: DATA,BACK
服务:
数据库已启用
数据库是管理员管理的
[grid@hisrac2 ~]$ srvctl status asm
ASM 正在 hisrac1,hisrac2 上运行
[grid@hisrac2 ~]$ srvctl status asm -a
ASM 正在 hisrac1,hisrac2 上运行
ASM 已启用。
[grid@hisrac2 ~]$ srvctl status listener
监听程序 LISTENER 已启用
监听程序 LISTENER 正在节点上运行: hisrac1,hisrac2
[grid@hisrac2 ~]$ srvctl config listener -a
名称: LISTENER
网络: 1, 所有者: grid
主目录: 节点 hisrac2,hisrac1 上的 /u01/app/11.2.0/grid
端点: TCP:1521
[grid@hisrac2 ~]$ srvctl status scan
SCAN VIP scan1 已启用
SCAN VIP scan1 正在节点 hisrac2 上运行
[grid@hisrac2 ~]$ cluvfy comp clocksync -verbose
验证 各集群节点上的时钟同步
正在检查是否在所有节点上安装了集群件...
集群件的安装检查通过
正在检查 CTSS 资源是否在所有节点上运行...
检查: CTSS 资源是否正在所有节点上运行
节点名                                   状态
------------------------------------  ------------------------
hisrac2                               通过
结果:CTSS 资源检查通过
正在查询所有节点上时间偏移量的 CTSS...
结果:时间偏移量的 CTSS 查询通过
检查 CTSS 状态已启动...
检查: CTSS 状态
节点名                                   状态
------------------------------------  ------------------------
hisrac2                               活动
CTSS 处于活动状态。正在继续检查所有节点上的时钟时间偏移量...
引用时间偏移量限制: 1000.0 毫秒
检查: 引用时间偏移量
节点名           时间偏移量                     状态
------------  ------------------------  ------------------------
hisrac2       0.0                       通过
以下节点集的时间偏移量在指定的限制之内:
"[hisrac2]"
结果:时钟时间偏移量检查通过
Oracle 集群时间同步服务检查已通过
各集群节点上的时钟同步 的验证成功。
[grid@hisrac2 ~]$