一、RAC启动关闭顺序
启动RAC顺序:
1 启动HA (建议两节点分别启动,重起机器第一次启动HA软件oracle会自动启动)
2 启动CRS (两节点都要执行)
3 启动instance 默认会跟着CRS一并启动,如果没有启动可以单独启动。
关闭RAC顺序:
1 关闭instance (详见第2节)
2 关闭CRS (两节点都要执行)
3 关闭HA软件 (如果没有必要可以不关闭HA)
二、启停instance (oracle用户执行)
注意:PSDSS/SGDC 的RAC存在两个instance (dcods , bietl),需要分别启停
2.1启动指定instance (三种方法)
(1) 启动DCODS实例 (包括两节点)
srvctl start database -d dcods
(2) 启动DCODS实例中的两个节点实例
srvctl start instance –d dcods –i dcods1
srvctl start instance –d dcods –i dcods2
(3) export ORACLE_SID=dcods1 (单节点)
sqlplus /nolog
conn / as sysdba
shutdown immediate
export ORACLE_SID=dcods2 (单节点)
sqlplus /nolog
conn / as sysdba
shutdown immediate
2.2停止指定instance
(1) 停止DCODS实例
srvctl stop database -d bietl
(2) 停止DCODS实例中的两个节点实例
srvctl stop instance –d dcods –i dcods1
srvctl stop instance –d dcods –i dcods2
(–d代表database –i代表每个节点的SID)
2.3启停Listener
(1) 启动listener
dcods实例
srvctl start listener -n dcods1
srvctl start listener -n dcods2
(2) 停止listener
dcods实例
srvctl stop listener -n dcods1
srvctl stop listener -n dcods2
2.3启停srv服务(一般会默认启动)
如果使用crs_stat -t查看发现.srv没有启动可以使用一下方法启动
启动关闭service
srvctl start service –d dcods (–s dcods)
srvctl stop service –d dcods (–s dcods)
三、启停CRS (ROOT用户执行)
3.1启动CRS (两节点分别都要执行)
AIX 系统 /etc/init.crs start
HP-UX系统 /sbin/init.d/init.crs start
Linux 系统 /etc/init.d/init.crs start
默认:CRS启动后会自动启动instance
等待3分钟左右
再用oracle用户登陆运行crs_stat –t命令查看实例是否启动
3.2停止CRS (两节点分别都要执行)
AIX 系统 /etc/init.crs stop
HP-UX系统 /sbin/init.d/init.crs stop
Linux 系统 /etc/init.d/init.crs stop
等待3分钟左右
ps -ef|grep crs
停止前会显示两个进程:init.csd 和 grep crs
四、启停HACMP (ROOT用户执行)
4.1启动HA
(1)smitty clstart
先选择启动的两个节点(dcods1+dcods2)
(2)选择需要启动的两个节点(按ESC+7 选择多节点)
(3)按回车确认启动的节点
如果选择错误可以取消
取消键是F3
列表键是F4
(4)检查VG是否挂载成功 (两节点都要执行)
4.2停止HA
首先执行smitty clstop
五、启停Service Guard (ROOT用户执行)
5.1 查看Service Guard状态
# cmviewcl
CLUSTER STATUS
cluster up
NODE STATUS STATE
sxjydb1 up running
PACKAGE STATUS STATE AUTO_RUN NODE
jydbpkg1 up running enabled sxjydb1
NODE STATUS STATE
sxjydb2 up running
PACKAGE STATUS STATE AUTO_RUN NODE
jydbpkg2 up running enabled sxjydb2
5.2 启动 Service Guard
(1)
sxjydb1# cmrunnode sxjydb1
sxjydb2# cmrunnode sxjydb2
cmrunnode: Validating network configuration...
cmrunnode: Network validation complete
cmrunnode: Validating cluster lock disk .... Done
Waiting for nodes to join ..... done
Cluster successfully formed.
Check the syslog files on all nodes in the cluster to verify that no warnings occurred during startup.
(如果是开机后第一次启动Service Guard,可以自动把oracle启动起来)
5.3 关闭Service Guard
sxjydb1# cmhaltnode -f sxjydb1
Disabling all packages from starting on nodes to be halted.
Warning: Do not modify or enable packages until the halt operation is completed.
Disabling automatic failover for failover packages to be halted.
Halting package jydbpkg1
Successfully halted package jydbpkg1
Waiting for nodes to halt .... done
Successfully halted all nodes specified.
Halt operation complete.
sxjydb2# cmviewcl
CLUSTER STATUS
cluster up
NODE STATUS STATE
sxjydb1 down halted
sxjydb2 up running
PACKAGE STATUS STATE AUTO_RUN NODE
jydbpkg2 up running enabled sxjydb2
UNOWNED_PACKAGES
PACKAGE STATUS STATE AUTO_RUN NODE
jydbpkg1 down halted enabled unowned
sxjydb2# cmhaltnode -f sxjydb2
5.4 Service Guard的package管理
停止package
cmhaltpkg jydbpkg1
cmhaltpkg jydbpkg2
启动package
# cmrunpkg
# cmrunpkg -n jydbpkg1
# cmrunpkg -n jydbpkg2
六、重起机器
6.1 AIX系统重起计算机
root用户:# cd /
# shutdown -Fr
关闭计算机
root用户:# cd /
# shutdown
6.2 HP-UX系统重起计算机
root用户:# cd /
# shutdown -ry 0
关闭计算机
root用户:# cd /
# shutdown
6.3 Linux系统
重启计算机 : reboot