Oracle的Clusterware起停可以通过crsctl [ start / stop ] crs来实现。其根本原理是通过ocr.loc文件找到OCR,通过OCR去启动依赖的服务。
发出stop crs命令:
bash-2.05# crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.在主机系统日志中会记录停止过程:
Mar 29 22:08:43 db210-rac1 genunix: [ID 809163 kern.info] NOTICE: oracle, uid 101: setuid execution not allowed, dev=550000003c
Mar 29 22:08:45 db210-rac1 last message repeated 1 time
Mar 29 22:08:46 db210-rac1 root: [ID 702911 user.error] Oracle clsomon shutdown successful.
Mar 29 22:08:46 db210-rac1 root: [ID 702911 user.error] Oracle clsomon shutdown successful.
Mar 29 22:08:46 db210-rac1 root: [ID 702911 user.error] Oracle CSS family monitor shutting down gracefully.
Mar 29 22:08:46 db210-rac1 root: [ID 702911 user.error] Oracle CSS family monitor shutting down gracefully.
Mar 29 22:08:47 db210-rac1 root: [ID 702911 user.error] Oracle CSSD graceful shutdown
Mar 29 22:08:47 db210-rac1 root: [ID 702911 user.error] Oracle CSSD graceful shutdown
Mar 29 22:08:47 db210-rac1 root: [ID 702911 user.error] Oprocd received graceful shutdown request. Shutting down.
Mar 29 22:08:47 db210-rac1 root: [ID 702911 user.error] Oprocd received graceful shutdown request. Shutting down.此时如果移动ocr.loc文件,则CRS必然无法启动:
bash-2.05# pwd
/var/opt/oracle
bash-2.05# ls
ocr.loc oprocd oraInst.loc oratab scls_scr
bash-2.05# mv ocr.loc ocr.loc.o
bash-2.05#
bash-2.05# crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly此时系统日志中会记录错误日志,提示依赖的资源无法启动:
Mar 29 22:10:17 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services waiting on dependencies. Diagnostics in /tmp/crsctl.12678.
Mar 29 22:10:17 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services waiting on dependencies. Diagnostics in /tmp/crsctl.12678.
Mar 29 22:10:17 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services waiting on dependencies. Diagnostics in /tmp/crsctl.12763.
Mar 29 22:10:17 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services waiting on dependencies. Diagnostics in /tmp/crsctl.12763.
Mar 29 22:10:18 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services waiting on dependencies. Diagnostics in /tmp/crsctl.12813.
Mar 29 22:10:18 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services waiting on dependencies. Diagnostics in /tmp/crsctl.12813.临时文件记录无法找到OCR文件:
bash-2.05# cat /tmp/crsctl.12813
Failure 33 in main OCR context initialization: PROC-33: Oracle Cluster Registry is not configured Operating System error [No such file or directory] [2]修正ocr.loc文件,则crs可以正常启动:
bash-2.05# ls
ocr.loc.o oprocd oraInst.loc oratab scls_scr
bash-2.05# mv ocr.loc.o ocr.loc
bash-2.05# crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly正常启动的系统日志信息如下:
Mar 29 22:13:19 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services completed waiting on dependencies.
Mar 29 22:13:19 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services completed waiting on dependencies.
Mar 29 22:13:20 db210-rac1 last message repeated 1 time
Mar 29 22:13:20 db210-rac1 root: [ID 702911 user.error] Running CRSD with TZ = PRC
Mar 29 22:13:20 db210-rac1 last message repeated 1 time
Mar 29 22:13:20 db210-rac1 root: [ID 702911 user.error] Running CRSD with TZ = PRC
Mar 29 22:13:20 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services completed waiting on dependencies.
Mar 29 22:13:20 db210-rac1 root: [ID 702911 user.error] Cluster Ready Services completed waiting on dependencies.
Mar 29 22:13:20 db210-rac1 root: [ID 702911 user.error] Oracle CSS Family monitor starting.
Mar 29 22:13:20 db210-rac1 root: [ID 702911 user.error] Oracle CSS Family monitor starting.
Mar 29 22:13:21 db210-rac1 root: [ID 702911 user.error] Oracle CSS restart. 0, 1
Mar 29 22:13:21 db210-rac1 root: [ID 702911 user.error] Oracle CSS restart. 0, 1