11GR2下创建dataguard(四)

2014-11-24 17:08:06 · 作者: · 浏览: 12
adata/oraclbak/redo01.log';

alter database rename file '/u01/app/oracle/oradata/oracl/redo02.log' to '/u01/app/oracle/oradata/oraclbak/redo02.log';

alter database rename file '/u01/app/oracle/oradata/oracl/redo03.log' to '/u01/app/oracle/oradata/oraclbak/redo03.log';

alter database rename file '/u01/app/oracle/oradata/oracl/stdbyredo01.log' to '/u01/app/oracle/oradata/oraclbak/stdbyredo01.log';

alter database rename file '/u01/app/oracle/oradata/oracl/stdbyredo02.log' to '/u01/app/oracle/oradata/oraclbak/stdbyredo02.log';

alter database rename file '/u01/app/oracle/oradata/oracl/stdbyredo03.log' to '/u01/app/oracle/oradata/oraclbak/stdbyredo03.log';

alter database rename file '/u01/app/oracle/oradata/oracl/stdbyredo04.log' to '/u01/app/oracle/oradata/oraclbak/stdbyredo04.log';

9.3设置standby_file_management=auto

10.应用日志
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.

11G以后备库可以在打开的情况下同时应用归档日志.

alter database recover managed standby database cancel;
alter database open;
alter database recover managed standby database using current logfile disconnect from session;

这个时候可以启动主库了,然后验证备库上日志的应用情况:

Select Sequence#, Name, Applied From V$archived_Log Order By Sequence#;

SEQUENCE# NAME APPLIED

10 /u01/archive_log/1_10_833405832.dbf YES

11 /u01/archive_log/1_11_833405832.dbf YES

12 /u01/archive_log/1_12_833405832.dbf YES

13 /u01/archive_log/1_13_833405832.dbf YES

14 /u01/archive_log/1_14_833405832.dbf YES

15 /u01/archive_log/1_15_833405832.dbf YES

16 /u01/archive_log/1_16_833405832.dbf YES

17 /u01/archive_log/1_17_833405832.dbf YES

18 /u01/archive_log/1_18_833405832.dbf YES

19 /u01/archive_log/1_19_833405832.dbf YES

20 /u01/archive_log/1_20_833405832.dbf YES

21 /u01/archive_log/1_21_833405832.dbf YES

22 /u01/archive_log/1_22_833405832.dbf YES

23 /u01/archive_log/1_23_833405832.dbf YES

24 /u01/archive_log/1_24_833405832.dbf YES

25 /u01/archive_log/1_25_833405832.dbf YES

26 /u01/archive_log/1_26_833405832.dbf YES

搭建过程中遇到的问题:

1. 因standby_file_management设置为manual后忘记设置auto,导致在主库上创建了数据文件后,传输到备库是UNNAMED的数据文件.

执行Alter database open;报如下错误:

ERROR at line 1:

ORA-10458: standby database requires recovery

ORA-01157: cannot identify/lock data file 5 - see DBWR trace file

ORA-01111: name for data file 5 is unknown - rename to correct file

ORA-01110: data file 5: '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00005'

解决办法:

1. alter system set standby_file_management=manual;

2. alter database create datafile '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00005' as '/u01/app/oracle/oradata/oraclbak/tps_hxl01.dbf';

3. alter system set standby_file_management=auto;

4. recover managed standby database disconnect from session;

-- The End--