当前位置: 首页 > 数据库 > MSSQL > 正文

DataGuard日常维护

时间:2010-01-27 why566

一 正确打开主库和备库

1 主库:

SQL> STARTUP MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;

2 备库:

SQL> STARTUP MOUNT;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

二 正确关闭顺序

1 备库:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL>SHUTDOWN IMMEDIATE;

2 主库

SQL>SHUTDOWN IMMEDIATE;

三 备库Read-Only模式打开

当前主库正常OPEN状态

备库处于日志传送状态.

1 在备库停止日志传送

SQL> recover managed standby database cancel;

2 备库Read-only模式打开

SQL> alter database open read only;

3 备库回到日志传送模式

SQL> recover managed standby database disconnect from session;
Media recovery complete.
SQL> select status from v$instance;

STATUS
------------
MOUNTED