RAC环境下dataguard的搭建

----primary端配置

1. 启用强制数据库日志

SQL>  ALTER DATABASE FORCE LOGGING;

Database altered.

SQL> select force_logging from v$database;

FORCE_LOGGING
---------------
YES

2.创建密码文件

创建rac数据库时已经创建

3.修改数据库初始化参数,使之适应dataguard配置

alter system set DB_UNIQUE_NAME=mbs  scope=spfile sid='*';
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(mbs,stby)'   scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_1='LOCATION=+DATA/arch/mbs VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=mbs'         scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_2='SERVICE=stby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)  DB_UNIQUE_NAME=stby' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE        scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_STATE_2=ENABLE         scope=both sid='*';
alter system set LOG_ARCHIVE_MAX_PROCESSES=30               scope=both sid='*';

alter system set FAL_SERVER=stby   scope=both sid='*';
alter system set FAL_CLIENT=mbs1 scope=both sid='mbs1';
alter system set FAL_CLIENT=mbs2 scope=both sid='mbs2';
alter system set DB_FILE_NAME_CONVERT='+DATA/MBS/datafile/','/home/db/oracle/oradata/mbs/' scope=spfile sid='*';
alter system set LOG_FILE_NAME_CONVERT='+DATA/MBS/onlinelog/','/home/db/oracle/oradata/mbs/'  scope=spfile sid='*';
alter system set STANDBY_FILE_MANAGEMENT=AUTO scope=both sid='*';

4.修改主库为归档模式
--关闭数据库
[oracle@rac01 dbs]$ srvctl stop db -d mbs

--启动数据库到mount状态
SQL> startup mount;
ORACLE instance started.

Total System Global Area  264241152 bytes
Fixed Size                  1273152 bytes
Variable Size             113246912 bytes
Database Buffers          146800640 bytes
Redo Buffers                2920448 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +DATA/arch/mbs
Oldest online log sequence     15
Next log sequence to archive   16
Current log sequence           16

SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

--启动数据库
[oracle@rac01 dbs]$ srvctl start database -d mbs

5. 用RMAN备份主数据

[oracle@rac01 backup]$ rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Thu Sep 6 15:58:54 2012

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

connected to target database: MBS (DBID=1443295382)

RMAN> run
2> {
3> allocate channel c1 device type disk format '/home/oracle/backup/%u' connect sys/oracle@mbs1;
4> allocate channel c2 device type disk format '/home/oracle/backup/%u' connect sys/oracle@mbs2;
5> backup database plus archivelog;
6> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=106 instance=mbs1 devtype=DISK

allocated channel: c2
channel c2: sid=131 instance=mbs2 devtype=DISK


Starting backup at 06-SEP-12
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=2 sequence=11 recid=2 stamp=793293742
input archive log thread=2 sequence=12 recid=6 stamp=793295431
channel c1: starting piece 1 at 06-SEP-12
channel c2: starting archive log backupset
channel c2: specifying archive log(s) in backup set
input archive log thread=1 sequence=16 recid=1 stamp=793293727
input archive log thread=1 sequence=17 recid=3 stamp=793293823
input archive log thread=1 sequence=18 recid=4 stamp=793293832
input archive log thread=1 sequence=19 recid=5 stamp=793295417
input archive log thread=1 sequence=20 recid=8 stamp=793295556
input archive log thread=1 sequence=21 recid=12 stamp=793295954
channel c2: starting piece 1 at 06-SEP-12
channel c1: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/05nkhf2o tag=TAG20120906T155919 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:06
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=2 sequence=13 recid=7 stamp=793295555
input archive log thread=2 sequence=14 recid=9 stamp=793295558
input archive log thread=2 sequence=15 recid=10 stamp=793295831
input archive log thread=2 sequence=16 recid=11 stamp=793295950
channel c1: starting piece 1 at 06-SEP-12
channel c2: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/06nkhf2n tag=TAG20120906T155919 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:08
channel c1: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/07nkhf2u tag=TAG20120906T155919 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 06-SEP-12

Starting backup at 06-SEP-12
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DATA/mbs/datafile/system.256.791457263
input datafile fno=00002 name=+DATA/mbs/datafile/undotbs1.258.791457263
input datafile fno=00006 name=+DATA/mbs/datafile/undotbs2.265.791457625
channel c1: starting piece 1 at 06-SEP-12
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
input datafile fno=00003 name=+DATA/mbs/datafile/sysaux.257.791457263
input datafile fno=00005 name=+DATA/mbs/datafile/example.264.791457419
input datafile fno=00004 name=+DATA/mbs/datafile/users.259.791457263
channel c2: starting piece 1 at 06-SEP-12
channel c1: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/08nkhf32 tag=TAG20120906T155930 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:59
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece 1 at 06-SEP-12
channel c2: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/09nkhf31 tag=TAG20120906T155930 comment=NONE
channel c2: backup set complete, elapsed time: 00:01:54
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
channel c1: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/0ankhf6r tag=TAG20120906T155930 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:10
including current SPFILE in backupset
channel c2: starting piece 1 at 06-SEP-12
channel c2: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/0bnkhf6l tag=TAG20120906T155930 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:02
Finished backup at 06-SEP-12

Starting backup at 06-SEP-12
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=22 recid=13 stamp=793296104
channel c1: starting piece 1 at 06-SEP-12
channel c2: starting archive log backupset
channel c2: specifying archive log(s) in backup set
input archive log thread=2 sequence=17 recid=14 stamp=793296092
channel c2: starting piece 1 at 06-SEP-12
channel c1: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/0cnkhf7h tag=TAG20120906T160147 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:00
channel c2: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/0dnkhf6t tag=TAG20120906T160147 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:05
Finished backup at 06-SEP-12
released channel: c1
released channel: c2

6.备份控制文件为standby用

RMAN> run
2> {
3> allocate channel c1 device type disk format '/home/oracle/backup/control_stby.ctl';
4> backup current controlfile for standby;
5> }

allocated channel: c1
channel c1: sid=83 instance=mbs1 devtype=DISK

Starting backup at 06-SEP-12
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including standby control file in backupset
channel c1: starting piece 1 at 06-SEP-12
channel c1: finished piece 1 at 06-SEP-12
piece handle=/home/oracle/backup/control_stby.ctl tag=TAG20120906T160400 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:12
Finished backup at 06-SEP-12
released channel: c1

7. 修改主库两个节点的tnsnames.ora,添加入戏内容:

stby =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.88)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mbs)
      (UR = A)
    )
  )

8. 为主库添加备用重做日志文件

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

Database altered.

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

Database altered.

SQL> select * from v$standby_log; 

    GROUP# DBID          THREAD#  SEQUENCE#      BYTES       USED ARC STATUS     FIRST_CHANGE# FIRST_TIM LAST_CHANGE# LAST_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------- ------------- --------- ------------ ---------
         5 UNASSIGNED          1          0   52428800        512 YES UNASSIGNED             0                      0
         6 UNASSIGNED          1          0   52428800        512 YES UNASSIGNED             0                      0
         7 UNASSIGNED          1          0   52428800        512 YES UNASSIGNED             0                      0
         8 UNASSIGNED          2          0   52428800        512 YES UNASSIGNED             0                      0
         9 UNASSIGNED          2          0   52428800        512 YES UNASSIGNED             0                      0
        10 UNASSIGNED          2          0   52428800        512 YES UNASSIGNED             0                      0

6 rows selected.

---standby端
9.准备standby库的初始化参数文件

--在主库上生成pfile
SQL> create pfile='/home/oracle/initmbs.ora' from spfile;

File created.

--编辑initmbs.ora,去掉rac相关的参数,并增加standby相关参数
*.audit_file_dest='/home/db/oracle/admin/mbs/adump'
*.background_dump_dest='/home/db/oracle/admin/mbs/bdump'
*.compatible='10.2.0.5.0'
*.control_files='/home/db/oracle/oradata/mbs/control01.ctl,/home/db/oracle/oradata/mbs/control02.ctl'
*.core_dump_dest='/home/db/oracle/admin/mbs/cdump'
*.db_block_size=8192
#*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_file_name_convert='+DATA/MBS/datafile/','/home/db/oracle/oradata/mbs/'
*.db_name='mbs'
*.db_unique_name='stby'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=mbsXDB)'
*.fal_server='STBY'
*.fal_client='mbs1,mbs2'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(mbs,stby)'
*.log_archive_dest_1='LOCATION=/home/db/oracle/arch/mbs VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=stby'
*.log_archive_dest_2='SERVICE=mbs LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)  DB_UNIQUE_NAME=mbs'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_max_processes=3
*.log_file_name_convert='+DATA/MBS/onlinelog/','/home/db/oracle/oradata/mbs/'
*.open_cursors=300
*.pga_aggregate_target=104857600
*.processes=150
*.remote_login_passwordfile='exclusive'
*.service_names='mbs'
*.sga_target=262144000
*.standby_file_management='AUTO'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/home/db/oracle/admin/mbs/udump'

10.将生成的初始化参数文件及密码文件传到standby端

[oracle@rac01 ~]$ scp initmbs.ora 192.168.56.88:/home/db/oracle/product/10.2.0/dbs
[oracle@rac01 dbs]$ scp orapwmbs1 192.168.56.88:/home/db/oracle/product/10.2.0/dbs

在standby端将密码文件改名:
[oracle@racdg01 dbs]$ mv orapwmbs1 orapwmbs

11.编辑standby端tnsnames.ora,listener.ora

--tnsnames.ora内容:
MBS1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.21)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mbs)
      (INSTANCE_NAME = mbs1)
    )
  )

MBS2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.22)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mbs)
      (INSTANCE_NAME = mbs2)
    )
  )

--listener.ora

# listener.ora Network Configuration File: /home/db/oracle/product/10.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /home/db/oracle/product/10.2.0)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = racdg01)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )

12. 将数据库备份恢复到备库

--启动备库到nomount状态
SQL> startup nomount;
ORACLE instance started.

Total System Global Area  264241152 bytes
Fixed Size                  1273152 bytes
Variable Size              88081088 bytes
Database Buffers          171966464 bytes
Redo Buffers                2920448 bytes

--检查主库两节点到备库的连通性

[oracle@rac01 dbs]$  sqlplus sys/oracle@stby as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Thu Sep 6 16:40:58 2012

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@rac02 ~]$ sqlplus sys/oracle@stby as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Thu Sep 6 16:40:12 2012

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

--在备库上创建backup目录,存放备份
[oracle@racdg01 ~]$ mkdir backup

--将主库两个节点上的备份copy到备库的backup目录下:
[oracle@racdg01 backup]$ scp 192.168.56.11:/home/oracle/backup/* ./
[oracle@racdg01 backup]$ scp 192.168.56.12:/home/oracle/backup/* ./

--恢复备库
[oracle@rac01 dbs]$ rman target / auxiliary sys/oracle@stby

Recovery Manager: Release 10.2.0.5.0 - Production on Thu Sep 6 16:50:34 2012

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

connected to target database: MBS (DBID=1443295382)
connected to auxiliary database: MBS (not mounted)

RMAN> run      
2> {
3> allocate channel c1 device type disk format '/home/oracle/backup/%U' connect sys/oracle@mbs1;
4> allocate channel c2 device type disk format '/home/oracle/backup/%U' connect sys/oracle@mbs2;
5> allocate auxiliary channel ac1 device type disk format '/home/oracle/backup/%U';
6> allocate auxiliary channel ac2 device type disk format '/home/oracle/backup/%U';
7> duplicate target database for standby nofilenamecheck;
8> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=83 instance=mbs1 devtype=DISK

allocated channel: c2
channel c2: sid=147 instance=mbs2 devtype=DISK

allocated channel: ac1
channel ac1: sid=156 devtype=DISK

allocated channel: ac2
channel ac2: sid=155 devtype=DISK

Starting Duplicate Db at 06-SEP-12

contents of Memory Script.:
{
   restore clone standby controlfile;
   sql clone 'alter database mount standby database';
}
executing Memory Script

Starting restore at 06-SEP-12

channel ac1: starting datafile backupset restore
channel ac1: restoring control file
channel ac1: reading from backup piece /home/oracle/backup/control_stby.ctl
channel ac1: restored backup piece 1
piece handle=/home/oracle/backup/control_stby.ctl tag=TAG20120906T160400
channel ac1: restore complete, elapsed time: 00:00:03
output filename=/home/db/oracle/oradata/mbs/control01.ctl
output filename=/home/db/oracle/oradata/mbs/control02.ctl
Finished restore at 06-SEP-12

sql statement: alter database mount standby database
WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to diskgroup only.

contents of Memory Script.:
{
   set newname for tempfile  1 to 
 "+data";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/home/db/oracle/oradata/mbs/system.256.791457263";
   set newname for datafile  2 to 
 "/home/db/oracle/oradata/mbs/undotbs1.258.791457263";
   set newname for datafile  3 to 
 "/home/db/oracle/oradata/mbs/sysaux.257.791457263";
   set newname for datafile  4 to 
 "/home/db/oracle/oradata/mbs/users.259.791457263";
   set newname for datafile  5 to 
 "/home/db/oracle/oradata/mbs/example.264.791457419";
   set newname for datafile  6 to 
 "/home/db/oracle/oradata/mbs/undotbs2.265.791457625";
   restore
   check readonly
   clone database
   ;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to +data in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 06-SEP-12

channel ac1: starting datafile backupset restore
channel ac1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /home/db/oracle/oradata/mbs/sysaux.257.791457263
restoring datafile 00004 to /home/db/oracle/oradata/mbs/users.259.791457263
restoring datafile 00005 to /home/db/oracle/oradata/mbs/example.264.791457419
channel ac1: reading from backup piece /home/oracle/backup/09nkhf31
channel ac2: starting datafile backupset restore
channel ac2: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /home/db/oracle/oradata/mbs/system.256.791457263
restoring datafile 00002 to /home/db/oracle/oradata/mbs/undotbs1.258.791457263
restoring datafile 00006 to /home/db/oracle/oradata/mbs/undotbs2.265.791457625
channel ac2: reading from backup piece /home/oracle/backup/08nkhf32
channel ac1: restored backup piece 1
piece handle=/home/oracle/backup/09nkhf31 tag=TAG20120906T155930
channel ac1: restore complete, elapsed time: 00:01:55
channel ac2: restored backup piece 1
piece handle=/home/oracle/backup/08nkhf32 tag=TAG20120906T155930
channel ac2: restore complete, elapsed time: 00:02:34
Finished restore at 06-SEP-12

contents of Memory Script.:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy recid=8 stamp=793300994 filename=/home/db/oracle/oradata/mbs/system.256.791457263
datafile 2 switched to datafile copy
input datafile copy recid=9 stamp=793300994 filename=/home/db/oracle/oradata/mbs/undotbs1.258.791457263
datafile 3 switched to datafile copy
input datafile copy recid=10 stamp=793300994 filename=/home/db/oracle/oradata/mbs/sysaux.257.791457263
datafile 4 switched to datafile copy
input datafile copy recid=11 stamp=793300994 filename=/home/db/oracle/oradata/mbs/users.259.791457263
datafile 5 switched to datafile copy
input datafile copy recid=12 stamp=793300994 filename=/home/db/oracle/oradata/mbs/example.264.791457419
datafile 6 switched to datafile copy
input datafile copy recid=13 stamp=793300994 filename=/home/db/oracle/oradata/mbs/undotbs2.265.791457625
Finished Duplicate Db at 06-SEP-12
released channel: c1
released channel: c2
released channel: ac1
released channel: ac2

---为备库添加standby log

SQL>  ALTER DATABASE ADD STANDBY LOGFILE THREAD 1  group 5 ('/home/db/oracle/oradata/mbs/group_5') SIZE 50m;

Database altered.

SQL>  ALTER DATABASE ADD STANDBY LOGFILE THREAD 1  group 6 ('/home/db/oracle/oradata/mbs/group_6') SIZE 50m;

Database altered.

SQL>  ALTER DATABASE ADD STANDBY LOGFILE THREAD 1  group 7 ('/home/db/oracle/oradata/mbs/group_7') SIZE 50m;

Database altered.

SQL>  ALTER DATABASE ADD STANDBY LOGFILE THREAD 2  group 8 ('/home/db/oracle/oradata/mbs/group_8') SIZE 50m;

Database altered.

SQL>  ALTER DATABASE ADD STANDBY LOGFILE THREAD 2  group 9 ('/home/db/oracle/oradata/mbs/group_9') SIZE 50m;

Database altered.

SQL>  ALTER DATABASE ADD STANDBY LOGFILE THREAD 2  group 10 ('/home/db/oracle/oradata/mbs/group_10') SIZE 50m;

Database altered.

SQL> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                                             IS_
---------- ------- ------- -------------------------------------------------- ---
         2         ONLINE  /home/db/oracle/oradata/mbs/group_2.262.791457379  NO
         1         ONLINE  /home/db/oracle/oradata/mbs/group_1.261.791457373  NO
         3         ONLINE  /home/db/oracle/oradata/mbs/group_3.266.791457675  NO
         4         ONLINE  /home/db/oracle/oradata/mbs/group_4.267.791457681  NO
         5         STANDBY /home/db/oracle/oradata/mbs/group_5                NO
         6         STANDBY /home/db/oracle/oradata/mbs/group_6                NO
         7         STANDBY /home/db/oracle/oradata/mbs/group_7                NO
         8         STANDBY /home/db/oracle/oradata/mbs/group_8                NO
         9         STANDBY /home/db/oracle/oradata/mbs/group_9                NO
        10         STANDBY /home/db/oracle/oradata/mbs/group_10               NO

--在备库上启动恢复进程
alter database recover managed standby database disconnect from session;

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

转载于:http://blog.itpub.net/10972173/viewspace-742877/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Oracle 19c RAC DataGuard搭建是一种高可用性和容灾解决方案。RAC集群可以提供跨数据中心的集群解决方案。DataGuard技术可以帮助数据库管理员在灾难发生时迅速切换到备份数据库。 Oracle 19c RAC DataGuard搭建可以分为以下步骤: 1. 安装Oracle Grid Infrastructure和RAC数据库实例。 2. 配置RAC集群。这包括网络设置、存储设置和群集设置。确保所有节点能够相互通信,并且使用共享存储。 3. 创建主数据库和备份数据库。主备同步,备份数据库和主数据库位于不同的数据中心。 4. 配置DataGuard物理备份和逻辑备份。 5. 在主数据库和备份数据库之间配置DataGuard次级应用程序。 6. 测试DataGuard配置是否正常工作。测试主数据库的故障转移,确保在主数据库发生故障时可以切换到备份数据库。 Oracle 19c RAC DataGuard搭建需要谨慎计划和操作。在搭建过程中需要确保数据的一致性,并且需要考虑容灾策略,如灾难恢复和演练。只有通过正确的设置和测试,才能确保Oracle 19c RAC DataGuard搭建提供高可用性和容灾保护解决方案。 ### 回答2: Oracle 19c是一种强大的数据库管理系统,可用于构建高可用性环境。对于那些需要可靠数据保护和复制的企业来说,Oracle RACDataGuard功能是非常重要的。 首先,要构建Oracle 19c RAC集群,需要至少两台服务器。可以使用Oracle Grid Infrastructure安装程序轻松地将这些服务器组成集群。RAC集群是可以在多个服务器上运行的数据库实例,它们能够协同工作,处理更多的请求并提供更快的性能。安装后,可以将应用程序连接到集群,并使用透明应用程序故障转移(TAF)来实现应用程序的优化和可用性。 接下来就是使用DataGuard来进行数据保护。DataGuard是Oracle自带的一个功能,它可以实现数据镜像、备份和恢复。它需要在主数据库和备用数据库之间创建物理链接和转发。主数据库通过将其变更记录发送到备用数据库来保持它们同步。如果主库崩溃,则可以立即启动备用数据库来维护业务连续性。 通过上述的步骤,可以构建一个高可用、高性能、高可靠、高安全的Oracle 19c RAC集群和DataGuard数据保护系统。每一个组件的优点都可以为企业提供无可比拟的价值,并将使整个环境更加健壮和不易受到数据故障的影响。 ### 回答3: Oracle 19c RAC DataGuard搭建是一种高可用性和灾备性解决方案,它可以确保企业系统和数据在本地或异地灾害发生时仍能保持可用。 首先,需要建立两个物理服务器,安装Oracle 19c RAC数据库软件并创建RAC实例。然后,需要创建两个DataGuard实例并配置它们之间的数据传输。 在RAC集群环境下,每个节点上都需要安装Oracle软件,并使用Oracle ASM进行存储管理。用户需要创建一个ASM磁盘组来存储Oracle数据库,并为每个节点划分适当的ASM磁盘组。 接下来,建立数据保护服务器,并安装Oracle 19c DataGuard数据库软件。在数据保护服务器上创建一个新的实例,并配置DataGuard属性。 然后,开始配置主数据库和备份数据库的DataGuard。将主数据库设为“主”模式,备份数据库设置为“备份”模式。配置主数据库的重做日志和备份数据库的重做日志的传输顺序,并指定主数据库的网络地址和备份数据库的网络地址及端口号。 最后,在主数据库上设置联机重做日志、数据文件和控制文件自动备份;并在备份数据库上设置数据文件和控制文件自动备份。测试系统中的故障转移、自动重试和网络连接性问题,以确保系统在灾难发生后可以无缝地进行切换和恢复。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值