Thursday, September 14, 2006

手动standby数据库

在时间点A冷备数据库,然后启动主库正常使用,standby数据库不打开或者只open readonly。
经过一段时间后,想要使standby库与主库再次一致。

实现方法:
SQL> alter database backup controlfile to 'back.ctl';
SQL> show parameter log_archive_dest (Decide where to put the archived logs)
SQL> select name from v$controlfile (Decide where to put the backup of control file)
Note:
You should change the name of "back.ctl" and duplicate it to match the results of this query.

SQL>shutdown;

拷贝back.ctl以及所有的archivelog,onlinelog到standby库。

SQL> startup mount;
SQL> select * from v$recover_file; (Use this to verify all the datafiles need recovery)
SQL> recover database until cancel using backup controlfile;
auto (input "auto" as prompt)
手工指定onlinelog(一个一个尝试,失败就再来一次)
SQL> alter database open resetlogs;

No comments: