DG测试—Failover

[oracle@lfdz1 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/oracle@sbdb1
Connected.
DGMGRL> 
DGMGRL> failover to 'SBDB1';
Performing failover NOW, please wait...
Failover succeeded, new primary is "SBDB1"
DGMGRL> show configuration;
Configuration - dgtest

  Protection Mode: MaxAvailability
  Databases:
    SBDB1 - Primary database
      Warning: ORA-16817: unsynchronized fast-start failover configuration

    PROD1 - (*) Physical standby database (disabled)
      ORA-16661: the standby database needs to be reinstated

Fast-Start Failover: ENABLED

Configuration Status:
WARNING

SYS@PROD1> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@PROD1> startup mount
ORACLE instance started.

Total System Global Area  523108352 bytes
Fixed Size                  1346052 bytes
Variable Size             331351548 bytes
Database Buffers          184549376 bytes
Redo Buffers                5861376 bytes
Database mounted.

[oracle@lfdz1 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@sbdb1
Connected.
DGMGRL> show configuration;

Configuration - dgtest

  Protection Mode: MaxAvailability
  Databases:
    SBDB1 - Primary database
      Warning: ORA-16817: unsynchronized fast-start failover configuration

    PROD1 - (*) Physical standby database (disabled)
      ORA-16661: the standby database needs to be reinstated

Fast-Start Failover: ENABLED

Configuration Status:
WARNING

DGMGRL> reinstate database 'PROD1';
Reinstating database "PROD1", please wait...
Reinstatement of database "PROD1" succeeded
DGMGRL> show configuration;
Configuration - dgtest

  Protection Mode: MaxAvailability
  Databases:
    SBDB1 - Primary database
    PROD1 - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:
SUCCESS

DGMGRL> show database 'SBDB1';
Database - SBDB1

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    SBDB1

Database Status:
SUCCESS

DGMGRL> show database 'PROD1';
Database - PROD1

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

Database Status:
SUCCESS

DGMGRL> failover to 'PROD1';
Performing failover NOW, please wait...
Failover succeeded, new primary is "PROD1"
DGMGRL> show configuration;
Configuration - dgtest

  Protection Mode: MaxAvailability
  Databases:
    PROD1 - Primary database
      Warning: ORA-16817: unsynchronized fast-start failover configuration

    SBDB1 - (*) Physical standby database (disabled)
      ORA-16661: the standby database needs to be reinstated

Fast-Start Failover: ENABLED

Configuration Status:
WARNING

DGMGRL> show database 'PROD1';
Database - PROD1

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    PROD1

  Database Warning(s):
    ORA-16817: unsynchronized fast-start failover configuration

Database Status:
WARNING

DGMGRL> show database 'SBDB1';
Database - SBDB1

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

Database Status:
ORA-16661: the standby database needs to be reinstated

SYS@SBDB1> startup mount;
ORACLE instance started.

Total System Global Area  523108352 bytes
Fixed Size                  1346052 bytes
Variable Size             331351548 bytes
Database Buffers          184549376 bytes
Redo Buffers                5861376 bytes
Database mounted.

DGMGRL> reinstate database 'SBDB1';
Reinstating database "SBDB1", please wait...
Reinstatement of database "SBDB1" succeeded

DGMGRL> show configuration;
Configuration - dgtest

  Protection Mode: MaxAvailability
  Databases:
    PROD1 - Primary database
    SBDB1 - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:
SUCCESS

SYS@PROD1> select open_mode, database_role, switchover_status from v$database;

OPEN_MODE            DATABASE_ROLE    SWITCHOVER_STATUS
-------------------- ---------------- --------------------
READ WRITE           PRIMARY          TO STANDBY

SYS@SBDB1> select open_mode, database_role, switchover_status from v$database;

OPEN_MODE            DATABASE_ROLE    SWITCHOVER_STATUS
-------------------- ---------------- --------------------
READ ONLY WITH APPLY PHYSICAL STANDBY NOT ALLOWED

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

转载于:http://blog.itpub.net/30192548/viewspace-2121493/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值