Cascaded Standby Databases

March 17th, 2007 | Categories: Boring | Tags:

在本地有个Primary Production数据库,为了防止在Production数据库失败的时候,仍然能够提供数据库服务并且保证零数据丢失的需要,在本地建立一个Standby数据库。此外,可能还需要一个在地理上比较远的远程Standby数据库,来做天灾的备份;或者一个恢复延迟数个小时,防止用户对数据进行错误操作的人灾的Standby.对远程的灾备Standby,少量数据丢失是可接受的。

当配置Primary数据库传递日志给Standby的时候,有两种方式。

一种是Primary负责传递2份Redo分别给Local Standby和Remote Standby. Primary传递Redo给Remote Standby的时候由于地域和网络的限制,可能会对Primary的带宽吞吐和性能带来影响。

第二种方式是Primary采用同步的方式传递Redo给Local Standby,再由Local Standby以异步的方式传递给Remote Standby。如下图。

有Local Standby负责和Remote Standby 的通信,减少了Primary维护Remote Standby的工作。

实现Cascaded Standby Databases,需要如下配置,

  • 在 Local standby database 创建 standby redo logfile
    • If standby redo log files are not already defined, you can define them dynamically on the standby database. The standby database will begin using them after the next log switch on the primary database.
    • alter database add standby logfile ‘’ size ..;
  • 在Primary DB上设置LOG_ARCHIVE_DEST_n 参数,传递redo给Local standby database
    • LGWR ASYNC or LGWR SYNC.
    • Optionally, set the VALID_FOR attribute so that redo forwarding is enabled even after a role transition happens between the original primary database and the intermediate standby database that is forwarding redo. This may be meaningful in cases where the databases are separated over Wide Area Networks.
    • alter system set log_archive_dest=”;alter system set log_archive_dest_1=’LOCATION=local_arch_directory’;

      alter system set log_archive_dest_2=’SERVICE=Local_standby lgwr’;

  • 在Remote standby database上设置STANDBY_ARCHIVE_DEST接收Local standby database的Redo

alter system set STANDBY_ARCHIVE_DEST=’local_arch_directory‘;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

  • 在Local standby database上设置LOG_ARCHIVE_DEST_n和STANDBY_ARCHIVE_DEST

alter system set log_archive_dest=”;

alter system set log_archive_dest_1=’LOCATION=local_arch_directory‘;

alter system set STANDBY_ARCHIVE_DEST=’local_arch_directory‘;

alter system set log_archive_dest_2=’SERVICE=Remote_standby arch’;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

See More in document and kamus.

Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪 ViVi 365Key 网摘 天极网摘 和讯网摘 博拉网 POCO 网摘 饭否 QQ 书签 Digbuzz 我挖网 Mister Wong
No comments yet.