Oracle DG failover 后恢复

以pkssk2g01/ pkssk2g02 上SHSKDBG1为例:

SHSKDBG1 已经failover切换到原来的备库,现在pkssk2g02是主库, pkssk2g01为备库,现在要把pkssk2g01 上的备库开起来具体步骤如下:

1.     在新主库上(pkssk2g02) 查出failover时的SCN:

Select standby_became_primary_scn from v$database;

or:

Selectto_char(standby_became_primary_scn) from v$database;

 

2.    在oldprimary库上(pkssk2g01):

Startup mount;

flashback database to scn 117332425; //117332425 这个值为在新主库上查询到的SCN值

Alter database convert to physical standby;

Shutdown immediate;

Startup;

alter database recover managed standby database using current logfiledisconnect from session;//注意在开启备库的时候,要看看现在的备库上是否有standbylog file,如果没有则用下面的语句添加:

 

Alterdatabase add standby logfile group 11('/redo1/oradata/shskdbg1/redo01_stb.log','/redo2/oradata/shskdbg1/redo01_stb.rdo')SIZE 512M;

 

Alterdatabase add standby logfile group 12('/redo1/oradata/shskdbg1/redo02_stb.log','/redo2/oradata/shskdbg1/redo02_stb.rdo')SIZE 512M;

 

 

 

 

 

你可能感兴趣的:(Oracle DG failover 后恢复)