我是靠谱客的博主 强健美女,最近开发中收集的这篇文章主要介绍Real-Time apply异常,求解,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述


点击(此处)折叠或打开

  1. 备库在启动实时恢复后,进行测试,结果是仍然是redo apply
  2. --standby database
  3. alter database recover managed standby database using current logfile disconnect from session;
  4. SQL> select open_mode,database_role,db_unique_name from v$database;
  5. OPEN_MODE            DATABASE_ROLE    DB_UNIQUE_NAME
    -------------------- ---------------- ------------------------------
    READ ONLY WITH APPLY PHYSICAL STANDBY phydb

  6. MRP0: Background Managed Standby Recovery process started (phydb)
    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 Log +FLASHDG/phydb/archivelog/arch_925752176_1_150.arc
    Media Recovery Log +FLASHDG/phydb/archivelog/arch_925752176_1_151.arc
    Media Recovery Log +FLASHDG/phydb/archivelog/arch_925752176_1_152.arc
    Media Recovery Waiting for thread 1 sequence 153 (in transit)
    Completed: alter database recover managed standby database using current logfile disconnect from session
  7. 备库正常开启日志实时恢复,接下来,主库删除部分数据 ,进行验证

点击(此处)折叠或打开

  1. --primary database 做删除数据的动作
  2. SQL> delete from xjmon.b where rownum <=1;

  3. 1 row deleted.

  4. SQL> commit;

  5. Commit complete.

  6. SQL> select count(*) from xjmon.b;

  7.   COUNT(*)
  8. ----------
  9.         41

  10. SQL> archive log list;
  11. Database log mode Archive Mode
  12. Automatic archival Enabled
  13. Archive destination +FLASH/racdb/archivelog/
  14. Oldest online log sequence 157
  15. Next log sequence to archive 158
  16. Current log sequence 158
  17. SQL>

点击(此处)折叠或打开

  1. --standby database 检查,表数据未与主库保持一致
  2. SQL> archive log list;
  3. Database log mode Archive Mode
  4. Automatic archival Enabled
  5. Archive destination +FLASHDG/phydb/archivelog/
  6. Oldest online log sequence 157
  7. Next log sequence to archive 0
  8. Current log sequence 158
  9. SQL> select count(*) from xjmon.b;

  10.   COUNT(*)
  11. ----------
  12.         42
  13. SQL> archive log list;
  14. Database log mode Archive Mode
  15. Automatic archival Enabled
  16. Archive destination +FLASHDG/phydb/archivelog/
  17. Oldest online log sequence 158
  18. Next log sequence to archive 0
  19. Current log sequence 159

  20. ---在primary database上进行切换日志文件操作后,standby database查询才进行了同步
  21. alter system switch lofile

  22. SQL> select count(*) from xjmon.b;

  23.   COUNT(*)
  24. ----------
  25.         41
我的环境是11.2.0.3 RAC+ 单实例DG,以上操作是在主库节点1和备库上操作,出现实时恢复异常的情况。

但同样的操作,在节点2上执行,实时恢复正常,备库上的数据随着主库节点2的commit后,保持与主库一致。

点击(此处)折叠或打开

  1. 节点1环境如下
  2. SQL> show parameter log_archive_dest

  3. NAME TYPE VALUE
  4. ------------------------------------ ----------- ------------------------------
  5. log_archive_dest string
  6. log_archive_dest_1 string LOCATION=+FLASH/RACDB/ARCHIVELOG/ valid_for=(all_logfiles,al
  7.                                                  l_roles) db_unique_name=racdb

  8. log_archive_dest_2 string SERVICE=phydb lgwr async valid_for=(online_logfiles,primary_
  9.                                                  role) db_unique_name=phydb
  10. log_archive_dest_20 string


点击(此处)折叠或打开

  1. --备库环境如下
  2. SQL> show parameter log_archive_dest_1

  3. NAME TYPE VALUE
  4. ------------------------------------ ----------- ------------------------------
  5. log_archive_dest_1 string LOCATION=+FLASHDG/phydb/ARCHIV
  6.                                                  ELOG/ valid_for=(all_logfiles,
  7.                                                  all_roles) db_unique_name=phyd
  8.                                                  b
  9. SQL> show parameter log_archive_dest_2

  10. NAME TYPE VALUE
  11. ------------------------------------ ----------- ------------------------------
  12. log_archive_dest_2 string SERVICE=racdb lgwr async valid
  13.                                                  _for=(online_logfiles,primary_
  14.                                                  role) db_unique_name=racdb
  15. ---备库是real-time apply
  16. SQL> select open_mode,database_role,db_unique_name from v$database;


    OPEN_MODE            DATABASE_ROLE    DB_UNIQUE_NAME
    -------------------- ---------------- ------------------------------
    READ ONLY WITH APPLY PHYSICAL STANDBY phydb







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

转载于:http://blog.itpub.net/28551528/viewspace-2127056/

最后

以上就是强健美女为你收集整理的Real-Time apply异常,求解的全部内容,希望文章能够帮你解决Real-Time apply异常,求解所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(35)

评论列表共有 0 条评论

立即
投稿
返回
顶部