was连接oracle rac集群,oracle 11g rac 集群操作命令

1)、检查集群状态:

[grid@rac02 ~]$ crsctl check cluster

CRS-4537: Cluster Ready Services is online

CRS-4529: Cluster Synchronization Services is online

CRS-4533: Event Manager is online

2)、所有 Oracle 实例 —(数据库状态):

[grid@rac02 ~]$ srvctl status database -d racdb

Instance racdb1 is running on node rac01

Instance racdb2 is running on node rac02

3)、检查单个实例状态:

[grid@rac02 ~]$ srvctl status instance -d racdb -i racdb1

Instance racdb1 is running on node rac01

4)、节点应用程序状态:

[grid@rac02 ~]$  srvctl status nodeapps

VIP rac01-vip is enabled

VIP rac01-vip is running on node: rac01

VIP rac02-vip is enabled

VIP rac02-vip is running on node: rac02

Network is enabled

Network is running on node: rac01

Network is running on node: rac02

GSD is disabled

GSD is not running on node: rac01

GSD is not running on node: rac02

ONS is enabled

ONS daemon is running on node: rac01

ONS daemon is running on node: rac02

eONS is enabled

eONS daemon is running on node: rac01

eONS daemon is running on node: rac02

5)、列出所有的配置数据库:

[grid@rac02 ~]$ srvctl config database

racdb

6)、数据库配置:

[grid@rac02 ~]$ srvctl config database -d racdb -a

Database unique name: racdb

Database name: racdb

Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1

Oracle user: oracle

Spfile: +RACDB_DATA/racdb/spfileracdb.ora

Domain: xzxj.edu.cn

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: racdb

Database instances: racdb1,racdb2

Disk Groups: RACDB_DATA,FRA

Services:

Database is enabled

Database is administrator managed

7)、ASM状态以及ASM配置:

[grid@rac02 ~]$ srvctl status asm

ASM is running on rac01,rac02

[grid@rac02 ~]$ srvctl config asm -a

ASM home: /u01/app/11.2.0/grid

ASM listener: LISTENER

ASM is enabled.

8)、TNS监听器状态以及配置:

[grid@rac02 ~]$ srvctl status listener

Listener LISTENER is enabled

Listener LISTENER is running on node(s): rac01,rac02

[grid@rac02 ~]$ srvctl config listener -a

Name: LISTENER

Network: 1, Owner: grid

Home:

/u01/app/11.2.0/grid on node(s) rac02,rac01

End points: TCP:1521

9)、SCAN状态以及配置:

[grid@rac02 ~]$ srvctl status scan

SCAN VIP scan1 is enabled

SCAN VIP scan1 is running on node rac02

[grid@rac02 ~]$ srvctl config scan

SCAN name: rac-scan.xzxj.edu.cn, Network: 1/192.168.1.0/255.255.255.0/eth0

SCAN VIP name: scan1, IP: /rac-scan.xzxj.edu.cn/192.168.1.55

10)、VIP各个节点的状态以及配置:

[grid@rac02 ~]$ srvctl status vip -n rac01

VIP rac01-vip is enabled

VIP rac01-vip is running on node: rac01

[grid@rac02 ~]$ srvctl status vip -n rac02

VIP rac02-vip is enabled

VIP rac02-vip is running on node: rac02

[grid@rac02 ~]$  srvctl config vip -n rac01

VIP exists.:rac01

VIP exists.: /rac01-vip/192.168.1.53/255.255.255.0/eth0

[grid@rac02 ~]$  srvctl config vip -n rac02

VIP exists.:rac02

VIP exists.: /rac02-vip/192.168.1.54/255.255.255.0/eth0

11)、节点应用程序配置 —(VIP、GSD、ONS、监听器)

[grid@rac02 ~]$ srvctl config nodeapps -a -g -s -l

-l option has been deprecated and will be ignored.

VIP exists.:rac01

