Data Guard ----理论详解(四)

1.Data Guard

第一章详细部分阅读–传送门

2 DG Services 详解 – Redo Transport Services

第二章详细部分阅读–传送门

3 DG Services 详解 – Apply Services

4 DG Services 详解 – Role Transitions

第三、四章详细部分阅读–传送门

5 Data Guard 的数据保护级别与性能关系

5.1 三种模式对比

1️⃣最大保护模式

  1. 这种模式提供了最高级别的数据保护能力;
  2. 要求至少一个物理备库收到重做日志后,主库的事务才能够提交;
  3. 主库找不到合适的备库写入时,主库会hang住,防止未受保护的数据出现;

优点:该模式可以保证备库没有数据丢失;
缺点:备库的自动关闭会影响到主库的可用性,同时需要备库恢复后才能提交,对网络等客观条件要求非常的高,主库的性能会因此受到非常大的冲击。

2️⃣最大可用性模式

  1. 该模式提供了仅次于“最大保护模式”的数据保护能力;
  2. 要求至少一个物理备库收到重做日志后,主库的事务才能够提交;
  3. 主库找不到合适的备库写入时,主库不会关闭,而是临时降低到“最大性能模式”模式,直到问题得到处理;

优点:该模式可以在没有问题出现的情况下,保证备库没有数据丢失,是一种折中的方法;
缺点:在正常运行的过程中缺点是主库的性能受到诸多因素的影响。

3️⃣最大性能模式

  1. 该模式是默认模式,可以保证主数据库的最高可用性;
  2. 保证主库运行过程中不受备库的影响,主库事务正常提交,不因备库的任何问题影响到主库的运行;

优点:避免了备库对主数据库的性能和可用性影响;
缺点:如果与主库提交的事务相关的恢复数据没有发送到备库,这些事务数据将被丢失,不能保证数据无损失;

5.2 设置主库的保护模式

查询当前的保护模式

SQL> SELECT PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE ROLE, SWITCHOVER_STATUS FROM V$DATABASE;

不同数据保护模式对redo transport 的要求

最大可用最大性能最大保护
AFFIRMNOAFFIRMAFFIRM
SYNCASYNCSYNC

注:主库和备库的参数log_archive_dest_n 参数都需要指定DB_UNIQUE_NAME

语句

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE {AVAILABILITY | PERFORMANCE | PROTECTION};

将主库模式切换到最大可用性

maximize protection <--> maximize availability <--> maximize performance

当在把dataguard的保护级别按这上面的顺序减低或, 不需要primary库在mount状态;当从最好性能直接切换到最好保护时,primary 必须在mount 状态。

主库操作

SQL> select protection_mode, protection_level, database_role role, switchover_status from v$database; 
SQL> alter system set log_archive_dest_2='service=study_st lgwr affirm sync valid_for=(online_logfiles,primary_role) db_unique_name=study_st';
SQL> alter database set standby database to maximize availability; 

将主库模式切换到最大保护

SQL> alter database set standby database to maximize protection;

SQL> shutdown immediate;
SQL> startup mount;
SQL> select database_role,protection_mode,protection_level from v$database;
SQL> alter database open;

6 Data Guard 异构平台支持

部署 Data Guard 时最简单的途径是配置同构的对称主/备用配置。但是,为了利用运行不同操作系统的现有服务器,或者为了在尽可能减少停机时间或风险的情况下帮助从一个平台向另一个平台移植时,通常部署异构配置会非常有用。对于希望使用低于生产环境的处理能力的配置或者使用成本低于其主系统的组件来配置备用系统,从而减少其灾难恢复投资的用户而言,这是相当合理的选择。

确定主数据库和备用数据库的平台 ID。

SQL> select platform_id, platform_name from v$database;

物理standby

