[20140416]使用dgmgrl管理dataguard(3)

[20140416]使用dgmgrl管理dataguard(3).txt

参考链接:

http://blog.itpub.net/267265/viewspace-1142649/
http://blog.itpub.net/267265/viewspace-1143027/

从前面的测试看配置启用dgmgrl还是非常简单的。不需要太多的命令。举一些例子来说明:

1.关闭dataguard数据库。看看情况。
SYS@testdg> shutdown immediate ;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

DGMGRL> show configuration verbose
Configuration - study
  Protection Mode: MaxPerformance
  Databases:
    test   - Primary database
      Error: ORA-16778: redo transport error for one or more databases
    testdg - Physical standby database (disabled)
  Properties:
    FastStartFailoverThreshold      = '30'
    OperationTimeout                = '30'
    FastStartFailoverLagLimit       = '30'
    CommunicationTimeout            = '180'
    FastStartFailoverAutoReinstate  = 'TRUE'
    FastStartFailoverPmyShutdown    = 'TRUE'
    BystandersFollowRoleChange      = 'ALL'

Fast-Start Failover: DISABLED

Configuration Status:
ERROR

DGMGRL> show database  testdg

Database - testdg

  Role:            PHYSICAL STANDBY
  Intended State:  OFFLINE
  Transport Lag:   (unknown)
  Apply Lag:       (unknown)
  Real Time Query: OFF
  Instance(s):
    testdg

Database Status:
SHUTDOWN
--可以发现提示dg处于关闭状态。

2.启动dataguard到mount状态。
DGMGRL> show configuration verbose

Configuration - study

  Protection Mode: MaxPerformance
  Databases:
    test   - Primary database
    testdg - Physical standby database

  Properties:
    FastStartFailoverThreshold      = '30'
    OperationTimeout                = '30'
    FastStartFailoverLagLimit       = '30'
    CommunicationTimeout            = '180'
    FastStartFailoverAutoReinstate  = 'TRUE'
    FastStartFailoverPmyShutdown    = 'TRUE'
    BystandersFollowRoleChange      = 'ALL'

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database  testdg
Database - testdg

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: OFF
  Instance(s):
    testdg

Database Status:
SUCCESS

--可以发现redo 日志自动传输,不需要在输入alter database recover managed standby database using current logfile disconnect ;之类的命令。
--从以下命令也可以看出redo日志在传输:
SYS@testdg> select process, status, thread#, sequence#, block#, blocks from v$managed_standby;

PROCESS   STATUS          THREAD#  SEQUENCE#     BLOCK#     BLOCKS
--------- ------------ ---------- ---------- ---------- ----------
ARCH      CONNECTED             0          0          0          0
ARCH      CONNECTED             0          0          0          0
ARCH      CLOSING               1        978      18432         74
ARCH      CLOSING               1        979          1        231
RFS       IDLE                  0          0          0          0
RFS       IDLE                  1        980        165          1
RFS       IDLE                  0          0          0          0
MRP0      APPLYING_LOG          1        980        165     102400
8 rows selected.

3.启动dataguard到read only状态。
SYS@testdg> alter database open read only;
Database altered.

-- 11G 有一个新特性 read-time apply,日志依旧传输与应用。
DGMGRL> show configuration verbose

Configuration - study

  Protection Mode: MaxPerformance
  Databases:
    test   - Primary database
    testdg - Physical standby database

  Properties:
    FastStartFailoverThreshold      = '30'
    OperationTimeout                = '30'
    FastStartFailoverLagLimit       = '30'
    CommunicationTimeout            = '180'
    FastStartFailoverAutoReinstate  = 'TRUE'
    FastStartFailoverPmyShutdown    = 'TRUE'
    BystandersFollowRoleChange      = 'ALL'

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> show database  testdg

Database - testdg

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: ON
  Instance(s):
    testdg

Database Status:
SUCCESS

--可以发现日志一样在应用。
SYS@testdg> select process, status, thread#, sequence#, block#, blocks from v$managed_standby;
PROCESS   STATUS          THREAD#  SEQUENCE#     BLOCK#     BLOCKS
--------- ------------ ---------- ---------- ---------- ----------
ARCH      CONNECTED             0          0          0          0
ARCH      CONNECTED             0          0          0          0
ARCH      CLOSING               1        978      18432         74
ARCH      CLOSING               1        979          1        231
RFS       IDLE                  0          0          0          0
RFS       IDLE                  1        980        760          1
RFS       IDLE                  0          0          0          0
MRP0      APPLYING_LOG          1        980        760     102400

8 rows selected.
--你也可以在主数据库修改一条记录,看看备用库是否相应也修改这条记录,测试忽略。

总结:
可以发现使用dgmgrl来管理后,一切变的很简单。如果认真理解broker的含义(表示 n.掮客, 经纪人的意思。),
就很容易理解,这些操作在后台已经由ora_dmon_XXX来完成。

下面讲解已经使用了dgmgrl来管理dataguard,在使用sqlplus修改一些相关参数会出现什么情况呢?请看下篇。

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

转载于:http://blog.itpub.net/267265/viewspace-1143058/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值