控制 Oracle Restart(续)
如果使用 CRSCTL 实用程序来停止 Oracle Restart,则还将同时停止当前由 Oracle Restart 管理的所有组件。
$ crsctl stop has
CRS-4549: Stopping resources.
CRS-2673: Attempting to stop 'ora.diskmon' on 'host01'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'host01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'host01'
CRS-2677: Stop of 'ora.DATA.dg' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'host01'
CRS-2675: Stop of 'ora.diskmon' on 'host01' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'host01' succeeded
CRS-2677: Stop of 'ora.asm' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'host01'
CRS-2677: Stop of 'ora.cssd' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'host01'
CRS-2677: Stop of 'ora.diskmon' on 'host01' succeeded
CRS-4133: Oracle High Availability Services has been stopped.
在上例中,未安装 Oracle DB 软件。如果 Oracle DB 已在 Oracle Restart 中注册或已在使用 ASM,则 Oracle DB 也将被停止。
使用 CRSCTL 实用程序启动 Oracle Restart 时,不会在标准输出中显示每个被启动的组件。
$ crsctl start has
CRS-4123: Oracle High Availability Services has been started.
注:不支持直接调用包装脚本来启动 Oracle Grid Infrastructure 进程。
选择正确的 SRVCTL 实用程序
Oracle Restart 中包含了用于启动、停止和管理 Oracle Restart 组件的 SRVCTL 实用程序。在安装了 Oracle Grid Infrastructure 软件和 Oracle DB 软件后,在每个 ORACLE_HOME 位置都会存在 SRVCTL 实用程序的一个副本。您需要确定用于运行 SRVCTL 实用程序的正确 ORACLE_HOME 位置。管理 ASM 实例、ASM 磁盘组、Oracle Net 监听程序和 ONS 时,需要从 Oracle Grid Infrastructure 软件的主目录运行 SRVCTL 实用程序。管理 Oracle DB 实例时,需要从 Oracle DB 软件主目录运行 SRVCTL 实用程序。要确定 SRVCTL 实用程序的当前映射位置,请使用 which 命令,如下所示:
$ which srvctl
/u01/app/oracle/product/11.2.0/grid/bin/srvctl
注:以上关于 Oracle Net 监听程序的说明,假定先安装了 Oracle Grid Infrastructure,然后才安装了 Oracle DB 软件。如果在现有的 Oracle DB 安装中添加了 Oracle Restart,则可以从 Oracle DB 主目录运行 Oracle Net 监听程序。在这种情况下,您应该在 Oracle DB 主目录下使用 SRVCTL 实用程序管理 Oracle Net 监听程序。