PLATFORM_IDPLATFORM_NAME使用 Data Guard (物理备用)时,相同 Data Guard 配置中支持的 PLATFORM_ID
2Solaris[tm] OE (64-bit)
Solaris Operating System (SPARC)(64-bit)
2
6 - 由于 Bug 12702521 中报告的问题,不支持此项
3HP-UX (64-bit)
HP-UX PA-RISC
3
4 - Oracle 10g 及更高版本,请参阅技术支持文档 Note: 395982.1
4HP-UX IA (64-bit)
HP-UX Itanium
4
3 - Oracle 10g 及更高版本,请参阅技术支持文档 Note: 395982.1
5HP Tru64 UNIX
HP Tru64 UNIX
5
6IBM AIX on POWER Systems (64-bit)2 - 由于 Bug 12702521 中报告的问题,不支持此项
6
7Microsoft Windows (32-bit)
Microsoft Windows (x86)
7
8, 12 - Oracle 10g 及更高版本,请参阅 技术支持文档 Note: 414043.1
10 - Oracle 11g 及更高版本,需要 Patch 13104881
11, 13 - Oracle 11g 及更高版本,请参阅 技术支持文档 Note: 414043.1, Patch 13104881
8Microsoft Windows IA (64-bit)
Microsoft Windows (64-bit Itanium)
7 - Oracle 10g 及更高版本,请参阅 技术支持文档 Note: 414043.1
8
12 - Oracle 10g 及更高版本
11, 13 - Oracle 11g 及更高版本,需要 Patch 13104881
9IBM zSeries Based Linux
z/Linux
9
18 (仅 64 位 zSeries)
10Linux (32-bit)
Linux x86
7 - Oracle 11g 及更高版本,需要 Patch 13104881
10
11, 13 - Oracle 10g 及更高版本,请参阅 技术支持文档 Note: 414043.1
11Linux IA (64-bit)
Linux Itanium
10 - Oracle 10g 及更高版本,请参阅 技术支持文档 Note: 414043.1
11
13 - Oracle 10g 及更高版本
7 - Oracle 11g 及更高版本,请参阅 技术支持文档 Note: 414043.1,还需要 Patch 13104881
8, 12 - Oracle 11g 及更高版本,需要 Patch 13104881
12Microsoft Windows 64-bit for AMD
Microsoft Windows (x86-64)
7 - Oracle 10g 及更高版本,请参阅技术支持说明 Note: 414043.1
8 - Oracle 10g 及更高版本
12
11, 13 - Oracle 11g 及更高版本,需要 Patch 13104881
13Linux 64-bit for AMD
Linux x86-64
7 - Oracle 11g 及更高版本,请参阅 技术支持文档 Note: 414043.1,还需要 Patch 13104881
10 - Oracle 10g 及更高版本,请参阅技术支持文档 Note: 414043.1
11 - Oracle 10g 及更高版本
8, 12 - Oracle 11g 及更高版本,需要 Patch 13104881
13
20 - Oracle 11g 及更高版本
15HP Open VMS
HP OpenVMS Alpha
HP IA OpenVMS
OpenVMS Itanium
15
16Apple Mac OS
Mac OS X Server
16
17Solaris Operating System (x86)
Solaris Operating System (x86)
17
20 - Oracle 10g 及更高版本,请参阅 技术支持文档 Note: 414043.1
18IBM Power Based Linux
Linux on Power
9(仅 64 位 zSeries)
18
20Solaris Operating System (AMD64)
Solaris Operating System (x86-64)
13 - Oracle 11g 及更高版本
17 - Oracle 10g 及更高版本,请参阅 技术支持文档 Note: 414043.1
20

举例:表格10,主库10支持的备库有7,10,11,13。但是备库是7时需要11g及更高版本才支持,并且需要应用patch13104881;备库为11和13时,需要10g及更高版本,支持文档为414043.1

逻辑standby

PLATFORM_IDPLATFORM_NAME使用 Data Guard (物理备用)时,相同 Data Guard 配置中支持的 PLATFORM_ID
2Solaris[tm] OE (64-bit)
Solaris Operating System (SPARC) (64-bit)
2
3HP-UX (64-bit)
HP-UX PA-RISC
3
4
4HP-UX IA (64-bit)
HP-UX Itanium
3
4
5HP Tru64 UNIX
HP Tru64 UNIX
5
6AIX-Based Systems (64-bit)
AIX5L
6
7Microsoft Windows (32-bit)
Microsoft Windows (x86)
7
10 requires patch for Bug 13104881
8, 12 - Replication can only occur from a 32-bit primary to a 64-bit standby, once a role transition has promoted the 64-bit system to the primary role, the original 32-bit primary is not supported as a standby database.
8Microsoft Windows IA (64-bit)
Microsoft Windows (64-bit Itanium)
7 - Replication can only occur from a 32-bit primary to a 64-bit standby, once a role transition has promoted the 64-bit system to the primary role, the original 32-bit primary is not supported as a standby database.
8, 12
11, 13, both require patch for Bug 13104881
9IBM zSeries Based Linux
z/Linux
9
10Linux (32-bit)
Linux x86
7, requires patch for Bug 13104881
10
11, 13 - Replication can only occur from a 32-bit primary to a 64-bit standby, once a role transition has promoted the 64-bit system to the primary role, the original 32-bit primary is not supported as a standby database.
11Linux IA (64-bit)
Linux Itanium
10 - Replication can only occur from a 32-bit primary to a 64-bit standby, once a role transition has promoted the 64-bit system to the primary role, the original 32-bit primary is not supported as a standby database.
8, requires patch for Bug 13104881
11, 13
12Microsoft Windows 64-bit for AMD
Microsoft Windows (x86-64)
7 - from Oracle 11g onward. Replication can only occur from a 32-bit primary to a 64-bit standby, once a role transition has promoted the 64-bit system to the primary role, the original 32-bit primary is not supported as a standby database.
8, 12
13Linux 64-bit for AMD
Linux x86-64
10 - Replication can only occur from a 32-bit primary to a 64-bit standby, once a role transition has promoted the 64-bit system to the primary role, the original 32-bit primary is not supported as a standby database.
8, requires patch for Bug 13104881
11, 13
15HP Open VMS
HP OpenVMS Alpha
HP IA OpenVMS
OpenVMS Itanium
15
16Apple Mac OS
Mac OS X Server
16
17Solaris Operating System (x86)
Solaris Operating System (x86)
17
18IBM Power Based Linux
Linux on Power
18
20Solaris Operating System (AMD64)
Solaris Operating System (x86-64)
20

今天的文章先到这里,后面继续更新Data Guard ----理论详解(五) 之DG日常维护管理与监控

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

eason_hyj

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值