Home Database Mysql Tutorial Oracle 集群(RAC)的启动与关闭

Oracle 集群(RAC)的启动与关闭

Jun 07, 2016 pm 05:02 PM

Oracle RAC启动与关闭的时候需要注意以下几点:一、检查共享设备二、自动启动RAC并检查相关进程三、 手动启动RAC四、 在启动的过

Oracle RAC启动与关闭的时候需要注意以下几点:

一、检查共享设备
二、自动启动RAC并检查相关进程
三、 手动启动RAC
四、 在启动的过程中最好检测着crs、ASM和数据库的日志。

一、检查共享设备

一般情况下, 存放OCR 和 Voting Disk 的OCFS2 或者raw 都是自动启动的。 如果他们没有启动,RAC 肯定是启动不了的。 

1.1 如果使用ocfs2的,检查ocfs2 状态

/etc/init.d/o2cb status

在挂载之前,/etc/init.d/o2cb status 显示为Checking O2CB heartbeat: Not active。

在格式化和挂载文件系统之前,应验证 O2CB 在两个节点上均联机;O2CB 心跳当前没有

活动,因为文件系统还没有挂载 。挂载之后就会变成active。

mount -t ocfs2 -o datavolume /dev/sdb1 /u02/oradata/orcl 

1,2. 如果使用raw device.

[root@raw1 ~]# cd /dev/raw/

[root@raw1 raw]# ls

raw1  raw2

或者:

[root@raw1 init.d]# /etc/init.d/rawdevices status

/dev/raw/raw1:  bound to major 8, minor 17

/dev/raw/raw2:  bound to major 8, minor 18

 1.3. 检查ASM 

/etc/init.d/oracleasm listdisks 

二、自动启动RAC并检查相关进程

 RAC 在启动的时候crs 等进程都是自动启动的:

[root@rac1 init.d]# ls -l /etc/init.d/init.*

-r-xr-xr-x  1 root root  1951 Feb 26 22:38 /etc/init.d/init.crs

-r-xr-xr-x  1 root root  4714 Feb 26 22:38 /etc/init.d/init.crsd

-r-xr-xr-x  1 root root  35394 Feb 26 22:38 /etc/init.d/init.cssd

-r-xr-xr-x  1 root root  3190 Feb 26 22:38 /etc/init.d/init.evmd

我们要查看一下crs 的状态:

正常情况下,, 进程都是online的:

[root@raw1 bin]# ./crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora.raw.db      application    ONLINE    ONLINE    raw1

ora.raw.raw.cs   application    ONLINE    ONLINE    raw1

ora....aw1.srv   application    ONLINE    ONLINE    raw1

ora....aw2.srv   application    ONLINE    ONLINE    raw2

ora....w1.inst    application    ONLINE    ONLINE    raw1

ora....w2.inst    application    ONLINE    ONLINE    raw2

ora....SM1.asm  application    ONLINE    ONLINE    raw1

ora....W1.lsnr   application    ONLINE    ONLINE    raw1

ora.raw1.gsd    application    ONLINE    ONLINE    raw1

ora.raw1.ons    application    ONLINE    ONLINE    raw1

ora.raw1.vip    application    ONLINE    ONLINE    raw1

ora....SM2.asm  application    ONLINE    ONLINE    raw2

ora....W2.lsnr   application    ONLINE    ONLINE    raw2

ora.raw2.gsd   application    ONLINE    ONLINE    raw2

ora.raw2.ons   application    ONLINE    ONLINE    raw2

ora.raw2.vip   application    ONLINE    ONLINE    raw2

如果出现以下情况:

[root@rac2 bin]# ./crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora.rac.db     application    ONLINE    UNKNOWN   rac1

ora....orcl.cs   application    ONLINE    UNKNOWN   rac1

ora....ac1.srv   application    OFFLINE   OFFLINE

ora....ac2.srv   application    OFFLINE   OFFLINE

ora....c1.inst   application    ONLINE    UNKNOWN   rac1

ora....c2.inst   application    ONLINE    UNKNOWN   rac2

ora....SM1.asm application    ONLINE    ONLINE    rac1

ora....C1.lsnr   application    ONLINE    UNKNOWN   rac1

ora.rac1.gsd   application    ONLINE    UNKNOWN   rac1

ora.rac1.ons   application    ONLINE    ONLINE    rac1

ora.rac1.vip   application    ONLINE    ONLINE    rac1

ora....SM2.asm  application    ONLINE    ONLINE    rac2

ora....C2.lsnr   application    ONLINE    UNKNOWN   rac2

ora.rac2.gsd   application    ONLINE    UNKNOWN   rac2

ora.rac2.ons   application    ONLINE    ONLINE    rac2

ora.rac2.vip   application    ONLINE    ONLINE    rac2

 

解决方法:

1. 用crs_stat 查看进程全部信息:

[root@rac2 bin]# ./crs_stat

NAME=ora.rac.db

TYPE=application

TARGET=ONLINE

