Oracle dataguard主備庫建立閃回點及快照資料庫與物理standby的切換方法
阿新 • • 發佈:2019-02-04
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)
11.2 Data Guard Physical Standby Switchover Best Practices using SQL*Plus (文件 ID 1304939.1)