您的位置:首页 > 数据库 > Oracle

Oracle dataguard主备库创建闪回点及快照数据库与物理standby的切换方法

2016-07-29 11:23 477 查看
dg主备库创建闪回点:
Create Guaranteed Restore Points (optional)
The standard switchover fallback options should suffice for successfully backing out of a switchover. However, if you want an additional fallback option then you can create a guaranteed restore point on the primary and standby database participating in the switchover.

On the standby
Stop the apply process
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Create a guaranteed restore point
SQL> CREATE RESTORE POINT SWITCHOVER_START_GRP GUARANTEE FLASHBACK DATABASE;
Start the apply process
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

On the primary
Create a guaranteed restore point
SQL> CREATE RESTORE POINT SWITCHOVER_START_GRP GUARANTEE FLASHBACK DATABASE;

dg Snapshot Standby与Physical standby备库的转换:

Steps to convert Physical Standby Database to the Snapshot Standby Database
The conversion from physical standby to snapshot standby database  can be done through the command 
ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;  
1) If not already configured , configure flash recovery area as given below 
a) Set the size for recovery area. 
Alter system set db_recovery_file_dest_size=<size> 
b) Set Flash recovery area. 
Alter system set db_recovery_file_dest=<path> 
2) Bring the physical standby database to mount stage.  
3) Stop managed recovery if it is active.  
4) Convert physical standby database to snapshot standby database.  
ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;  
The database is dismounted during conversion and must be restarted. 
Once the database is restarted  any transaction can be executed . 
SQL> select open_mode,database_role from v$database; 
OPEN_MODE  DATABASE_ROLE 
---------- ---------------- 
READ WRITE SNAPSHOT STANDBY

An implicit guaranteed restore point is created when a physical standby database is converted into a snapshot standby database and this restore point is used to flashback a snapshot standby to its original state when it is converted back into a physical standby database.

Steps to convert the Snapshot Standby Database to the Physical Standby Database
1. Shutdown the snapshot standby database. 
2. Bring the database to the mount stage. 
3. Issue the command 
ALTER DATABASE CONVERT TO PHYSICAL STANDBY; 
4. Shutdown the database and mount it . 
SQL> select open_mode,database_role from v$database; 
OPEN_MODE  DATABASE_ROLE 
---------- ---------------- 
MOUNTED    PHYSICAL STANDBY 
5. Start the media recovery process.

参考文章:
11g Using Snapshot Standby Database. (文档 ID 443720.1)

11.2
Data Guard Physical Standby Switchover Best Practices using SQL*Plus (文档 ID 1304939.1)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: