oracle 11g rac启停

2024-01-22 12:58
文章标签 oracle rac 11g 启停

本文主要是介绍oracle 11g rac启停,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1.熟悉主要进程的启停顺序

1.1 启动节点rac1:

复制代码
 1 [root@rac1 bin]# ./crsctl start crs -excl
 2 CRS-4123: Oracle High Availability Services has been started.  --启动OHASD进程
 3 CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
 4 CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
 5 CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded             --启动ora.gipcd
 6 CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded             --启动ora.mdnsd
 7 CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
 8 CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded             --启动ora.gpnpd
 9 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
10 CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded       --启动ora.cssdmonitor
11 CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
12 CRS-2679: Attempting to clean 'ora.diskmon' on 'rac1'
13 CRS-2681: Clean of 'ora.diskmon' on 'rac1' succeeded           --清除ora.diskmon
14 CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
15 CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded           --启动ora.diskmon
16 CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded              --启动ora.cssd
17 CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
18 CRS-2672: Attempting to start 'ora.drivers.acfs' on 'rac1'
19 CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded             --启动ora.ctssd
20 CRS-2676: Start of 'ora.drivers.acfs' on 'rac1' succeeded      --启动ora.drivers.acfs
21 CRS-2672: Attempting to start 'ora.asm' on 'rac1'             
22 CRS-2676: Start of 'ora.asm' on 'rac1' succeeded               --启动ora.asm
23 CRS-2672: Attempting to start 'ora.crsd' on 'rac1'             
24 CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded              --启动ora.crsd
25 
26 观察节点rac2:                                                 --节点未启动,说明 crsctl start crs -excl 只启动单节点进程
27 [root@rac2 bin]# ps -ef|grep grid          
28 root      5823  4165  0 23:26 pts/1    00:00:00 grep grid
29 [root@rac2 bin]# 
复制代码

1.2 关闭节点rac1

复制代码
 1 [root@rac1 bin]# ./crsctl stop crs -f
 2 CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1' 
 3 CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'                                            
 4 CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded                               --关闭ora.crsd
 5 CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac1'                                      
 6 CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
 7 CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
 8 CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac1'
 9 CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
10 CRS-2677: Stop of 'ora.cssdmonitor' on 'rac1' succeeded                        --关闭ora.cssdmonitor         
11 CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded                              --关闭ora.mdnsd
12 CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded                              --关闭ora.ctssd
13 CRS-2677: Stop of 'ora.drivers.acfs' on 'rac1' succeeded                       --关闭ora.drivers.acfs
14 CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded                                --关闭ora.asm   
15 CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
16 CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded                               --关闭ora.cssd
17 CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
18 CRS-2673: Attempting to stop 'ora.diskmon' on 'rac1'
19 CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded                              --关闭ora.gpnpd
20 CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
21 CRS-2677: Stop of 'ora.diskmon' on 'rac1' succeeded                            --关闭ora.diskmon
22 CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded                              --关闭ora.gipcd
23 CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed --关闭OHASD进程
24 CRS-4133: Oracle High Availability Services has been stopped.
25 [root@rac1 bin]#
复制代码

  总结:重要进程的启动顺序为:OHASD -> ora.gpnpd -> ora.cssd -> ora.asm -> ora.crsd

2. 了解独占模式 -excl

  既然是以独占模式启动,那么有些资源一定是不能被其他节点共享的。出现抢占资源会出现什么情况

2.1 启动节点rac1:

复制代码
 1 [root@rac1 bin]# ./crsctl start crs -excl                   -- -excl表示以独占模式启动
 2 CRS-4123: Oracle High Availability Services has been started.
 3 CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
 4 CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
 5 CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
 6 CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded
 7 CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
 8 CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
 9 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
10 CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
11 CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
12 CRS-2679: Attempting to clean 'ora.diskmon' on 'rac1'
13 CRS-2681: Clean of 'ora.diskmon' on 'rac1' succeeded
14 CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
15 CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
16 CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
17 CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
18 CRS-2672: Attempting to start 'ora.drivers.acfs' on 'rac1'
19 CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
20 CRS-2676: Start of 'ora.drivers.acfs' on 'rac1' succeeded
21 CRS-2672: Attempting to start 'ora.asm' on 'rac1'
22 CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
23 CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
24 CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
25 [root@rac1 bin]#
复制代码

2.2 RAC1在独占模式下时,看看节点RAC2抢占资源时会发生什么:

