管理oracle 11g RAC 常用命令

 

上一篇 / 下一篇  2011-04-27 17:28:14

1)、检查集群状态:

  [grid@rac02 ~]$ crsctl check clusterITPUB个人空间"s8{ Y(\ Y V-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个人空间$F Y'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"Ml X0  VIP rac01-vip is running on node: rac01ITPUB个人空间`!Fm F 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:@b f4n1{
  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:wt T&^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
7RDD xD K-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{z i\ ^)Ur0  Oracle user: oracleITPUB个人空间6A2zf \Cv9K'g
  Spfile: +RACDB_DATA/racdb/spfileracdb.oraITPUB个人空间LEI/d B6k/lu3LV
  Domain: xzxj.edu.cnITPUB个人空间n#W d{} n/gi u Q
  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^&Q M,^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
In f~ 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`uy d0  Network: 1, Owner: gridITPUB个人空间4fE*az4A/u#`|
  Home:
@+ez%E SB3p0  /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
/Np8Ls i~%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个人空间 G1oeQ d
  [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'h k#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)、验证所有集群节点间的时钟同步:
Q w`m$YQg*~4r0  [grid@rac02 ~]$ cluvfy comp clocksync -verbose
B6] yw,g G6x!i0  Verifying Clock Synchronization across the cluster nodes
7C J&CPv Z5Tl X0  Checking if Clusterware is installed on all nodes...
Q bv+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{I tYh0  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个人空间b L/\ {o6fc
  [root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster


]7` ye'W m'r(f0 注:在运行“crsctl stop cluster”命令之后,如果 Oracle Clusterware的ITPUB个人空间(M2~V _w
资源中有任何一个还在运行,则整个命令失败。使用 -f 选项无条件地停止所有资源并
Z Q9wngZ lJ R0停止 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#o q{*FQeu{0  [root@rac02 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster –all
`B*Z8S\T*EoD$|0  还可以通过列出服务器(各服务器之间以空格分隔)在集群中一个或多个指定的
$e"|n @!yWsl.KF u]"K0服务器上启动 Oracle Clusterware 系统:ITPUB个人空间I+~J or
  [root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster -n rac01 rac02

  使用 SRVCTL 启动/停止所有实例:
!_:z;f#eRn)n g0  [oracle@rac01 ~]#srvctl stop database -d racdb
t4mu \4]0`/~0  [oracle@rac01 ~]#srvctl start database -d racdb

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25243263/viewspace-696475/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25243263/viewspace-696475/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值