VIP exists.: /rac01-vip/192.168.1.53/255.255.255.0/eth0

VIP exists.:rac02

VIP exists.: /rac02-vip/192.168.1.54/255.255.255.0/eth0

GSD exists.

ONS daemon exists. Local port 6100, remote port 6200

Name: LISTENER

Network: 1, Owner: grid

Home:

/u01/app/11.2.0/grid on node(s) rac02,rac01

End points: TCP:1521

12)、验证所有集群节点间的时钟同步:

[grid@rac02 ~]$ cluvfy comp clocksync -verbose

Verifying Clock Synchronization across the cluster nodes

Checking if Clusterware is installed on all nodes...

Check of Clusterware install passed

Checking if CTSS Resource is running on all nodes...

Check: CTSS Resource running on all nodes

Node Name                             Status

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

rac02                                 passed

Result: CTSS resource check passed

Querying CTSS for time offset on all nodes...

Result: Query of CTSS for time offset passed

Check CTSS state started...

Check: CTSS state

Node Name                             State

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

rac02                                 Active

CTSS is in Active state. Proceeding with check of clock time offsets on all nodes...

Reference Time Offset Limit: 1000.0 msecs

Check: Reference Time Offset

Node Name     Time Offset               Status

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

rac02         0.0                       passed

Time offset is within the specified limits on the following set of nodes:

"[rac02]"

Result: Check of clock time offsets passed

Oracle Cluster Time Synchronization Services check passed

Verification of Clock Synchronization across the cluster nodes was successful.

13)、集群中所有正在运行的实例 — (SQL):

SELECT inst_id , instance_number inst_no , instance_name inst_name , parallel , status ,

database_status db_status , active_state state , host_name host FROM gv$instance ORDER BY inst_id;

14)、所有数据库文件及它们所在的 ASM 磁盘组 — (SQL):

15)、ASM 磁盘卷:

16)、启动和停止集群:

以下操作需用root用户执行。

(1)、在本地服务器上停止Oracle Clusterware 系统:

[root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster

注:在运行“crsctl stop cluster”命令之后,如果 Oracle Clusterware 管理的

资源中有任何一个还在运行,则整个命令失败。使用 -f 选项无条件地停止所有资源并

停止 Oracle Clusterware 系统。

另请注意,可通过指定 -all 选项在集群中所有服务器上停止 Oracle Clusterware

系统。如下所示,在rac01和rac02上停止oracle clusterware系统:

[root@rac02 ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster –all

在本地服务器上启动oralce clusterware系统:

[root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster

注:可通过指定 -all 选项在集群中所有服务器上启动 Oracle Clusterware 系统。

[root@rac02 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster –all

还可以通过列出服务器(各服务器之间以空格分隔)在集群中一个或多个指定的

服务器上启动 Oracle Clusterware 系统:

[root@rac01 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster -n rac01 rac02

使用 SRVCTL 启动/停止所有实例:

[oracle@rac01 ~]#srvctl stop database -d racdb

[oracle@rac01 ~]#srvctl start database -d racdb

在沈阳项目中的命令集锦:---沈洲医院的项目管理ORACL11G RAC FOR LINUX  REDATA 5.5 安装数据库版本为:ORACLE11G RAC

Last login: Mon Nov  4 13:25:59 2013 from 192.168.21.252

[root@hisrac2 ~]# su - grid

[grid@hisrac2 ~]$ crsctl check cluster

CRS-4537: Cluster Ready Services is online

CRS-4529: Cluster Synchronization Services is online

CRS-4533: Event Manager is online

[grid@hisrac2 ~]$ srvctl status database -d hisrac

实例 hisrac1 正在节点 hisrac1 上运行

实例 hisrac2 正在节点 hisrac2 上运行

[grid@hisrac2 ~]$ srvctl status instance -d hisrac -i hisrac1

实例 hisrac1 正在节点 hisrac1 上运行

[grid@hisrac2 ~]$ srvctl status instance -d hisrac -i hisrac2

实例 hisrac2 正在节点 hisrac2 上运行

[grid@hisrac2 ~]$ srvctl status nodeapps

VIP hisrac1-vip 已启用

VIP hisrac1-vip 正在节点上运行: hisrac1

VIP hisrac2-vip 已启用

VIP hisrac2-vip 正在节点上运行: hisrac2

网络已启用

网络正在节点上运行: hisrac1

网络正在节点上运行: hisrac2

GSD 已禁用

GSD 没有运行的节点: hisrac1

GSD 没有运行的节点: hisrac2

ONS 已启用

ONS 守护程序正在节点上运行:hisrac1

ONS 守护程序正在节点上运行:hisrac2

eONS 已启用

eONS 守护程序正在节点上运行:hisrac1

eONS 守护程序正在节点上运行:hisrac2

[grid@hisrac2 ~]$ srvctl config database

hisrac

[grid@hisrac2 ~]$ srvctl config database -d hisrac -a

数据库唯一名称: hisrac

数据库名: hisrac

Oracle 主目录: /u01/app/oracle/product/11.2.0/db_1

Oracle 用户: oracle

Spfile: +DATA/hisrac/spfilehisrac.ora

域:

启动选项: open

停止选项: immediate

数据库角色: PRIMARY

管理策略: AUTOMATIC

服务器池: hisrac

数据库实例: hisrac1,hisrac2

磁盘组: DATA,BACK

服务:

数据库已启用

数据库是管理员管理的

[grid@hisrac2 ~]$ srvctl status asm

ASM 正在 hisrac1,hisrac2 上运行

[grid@hisrac2 ~]$ srvctl status asm -a

ASM 正在 hisrac1,hisrac2 上运行

ASM 已启用。

[grid@hisrac2 ~]$ srvctl status listener

监听程序 LISTENER 已启用

监听程序 LISTENER 正在节点上运行: hisrac1,hisrac2

[grid@hisrac2 ~]$ srvctl config listener -a

名称: LISTENER

网络: 1, 所有者: grid

主目录:

节点 hisrac2,hisrac1 上的 /u01/app/11.2.0/grid

端点: TCP:1521

[grid@hisrac2 ~]$ srvctl status scan

SCAN VIP scan1 已启用

SCAN VIP scan1 正在节点 hisrac2 上运行

[grid@hisrac2 ~]$ cluvfy comp clocksync -verbose

验证 各集群节点上的时钟同步

正在检查是否在所有节点上安装了集群件...

集群件的安装检查通过

正在检查 CTSS 资源是否在所有节点上运行...

检查: CTSS 资源是否正在所有节点上运行

节点名                                   状态

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

hisrac2                               通过

结果:CTSS 资源检查通过

正在查询所有节点上时间偏移量的 CTSS...

结果:时间偏移量的 CTSS 查询通过

检查 CTSS 状态已启动...

检查: CTSS 状态

节点名                                   状态

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

hisrac2                               活动

CTSS 处于活动状态。正在继续检查所有节点上的时钟时间偏移量...

引用时间偏移量限制: 1000.0 毫秒

检查: 引用时间偏移量

节点名           时间偏移量                     状态

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

hisrac2       0.0                       通过

以下节点集的时间偏移量在指定的限制之内:

"[hisrac2]"

结果:时钟时间偏移量检查通过

Oracle 集群时间同步服务检查已通过

各集群节点上的时钟同步 的验证成功。

[grid@hisrac2 ~]$

Last login: Mon Nov  4 13:25:59 2013 from 192.168.21.252

[root@hisrac2 ~]# su - grid

[grid@hisrac2 ~]$ crsctl check cluster

CRS-4537: Cluster Ready Services is online

CRS-4529: Cluster Synchronization Services is online

CRS-4533: Event Manager is online

[grid@hisrac2 ~]$ srvctl status database -d hisrac

实例 hisrac1 正在节点 hisrac1 上运行

实例 hisrac2 正在节点 hisrac2 上运行

[grid@hisrac2 ~]$ srvctl status instance -d hisrac -i hisrac1

实例 hisrac1 正在节点 hisrac1 上运行

[grid@hisrac2 ~]$ srvctl status instance -d hisrac -i hisrac2

实例 hisrac2 正在节点 hisrac2 上运行

[grid@hisrac2 ~]$ srvctl status nodeapps

VIP hisrac1-vip 已启用

VIP hisrac1-vip 正在节点上运行: hisrac1

VIP hisrac2-vip 已启用

VIP hisrac2-vip 正在节点上运行: hisrac2

网络已启用

网络正在节点上运行: hisrac1

网络正在节点上运行: hisrac2

GSD 已禁用

GSD 没有运行的节点: hisrac1

GSD 没有运行的节点: hisrac2

ONS 已启用

ONS 守护程序正在节点上运行:hisrac1

ONS 守护程序正在节点上运行:hisrac2

eONS 已启用

eONS 守护程序正在节点上运行:hisrac1

eONS 守护程序正在节点上运行:hisrac2

[grid@hisrac2 ~]$ srvctl config database

hisrac

[grid@hisrac2 ~]$ srvctl config database -d hisrac -a

数据库唯一名称: hisrac

数据库名: hisrac

Oracle 主目录: /u01/app/oracle/product/11.2.0/db_1

Oracle 用户: oracle

Spfile: +DATA/hisrac/spfilehisrac.ora

域:

启动选项: open

停止选项: immediate

数据库角色: PRIMARY

管理策略: AUTOMATIC

服务器池: hisrac

数据库实例: hisrac1,hisrac2

磁盘组: DATA,BACK

服务:

数据库已启用

数据库是管理员管理的

[grid@hisrac2 ~]$ srvctl status asm

ASM 正在 hisrac1,hisrac2 上运行

[grid@hisrac2 ~]$ srvctl status asm -a

ASM 正在 hisrac1,hisrac2 上运行

ASM 已启用。

[grid@hisrac2 ~]$ srvctl status listener

监听程序 LISTENER 已启用

监听程序 LISTENER 正在节点上运行: hisrac1,hisrac2

[grid@hisrac2 ~]$ srvctl config listener -a

名称: LISTENER

网络: 1, 所有者: grid

主目录:

节点 hisrac2,hisrac1 上的 /u01/app/11.2.0/grid

端点: TCP:1521

[grid@hisrac2 ~]$ srvctl status scan

SCAN VIP scan1 已启用

SCAN VIP scan1 正在节点 hisrac2 上运行

[grid@hisrac2 ~]$ cluvfy comp clocksync -verbose

验证 各集群节点上的时钟同步

正在检查是否在所有节点上安装了集群件...

集群件的安装检查通过

正在检查 CTSS 资源是否在所有节点上运行...

检查: CTSS 资源是否正在所有节点上运行

节点名                                   状态

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

hisrac2                               通过

结果:CTSS 资源检查通过

正在查询所有节点上时间偏移量的 CTSS...

结果:时间偏移量的 CTSS 查询通过

检查 CTSS 状态已启动...

检查: CTSS 状态

节点名                                   状态

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

hisrac2                               活动

CTSS 处于活动状态。正在继续检查所有节点上的时钟时间偏移量...

引用时间偏移量限制: 1000.0 毫秒

检查: 引用时间偏移量

节点名           时间偏移量                     状态

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

hisrac2       0.0                       通过

以下节点集的时间偏移量在指定的限制之内:

"[hisrac2]"

结果:时钟时间偏移量检查通过

Oracle 集群时间同步服务检查已通过

各集群节点上的时钟同步 的验证成功。

[grid@hisrac2 ~]$

转自 http://blog.itpub.net/235507/viewspace-775633/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值