复制代码
 1 [root@rac2 bin]# ./crsctl start crs -excl
 2 CRS-4123: Oracle High Availability Services has been started.
 3 CRS-2672: Attempting to start 'ora.gipcd' on 'rac2'
 4 CRS-2672: Attempting to start 'ora.mdnsd' on 'rac2'
 5 CRS-2676: Start of 'ora.gipcd' on 'rac2' succeeded
 6 CRS-2676: Start of 'ora.mdnsd' on 'rac2' succeeded
 7 CRS-2672: Attempting to start 'ora.gpnpd' on 'rac2'
 8 CRS-2676: Start of 'ora.gpnpd' on 'rac2' succeeded
 9 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac2'
10 CRS-2676: Start of 'ora.cssdmonitor' on 'rac2' succeeded
11 CRS-2672: Attempting to start 'ora.cssd' on 'rac2'
12 CRS-2679: Attempting to clean 'ora.diskmon' on 'rac2'
13 CRS-2681: Clean of 'ora.diskmon' on 'rac2' succeeded
14 CRS-2672: Attempting to start 'ora.diskmon' on 'rac2'
15 CRS-2676: Start of 'ora.diskmon' on 'rac2' succeeded
16 CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac1, number 1, and is terminating
17 CRS-2674: Start of 'ora.cssd' on 'rac2' failed
18 CRS-2679: Attempting to clean 'ora.cssd' on 'rac2'
19 CRS-2681: Clean of 'ora.cssd' on 'rac2' succeeded
20 CRS-2673: Attempting to stop 'ora.diskmon' on 'rac2'
21 CRS-2677: Stop of 'ora.diskmon' on 'rac2' succeeded
22 CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac2'
23 CRS-2677: Stop of 'ora.cssdmonitor' on 'rac2' succeeded
24 CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac2'
25 CRS-2677: Stop of 'ora.gpnpd' on 'rac2' succeeded
26 CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac2'
27 CRS-2677: Stop of 'ora.mdnsd' on 'rac2' succeeded
28 CRS-2673: Attempting to stop 'ora.gipcd' on 'rac2'
29 CRS-2677: Stop of 'ora.gipcd' on 'rac2' succeeded
30 CRS-4000: Command Start failed, or completed with errors.
31 [root@rac2 bin]# 
复制代码

  出现状况了(CRS-4402,CRS-2674),现在看看两个节点的的进程状况.

2.3 查看两个节点此时的进程状况

复制代码
 1 节点RAC1的进程状态:
 2 [root@rac1 bin]# ps -ef|grep grid
 3 root     16810     1  0 00:56 ?        00:00:01 /u01/grid/bin/ohasd.bin exclusive
 4 grid     16944     1  0 00:56 ?        00:00:00 /u01/grid/bin/oraagent.bin
 5 grid     16959     1  0 00:56 ?        00:00:00 /u01/grid/bin/gipcd.bin
 6 grid     16964     1  0 00:56 ?        00:00:00 /u01/grid/bin/mdnsd.bin
 7 grid     16983     1  0 00:56 ?        00:00:00 /u01/grid/bin/gpnpd.bin
 8 root     17020     1  0 00:56 ?        00:00:00 /u01/grid/bin/orarootagent.bin
 9 grid     17640     1  0 01:02 ?        00:00:00 /u01/grid/bin/diskmon.bin -d -f
10 root     17708 14498  0 01:06 pts/1    00:00:00 grep grid
11 [root@rac1 bin]#
12 
13 节点RAC2的进程状态:
14 [root@rac2 bin]# ps -ef|grep grid
15 root      8557     1  0 01:01 ?        00:00:01 /u01/grid/bin/ohasd.bin exclusive
16 root      8929  7581  0 01:08 pts/1    00:00:00 grep grid
17 [root@rac2 bin]#
复制代码

  哈哈,在争夺资源时RAC1,RAC2两败俱伤!独占模式一般用于数据库恢复,升级时。

      以非独占模式启动则是去掉 -excl:crsctl start crs

3. crsctl start crs与crsctl start cluster 区别

复制代码
 1 启动命令:crsctl start  cluster
 2 --[root@rac1 bin]# ./crsctl start  cluster
 3 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
 4 CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
 5 CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
 6 CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
 7 CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
 8 CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
 9 CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
10 CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
11 CRS-2672: Attempting to start 'ora.asm' on 'rac1'
12 CRS-2672: Attempting to start 'ora.evmd' on 'rac1'
13 CRS-2676: Start of 'ora.evmd' on 'rac1' succeeded
14 CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
15 CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
16 CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
17 [root@rac1 bin]#
复制代码

  crsctl start/stop cluster 命令只是控制Start CRS stack(ora.cssdmonitor,ora.cssd,ora.diskmon,ora.ctssd,ora.asm,ora.crsd)。

      使用命令 crsctl start/stop cluster 的前提是OHASD进程已经被启动

