4.备库使用主库生成的控制文件
sql>startup nomount;
rman>restore standby controlfile from '/tmp/std.ctl';
rman> alter database mount;
5. 编目备库当前数据文件
在主备库使用ASM磁盘组的情况下,而且文件使用OMF,如果查看当前备库数据文件,你会发现不认识了,要让你修改:
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/MUST_RENAME_THIS_DATAFILE_1.4294967295.4294967295
+DATA/MUST_RENAME_THIS_DATAFILE_2.4294967295.4294967295
+DATA/MUST_RENAME_THIS_DATAFILE_3.4294967295.4294967295
+DATA/MUST_RENAME_THIS_DATAFILE_4.4294967295.4294967295
+DATA/MUST_RENAME_THIS_DATAFILE_5.4294967295.4294967295
+DATA/MUST_RENAME_THIS_DATAFILE_7.4294967295.4294967295
直接编目当前数据文件位置即可:
rman >catalog start with '+data/orcl/datafile/';
...
Do you really want to catalog the above files (enter YES or NO)? YES
...
如果不是OMF,需要如下:
RMAN> catalog datafilecopy '<File-Specification>';
之后,提交更改:
RMAN> switch database to copy;
6.clear all online redo log groups
SQL> alter database clear logfile group 1;
Database altered.
SQL> alter database clear logfile group 2;
Database altered.
SQL> alter database clear logfile group 3;
Database altered.
7.Recreate the standby redo logs on standby database
SQL> alter database add standby logfile group 4 size 50m;