--创建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实战的更多相关文章

  1. Oracle HA 之 SERVICE和DRM实战

    第一部分:service实战 --oracle 11gR2中创建service的方法:db console和srvctl两种方法. --db console创建service方法-略 --srvctl ...

  2. 【总文档】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 ...

  3. 【Oracle 集群】ORACLE DATABASE 11G RAC 知识图文详细教程之集群概念介绍(一)

    集群概念介绍(一)) 白宁超 2015年7月16日 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习 ...

  4. 【转】【Oracle 集群】ORACLE DATABASE 11G RAC 知识图文详细教程之缓存融合技术和主要后台进程(四)

    原文地址:http://www.cnblogs.com/baiboy/p/orc4.html   阅读目录 目录 Cache Fusion 原理 什么是 Cache Fusion? 什么是高可用 FA ...

  5. 【转】【Oracle 集群】ORACLE DATABASE 11G RAC 知识图文详细教程之集群概念介绍(一)

    原文地址:http://www.cnblogs.com/baiboy/p/orc1.html 阅读目录 目录 集群概念介绍 什么是集群 为什么搭建数据库集群 数据库集群的分类 可扩展的分布式数据库架构 ...

  6. [置顶] Oracle 11g R2 RAC:使用 srvctl 工具管理 service 资源

    1.使用 srvctl 工具创建 service 资源 srvctl add service -d db_unique_name -s service_name {-r "preferred ...

  7. weblogic多池与oracle集群RAC

    http://www.techpaste.com/2013/04/soa-infra-start-fails-weblogic-common-resourceexception-good-connec ...

  8. RAC One Node转换为RAC

    1.查看状态 [oracle@rone1 ~]$ srvctl config database -d rone Database unique name: rone Database name: ro ...

  9. rac one node在线relocation

    1.查看数据库运行状态 $ srvctl status database -d rone Instance rone_2 is running on node rone2 Online relocat ...

随机推荐

  1. (转)Tiny210v2( S5PV210 ) 平台下 FIMD 对应 的 framebuffer 驱动中,关于 video buffer 的理解

    原文:http://www.arm9home.net/read.php?tid-25938.html 管理提醒: 本帖被 xoom 执行加亮操作(2012-12-13) 如之前所说,一直想知道显示数据 ...

  2. C#获取并修改文件扩展名的方法

    本文实例讲述了C#获取并修改文件扩展名的方法.分享给大家供大家参考.具体分析如下: 这里使用C#编程的方法改变文件扩展名的文件,必须使用Path类. Path类用来解析文件系统路径的各个部分.静态方法 ...

  3. js 文件下载

    工程WebApi: 点击按钮执行的handler exportClick() { var profile = { content: this.state.profile, type: MappingT ...

  4. myeclipse配置Hadoop插件

    每个版本的 hadoop 都有相应版本的 MyEclipse 插件,官网并没有提供插件的jar包下载.在hadoop/src/contrib 目录下有一个 eclipse-plugin 项目,此项目就 ...

  5. Jquery实现上下移动和排序代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...

  6. 在WCF中实现双工通信

    双工(Duplex)模式的消息交换方式体现在消息交换过程中,参与的双方均可以向对方发送消息.基于双工MEP消息交换可以看成是多个基本模式下(比如请求-回复模式和单项模式)消息交换的组合.双工MEP又具 ...

  7. 第十六篇:初探IO复用

    前言 在之前的文章中,我具体实现了一个并发回射服务器并给它加载了僵尸子进程的自动清理信号机制.在正常情况下,它已经可以很好地工作了,但它能否合理应对一些特殊情况呢? 问题发现 先来看看当服务器的客户子 ...

  8. C文件流

    在Linux系统中,系统默认认为每个进程打开了3个文件,即每个进程默认可以操作3 个流,即标准输入了流(/dev/stdin),标准输出流(/dev/stdout),标准错误输出流(/dev/stde ...

  9. eclipse export runnable jar

    如果要导出可运行的JAR文件,需要选择Runnable Jar File. 方法/步骤     1. 选择要到处JAR文件的工程,右键选择“Export”:   2. 选择“Java-->Run ...

  10. Jquery checkbox选中问题

    checkbox中有.checked的写法,判断当前是否是选中状态,不过这种是针对[object HTMLInputElement]这种类型的,而对于[object Object]这种类型是不能使用的 ...