STATE=ONLINE on rac2

 

NAME=ora.rac1.LISTENER_RAC1.lsnr

TYPE=application

TARGET=ONLINE

STATE=UNKNOWN on rac1

 

NAME=ora.rac1.gsd

TYPE=application

TARGET=ONLINE

STATE=UNKNOWN on rac1

 

NAME=ora.rac2.LISTENER_RAC2.lsnr

TYPE=application

TARGET=ONLINE

STATE=UNKNOWN on rac2

... ...

2. 对于offline 的进程,我们可以直接手动的启动它

[root@rac2 bin]# ./crs_start ora.rac.orcl.rac1.srv

Attempting to start `ora.rac.orcl.rac1.srv` on member `rac1`

Start of `ora.rac.orcl.rac1.srv` on member `rac1` succeeded.、

3. 对于UNKNOWN 的进程,我们可以先stop 它, 在start。

[root@rac2 bin]# ./crs_stop ora.rac2.gsd

Attempting to stop `ora.rac2.gsd` on member `rac2`

Stop of `ora.rac2.gsd` on member `rac2` succeeded.

[root@rac2 bin]# ./crs_start ora.rac2.gsd

Attempting to start `ora.rac2.gsd` on member `rac2`

Start of `ora.rac2.gsd` on member `rac2` succeeded.

4. 如果crs_stop不能结束,crs_start 不能启动的进程,我们有2中方法来解决:

4.1)是用crs_stop -f  参数把crs中状态是UNKNOWN的服务关掉,然后再用crs_start -f (加一个-f的参数)启动所有的服务就可以。要分别在两个节点上执行;

[oracle@rac2 ~]$ crs_start -f ora.ora9i.ora9i2.inst

Attempting to start `ora.ora9i.ora9i2.inst` on member `rac2`

Start of `ora.ora9i.ora9i2.inst` on member `rac2` succeeded.

[oracle@rac2 ~]$ crs_stop -f ora.ora9i.db

Attempting to stop `ora.ora9i.db` on member `rac2`

Stop of `ora.ora9i.db` on member `rac2` succeeded.

4.2)转换到root用户下用/etc/init.d/init.crs stop先禁用crs,然后再用/etc/init.d/init.crs start去启用crs,启用crs后会自动启动crs的一系列服务,注意此种方法需要在两台节点上都执行;

5. 可以用命令一次启动和关闭相关进程

[root@rac2 bin]# ./crs_stop -all

[root@rac2 bin]# ./crs_start -all

三、 手动启动RAC

       一般情况下每次节点启动的时候,所有服务都会自动启动,如果需要关闭或者启动某个节点,如下所示

        停止RAC:

                emctl stop dbconsole

                srvctl stop instance -d raw -i raw1

                srvctl stop instance -d raw -i raw2

                srvctl stop asm -n raw1

                srvctl stop asm -n raw2

                srvctl stop nodeapps -n raw1

                srvctl stop nodeapps -n raw2

        启动RAC:     

                和上面的步骤正好相反即

                srvctl start nodeapps -n raw1

                srvctl start nodeapps -n raw2

                srvctl start asm -n raw1

                srvctl start asm -n raw2

                srvctl start instance -d raw -i raw2

                srvctl start instance -d orcl -i raw1

                emctl start dbconsole

使用 SRVCTL 启动/停止所有实例及其启用的服务。

srvctl start database -d orcl

srvctl stop database -d orcl

注:CRS Resource 包括GSD(Global Serveice Daemon),ONS(Oracle Notification Service),VIP, Database, Instance 和 Service. 这些资源被分成2类:

GSD,ONS,VIP 和 Listener 属于Noteapps类

Database,Instance 和Service 属于 Database-Related Resource 类。

四、在启动的过程中最好检测着crs、ASM和数据库的日志:

crs日志:

[oracle@rac1 ~]$ tail -f /u01/app/oracle/product/10.2.0/crs_1/log/rac1/alertrac1.log

[oracle@rac2 ~]$ tail -f /u01/app/oracle/product/10.2.0/crs_1/log/rac2/alertrac2.log

ASM日志:

[oracle@rac1 ~]$ tail -f /u01/app/oracle/admin/+ASM/bdump/alert_+ASM1.log

[oracle@rac2 ~]$ tail -f /u01/app/oracle/admin/+ASM/bdump/alert_+ASM2.log

数据库日志:

[oracle@rac1 ~]$ tail -f /u01/app/oracle/admin/ora9i/bdump/alert_ora9i1.log

[oracle@rac2 ~]$ tail -f /u01/app/oracle/admin/ora9i/bdump/alert_ora9i2.log

linux

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

How do you handle large datasets in MySQL? How do you handle large datasets in MySQL? Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Difference between clustered index and non-clustered index (secondary index) in InnoDB. Difference between clustered index and non-clustered index (secondary index) in InnoDB. Apr 02, 2025 pm 06:25 PM

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values ​​and pointers to data rows, and is suitable for non-primary key column queries.

See all articles