oracle 11g RAC 的基本操作(一)------启动与关闭
- 启动RAC
手工启动按照HAS, cluster, database的顺序启动,具体命令如下:
- 启动HAS(High Availability Services),必须以root用户
[root@orcl-1 ~]# crsctl start has
CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
报错原因是因为11g的一个bug,重新开一个窗口执行/bin/dd if=/var/tmp/.oracle/npohasd f=/dev/null bs=1024 count=1
[root@orcl-1 ~]# crsctl start has
CRS-4640: Oracle High Availability Services is already active
CRS-4000: Command Start failed, or completed with errors.
以上has启动命令需要在每个节点分别执行
- 启动集群(cluster)
[root@orcl-1 ~]# crsctl start cluster -all --所有节点同时启动
CRS-5702: Resource 'ora.evmd' is already running on 'orcl-1'
CRS-5702: Resource 'ora.crsd' is already running on 'orcl-1'
或者只启动指定节点的
[root@orcl-1 ~]# ./crsctl start cluster -n orcl1 orcl2 --两个节点同时启动
- 启动数据库(数据库名为orcl):
[root@orcl-1 ~]# srvctl start database -d orcl ---启动所有节点上的实例
PRCC-1014 : orcl was already running
或者每个节点登录数据库后再执行
SQL>startup
[root@orcl-1 ~]# srvctl status asm ---查看ASM状态
ASM is running on orcl-1,orcl-2
[root@orcl-1 ~]# crs_stat -t -v ---查看集群资源状态(oc4j、gsd默认服务是禁用的)
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.FRA.dg ora....up.type 0/5 0/ ONLINE ONLINE orcl-1
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE orcl-1
ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE orcl-1
ora.OCR.dg ora....up.type 0/5 0/ ONLINE ONLINE orcl-1
ora.RACDB.dg ora....up.type 0/5 0/ ONLINE ONLINE orcl-1
ora....DISK.dg ora....up.type 0/5 0/ ONLINE ONLINE orcl-1
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE orcl-1
ora.eons ora.eons.type 0/3 0/ ONLINE ONLINE orcl-1
ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
ora....network ora....rk.type 0/5 0/ ONLINE ONLINE orcl-1
ora.oc4j ora.oc4j.type 0/5 0/0 OFFLINE OFFLINE
ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE orcl-1
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE orcl-1
ora....-1.lsnr application 0/5 0/0 ONLINE ONLINE orcl-1
ora.orcl-1.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.orcl-1.ons application 0/3 0/0 ONLINE ONLINE orcl-1
ora.orcl-1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE orcl-1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE orcl-2
ora....-2.lsnr application 0/5 0/0 ONLINE ONLINE orcl-2
ora.orcl-2.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.orcl-2.ons application 0/3 0/0 ONLINE ONLINE orcl-2
ora.orcl-2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE orcl-2
ora.orcl.db ora....se.type 0/2 0/1 ONLINE ONLINE orcl-1
ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE orcl-1
[root@orcl-1 ~]# srvctl status database -d orcl ---检查数据库状态
Instance orcl1 is running on node orcl-1
Instance orcl2 is running on node orcl-2
[root@orcl-1 ~]# srvctl status nodeapps --- 检查节点状态
VIP orcl-1-vip is enabled
VIP orcl-1-vip is running on node: orcl-1
VIP orcl-2-vip is enabled
VIP orcl-2-vip is running on node: orcl-2
Network is enabled
Network is running on node: orcl-1
Network is running on node: orcl-2
GSD is disabled
GSD is not running on node: orcl-1
GSD is not running on node: orcl-2
ONS is enabled
ONS daemon is running on node: orcl-1
ONS daemon is running on node: orcl-2
eONS is enabled
eONS daemon is running on node: orcl-1
eONS daemon is running on node: orcl-2
votedisk检查(grid用户)
[root@orcl-1 ~]# crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 786f6bda41ff4fb8bf2b3e17fd7302c9 (/dev/asm-disk-mpathg) [OCR]
2. ONLINE 8b5315974e484f30bff0eb3f2dfaa443 (/dev/asm-disk-mpathh) [OCR]
3. ONLINE 394cd132329b4f39bf57dc8322e359c2 (/dev/asm-disk-mpathi) [OCR]
4. ONLINE 561d06ffcb3e4fe5bf2b896422a8b5cc (/dev/asm-disk-mpathj) [OCR]
Located 4 voting disk(s).
[grid@orcl-2 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2588
Available space (kbytes) : 259532
ID : 2021652580
Device/File Name : +OCR
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
关闭RAC
关闭数据库(oracle用户)
[oracle@orcl-2 ~]$ srvctl stop database -d orcl ---停止所有节点上的实例
[oracle@orcl-2 ~]$ srvctl status database -d orcl ---查看数据库实例状态
Instance orcl1 is not running on node orcl-1
Instance orcl2 is not running on node orcl-2
或者每个节点登录数据库后执行SQL>shutdown immediate
停止集群服务,必须以root用户
[root@orcl-1 ~]# crsctl stop cluster -all
CRS-2673: Attempting to stop 'ora.crsd' on 'orcl-2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'orcl-2'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'orcl-2'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'orcl-2'
CRS-2673: Attempting to stop 'ora.RACDB.dg' on 'orcl-2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'orcl-2'
CRS-2673: Attempting to stop 'ora.crsd' on 'orcl-1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'orcl-2' succeeded
CRS-2673: Attempting to stop 'ora.orcl-2.vip' on 'orcl-2'
CRS-2677: Stop of 'ora.orcl-2.vip' on 'orcl-2' succeeded
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'orcl-1'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'orcl-1'
CRS-2673: Attempting to stop 'ora.VOTING_DISK.dg' on 'orcl-1'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'orcl-1'
CRS-2673: Attempting to stop 'ora.RACDB.dg' on 'orcl-1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'orcl-1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'orcl-1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'orcl-1' succeeded
CRS-2673: Attempting to stop 'ora.orcl-1.vip' on 'orcl-1'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'orcl-1' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'orcl-1'
CRS-2677: Stop of 'ora.orcl-1.vip' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.scan1.vip' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'orcl-2' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'orcl-2' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.RACDB.dg' on 'orcl-2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'orcl-2'
CRS-2677: Stop of 'ora.VOTING_DISK.dg' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.asm' on 'orcl-2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'orcl-2'
CRS-2673: Attempting to stop 'ora.eons' on 'orcl-2'
CRS-2677: Stop of 'ora.RACDB.dg' on 'orcl-1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'orcl-1'
CRS-2677: Stop of 'ora.asm' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.ons' on 'orcl-2' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'orcl-2'
CRS-2677: Stop of 'ora.net1.network' on 'orcl-2' succeeded
CRS-2677: Stop of 'ora.eons' on 'orcl-2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'orcl-2' has completed
CRS-2673: Attempting to stop 'ora.ons' on 'orcl-1'
CRS-2673: Attempting to stop 'ora.eons' on 'orcl-1'
CRS-2677: Stop of 'ora.crsd' on 'orcl-2' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'orcl-2'
CRS-2673: Attempting to stop 'ora.ctssd' on 'orcl-2'
CRS-2673: Attempting to stop 'ora.evmd' on 'orcl-2'
CRS-2673: Attempting to stop 'ora.asm' on 'orcl-2'
CRS-2677: Stop of 'ora.cssdmonitor' on 'orcl-2' succeeded
CRS-2677: Stop of 'ora.ons' on 'orcl-1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'orcl-1'
CRS-2677: Stop of 'ora.net1.network' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'orcl-2' succeeded
CRS-2677: Stop of 'ora.eons' on 'orcl-1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'orcl-1' has completed
CRS-2677: Stop of 'ora.crsd' on 'orcl-1' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'orcl-1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'orcl-1'
CRS-2673: Attempting to stop 'ora.evmd' on 'orcl-1'
CRS-2673: Attempting to stop 'ora.asm' on 'orcl-1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.asm' on 'orcl-2' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'orcl-2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'orcl-2'
CRS-2677: Stop of 'ora.ctssd' on 'orcl-1' succeeded
CRS-2677: Stop of 'ora.cssd' on 'orcl-2' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'orcl-2'
CRS-2677: Stop of 'ora.asm' on 'orcl-1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'orcl-1'
CRS-2677: Stop of 'ora.cssd' on 'orcl-1' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'orcl-1'
CRS-2677: Stop of 'ora.diskmon' on 'orcl-2' succeeded
CRS-2677: Stop of 'ora.diskmon' on 'orcl-1' succeeded
或者每个节点分别执行
[root@orcl-1]# crsctl stop cluster ----停止本节点集群服务,
也可以指定停止节点:
[root@orcl-1]# ./crsctl stop cluster -n orcl1 orcl2
[root@orcl-1 ~]# crsctl config crs
CRS-4622: Oracle High Availability Services autostart is enabled. ---检查crs配置为是否自动启动
[root@orcl-1 ~]# crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled. ---禁止CRS系统重启而自动启动
[root@orcl-1 ~]# crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled. ---启用CRS系统重启而自动启动(每个节点分别执行)
oracle 11g RAC 的基本操作(一)------启动与关闭的更多相关文章
- Oracle 11gR2 RAC集群服务启动与关闭总结
引言:这写篇文章的出处是因为我的一名学生最近在公司搭建RAC集群,但对其启动与关闭的顺序和原理不是特别清晰,我在教学工作中也发现了很多学员对RAC知识了解甚少,因此我在这里就把RAC里面涉及到的最常用 ...
- Oracle 11g RAC停止和启动步骤
关闭前备份控制文件/参数文件: sqlplus / as sysdba alter database backup controlfile to '/home/oracle/control.ctl ...
- 【Oracle 集群】Oracle 11G RAC教程之集群安装(七)
Oracle 11G RAC集群安装(七) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总. ...
- Oracle 11g RAC环境下Private IP修改方法及异常处理
Oracle 11g RAC环境下Private IP修改方法及异常处理 Oracle 11g RAC环境下Private IP修改方法及异常处理 一. 修改方法 1. 确认所有节点CRS服务以启动 ...
- 安装Oracle 11g RAC R2 之Linux DNS 配置
Oracle 11g RAC 集群中引入了SCAN(Single Client Access Name)的概念,也就是指集群的单客户端访问名称.SCAN 这个特性为客户端提供了单一的主机名,用于访问集 ...
- Oracle 11g RAC oc4j/gsd Offline
Oracle 11g RAC中,发现oc4j以及gsd服务都处于offline状态,这是Oracle 11g RAC默认情形.即便如此,并不影响数据库的使用,因为 oc4j 是用于WLM 的一个资源, ...
- Oracle 11g RAC 环境下单实例非缺省监听及端口配置
如果在Oracle 11g RAC环境下使用dbca创建单实例数据库后,Oracle会自动将其注册到缺省的1521端口及监听器.大多数情况下我们使用的为非缺省监听器以及非缺省的监听端口.而且在Orac ...
- Oracle 11g RAC 修改各类IP地址
Oracle 11g RAC 修改各类IP地址 首先,我们都知道Oracle 11g RAC中的IP主要有:Public IP.VIP.SCAN VIP.Private IP这几种. 一般这类改IP地 ...
- [转帖]Oracle 11G RAC For Windows 2008 R2部署手册
Oracle 11G RAC For Windows 2008 R2部署手册(亲测,成功实施多次) https://www.cnblogs.com/yhfssp/p/7821593.html 总体规划 ...
随机推荐
- C# 多线程之Task(任务
1.简介 为什么MS要推出Task,而不推Thread和ThreadPool,以下是我的见解: (1).Thread的Api并不靠谱,甚至MS自己都不推荐,原因,它将整个Thread类都不开放给W ...
- jenkins深入学习
一.jenkins深入学习 一.jenkins项目配置 1.Jenkins Gitlab持续集成打包平台搭建 http://blog.csdn.net/zgzhaobo/article/details ...
- Azure架构(一):云计算基础
云计算的定义 云计算(英语:cloud computing),是一种基于互联网的计算方式,通过这种方式,共享的软硬件资源和信息可以按需求提供给使用各种计算终端(桌面电脑.笔记本电脑.平板电脑.手机等) ...
- spring IOC 分析及实现
什么是IOC Inversion of Control,控制反转,也成依赖倒置. 反转: 依赖对象的创建被反转,使用IOC之前,对象由自己创建,反转后,由IOC容器获取 IOC容器的工作: 负责创建, ...
- redis----------基本命令使用
1.查看全部缓存数据的key keys * 2.清空当前redis数据库缓存 flushdb (redis默认由16个库(0~15号). 且默认使用的是0号库.库之间的切换使用select命令例如: ...
- HTTP协议基础总结
1,HTTP协议协议的概念:协议就是指计算机网络中,两台计算机之间进行通讯所必须共同遵守的规定和规则.HTTP协议:超文本传输协议是一种通信协议,它允许将超文本标记语言(html)文档从web服务器传 ...
- mvc jquery ajax传递数组null问题
mvc jquery ajax传递数, areaIds是个int数组.后台action用list<int>接收.当我想传空值时,先用null传递,结果action收到的AreaIds竟然 ...
- oracle之数据恢复(delete误删)
ALTER TABLE TA_申请材料表 ENABLE row movement ; flashback table TA_申请材料表 to timestamp to_timestamp('2019- ...
- 文件下载后台报错IllegalStateException: getOutputStream() has already been called
java.lang.IllegalStateException: getOutputStream() has already been called <%@page language=" ...
- JVM内存回收机制——哪些内存需要被回收(JVM学习系列2)
上一篇文章中讨论了Java内存运行时的各个区域,其中程序计数器.虚拟机栈.本地方法栈随线程生灭,且创建时需要多少内存,基本上在译期间就决定的了,所以在内存回收时无需特殊的关注.而堆和方法区则不同,首先 ...