Home > Database > Oracle > body text

How to close oracle rac

藏色散人
Release: 2021-12-29 15:12:14
Original
4472 people have browsed it

Methods to shut down oracle rac: 1. Stop the listening service of each node; 2. Shut down the database instance; 3. Shut down the ASM instance; 4. Use the crs_stat command to check whether the service status of the RAC node is normal; 5. Stop CRS cluster software is enough.

How to close oracle rac

The operating environment of this tutorial: Windows 7 system, Oracle 11g version, Dell G3 computer.

How to start and shut down Oracle RAC correctly?

If you want to shut down the Oracle cluster database system, the simple and crude way is to execute the OS command on the operating system: shutdown -h now;

This method is more violent and can shut down the database system. However, some Oracle services may not be shut down properly. After restarting the OS, many services will be in the UNKNOW state.

So how to shut down and start RAC correctly according to the Oracle working mechanism?

##RAC Reasonable order for shutdown: (Note: Exit all client connections, such as SQLplus...)

Stop listening on each node Service-->>Close database (instance)-->>Close ASM instance-->>Close node cluster service-->>Close server

1. Stop the monitoring service of each node

Check the listening status: ##

srvctl status listener -n node1
Copy after login

##Close listening:

[oracle@node1 ~]$ srvctl stop listener -n node1
[oracle@node2 ~]$ srvctl stop listener -n node2
Copy after login

You can use the above command to stop the corresponding monitoring on two nodes, or you can use the following command to execute on one node to stop All monitoring.

[oracle@node1 ~]$ srvctl stop listener
Copy after login

Check the listening status again:

2. Close the database instance

(1) View the database Instance name: select instance_name from v$instance;


For example, the database instance name found is: DEVDB

(2) Use the srvctl (service control) command to shut down the cluster services in sequence (note: exit the sqlplus client above, otherwise the database cannot be shut down normally)

A. Check the database instance status (executed under oracle user)


srvctl status database -d DEVDB (数据库实例名根据实际填写,并且区分大小写)
Copy after login

b Close the database instance:

srvctl stop database -d DEVDB
Copy after login

The above command can only be used in one You can execute it on the node, or you can execute the following commands separately on two nodes to achieve the same function.

srvctl stop instance -d DEVDB -i devdb1  (填写自实际的INSTANCE_NAME)
srvctl stop instance -d DEVDB -i devdb2
Copy after login

C Check the shutdown status: srvctl status database -d DEVDB

3.关闭ASM实例

查看ASM运行状态:srvctl status asm -n node1

停止ASM实例:

srvctl stop asm -n node1

4.关闭RAC(CRS)集群服务

(1)使用crs_stat 命令查询RAC节点的服务状态是否正常 (root或者grid用户)

crs_stat -t -v
Copy after login

(2)停止CRS集群服务

停止两个节点的服务:

srvctl stop nodeapps -n node1
srvctl stop nodeapps -n node2
Copy after login

****

(3)停止CRS集群软件

[root@node1 ~]# find / -name crsctl 

[root@node1 ~]# /u01/grid/11.2.0.4/bin/crsctl stop crs   (分别在两个节点的root用户下执行)

CRS-2791: 正在启动用于关闭 'rac1' 上 Oracle High Availability Services 管理的资源的操作
CRS-2673: 尝试停止 'ora.crsd' (在 'rac1' 上)
CRS-2790: 正在启动关闭 'rac1' 上集群就绪服务管理的资源的操作
CRS-2673: 尝试停止 'ora.asm' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.asm' (在 'rac1' 上)
CRS-2792: 关闭 'rac1' 上集群就绪服务管理的资源的操作已完成
CRS-2677: 成功停止 'ora.crsd' (在 'rac1' 上)
CRS-2673: 尝试停止 'ora.cssdmonitor' (在 'rac1' 上)
CRS-2673: 尝试停止 'ora.ctssd' (在 'rac1' 上)
CRS-2673: 尝试停止 'ora.evmd' (在 'rac1' 上)
CRS-2673: 尝试停止 'ora.asm' (在 'rac1' 上)
CRS-2673: 尝试停止 'ora.mdnsd' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.cssdmonitor' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.evmd' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.mdnsd' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.ctssd' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.asm' (在 'rac1' 上)
CRS-2673: 尝试停止 'ora.cssd' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.cssd' (在 'rac1' 上)
CRS-2673: 尝试停止 'ora.gpnpd' (在 'rac1' 上)
CRS-2673: 尝试停止 'ora.diskmon' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.gpnpd' (在 'rac1' 上)
CRS-2673: 尝试停止 'ora.gipcd' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.gipcd' (在 'rac1' 上)
CRS-2677: 成功停止 'ora.diskmon' (在 'rac1' 上)
CRS-2793: 关闭 'rac1' 上 Oracle High Availability Services 管理的资源的操作已完成
CRS-4133: Oracle High Availability Services has been stopped.
Copy after login

注意:停止数据库集群软件,在一个节点执行即可,在节点2就不用执行了。

(4)再次查看两个节点的CRS服务状态:

[grid@node1 ~]$ crs_stat -t -v 
CRS-0184: Cannot communicate with the CRS daemon. (服务已经关闭)
[grid@node2 ~]$ crs_stat -t -v
CRS-0184: Cannot communicate with the CRS daemon. (服务已经关闭)
Copy after login

当上述操作都执行完成,并且正常关闭后,就可以将服务器的关闭了。

================

启动的顺序和关闭相反

启动服务器-->>启动服务-->>启动ASM-->>启动实例-->>启动监听

这里我们需要注意;Oracle RAC集群软件有一个属性可以设置,就是当服务器操作系统重启后,集群服务是否会随着操作系统一块启动;上边启动的顺序步骤是在:当禁用该自启动属性的情况下的操作顺序;关于该属性的查看与设置,详见下一篇稳文章:关于集群自启动的查看

(1)首先启动服务器

(2)启动CRS软件:

[root@node1 ~]# find / -name crsctl 
[root@node1 ~]# /u01/grid/11.2.0.4/bin/crsctl start crs
Copy after login

查看服务:

srvctl status nodeapps -n node1
srvctl status nodeapps -n node2
crsctl status res – -t
Copy after login

(3)启动ASM

查看ASM状态

srvctl status asm -n node1
Copy after login

启动ASM

srvctl start asm -n node1
srvctl start asm -n node2
Copy after login

(4)启动实例

srvctl status database -d node1
srvctl start database -d node2
Copy after login

(5)启动监听

srvctl status listener   (RAC环境)
srvctl start listener  
或者 lsnrctl start
Copy after login

===============================

重启=关闭+启动

从上述各步可以看出,关闭和开启都是分步执行的,这样操作还有一个好处,可以帮助我们发现定位问题。

推荐教程:《Oracle使用教程

The above is the detailed content of How to close oracle rac. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!