主库上打开闪回
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
YES
模拟断电
SQL> shutdown abort
ORACLE instance shut down.
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Mar 27 20:54:18 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
主库到mount状态
SQL> startup mount;
ORACLE instance started.
Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 478154296 bytes
Database Buffers 301989888 bytes
Redo Buffers 2596864 bytes
Database mounted.
备库reinstate
DGMGRL> reinstate database newtest
Reinstating database "newtest", please wait...
Reinstatement of database "newtest" succeeded
DGMGRL> show configuration;
Configuration - dg_newtest
Protection Mode: MaxPerformance
Databases:
snewtest - Primary database
newtest - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
加入dg成功
SQL> conn / as sysdba
Connected.
SQL> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY