Oracle HA 之 RAC one node实战
--创建rac one node步骤
安装grid软件,配置grid集群;
安装oracle软件;
dbca创建rac one node。
>试验创建的rac one node数据库信息如下:
global db name: dbkdb
sid: dbkdb
service name: dbk
安装节点: node1、node2
--检查数据库信息
>环境信息检查:
[grid@node1 ~]$ crsctl status res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
.........
ora.dbkdb.db
1 ONLINE ONLINE node2 Open
ora.dbkdb.dbk.svc
1 ONLINE ONLINE node2
ora.dbking.db
1 ONLINE ONLINE node1 Open
2 ONLINE ONLINE node2 Open
.........
ora.orcl.db
1 ONLINE ONLINE node1 Open
ora.orclasm.db
1 ONLINE ONLINE node1 Open
.........
[grid@node1 ~]$
可以看到,目前这个grid集群下包含节点node1和node2,有一套rac数据库dbking,两套单实例数据库orcl(普通存储),orclasm(asm存储),一套rac one node库dbkdb。
>确认dbkdb为rac one node数据库:
[grid@node1 ~]$ srvctl config database -d dbkdb
Database unique name: dbkdb
Database name: dbkdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +FLASH/dbkdb/spfiledbkdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: dbkdb
Database instances:
Disk Groups: FLASH
Mount point paths:
Services: dbk
Type: RACOneNode --确实为rac one node类型
Online relocation timeout: 30
Instance name prefix: dbkdb
Candidate servers: node2,node1
Database is administrator managed
>rac one node库当前运行情况:
[grid@node1 ~]$ srvctl status database -d dbkdb
Instance dbkdb_1 is running on node node2
Online relocation: INACTIVE
>数据库信息检查如下:
C:\Users\Administrator>sqlplus sys/oracle@192.168.100.23/dbk as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期四 8月 4 09:38:57 2016
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,
OLAP,
Data Mining and Real Application Testing options
SQL> set line 200;
SQL> set pagesize 999;
SQL> select instance_name,status from gv$instance;
INSTANCE_NAME STATUS
------------------------------------------------ ------------------------------------
dbkdb_1 OPEN
SQL> select name from v$datafile;
NAME
----------------------------------------------------------------------------------------------
+FLASH/dbkdb/datafile/system.261.918983553
+FLASH/dbkdb/datafile/sysaux.262.918983553
+FLASH/dbkdb/datafile/undotbs1.263.918983553
+FLASH/dbkdb/datafile/users.264.918983553
+FLASH/dbkdb/datafile/undotbs2.272.918983747
SQL> select member from v$logfile;
MEMBER
----------------------------------------------------------------------------------------------
+FLASH/dbkdb/onlinelog/group_2.269.918983647
+FLASH/dbkdb/onlinelog/group_2.270.918983649
+FLASH/dbkdb/onlinelog/group_1.267.918983645
+FLASH/dbkdb/onlinelog/group_1.268.918983645
+FLASH/dbkdb/onlinelog/group_3.273.918983845
+FLASH/dbkdb/onlinelog/group_3.274.918983847
+FLASH/dbkdb/onlinelog/group_4.275.918983847
+FLASH/dbkdb/onlinelog/group_4.276.918983849
8 rows selected.
SQL>
--rac one node在线飘移
>语法:srvctl relocate database -d <db_unique_name> {[-n <target node>] [-w <timeout>] | -a [-r]} [-v]
>将dbkdb从node2漂移到node1
检查当前dbkdb运行状态:
[oracle@node1 ~]$ srvctl status database -d dbkdb
Instance dbkdb_1 is running on node node2
Online relocation: INACTIVE
发起漂移命令(oracle用户执行):
###########################如果在grid用户下执行会报“权限不足”的错误#################################################
[grid@node2 ~]$ srvctl relocate database -d dbkdb -n node1 -w 5
PRCD-1222 : Online relocation of database "dbkdb" failed but database was restored to its original state
PRCR-1037 : Failed to update cardinality of the resource ora.dbkdb.db to 2
PRCR-1071 : Failed to register or update resource ora.dbkdb.db
CRS-0245: User doesn't have enough privilege to perform the operation
####################################################################################################################
[oracle@node2 ~]$ srvctl relocate database -d dbkdb -n node1 -w 5
检查中间状态:
[oracle@node2 ~]$ srvctl status database -d dbkdb
Instance dbkdb_1 is running on node node2
Online relocation: ACTIVE
Source instance: dbkdb_1 on node2
Destination instance: dbkdb_2 on node1
漂移完成后检查实例运行状态:以经运行在node1上了
[oracle@node2 ~]$ srvctl status database -d dbkdb
Instance dbkdb_2 is running on node node1
Online relocation: INACTIVE
--rac one node数据库的伸缩能力
>伸:将dbkdb扩展成为rac数据库:转换、add实例、启动实例
当前dbkdb信息:
[oracle@node2 ~]$ srvctl config database -d dbkdb
Database unique name: dbkdb
Database name: dbkdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +FLASH/dbkdb/spfiledbkdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: dbkdb
Database instances:
Disk Groups: FLASH
Mount point paths:
Services: dbk
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: dbkdb
Candidate servers: node2,node1
Database is administrator managed
发起转换命令:srvctl convert database
[oracle@node2 ~]$ srvctl convert database -d dbkdb -c rac
再次查看dbkdb信息:
[oracle@node2 ~]$ srvctl config database -d dbkdb
Database unique name: dbkdb
Database name: dbkdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +FLASH/dbkdb/spfiledbkdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: dbkdb
Database instances: dbkdb_1
Disk Groups: FLASH
Mount point paths:
Services: dbk
Type: RAC
Database is administrator managed
已经成功从rac one node转换为rac数据库,但是目前实例只有一个。
[oracle@node2 ~]$ srvctl status database -d dbkdb
Instance dbkdb_1 is running on node node2
添加实例:
[oracle@node2 ~]$ srvctl add instance -d dbkdb -i dbkdb_2 -n node1
查看dbkdb的配置信息:
[oracle@node2 ~]$ srvctl config database -d dbkdb
Database unique name: dbkdb
Database name: dbkdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +FLASH/dbkdb/spfiledbkdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: dbkdb
Database instances: dbkdb_2,dbkdb_1
Disk Groups: FLASH
Mount point paths:
Services: dbk
Type: RAC
Database is administrator managed
[oracle@node2 ~]$ srvctl status database -d dbkdb
Instance dbkdb_2 is not running on node node1
Instance dbkdb_1 is running on node node2
实例添加成功,但是实例目前处于关闭状态:
启动新实例:
[oracle@node2 ~]$ srvctl start instance -d dbkdb -i dbkdb_2
[oracle@node2 ~]$ srvctl status database -d dbkdb
Instance dbkdb_2 is running on node node1
Instance dbkdb_1 is running on node node2
可以看到目前,rac one node数据库已经成功转换为rac数据库了。
检查dbkdb这个rac数据库信息:回滚段和日志线程组
SQL> select tablespace_name,status from dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINE
UNDOTBS2 ONLINE
已选择6行。
SQL> select group#,thread#,status,members from v$log;
GROUP# THREAD# STATUS MEMBERS
---------- ---------- ---------------- ----------
1 1 CURRENT 2
2 1 INACTIVE 2
3 2 CURRENT 2
4 2 UNUSED 2
SQL>
>缩:将dbkdb转换为rac one node数据库:删除实例、转换
注意:
必须要有service;
删除rac数据库多余实例。
查看dbkdb的配置信息:
[grid@node1 ~]$ srvctl config database -d dbkdb
Database unique name: dbkdb
Database name: dbkdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +FLASH/dbkdb/spfiledbkdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: dbkdb
Database instances: dbkdb_2,dbkdb_1
Disk Groups: FLASH
Mount point paths:
Services: dbk
Type: RAC
Database is administrator managed
[grid@node1 ~]$ srvctl status database -d dbkdb
Instance dbkdb_2 is running on node node1
Instance dbkdb_1 is running on node node2
可以看到,这是一个包含2个实例的rac数据库。
dbca删除实例:图形化界面删除-略。silent模式如下:
dbca -silent -deleteinstance -gdbname dbkdb -instancename dbkdb_2 -sysdbausername sys -sysdbapassword oracle
删除实例后,检查配置信息:
[grid@node1 ~]$ srvctl config database -d dbkdb
Database unique name: dbkdb
Database name: dbkdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +FLASH/dbkdb/spfiledbkdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: dbkdb
Database instances: dbkdb_1
Disk Groups: FLASH
Mount point paths:
Services: dbk
Type: RAC
Database is administrator managed
[grid@node1 ~]$ srvctl status database -d dbkdb
Instance dbkdb_1 is running on node node2
检查数据库信息:
SQL> select group#,thread#,status,members from v$log;
GROUP# THREAD# STATUS MEMBERS
---------- ---------- ---------------- ----------
1 1 CURRENT 2
2 1 INACTIVE 2
SQL> select tablespace_name,status from dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINE
UNDOTBS2 ONLINE
已选择6行。
dbkdb_2实例相应的日志线程也同时被删除了,但是其对应的undo表空间还是处于online状态的。
现在dbkdb只剩下一个isntance,可以进行rac数据库向rac one node的转换了:执行转换之前必须保证数据库有service以及仅剩下一个instance
[oracle@node2 ~]$ srvctl convert database -d dbkdb -c raconenode -i dbkdb_1 -w 5
检查dbkdb状态:
[grid@node1 ~]$ srvctl config database -d dbkdb
Database unique name: dbkdb
Database name: dbkdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +FLASH/dbkdb/spfiledbkdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: dbkdb
Database instances:
Disk Groups: FLASH
Mount point paths:
Services: dbk
Type: RACOneNode
Online relocation timeout: 2
Instance name prefix: dbkdb
Candidate servers: node2
Database is administrator managed
Oracle HA 之 RAC one node实战的更多相关文章
- Oracle HA 之 SERVICE和DRM实战
第一部分:service实战 --oracle 11gR2中创建service的方法:db console和srvctl两种方法. --db console创建service方法-略 --srvctl ...
- 【总文档】rac增加新节点的方法步骤 How to Add Node/Instance or Remove Node/Instance in 10gR2, 11gR1, 11gR2 and 12c Oracle Clusterware and RAC
[总文档]How to Add Node/Instance or Remove Node/Instance in 10gR2, 11gR1, 11gR2 and 12c Oracle Clusterw ...
- 【Oracle 集群】ORACLE DATABASE 11G RAC 知识图文详细教程之集群概念介绍(一)
集群概念介绍(一)) 白宁超 2015年7月16日 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习 ...
- 【转】【Oracle 集群】ORACLE DATABASE 11G RAC 知识图文详细教程之缓存融合技术和主要后台进程(四)
原文地址:http://www.cnblogs.com/baiboy/p/orc4.html 阅读目录 目录 Cache Fusion 原理 什么是 Cache Fusion? 什么是高可用 FA ...
- 【转】【Oracle 集群】ORACLE DATABASE 11G RAC 知识图文详细教程之集群概念介绍(一)
原文地址:http://www.cnblogs.com/baiboy/p/orc1.html 阅读目录 目录 集群概念介绍 什么是集群 为什么搭建数据库集群 数据库集群的分类 可扩展的分布式数据库架构 ...
- [置顶] Oracle 11g R2 RAC:使用 srvctl 工具管理 service 资源
1.使用 srvctl 工具创建 service 资源 srvctl add service -d db_unique_name -s service_name {-r "preferred ...
- weblogic多池与oracle集群RAC
http://www.techpaste.com/2013/04/soa-infra-start-fails-weblogic-common-resourceexception-good-connec ...
- RAC One Node转换为RAC
1.查看状态 [oracle@rone1 ~]$ srvctl config database -d rone Database unique name: rone Database name: ro ...
- rac one node在线relocation
1.查看数据库运行状态 $ srvctl status database -d rone Instance rone_2 is running on node rone2 Online relocat ...
随机推荐
- e660. 用一组像素创建图像
This example demonstrates how to convert a byte array of pixel values that are indices to a color ta ...
- 转:Python操作SQLServer示例
注:此文也是转载,2018年1月发现此文阅读量过万,略感不安.当时只是为了自己存档学习,未粘此文的原始连接.如有侵权,通过即删除,敬请谅解! 从网上找的,估计原文是:Python操作SQLServer ...
- 关于对afx_msg的解释-----来源百度百科
1AFX前缀 Afx前缀是微软MFC一个小组的名称简写,并没有别的意义. MFC的很多代码,包括全局函数名.宏.头文件名都使用了"Afx". Afx*.h是一组MFC的核心头文件, ...
- chrome浏览器默认启动时打开2345导航的解决方法
2345并没有改动chrome内部设置.它仅仅是把全部的快捷方式改动了.包含開始菜单旁边的快捷启动图标. 仅仅须要右键chrome快捷方式.在目标一栏中,把"----chrome.exe&q ...
- write solid code 零散(原文)
整理下目录,看了这个文件,幸好未删除. 以下是<write solid code>中的原文摘录. 1.How could I have prevented this bug? 2.How ...
- 图像的降采样与升采样(二维插值)----转自LOFTER-gengjiwen
图像的降采样与升采样(二维插值) 1.先说说这两个词的概念: 降采样,即是采样点数减少.对于一幅N*M的图像来说,如果降采样系数为k,则即是在原图中 每行每列每隔k个点取一个点组成一幅图像.降采样很容 ...
- 阿里巴巴Java开发规约插件-体验
插件有哪些功能? 阿里技术公众号于今年的2月9日首次公布<阿里巴巴Java开发规约>,瞬间引起全民代码规范的热潮,上月底又发布了PDF的终极版,大家踊跃留言,期待配套的静态扫描工具开放出来 ...
- Tomcat之JSP运行原理之小试牛刀
最近空闲看了下JSP/Servlet,以前只知道用JSP,但是对其运行原理知之甚少,今在此做些笔记,以备查阅. 首先简要描述下其运行过程,然后结合Tomcat源码作简要分析. JSP运行过程: 第一步 ...
- Android Timer的应用示例
package com.hyzhou.timerdemo1; import java.util.Timer; import java.util.TimerTask; import android.os ...
- m2014-architecture-imgserver->利用Squid反向代理搭建CDN缓存服务器加快Web访问速度
案例:Web服务器:域名www.abc.com IP:192.168.21.129 电信单线路接入访问用户:电信宽带用户.移动宽带用户出现问题:电信用户打开www.abc.com正常,移动用户打开ww ...