ITPub博客

首页 > Linux操作系统 > Linux操作系统 > dest_2参数与using current controlfile及standby log相互关系测试

dest_2参数与using current controlfile及standby log相互关系测试

原创 Linux操作系统 作者:大米嗵嗵 时间:2012-10-27 23:26:44 0 删除 编辑
环境:oracle11.2.0.3/Linux5.5
结论:
当dest_参数为lgwr时,需要配置standby redolog,否则会报错;为arch时,则不需要配置。
当恢复命令发起为alter database recover managed standby database using current controlfile disconnect时,必须已经配置standby redolog。该模式下,数据实时同步
而alter database recover managed standby database disconnect时,数据异步应用,需要主库做日志切换(switch logfile)后备库才进行应用归档,之后才能在备库查到相关数据。
(实验中利用11gDataGuard只读查询模式并同步恢复进行验证数据)

1.//lgwr sync without standby logfile
alter database recover managed standby database disconnect
Attempt to start background Managed Standby Recovery process (orcl)
Sat Oct 27 21:33:17 2012
MRP0 started with pid=23, OS id=3401 
MRP0: Background Managed Standby Recovery process started (orcl)
Serial Media Recovery started
Managed Standby Recovery not using Real Time Apply
Sat Oct 27 22:10:13 2012
Archived Log entry 44 added for thread 1 sequence 68 rlc 790697508 ID 0x4f000c23 dest 2:
RFS[4]: No standby redo logfiles created
RFS[4]: Opened log for thread 1 sequence 69 dbid 1318478244 branch 790697508
Sat Oct 27 22:10:18 2012
Media Recovery Log /oradata/arch/1_68_790697508.dbf

2.//lgwr sync without standby logfile/using current logfile
SQL> alter database recover managed standby database using current logfile disconnect;
alter database recover managed standby database using current logfile disconnect
*
ERROR at line 1:
ORA-38500: USING CURRENT LOGFILE option not available without standby redo logs

3.//lgwr async without standby logfile
'SERVICE=rzorcl LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=rzorcl'
Sat Oct 27 22:15:02 2012
Archived Log entry 46 added for thread 1 sequence 70 rlc 790697508 ID 0x4f000c23 dest 2:
RFS[6]: No standby redo logfiles created
RFS[6]: Opened log for thread 1 sequence 71 dbid 1318478244 branch 790697508
Sat Oct 27 22:15:08 2012
Media Recovery Log /oradata/arch/1_70_790697508.dbf
Media Recovery Waiting for thread 1 sequence 71 (in transit)

4.//arch async without standby logfile
Sat Oct 27 22:20:30 2012
RFS[4]: Assigned to RFS process 3772
RFS[4]: Opened log for thread 1 sequence 75 dbid 1318478244 branch 790697508
Archived Log entry 51 added for thread 1 sequence 75 rlc 790697508 ID 0x4f000c23 dest 2:
Sat Oct 27 22:20:44 2012
Media Recovery Log /oradata/arch/1_75_790697508.dbf
Media Recovery Waiting for thread 1 sequence 76

5.//lgwr sync with standby logfile
alter database recover managed standby database disconnect
Attempt to start background Managed Standby Recovery process (orcl)
Sat Oct 27 22:37:08 2012
MRP0 started with pid=26, OS id=3828 
MRP0: Background Managed Standby Recovery process started (orcl)
Serial Media Recovery started
Managed Standby Recovery not using Real Time Apply
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Waiting for thread 1 sequence 81 (in transit)
Completed: alter database recover managed standby database disconnect
Sat Oct 27 22:37:27 2012
Primary database is in MAXIMUM PERFORMANCE mode
Sat Oct 27 22:37:28 2012
RFS[7]: Selected log 4 for thread 1 sequence 82 dbid 1318478244 branch 790697508
Sat Oct 27 22:37:28 2012
Archived Log entry 57 added for thread 1 sequence 81 ID 0x4f000c23 dest 1:
Sat Oct 27 22:37:30 2012
Media Recovery Log /oradata/arch/1_81_790697508.dbf
Media Recovery Waiting for thread 1 sequence 82 (in transit)
此时,主库新建一张表,备库并不会立马新建一张表,需要alter system switch logfile切换后或者主库shutdown immediate后生成归档备库应用后备库上才能查到该表。

6.//lgwr async with standby logfile
alter database recover managed standby database disconnect
Attempt to start background Managed Standby Recovery process (orcl)
Sat Oct 27 22:34:32 2012
MRP0 started with pid=26, OS id=3820 
MRP0: Background Managed Standby Recovery process started (orcl)
Serial Media Recovery started
Managed Standby Recovery not using Real Time Apply
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Waiting for thread 1 sequence 78 (in transit)
Completed: alter database recover managed standby database disconnect
Sat Oct 27 22:34:50 2012
RFS[6]: Selected log 5 for thread 1 sequence 79 dbid 1318478244 branch 790697508
Sat Oct 27 22:34:50 2012
Archived Log entry 54 added for thread 1 sequence 78 ID 0x4f000c23 dest 1:
Sat Oct 27 22:34:53 2012
Media Recovery Log /oradata/arch/1_78_790697508.dbf
Media Recovery Waiting for thread 1 sequence 79 (in transit)
此时,主库新建一张表,备库并不会立马新建一张表,需要alter system switch logfile切换后或者主库shutdown immediate后生成归档备库应用后备库上才能查到该表。

7.//lgwr sync with standby logfile/using current logfile
MRP0: Background Managed Standby Recovery process started (orcl)
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Waiting for thread 1 sequence 82 (in transit)
Recovery of Online Redo Log: Thread 1 Group 4 Seq 82 Reading mem 0
  Mem# 0: /oradata/orcl/redo04.std
Completed: alter database recover managed standby database using current logfile disconnect
Sat Oct 27 22:39:58 2012
RFS[7]: Selected log 5 for thread 1 sequence 83 dbid 1318478244 branch 790697508
Sat Oct 27 22:39:58 2012
Archived Log entry 58 added for thread 1 sequence 82 ID 0x4f000c23 dest 1:
Sat Oct 27 22:39:58 2012
Media Recovery Waiting for thread 1 sequence 83 (in transit)
Recovery of Online Redo Log: Thread 1 Group 5 Seq 83 Reading mem 0
  Mem# 0: /oradata/orcl/redo05.std
此时,主库新建一张表,备库立马新建一张表,而不需要alter system switch logfile切换后才新建。
并且,参数dest_2中的lgwr sync/async或arch sync都不影响数据同步

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24005010/viewspace-747512/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-07-31

  • 博文量
    75
  • 访问量
    150054