Oracle10g RAC (OCFS2)开启关闭及日常检查

来源:互联网 发布:喜马拉雅山攀登 知乎 编辑:程序博客网 时间:2024/06/02 02:31

Oracle10g RAC (OCFS2)开启关闭及日常检查

 (2008-03-24 14:58:26)

转载

标签: 

it

开关机步骤:

 

1. 停止Oracle10g 环境

 

$ lsnrctl stop (停止监听)

 

$ emctl stop dbconsole (停止dbconsole)

 

$ shutdown immediate (停止实例)

 

$ srvctl stop nodeapps -n gnd-rac01 (停节点服务)

 

# /etc/init.d/init.crs stop (root 停cluster 软件)

 

2. 启动Oracle10g 环境

 

$ srvctl start nodeapps -n gnd-rac01 (启动一些服务)

 

$ startup (启动实例)

 

$ emctl start dbconsole (启动dbconsole)

 

$ lsnrctl start (启动监听)

 

平时的检查:

 

1. 平时查看instance 状态(所有节点) :

 

gnd-rac01</home/oracle>$srvctl statusdatabase -d tpc [注意:tpc 是db name]

 

Instance tpc1 is running on node gnd-rac01

 

Instance tpc2 is running on node gnd-rac02

 

2. 检查 crs(所有节点) :

 

gnd-rac01</>$cd /u01/product/crs/bin

 

gnd-rac01</u01/product/crs/bin>$ crs_stat-t

 

Name Type Target State Host

 

┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅

 

ora....01.lsnr application ONLINE ONLINEgnd-rac01

 

ora....c01.gsd application ONLINE ONLINEgnd-rac01

 

ora....c01.ons application ONLINE ONLINEgnd-rac01

 

ora....c01.vip application ONLINE ONLINEgnd-rac01

 

ora....02.lsnr application OFFLINE OFFLINE

 

ora....c02.gsd application ONLINE ONLINEgnd-rac02

 

ora....c02.ons application ONLINE ONLINEgnd-rac02

 

ora....c02.vip application ONLINE ONLINEgnd-rac02

 

ora.tpc.db application ONLINE ONLINE gnd-rac01

 

ora....c1.inst application ONLINE ONLINEgnd-rac01

 

ora....c2.inst application ONLINE ONLINEgnd-rac02

 

3. 检查VIP, GSD,ONS, Listener 等(所有节点)。

 

gnd-rac01</home/oracle>$srvctl statusnodeapps -n gnd-rac01

 

VIP is running on node: gnd-rac01

 

GSD is running on node: gnd-rac01

 

Listener is running on node: gnd-rac01

 

ONS daemon is running on node: gnd-rac01

gnd-rac01</home/oracle>$srvctl statusnodeapps -n gnd-rac02

 

VIP is running on node: gnd-rac02

 

GSD is running on node: gnd-rac02

 

Listener is not running on node: gnd-rac02

 

ONS daemon is running on node: gnd-rac02

4.检查Oracle Cluster 状态: CSS, CRS, EVM .

 

gnd-rac01</home/oracle>$crsctl check crs

 

CSS appears healthy

 

CRS appears healthy

 

EVM appears healthy

gnd-rac02</home/oracle>$crsctl check crs

 

CSS appears healthy

 

CRS appears healthy

 

EVM appears healthy

 

5.Ocfs 方面的问题可以到/etc/init.d/o2cb 这里看看。一般不用管理。

Oracle10g RAC 关闭及启动

情况1: 保养数据库及操作系统,服务器,需要关闭DB(所有实例),OS及Server 。

a. 首先停止Oracle10g 环境

 

$ lsnrctl stop (每个节点上停止监听,也可以用srvctl来操作)

 

$ emctl stop dbconsole (每个节点停止dbconsole)

 

$ srvctl stop database -d tpc (停止数据库所有实例)

 

$ srvctl stop nodeapps -n gnd-rac01 (停节点1服务)

 

$ srvctl stop nodeapps -n gnd-rac02 (停节点2服务)

 

# /etc/init.d/init.crs stop (root 停cluster 软件)

 

或者用 $ crs_stop -all

 

b. 然后# init 0 关闭服务器,或者如果重新启动#init 6

 

c. 关闭电源 。

 

d. 开启Server,开始开启Oracle10g数据库及服务等(如果OS重新启动,那么下面的所有服务是自动打开的【除了dbconsole】,不用手工执行了)。

 

$ srvctl start nodeapps -n gnd-rac01 (停节点1服务)

 

$ srvctl start nodeapps -n gnd-rac02 (停节点2服务)

 

# /etc/init.d/init.crs start (root 停cluster 软件)

 

或者用 $ crs_start -all

 

$ srvctl start database -d tpc (停止数据库所有实例)

 

$ lsnrctl start (每个节点上停止监听,也可以用srvctl来操作)

 

$ emctl start dbconsole (每个节点停止dbconsole)

注: srvctl 也可以用来关闭某个实例:srvctl stop instance -dorcl -i orcl2

 

srvctl 开启关闭监听器: srvctl stop listener -n orcl2

 

srvctl start listener -n orcl2

情况2: 调整数据库参数的时候,只关闭所有节点实例,不重新启动OS及Server 。

a.首先停止Oracle10g 环境

 

$ lsnrctl stop (在所有节点上停止监听,也可以用srvctl)

 

$ srvctl stop database -d tpc (停止数据库所有实例)

 

b. 然后开启所有实例及监听器。

 

$ srvctl start database -d tpc (开启数据库所有实例)

 

$ lsnrctl start (开启所有节点上监听,也可以用srvctl 开启监听)

情况3: 不关闭操作系统的情况下,由于问题点或调整某些服务而需要关闭然后开启某些服务程序等。

 

關閉某些服务的时候,由于涉及到RAC运行,所以也需要先关闭数据库实例,类似于第一种情况。

附Oracle10g RAC检查命令 :

 

----------------------------------------------

 

Oracle10g RAC数据库的 nodeapps 有 VIP, GSD, Listener,ONS .

$ srvctl status nodeapps –n dbrac1 (檢查VIP,GSD,ONS, Listener 等(所有節點))

 

VIP is running on node: dbrac1

 

GSD is not running on node: dbrac1

 

Listener is not running on node: dbrac1

 

ONS daemon is not running on node: dbrac1

gnd-rac01$crsctl check crs (檢查Oracle Cluster 狀態:CSS, CRS, EVM .)

 

CSS appears healthy

 

CRS appears healthy

 

EVM appears healthy

gnd-rac01$ crs_stat -t (全面檢查狀態 )

Name Type Target State Host

 

┅┅┅┅┅┅┅┅┅?br /> ora....01.lsnr applicationONLINE ONLINE gnd-rac01

 

ora....c01.gsd application ONLINE ONLINEgnd-rac01

 

ora....c01.ons application ONLINE ONLINEgnd-rac01

 

ora....c01.vip application ONLINE ONLINEgnd-rac01

 

ora....02.lsnr application OFFLINE OFFLINE

 

ora....c02.gsd application ONLINE ONLINEgnd-rac02

 

ora....c02.ons application ONLINE ONLINEgnd-rac02

 

ora....c02.vip application ONLINE ONLINEgnd-rac02

 

ora.tpc.db application ONLINE ONLINE gnd-rac01

 

ora....c1.inst application ONLINE ONLINEgnd-rac01

 

ora....c2.inst application ONLINE ONLINEgnd-rac02

 

来自 <http://blog.sina.com.cn/s/blog_43b6788101008q3g.html