精华内容
下载资源
问答
  • DG RAC - 单点搭建

    2017-05-15 10:46:08
     (ADDRESS = (PROTOCOL = TCP)(HOST = racdg)(PORT = 1521))  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))  )  ) ADR_BASE_LISTENER = /u01/oracle 注意:SID_LIST_...
    1、调整强制归档:
    SQL> select force_logging from v$database;

    FOR
    ---
    NO


    2 RAC开启归档
    SQL> alter system set log_archive_dest_1='LOCATION=+DATA' scope=spfile sid='RACDB1';

    System altered.

    SQL> alter system set log_archive_dest_1='LOCATION=+DATA' scope=spfile sid='RACDB2';

    System altered.


    [root@rac1 ~]# /u01/gridhome/11g/bin/srvctl stop database -d RACDB

    SQL> conn / as sysdba
    Connected to an idle instance.
    SQL> 
    SQL> 
    SQL> startup mount 
    ORACLE instance started.

    Total System Global Area  634679296 bytes
    Fixed Size                  2255912 bytes
    Variable Size             490734552 bytes
    Database Buffers          138412032 bytes
    Redo Buffers                3276800 bytes
    Database mounted.
    SQL> alter database archivelog
      2  ;

    Database altered.

    SQL> alter database open;

    Database altered.

    SQL> 

    [root@rac1 ~]# /u01/gridhome/11g/bin/srvctl stop database -d RACDB
    [root@rac1 ~]# /u01/gridhome/11g/bin/srvctl start database -d RACDB  


    SQL> archive log list;
    Database log mode              Archive Mode
    Automatic archival             Enabled
    Archive destination            +DATA
    Oldest online log sequence     5
    Next log sequence to archive   6
    Current log sequence           6

    SQL> alter system switch logfile;

    System altered.

    SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

    System altered.

    SQL>

    [grid@rac1 ~]$ asmcmd
    ASMCMD> ls
    thread_1_seq_6.269.888078345
    thread_2_seq_2.268.888078005
    thread_2_seq_3.270.888078429
    ASMCMD> ls
    thread_1_seq_6.269.888078345
    thread_1_seq_7.272.888078581
    thread_2_seq_2.268.888078005
    thread_2_seq_3.270.888078429
    thread_2_seq_4.271.888078581





    3 配置主备库的监听,修改tnsnames.ora 和 listener.ora  文件

    [oracle@rac1 admin]$ vi tnsnames.ora

    RACDB =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = racscan)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = RACDB)
        )
      )

    RACDB1 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.71)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = RACDB)
        )
      )

    RACDB2 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.72)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = RACDB)
        )
      )


    RACDB_DG =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.56.66 )(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SID = RACDB)
        )
      )


    用net manager 工具,在备库创建一个监听。 也可以手动的在listener.ora 文件里添加如下内容:
    [oracle@racdg admin]$ vi listener.ora 

    # listener.ora Network Configuration File: /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora
    # Generated by Oracle configuration tools.


    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = /u01/oracle/product/11.2.0/db_1)
          (PROGRAM = extproc)
        )
       (SID_DESC =
          (SID_NAME = RACDB)
          (ORACLE_HOME = /u01/oracle/product/11.2.0/db_1)
        )
      )


    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = racdg)(PORT = 1521))
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
        )
      )

    ADR_BASE_LISTENER = /u01/oracle
    注意:SID_LIST_LISTENER 配置的是静态注册,如果没有该参数,而且Data Guard 启动顺序又不正确,那么在主库可能会报 PING[ARC1]: Heartbeat failed to connect to standby 'RACDB_DG'. Error is 12514. 错误,导致归档无法完成。


    4 在主库上创建备库的密码文件和控制文件,并将文件传到备库的相关位置

    [oracle@rac1 ~]$ cd /u01/oracle/11g/dbs/
    [oracle@rac1 dbs]$ scp orapwRACDB1 192.168.56.66:/u01/oracle/product/11.2.0/db_1/dbs
    备库修改口令文件名称
    [oracle@racdg ~]$ cd $ORACLE_HOME/dbs
    [oracle@racdg dbs]$ mv orapwRACDB1 orapwRACDB


    5 调整主库初始化参数:
    alter system set log_archive_config='DG_CONFIG=(RACDB,RACDB_DG)'; --db_unique_name
    alter system set log_archive_dest_1='location=+DATA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=RACDB';
    alter system set log_archive_dest_2='SERVICE=RACDB_DG LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=RACDB';
    #ASYNC为异步同步 SYNC同步
    alter system set standby_file_management=auto scope=both;
    alter system set fal_server=RACDB_DG scope=both;--备库链接字符串
    alter system set fal_client=RACDB scope=both;--主库链接字符串

    下面两个参数只能修改spfile,然后重启数据库:
    alter system set db_file_name_convert='+data/racdb/DATAFILE/','/u01/oracle/oradata/RACDB/' scope=spfile;
    alter system set log_file_name_convert='+data/racdb/ONLINELOG','/u01/oracle/oradata/RACDB/' scope=spfile;


    启动和关闭数据库:
    [root@rac1 ~]# /u01/gridhome/11g/bin/srvctl stop instance -d RACDB -i RACDB1,RACDB2
    [root@rac1 ~]# /u01/gridhome/11g/bin/srvctl start instance -d RACDB -i RACDB1,RACDB2


    6 备份主数据
    create pfile='/u01/oracle/rman_bak/init$ORACLE_SID.ora' from spfile;

    rman target /
    run {
    allocate channel c1 device type disk;
    allocate channel c2 device type disk;
    backup incremental level 0 format '/u01/oracle/rman_bak/inr0_%U.bak' tag 'full_bak_for_standby' database plus archivelog;
    release channel c1;
    release channel c2;
    }
    backup format '/u01/oracle/rman_bak/control01.ctl' current controlfile for standby;

    --拷贝备份到standby节点
    scp -rp /u01/oracle/rman_bak/ 192.168.56.72:/u01/oracle/

    7 修改参数文件:
    修改前:
    RACDB2.__db_cache_size=197132288
    RACDB1.__db_cache_size=201326592
    RACDB2.__java_pool_size=4194304
    RACDB1.__java_pool_size=4194304
    RACDB2.__large_pool_size=8388608
    RACDB1.__large_pool_size=8388608
    RACDB1.__oracle_base='/u01/oracle'#ORACLE_BASE set from environment
    RACDB2.__pga_aggregate_target=260046848
    RACDB1.__pga_aggregate_target=255852544
    RACDB2.__sga_target=377487360
    RACDB1.__sga_target=381681664
    RACDB2.__shared_io_pool_size=0
    RACDB1.__shared_io_pool_size=0
    RACDB2.__shared_pool_size=159383552
    RACDB1.__shared_pool_size=159383552
    RACDB2.__streams_pool_size=0
    RACDB1.__streams_pool_size=0
    *.audit_file_dest='/u01/oracle/admin/RACDB/adump'
    *.audit_trail='db'
    *.cluster_database=true
    *.compatible='11.2.0.4.0'
    *.control_files='+DATA/racdb/controlfile/current.260.887983445'
    *.db_block_size=8192
    *.db_create_file_dest='+DATA'
    *.db_domain=''
    *.db_file_name_convert='+data/racdb/DATAFILE','/u01/oracle/oradata/RACDB/'
    *.db_name='RACDB'
    *.diagnostic_dest='/u01/oracle'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=RACDBXDB)'
    *.fal_client='RACDB'
    *.fal_server='RACDB_DG'
    RACDB2.instance_number=2
    RACDB1.instance_number=1
    *.log_archive_config='DG_CONFIG=(RACDB,RACDB_DG)'
    RACDB1.log_archive_dest_1='LOCATION=+DATA'
    RACDB2.log_archive_dest_1='LOCATION=+DATA'
    *.log_archive_dest_1='location=+DATA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=RACDB'
    *.log_archive_dest_2='SERVICE=RACDB_DG LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=RACDB'
    *.log_file_name_convert='+data/racdb/ONLINELOG','/u01/oracle/oradata/RACDB/'
    *.memory_target=635437056
    *.open_cursors=300
    *.processes=150
    *.remote_listener='racscan:1521'
    *.remote_login_passwordfile='exclusive'
    *.standby_file_management='AUTO'
    RACDB2.thread=2
    RACDB1.thread=1
    RACDB2.undo_tablespace='UNDOTBS2'
    RACDB1.undo_tablespace='UNDOTBS1'
    修改后:
    *.__db_cache_size=201326592
    *.__java_pool_size=4194304
    *.__large_pool_size=8388608
    *.__oracle_base='/u01/oracle'#ORACLE_BASE set from environment
    *.__pga_aggregate_target=255852544
    *.__sga_target=381681664
    *.__shared_io_pool_size=0
    *.__shared_pool_size=159383552
    *.__streams_pool_size=0
    *.audit_file_dest='/u01/oracle/admin/RACDB/adump'
    *.audit_trail='db'
    #*.cluster_database=true
    *.compatible='11.2.0.4.0'
    *.control_files='/u01/oracle/oradata/RACDB/control01.ctl','/u01/oracle/oradata/RACDB/control02.ctl'
    *.db_block_size=8192
    *.db_create_file_dest='/u01/oracle/oradata/RACDB/'
    *.db_domain=''
    *.db_file_name_convert='+data/racdb/DATAFILE','/u01/oracle/oradata/RACDB/'
    *.db_name='RACDB'
    *.diagnostic_dest='/u01/oracle'
    *.dispatchers='(PROTOCOL=TCP) (SERVICE=RACDBXDB)'
    *.fal_client='RACDB_DG'
    *.fal_server='RACDB'
    #RACDB2.instance_number=2
    #RACDB1.instance_number=1
    *.log_archive_config='DG_CONFIG=(RACDB_DG,RACDB)'
    #RACDB1.log_archive_dest_1='LOCATION=+DATA'
    #RACDB2.log_archive_dest_1='LOCATION=+DATA'
    *.log_archive_dest_1='location=/u01/oracle/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=RACDB'
    *.log_archive_dest_2='SERVICE=RACDB LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=RACDB'
    *.log_file_name_convert='+data/racdb/ONLINELOG','/u01/oracle/oradata/RACDB/'
    *.memory_target=635437056
    *.open_cursors=300
    *.processes=150
    #*.remote_listener='racscan:1521'
    *.remote_login_passwordfile='exclusive'
    *.standby_file_management='AUTO'
    #RACDB2.thread=2
    #RACDB1.thread=1
    #RACDB2.undo_tablespace='UNDOTBS2'
    *.undo_tablespace='UNDOTBS1'


    8 恢复备库:
    启动到nomount
    SQL> startup pfile='/u01/oracle/rman_bak/initRACDB.ora' nomount;
    ORACLE instance started.

    Total System Global Area  634679296 bytes
    Fixed Size                  2255912 bytes
    Variable Size             427819992 bytes
    Database Buffers          201326592 bytes
    Redo Buffers                3276800 bytes
    SQL> 
    释放控制文件
    RMAN> restore controlfile from '/u01/oracle/rman_bak/control01.ctl';

    Starting restore at 25-AUG-15
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=20 device type=DISK

    channel ORA_DISK_1: restoring control file
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
    output file name=/u01/oracle/oradata/RACDB/control01.ctl
    output file name=/u01/oracle/oradata/RACDB/control02.ctl
    Finished restore at 25-AUG-15


    [oracle@racdg dbs]$ rman target sys/oracle@RACDB auxiliary /   

    Recovery Manager: Release 11.2.0.4.0 - Production on Tue Aug 25 12:21:04 2015

    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

    connected to target database: RACDB (DBID=885600213)
    connected to auxiliary database: RACDB (not mounted)

    RMAN> catalog start with '/u01/oracle/rman_bak';

    RMAN> duplicate target database for standby nofilenamecheck;

    9 启动备库到dg模式
    SQL> select name,database_role from gv$database;

    NAME      DATABASE_ROLE
    --------- --------------------------------
    RACDB     PHYSICAL STANDBY

    SQL> alter database recover managed standby database disconnect from session;

    Database altered.

    col name for a50
    select SEQUENCE#,first_time,next_time,APPLIED, THREAD# from v$archived_log order by  SEQUENCE#,THREAD#;

    10 主备库添加standby 日志组
    主库
    alter database add standby logfile thread 1 group 5 '+DATA' size 50m;
    alter database add standby logfile thread 1 group 6 '+DATA' size 50m;
    alter database add standby logfile thread 2 group 7 '+DATA' size 50m;
    alter database add standby logfile thread 2 group 8 '+DATA' size 50m;
    备库
    alter database add standby logfile thread 1 group 5 '/u01/oracle/oradata/RACDB/redo05.log' size 50m;
    alter database add standby logfile thread 1 group 6 '/u01/oracle/oradata/RACDB/redo06.log' size 50m;
    alter database add standby logfile thread 2 group 7 '/u01/oracle/oradata/RACDB/redo07.log' size 50m;
    alter database add standby logfile thread 2 group 8 '/u01/oracle/oradata/RACDB/redo08.log' size 50m;

    11 #检查主备状态
    主库:alter system switch logfile;alter system archive log current;
    备库:
    col name for a50
    select SEQUENCE#,first_time,next_time,APPLIED, THREAD# from v$archived_log order by  SEQUENCE#,THREAD#;
    SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM V$MANAGED_STANDBY;

    12 切换到adg
    SQL> alter database recover managed standby database cancel;

    Database altered.

    SQL> alter database open;

    Database altered.

    SQL> select open_mode from v$database;

    OPEN_MODE
    --------------------
    READ ONLY

    SQL> alter database recover managed standby database using current logfile disconnect;

    Database altered.

    SQL> select open_mode,database_role,db_unique_name from v$database;

    OPEN_MODE            DATABASE_ROLE    DB_UNIQUE_NAME
    -------------------- ---------------- ------------------------------
    READ ONLY WITH APPLY PHYSICAL STANDBY RACDB

    13检察主备库状态
    主库
    SQL> conn scott/tiger
    Connected.
    SQL> select * from tab;

    TNAME                          TABTYPE  CLUSTERID
    ------------------------------ ------- ----------
    BONUS                          TABLE
    DEPT                           TABLE
    EMP                            TABLE
    SALGRADE                       TABLE

    SQL> create table t as select * from emp;

    Table created.

    SQL> insert into t select * from t;

    14 rows created.

    SQL> commit;

    Commit complete.

    SQL> select * from tab;

    TNAME                          TABTYPE  CLUSTERID
    ------------------------------ ------- ----------
    BONUS                          TABLE
    DEPT                           TABLE
    EMP                            TABLE
    SALGRADE                       TABLE
    T   

    备库:
    SQL> select TABLE_NAME from dba_tables where owner='SCOTT';

    TABLE_NAME
    ------------------------------
    DEPT
    EMP
    SALGRADE
    T
    BONUS

    SQL> conn scott/tiger
    Connected.
    SQL> select count(*) from t;

      COUNT(*)
    ----------
            28

    SQL>


    --主备库
    rman target /
    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;



    来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28572479/viewspace-2139062/,如需转载,请注明出处,否则将追究法律责任。

    转载于:http://blog.itpub.net/28572479/viewspace-2139062/

    展开全文
  • dg rac to single

    千次阅读 2010-08-19 03:45:00
    三个步骤[1] pre-configuration1.1 备份primary数据库 and 归档日志。COPY到standby那个备机上。 backup archivelog all delete input;标记**这个步骤置后1.2 生成standby的控制文件:alter database create ...
    展开全文
  • HA DG RAC 三者的区别

    2010-03-15 14:29:00
    高可用性解决方案分为4种(DG AR RAC HA):一种是oracle提供的被用方法,Standby (=9i DataGuard)一种是AR (高级复制Advanced Replication,在以前版本叫快照snapshot)一种是oracle 并行服务器8i的OPS (9i RAC,Real ...

    高可用性解决方案分为4种(DG AR RAC HA):
    一种是 oracle提供的被用方法,Standby (=9i DataGuard)
    一种是AR (高级复制Advanced Replication,在以前版本叫快照snapshot)
    一种是oracle 并行服务器8i的OPS (9i RAC,Real Application Cluster)
    一种是第三方HA解决方案 (如Rose HA,故障切换时间是几分钟,也叫双机)

     

    各自应用的侧重点:
    HA 侧重于业务的自动接管,自动接管需要几分钟时间,且长期有一组Instance闲置,浪费资源,不能容灾。
    DG 侧重于容灾,独立存储,但两者数据不能做到实时同步。
    RAC侧重于负载均衡,但共享存储不能容灾。

     

    详细说明:
    HA 双机热备由两台计算机和一个共享存储设备构成,通过第三方软件(HA Rose等)实现切换,不需要做数据同步.

    DG Data Guard 是oracle的远程复制技术,由两个多两个以上的独立的数据库构成,他们各自有各自的存储,Oracle负责他们之间的切换和数据同步,它需要在异地有 一套独立的系统,两套硬件配置可以不同的系统,但是这两套系统的软件结构保持一致,包括软件的版本,目录存储结构,以及数据的同步(其实也不是实时同 的),这两套系统之间只要网络是通的就可以了,是一种异地容灾的解决方案。

    RAC 本地的高可用集群,RAC是多节点,每个节点一个INSTANCE,是保证应用的,只要有一个节点是正常运行的,就能连接到数据库,每个节点用来分担不同 或相同的应用,以解决运算效率低下、单节点故障这样的问题,它是几台硬件相同或不相同的服务器,加一个SAN(共享的存储区域)来构成的。

     

    各自的应用:
    如是业务不要求24x7.可以考虑用dg.一台机器用于生 成报表和查询..一台只用于一般的业务处理.dg主要用容灾.双机,RAC均是提供可用性,但他们实现的方法不同,数据库均放在共享设备上。
    双机 同一时刻只能有一台主机接管,另一台待用,这种方式只能保护实例,不能保护db,而且备机长期处于闲置,对资源是一种极大的浪费!

    展开全文
  • DG】主rac + 备rac dg 部署_blog版.pdf【DG】主rac + 备rac dg 部署_blog版.pdf
  • 这里配置的过程中需要注意的一项是多看看rac1和rac2以及dg的告警日志会对配置过程有更深刻的理解。。。配置oracle racdg环境说白了首先将主库的数据恢复到从库上,然后在主从库上配置一些DG需要用到的参数   ...

    本文文档结构:

    这里配置的过程中需要注意的一项是多看看rac1和rac2以及dg的告警日志会对配置过程有更深刻的理解。。。配置oracle rac的dg环境说白了首先将主库的数据恢复到从库上,然后在主从库上配置一些DG需要用到的参数

     

    注意:

     

    1. 由于DG是以DB_UNIQUE_NAME作为区分数据库标识的,因此主从库的该参数一定要不同以做区分。但是数据库名db_name必须一致以便主从切换时方便
    2. Standby库只需要安装数据库软件,不必创建数据库
    3. 主从库的数据库软件大版本必须一致,且必须是企业版数据库EE

     

     

     

    1. RAC主库准备工作

     

    该步骤主要是① 将rac主库修改为归档+forcelogging模式 ② 利用rman备份db、archivelog、control file 、pfile 和口令文件

     

    1. ①RAC主库必须置为归档模式:

     

    和下一步一起做

     

    1. ②RAC主库必须置为ForceLogging模式:

     

    alter database force logging;

    alter database archivelog; ---归档模式下修改

     

     

     

    SQL> alter database force logging;

     

    Database altered.

     

     

    SQL> select name , open_mode, log_mode,force_logging from gv$database;

     

    NAME     OPEN_MODE     LOG_MODE FOR

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

    RACDB     READ WRITE     NOARCHIVELOG YES

    RACDB     READ WRITE     NOARCHIVELOG YES

     

    SQL> exit

     

     

     

     

    [oracle@rac1 ~]$ sqlplus / as sysdba

     

    SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 3 15:30:17 2014

     

    Copyright (c) 1982, 2011, Oracle. All rights reserved.

     

    Connected to an idle instance.

     

    SQL> startup mount

    ORACLE instance started.

     

    Total System Global Area 784998400 bytes

    Fixed Size         2232472 bytes

    Variable Size         532680552 bytes

    Database Buffers     247463936 bytes

    Redo Buffers         2621440 bytes

    Database mounted.

    SQL> select name , open_mode, log_mode,force_logging from gv$database;

     

    NAME     OPEN_MODE     LOG_MODE FOR

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

    RACDB     MOUNTED     NOARCHIVELOG YES

     

    SQL> alter database archivelog;

     

    Database altered.

     

    SQL> shutdown immediate;

    ORA-01109: database not open

     

     

    Database dismounted.

    ORACLE instance shut down.

    SQL>

     

     

     

    SQL> select name , open_mode, log_mode,force_logging from gv$database;

     

    NAME     OPEN_MODE     LOG_MODE FOR

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

    RACDB     READ WRITE     ARCHIVELOG YES

    RACDB     READ WRITE     ARCHIVELOG YES

     

    SQL>

     

     

    1. ③RAC主库执行RMAN全备:

     

    run {

    allocate channel c1 type disk;

    allocate channel c2 type disk;

    allocate channel c3 type disk;

    allocate channel c4 type disk;

    backup database format '/rman_backup/FULL_%U.bak';

    backup archivelog all format '/rman_backup/ARC_%U.bak';

    release channel c1;

    release channel c2;

    release channel c3;

    release channel c4;

    }

     

     

     

     

     

    1. ④RAC主库执行创建物理备库控制文件:

     

    Rman下:backup device type disk format '/rman_backup/standby_%U.ctl' current controlfile for standby;

     

    或:SQL>alter database create standby controlfile as '/dats/backup/standby.ctl'

     

     

     

    1. ⑤RAC主库创建物理备库初始化参数文件:

     

     

    create pfile ='/rman_backup/initphydb.ora' from spfile;

     

     

    SQL> show parameter spfile

     

    NAME                 TYPE     VALUE

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

    spfile                 string     +DATA/racdb/spfileracdb.ora

    SQL>

     

    SQL> show parameter cluster_database

     

    NAME                 TYPE     VALUE

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

    cluster_database         boolean     TRUE

    cluster_database_instances     integer     2

    SQL>

     

     

     

     

    1. ⑥RAC主库修改口令文件,使双节点SYS用户口令一致:

     

     

    最好是将其中一个口令文件复制到另外一个节点上,最后复制到dg下,确保口令文件是一样的

     

     

     

    1. 物理备库准备工作

      1. ①FTP主库备份文件+备库控制文件+备库参数文件至物理备库服务器:

     

     

    将备份文件全部传递到dg库:

     

    ----rac1

    scp /rman_backup/*.bak oracle@192.168.59.140:/rman_backup/

    scp /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwracdb1 oracle@192.168.59.140:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwphydb

     

     

     

     

    1. ②物理备库创建口令文件:

     

    上一步已做,不需要创建了

     

    1. ③物理备库初始化参数文件修改:

     

     

     

    ----------dg

    [oracle@dg rman_backup]$ cp initphydb.ora $ORACLE_HOME/dbs/

    [oracle@dg rman_backup]$ cd $ORACLE_HOME/dbs

     

    这个是比较重要的步骤,我把行号弄出来了,当然写的时候是没有前边的行号的

     

    物理备库初始化参数文件修改:

     

     

    1. phydb.__db_cache_size=255852544

    2. phydb.__java_pool_size=4194304

    3. phydb.__large_pool_size=4194304

    4. phydb.__oracle_base='/u01/app/oracle'#ORACLE_BASE environment from set

    5. phydb.__pga_aggregate_target=419430400

    6. phydb.__sga_target=423624704

    7. phydb.__shared_io_pool_size=0

    8. phydb.__shared_pool_size=146800640

    9. phydb.__streams_pool_size=0

    10. *.audit_file_dest='/u01/app/oracle/admin/phydb/adump'

    11. *.audit_trail='db'

    12. *.cluster_database=false

    13. *.compatible='11.2.0.0.0'

    14. *.control_files='+DATA/phydb/controlfile/cont.ctl'

    15. *.core_dump_dest='/u01/app/oracle/diag/rdbms/phydb/cdump'

    16. *.db_block_size=8192

    17. *.db_create_file_dest='+DATA'

    18. *.db_domain=''

    19. *.db_file_name_convert='+DATA/racdb/','+DATA/phydb/'

    20. *.db_name='racdb'

    21. *.db_recovery_file_dest='+FRA'

    22. *.db_recovery_file_dest_size=4070572032

    23. *.db_unique_name='phydb'

    24. *.diagnostic_dest='/u01/app/oracle'

    25. *.dispatchers='(PROTOCOL=TCP)(SERVICE=phydbXDB)'

    26. *.fal_client='phydb'

    27. *.fal_server='racdb1','racdb2'

    28. *.log_archive_config='dg_config=(racdb,phydb)'

    29. *.log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=phydb'

    30. *.log_archive_dest_2='service=racdb1 valid_for=(online_logfiles,primary_role) db_unique_name=racdb'

    31. *.log_archive_format='ARC_%t_%S_%r.arc'

    32. *.log_file_name_convert='+DATA/racdb/','+DATA/phydb/'

    33. *.memory_target=842006528

    34. *.open_cursors=300

    35. *.processes=150

    36. *.remote_login_passwordfile='exclusive'

    37. *.service_names='phydb'

    38. *.standby_file_management='auto'

    39. *.thread=1

    40. *.undo_management='auto'

    41. *.undo_tablespace='UNDOTBS1'

     

     

     

     

     

    [oracle@dg dbs]$ mkdir -p /u01/app/oracle/admin/phydb/adump

    [oracle@dg dbs]$ mkdir -p /u01/app/oracle/diag/rdbms/phydb/cdump

    [oracle@dg dbs]$

     

    [grid@dg ~]$ asmcmd

    ASMCMD> ls

    DATA/

    FRA/

    GRIDDG/

    ASMCMD> cd DATA

    ASMCMD> ls

    ASMCMD> mkdir phydb

    ASMCMD> ls

    phydb/

    ASMCMD>

     

     

     

    1. ④配置RAC主库,物理备库的tnsnames.ora文件:

     

    将以下内容复制到rac1,rac2和dg库:

    racdb =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.139)(PORT = 1521))

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = racdb.lhr.com)

    )

    )

     

    racdb1 =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.135)(PORT = 1521))

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = racdb.lhr.com)

    (INSTANCE_NAME = racdb1)

    )

    )

     

    racdb2 =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.136)(PORT = 1521))

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = racdb.lhr.com)

    (INSTANCE_NAME = racdb2)

    )

    )

     

    phydb =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.140)(PORT = 1521))

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = phydb)

    )

    )

     

    验证一下:

    分别在3个库上执行:

    sqlplus sys/lhr@racdb as sysdba

    sqlplus sys/lhr@racdb1 as sysdba

    sqlplus sys/lhr@racdb2 as sysdba

     

    确保3个库可以连接

     

    1. 创建物理备库

      1. ①物理备库启动NOMOUNT状态:

     

    startup nomount

     

    1. ②RMAN恢复备库控制文件:

     

    [oracle@dg dbs]$ rman target /

     

    Recovery Manager: Release 11.2.0.3.0 - Production on Fri Oct 3 19:06:52 2014

     

    Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

     

    connected to target database: RACDB (not mounted)

     

    RMAN> restore standby controlfile from '/rman_backup/standby_0tpk53jq_1_1.ctl';

     

    Starting restore at 2014-10-03 19:06:55

    using target database control file instead of recovery catalog

    allocated channel: ORA_DISK_1

    channel ORA_DISK_1: SID=16 device type=DISK

     

    channel ORA_DISK_1: restoring control file

    channel ORA_DISK_1: restore complete, elapsed time: 00:00:25

    output file name=+DATA/phydb/controlfile/cont.ctl

    Finished restore at 2014-10-03 19:07:22

     

    RMAN>

     

     

     

    1. ③MOUNT物理备库:

     

    SQL> alter database mount;

     

    1. ④RMAN restore物理备库:

     

    run {

    allocate channel c1 type disk;

    allocate channel c2 type disk;

    allocate channel c3 type disk;

    allocate channel c4 type disk;

    restore database ;

    release channel c1;

    release channel c2;

    release channel c3;

    release channel c4;

    }

     

     

    RMAN> restore database ;

     

    Starting restore at 2014-10-03 19:13:48

    Starting implicit crosscheck backup at 2014-10-03 19:13:48

    using target database control file instead of recovery catalog

    allocated channel: ORA_DISK_1

    channel ORA_DISK_1: SID=32 device type=DISK

    Crosschecked 6 objects

    Finished implicit crosscheck backup at 2014-10-03 19:13:49

     

    Starting implicit crosscheck copy at 2014-10-03 19:13:49

    using channel ORA_DISK_1

    Finished implicit crosscheck copy at 2014-10-03 19:13:49

     

    searching for all files in the recovery area

    cataloging files...

    no files cataloged

     

    using channel ORA_DISK_1

     

    channel ORA_DISK_1: starting datafile backup set restore

    channel ORA_DISK_1: specifying datafile(s) to restore from backup set

    channel ORA_DISK_1: restoring datafile 00001 to +DATA/phydb/datafile/system.256.859849357

    channel ORA_DISK_1: restoring datafile 00004 to +DATA/phydb/datafile/users.259.859849357

    channel ORA_DISK_1: restoring datafile 00005 to +DATA/phydb/datafile/example.264.859849549

    channel ORA_DISK_1: reading from backup piece /rman_backup/FULL_0npk5395_1_1.bak

    channel ORA_DISK_1: piece handle=/rman_backup/FULL_0npk5395_1_1.bak tag=TAG20141003T164524

    channel ORA_DISK_1: restored backup piece 1

    channel ORA_DISK_1: restore complete, elapsed time: 00:04:23

    channel ORA_DISK_1: starting datafile backup set restore

    channel ORA_DISK_1: specifying datafile(s) to restore from backup set

    channel ORA_DISK_1: restoring datafile 00002 to +DATA/phydb/datafile/sysaux.257.859849357

    channel ORA_DISK_1: restoring datafile 00003 to +DATA/phydb/datafile/undotbs1.258.859849357

    channel ORA_DISK_1: restoring datafile 00006 to +DATA/phydb/datafile/undotbs2.265.859849971

    channel ORA_DISK_1: reading from backup piece /rman_backup/FULL_0opk53c4_1_1.bak

    channel ORA_DISK_1: piece handle=/rman_backup/FULL_0opk53c4_1_1.bak tag=TAG20141003T164524

    channel ORA_DISK_1: restored backup piece 1

    channel ORA_DISK_1: restore complete, elapsed time: 00:01:45

    Finished restore at 2014-10-03 19:20:01

     

    RMAN>

     

     

     

    1. ⑤备库上创建standbylogfile:

     

    SQL> select name from v$datafile

    2 union

    3 select name from v$controlfile

    4 union

    5 select member from v$logfile;

     

    NAME

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

    +DATA/phydb/controlfile/cont.ctl

    +DATA/phydb/datafile/example.258.860008433

    +DATA/phydb/datafile/sysaux.260.860008695

    +DATA/phydb/datafile/system.257.860008433

    +DATA/phydb/datafile/undotbs1.261.860008697

    +DATA/phydb/datafile/undotbs2.262.860008697

    +DATA/phydb/datafile/users.259.860008435

    +DATA/phydb/onlinelog/group_1.261.859849493

    +DATA/phydb/onlinelog/group_2.262.859849495

    +DATA/phydb/onlinelog/group_3.266.859850179

    +DATA/phydb/onlinelog/group_4.267.859850183

    +FRA/racdb/onlinelog/group_1.257.859849493

    +FRA/racdb/onlinelog/group_2.258.859849495

    +FRA/racdb/onlinelog/group_3.259.859850181

    +FRA/racdb/onlinelog/group_4.260.859850187

     

    15 rows selected.

     

    SQL>

     

    创建standbylogfile,这里的大小应根据主库的v$log中的bytes列来计算:

     

     

    alter database add standby logfile thread 1 group 5 size 50M ,group 6 size 50M ,group 7 size 50M ;

    alter database add standby logfile thread 2 group 8 size 50M ,group 9 size 50M ,group 10 size 50M ;

     

    创建完成后查询:

    select * from v$standby_log;

     

    SQL> set linesize 1200

    SQL> select * from v$standby_log;

     

    GROUP# DBID                  THREAD#    SEQUENCE# BYTES BLOCKSIZE USED ARC STATUS     FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME LAST_CHANGE# LAST_TIME

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

         5 UNASSIGNED                     1        0 52428800     512      0 NO UNASSIGNED

         6 UNASSIGNED                     1        0 52428800     512      0 NO UNASSIGNED

         7 UNASSIGNED                     1        0 52428800     512      0 YES UNASSIGNED

         8 UNASSIGNED                     2        0 52428800     512      0 NO UNASSIGNED

         9 UNASSIGNED                     2        0 52428800     512      0 NO UNASSIGNED

        10 UNASSIGNED                     2        0 52428800     512      0 YES UNASSIGNED

     

    6 rows selected.

     

    SQL>

    SQL> col member for a50

    SQL> select * from v$logfile;

     

    GROUP# STATUS TYPE MEMBER                     IS_

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

         2     ONLINE +DATA/phydb/onlinelog/group_2.270.860171617     NO

         2     ONLINE +FRA/phydb/onlinelog/group_2.294.860171767     YES

         1     ONLINE +DATA/phydb/onlinelog/group_1.269.860171391     NO

         1     ONLINE +FRA/phydb/onlinelog/group_1.293.860171601     YES

         3     ONLINE +DATA/phydb/onlinelog/group_3.271.860171811     NO

         3     ONLINE +FRA/phydb/onlinelog/group_3.295.860171893     YES

         4     ONLINE +DATA/phydb/onlinelog/group_4.272.860171905     NO

         4     ONLINE +FRA/phydb/onlinelog/group_4.296.860172007     YES

         5     STANDBY +DATA/phydb/onlinelog/group_5.263.860014755     NO

         5     STANDBY +FRA/phydb/onlinelog/group_5.256.860014769     YES

         6     STANDBY +DATA/phydb/onlinelog/group_6.264.860014775     NO

         6     STANDBY +FRA/phydb/onlinelog/group_6.257.860014789     YES

         7     STANDBY +DATA/phydb/onlinelog/group_7.265.860014795     NO

         7     STANDBY +FRA/phydb/onlinelog/group_7.258.860014811     YES

         8     STANDBY +DATA/phydb/onlinelog/group_8.266.860090543     NO

         8     STANDBY +FRA/phydb/onlinelog/group_8.259.860090581     YES

         9     STANDBY +DATA/phydb/onlinelog/group_9.267.860090607     NO

         9     STANDBY +FRA/phydb/onlinelog/group_9.260.860090659     YES

        10     STANDBY +DATA/phydb/onlinelog/group_10.268.860090669 NO

        10     STANDBY +FRA/phydb/onlinelog/group_10.261.860090715     YES

     

    20 rows selected.

     

    SQL>

     

    这里可能会报一个错误:

    ORA-15041: diskgroup "DATA" space exhausted

    就是磁盘不足,具体大家上网搜吧,解决办法就是添加磁盘,不详解了:

     

     

    alter diskgroup DATA add disk '/dev/raw/raw5';

     

     

     

     

    1. ⑥主库参数调整:

     

    [oracle@rac2 ~]$ sqlplus / as sysdba

     

    SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 10 15:59:46 2014

     

    Copyright (c) 1982, 2011, Oracle. All rights reserved.

     

     

    Connected to:

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

    Data Mining and Real Application Testing options

     

    SQL> show parameter spfile

     

    NAME                 TYPE     VALUE

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

    spfile                 string     +DATA/racdb/spfileracdb.ora

    SQL>

     

    --rac1

    alter system set log_archive_dest_2='service=phydb lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=phydb' sid='*';

    alter system set log_archive_config='dg_config=(racdb,phydb)' sid='*';

     

    配置后的结果:

    SQL> show parameter log_archive_dest_2

     

    NAME                 TYPE     VALUE

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

    log_archive_dest_2         string     service=phydb lgwr sync valid_

                             for=(online_logfiles,primary_r

                             ole) db_unique_name=phydb

     

    SQL> show parameter log_archive_config

     

    NAME                 TYPE     VALUE

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

    log_archive_config         string     dg_config=(racdb,phydb)

    SQL>

     

     

     

    1. ⑦备库接收主库日志:

     

    SQL> select sequence#,name,applied from v$archived_log;

     

    SEQUENCE# NAME                                                 APPLIED

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

        39 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_39.327.860599799                    NO

        40 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_40.328.860599799                    NO

        41 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_41.329.860599953                    NO

        49 +FRA/phydb/archivelog/2014_10_10/thread_1_seq_49.330.860600751                    NO

        50 +FRA/phydb/archivelog/2014_10_10/thread_1_seq_50.331.860600755                    NO

        51 +FRA/phydb/archivelog/2014_10_10/thread_1_seq_51.332.860600869                    NO

        42 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_42.333.860601127                    NO

        43 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_43.334.860601131                    NO

        44 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_44.335.860601415                    NO

     

    9 rows selected.

     

    SQL>

     

    这里如果备库无法顺利接收主库日志,则主库的alert日志中有如下提示:

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

    Check that the primary and standby are using a password file

    and remote_login_passwordfile is set to SHARED or EXCLUSIVE,

    and that the SYS password is same in the password files.

    returning error ORA-16191

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

    PING[ARC2]: Heartbeat failed to connect to standby 'phydb'. Error is 16191.

    Process J000 died, see its trace file

    kkjcre1p: unable to spawn jobq slave process

    Errors in file /u01/app/oracle/diag/rdbms/racdb/racdb2/trace/racdb2_cjq0_14236.trc:

    Process NSS2 died, see its trace file

    Process J000 died, see its trace file

    kkjcre1p: unable to spawn jobq slave process

    Errors in file /u01/app/oracle/diag/rdbms/racdb/racdb2/trace/racdb2_cjq0_14236.trc:

    Error 443 for archive log file 3 to 'phydb'

    LGWR: Failed to archive log 3 thread 2 sequence 25 (443)

    Process O000 died, see its trace file

     

    该节点的用户口令和备库的口令不一致,最好的办法是生成一份口令文件之后,然后将该口令文件拷贝到其它节点,重新生成口令有的时候也报错的

     

    ---- 3 个节点

    orapwd file=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwracdb2 password=lhr force=y

     

     

     

    1. ⑧备库开始应用日志:

     

     

    SQL> alter database recover managed standby database using current logfile disconnect from session;

     

    Database altered.

     

    过几分钟后:

     

     

    SQL> select sequence#,name,applied from v$archived_log;

     

    SEQUENCE# NAME                                                                     APPLIED

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

    39 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_39.327.860599799                    YES

        40 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_40.328.860599799                    YES

        41 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_41.329.860599953                    YES

        49 +FRA/phydb/archivelog/2014_10_10/thread_1_seq_49.330.860600751                    YES

        50 +FRA/phydb/archivelog/2014_10_10/thread_1_seq_50.331.860600755                    YES

        51 +FRA/phydb/archivelog/2014_10_10/thread_1_seq_51.332.860600869                    YES

        42 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_42.333.860601127                    NO

        43 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_43.334.860601131                    NO

        44 +FRA/phydb/archivelog/2014_10_10/thread_2_seq_44.335.860601415                    NO

     

     

    1. ⑨备库以READONLY方式打开:

     

     

    alter database recover managed standby database cancel;

    alter database open;

    alter database recover managed standby database using current logfile disconnect from session;

     

    SQL> col name for a30

    SQL> select dbid,name,current_scn,protection_mode,database_role,force_logging,open_mode,switchover_status from v$database;

     

    DBID NAME              CURRENT_SCN PROTECTION_MODE     DATABASE_ROLE FOR OPEN_MODE     SWITCHOVER_STATUS

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

    857466254 RACDB             1871595 MAXIMUM PERFORMANCE PHYSICAL STANDBY YES READ ONLY WITH APPLY NOT ALLOWED

     

    SQL>

     

    至此,我们已经顺利的给RAC主库配置ActivePhysicalDataguard成功!

     

    1. 其它附加内容

      1. 11g rman duplicate命令

     

    注意:11g以前的版本在执行复制命令dupilicate时,必须在备库上存在有备份文件,即在主库上备份完成后将文件拷到备库相同目录下

    但是在11g一切都变的简单,只需要在复制命令后加上FROM ACTIVE DATABASE参数即可。

    例如为实现数据库的文件回复,可以执行命令:

    $ rman target / auxiliary sys/herenit@racheren_standby

    RMAN>duplicate target database for standby from active database;

    如果原目录下有对应文件已经删除,但是数据字典中存在,可以使用nofilenamecheck参数取消对文件名的检查

    RMAN>duplicate target database for standby from active database nofilenamecheck;

    恢复完成以后,检查备库状态

    SQL> select status from v$instance;

    STATUS$dEQ5b/C#x22494861------------ITPUB个人空间 T c:v_y!RMOUNTED

    SQL> select open_mode from v$database;

    OPEN_MODEITPUB个人空间FU?tN2FE5v:_wU}----------ITPUB个人空间1R_G@5k/kMOUNTED

    SQL> select member from v$logfile;

    SQL> select name from v$datafile;

    SQL> select name from v$tempfile;

     

    1. 创建standby redo log 日志

     

    DATA Guard在最大保护和最高可用性模式下,Standby数据库必须配置 Standby Redo Log

    备库创建并配置 Standby Redo Log 是为了能够接收到主库传过来的日志,用作恢复.

    主库创建并配置 Standby Redo Log 是为了在主备切换之后,能够接收到原备库(切换之后的主库)传过来的日志

    注意:为了主备切换后能正常,主备库都必须创建standby redo log

     

    创建原则:建议Standby Redologs日志组数量基于Primary数据库的线程数来确定(这里的线程数可以理解为RAC环境中的节点数)。

    有一个推荐的公式可供参考:(每线程的日志组数+1)×最大线程数。

    使用这个公式可以降低Primary数据库实例LGWR进程锁住的可能性。

    创建原则和单实例一样,大小相等,但是日志组数量要比primary数据库多一组,比如在我的环境中,有2个节点,每个节点有4组redo,那么现在要创建的standby redo log组数为:(4+1)*2=10个

    Standby Redologs的操作方式与Online Redologs几乎一模一样,只不过在创建或删除时需要多指定一个Standby关键字

    SQL>alter database add standby logfile thread 1 group 5 '+ORAFLASH/racheren/onlinelog/group_5.log' size 50M;

    SQL>alter database add standby logfile thread 2 group 6 '+ORAFLASH/racheren/onlinelog/group_6.log' size 50M;

    单实例上不需要thread标识

    SQL>alter database add standby logfile group 6 '/oradata/racheren/onlinelog/group_6.log' size 50M;

    删除方式:

    SQL>alter database drop standby logfile grop 6

    查询方式:

    SQL>select group#,thread#,sequence#,archived,status from v$standby_log;

     

    ERROR at line 1:

    ORA-01156: recovery or flashback in progress may need access to files

    --在备库添加standby redo log需要先停MRP

    SQL> alter database recover managed standby database cancel;

     

     

     

    1. 测试物理备库功能

      1. 测试文件同步

        1. 查看主备库的表空间信息

     

    select tablespace_name, file_name from dba_data_files;

     

     

    1. 主库创建表空间查看备库是否同步

     

    create tablespace dg_tbs datafile size 5m;

     

     

     

    1. 主库删除表空间查看备库是否同步

     

     

    drop tablespace dg_tbs including contents and datafiles;

     

     

    1. 测试数据同步

     

    ①主库创建测试表:

    ② 备库查看测试表同步:

    Create table tmp_test(id number);

    Insert into tmp_test values(1);

    Commit;

    Select * from tmp_test;

    1. 测试DATAGUARDSWITCHOVER功能

      1. RAC主库、ActiveDataguard角色切换

    即rac主库切换为物理备库,物理备库切换为rac主库。

    1. ①主库修改相关参数fal_client、fal_server:

    首先需要确保主库采用spfile启动,然后

    Rac1上:

    alter system set fal_client='rac1' sid='rac1';

    Rac2上:

    alter system set fal_client='rac2' sid='rac2';

    alter system set fal_server='phydb' sid='*';

    1. ②主库创建standbylogfile:

    2. ③主库修改相关参数standby_file_management、db_file_name_convert 、log_filename_convert

    3. ④停止RAC节点2:

    4. 单实例主库,RAC备库角色切换

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

    转载:http://blog.itpub.net/26736162/viewspace-1298735/

    展开全文
  • 搭建rac+racdg

    2020-01-08 23:48:00
    主库 # rac1 192.168.56.33 rac1 192.168.56.111 rac1-vip 10.10.10.1 rac1-priv # rac2 192.168.56.44 rac2 192.168.56.112 rac2-vip 10.10.10.2 r...
  • Oracle 19c RAC+DG生产完全实战,多套rac同步到同一台dg
  • Oracle高可用 RAC DG

    2020-02-29 11:44:21
     第九课 RAC+DG技术的应用  第十课 Oracle Golden gate 概念和机制  第十一课 Oracle Golden gate 设计及应用  第十二课 Oracle 流技术(streams)  第十三课 Oracle高级复制  第十四课 Oracle ...
  • DG】Oracle 19c使用dbca来搭建物理DG--主racracDG】Oracle 19c使用dbca来搭建物理DG(单实例)参考: http://blog....
  • dg in rac service的配置

    2016-12-16 09:36:29
    dgrac srvctl add database -r {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY} ------...
  • 浦东机场货运站核心数据库升级至Oracle RAC 11gR2。操作系统采用RedHat Enterprice Linux 6.3 x64,操作系统平台为x86-64。 Oracle网格管理器和数据库安装版本为11.2.0.3.,并且升级GI和DB至PSU 6,数据共享存储采用...
  • rac+dg+aix

    2013-07-18 14:29:19
    rac+dg+aix
  • Oracle 11g RAC-RAC DG Duplicate搭建(生产操作文档)Oracle 11g RAC-RAC DG Duplicate搭建(生产操作文档)
  • Oracle 12C DG 搭建(RAC-RAC/RAC-单机)

    千次阅读 2018-07-02 00:02:48
    主库上操作1.开启RAC的 force loggingSQL> alter database force logging;... alter system set log_archive_config='DG_CONFIG=(eisoo,eisoos)';SQL> alter system set log_archive_dest_2...
  • ​​​​​本章主要是搜集了一些安装rac的过程中出现的问题及解决办法,如果没有出现问题的话那么这一章可以不看的 目录结构: crs安装出现的问题 Oracle 11g RAC CRS-4535/ORA-15077 新安装了...
  • oracle 11gr2在linux下的安装配置,包括1.集群规划;2.RAC主库安装实施;3.RAC共享存储安装配置;4.安装GRID集群;5.ASM磁盘安装;6.安装数据库软件;7.安装数据库实例;8.备库安装配置。
  • 一步一步搭建11gR2 rac+dg之安装rac出现问题解决(六) 一步一步在RHEL6.5+VMware Workstation 10上搭建oracle 11gR2 rac + dg之安装rac出现的问题 (六) 本章主要是搜集了一些安装rac的过程中出现的问题及...
  • Rac & DG

    2015-04-03 10:31:00
    Rac环境: RAC版本异同:[10R2,11R1(和10类似)],11R2,12c: 目录: 10.2的ASM需要单独的目录(oracle home):rdbms home,asm home, crs home 11.2:rdbms,grid(crs+asm) ...
  • ORACLE 12C RAC 到 单机 DG 部署详细过程,遇到任何问题可以留言
  • RAC +DG

    千次阅读 2013-09-13 15:12:06
    此测试实验为 RAC 数据源 + 单实例 node 目标端。RAC 为 asm 存储, node 为systemfile系统。 其实都一样,和node+node: 1 环境: RAC : DB_NAME= DB_UNIQUE_NAME=DOMINIC NODE: DB_NAME= DOMINIC  
  • Oracle RACDG

    2020-09-05 09:11:42
    RAC RAC: real application clustersrac RAC: real application clustersrac 单节点数据库:数据文件和示例文件一一对应 实例损坏时数据库就损坏了 RAC架构数据库:数据文件和多个实例对应 RAC最根本的初衷是...
  • Oracle RAC-DG安装配置步骤详解
  • 本文文档结构图: ... 1.1 测试DATAGUARDSWITCHOVER功能 1.1.1 RAC主库、ActiveDataguard角色切换 即rac主库切换为物理备库,物理备库切换为rac主库。 1.1.1.1 ①主库修改相关参数fal_...
  • Oracle 12c rac下的dg搭建

    2018-01-04 17:48:23
    具体rac搭建可下载参照我另外一份oracle 12c rac安装。
  • RAC+DG

    千次阅读 2013-07-30 11:43:54
    主机:RAC 备机:ORACLE 软件安装 2. 密码文件准备: orapwd file=$ORACLE_HOME/dbs/orapwfirstrac password=admin cd $ORACLE_HOME/dbs scp orapwfirstrac oracle@10.10.10.33:/home/oracle/oracle/...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 7,867
精华内容 3,146
关键字:

dgrac