结论:crsctl start/stop crs  管理 CRS 包含进程 OHASD ;

   crsctl start/stop cluster 不包含OHASD进程,必须要先启动 OHASD 进程才可以使用

这篇关于oracle 11g rac启停的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/633040

相关文章

Oracle存储过程里操作BLOB的字节数据的办法

《Oracle存储过程里操作BLOB的字节数据的办法》该篇文章介绍了如何在Oracle存储过程中操作BLOB的字节数据,作者研究了如何获取BLOB的字节长度、如何使用DBMS_LOB包进行BLOB操作... 目录一、缘由二、办法2.1 基本操作2.2 DBMS_LOB包2.3 字节级操作与RAW数据类型2.

查看Oracle数据库中UNDO表空间的使用情况(最新推荐)

《查看Oracle数据库中UNDO表空间的使用情况(最新推荐)》Oracle数据库中查看UNDO表空间使用情况的4种方法:DBA_TABLESPACES和DBA_DATA_FILES提供基本信息,V$... 目录1. 通过 DBjavascriptA_TABLESPACES 和 DBA_DATA_FILES

Oracle登录时忘记用户名或密码该如何解决

《Oracle登录时忘记用户名或密码该如何解决》:本文主要介绍如何在Oracle12c中忘记用户名和密码时找回或重置用户账户信息,文中通过代码介绍的非常详细,对同样遇到这个问题的同学具有一定的参... 目录一、忘记账户:二、忘记密码:三、详细情况情况 1:1.1. 登录到数据库1.2. 查看当前用户信息1.

oracle DBMS_SQL.PARSE的使用方法和示例

《oracleDBMS_SQL.PARSE的使用方法和示例》DBMS_SQL是Oracle数据库中的一个强大包,用于动态构建和执行SQL语句,DBMS_SQL.PARSE过程解析SQL语句或PL/S... 目录语法示例注意事项DBMS_SQL 是 oracle 数据库中的一个强大包,它允许动态地构建和执行

PLsql Oracle 下载安装图文过程详解

《PLsqlOracle下载安装图文过程详解》PL/SQLDeveloper是一款用于开发Oracle数据库的集成开发环境,可以通过官网下载安装配置,并通过配置tnsnames.ora文件及环境变... 目录一、PL/SQL Developer 简介二、PL/SQL Developer 安装及配置详解1.下

oracle如何连接登陆SYS账号

《oracle如何连接登陆SYS账号》在Navicat12中连接Oracle11g的SYS用户时,如果设置了新密码但连接失败,可能是因为需要以SYSDBA或SYSOPER角色连接,解决方法是确保在连接... 目录oracle连接登陆NmOtMSYS账号工具问题解决SYS用户总结oracle连接登陆SYS账号

Oracle数据库如何切换登录用户(system和sys)

《Oracle数据库如何切换登录用户(system和sys)》文章介绍了如何使用SQL*Plus工具登录Oracle数据库的system用户,包括打开登录入口、输入用户名和口令、以及切换到sys用户的... 目录打开登录入口登录system用户总结打开登录入口win+R打开运行对话框,输php入:sqlp

查询Oracle数据库表是否被锁的实现方式

《查询Oracle数据库表是否被锁的实现方式》本文介绍了查询Oracle数据库表是否被锁的方法,包括查询锁表的会话、人员信息,根据object_id查询表名,以及根据会话ID查询和停止本地进程,同时,... 目录查询oracle数据库表是否被锁1、查询锁表的会话、人员等信息2、根据 object_id查询被

Oracle查询优化之高效实现仅查询前10条记录的方法与实践

《Oracle查询优化之高效实现仅查询前10条记录的方法与实践》:本文主要介绍Oracle查询优化之高效实现仅查询前10条记录的相关资料,包括使用ROWNUM、ROW_NUMBER()函数、FET... 目录1. 使用 ROWNUM 查询2. 使用 ROW_NUMBER() 函数3. 使用 FETCH FI

数据库oracle用户密码过期查询及解决方案

《数据库oracle用户密码过期查询及解决方案》:本文主要介绍如何处理ORACLE数据库用户密码过期和修改密码期限的问题,包括创建用户、赋予权限、修改密码、解锁用户和设置密码期限,文中通过代码介绍... 目录前言一、创建用户、赋予权限、修改密码、解锁用户和设置期限二、查询用户密码期限和过期后的修改1.查询用