重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1358|回复: 0
打印 上一主题 下一主题

[Oracle] Warning: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFIL...

[复制链接]
跳转到指定楼层
楼主
发表于 2023-2-25 08:48:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1、在搭建19c rac-pdb  -----》单机pdb完成后,按照11g的方式启动实时日志应用,执行了这个语句alter database recover managed standby database using current logfile disconnect from session
在alert.log里面看到了2行警告信息:2023-02-25T01:40:22.956824+08:00
Warning: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE has been deprecated.
Warning: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE has been deprecated.
alter database recover managed standby database using current logfile disconnect from session
2023-02-25T01:40:22.961078+08:00
Attempt to start background Managed Standby Recovery process (orclcdbdg)
Starting background process MRP0
2023-02-25T01:40:22.972103+08:00
MRP0 started with pid=89, OS id=30539
2023-02-25T01:40:22.972931+08:00
Background Managed Standby Recovery process started (orclcdbdg)
2023-02-25T01:40:27.990534+08:00
Started logmerger process
2023-02-25T01:40:27.996229+08:00

IM on ADG: Start of Empty Journal

IM on ADG: End of Empty Journal
PR00 (PID:30547): Managed Standby Recovery starting Real Time Apply   《《《《这里可以看到开启了实时恢复

注意:看has been deprecated.说明这个参数可能被废弃了,但是oracle还是向下进行了兼容,实时恢复并没有受到影响

2、通过查询资料发现在12c之后是使用如下的语句来实现:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;                                         --启用实时恢复
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING ARCHIVED LOGFILE DISCONNECT;  --如果是使用archivelog 方式同步(也就说不启用实时恢复)
再看看上面和11g启动实时恢复有什么不一样呢?就是using current logfile这里舍弃了,其它一样,disconnect 和 disconnect from session都是放后台操作;

3、我发出如下语句再观察alert日志
SQL> alter database recover managed standby database cancel;
SQL> alter database recover managed standby database disconnect;


在alert.log里面看到了2行警告信息:
2023-02-25T08:38:29.138639+08:00
Managed Standby Recovery Canceled (orclcdbdg)
Completed: alter database recover managed standby database cancel    <<取消恢复



2023-02-25T08:39:01.411460+08:00
alter database recover managed standby database disconnect             <<执行的启用实时恢复的语句
2023-02-25T08:39:01.413854+08:00
Attempt to start background Managed Standby Recovery process (orclcdbdg)
Starting background process MRP0
2023-02-25T08:39:01.425400+08:00
MRP0 started with pid=89, OS id=26801
2023-02-25T08:39:01.426250+08:00
Background Managed Standby Recovery process started (orclcdbdg)
2023-02-25T08:39:06.445084+08:00
Started logmerger process
2023-02-25T08:39:06.455955+08:00

IM on ADG: Start of Empty Journal

IM on ADG: End of Empty Journal
PR00 (PID:26807): Managed Standby Recovery starting Real Time Apply《《《《这里可以看到开启了实时恢复


4、总结
12c后可以看出命令更简单了,不需要向以前那样输入那么多就自动启动实时恢复功能;


11g 必须加using current logfile,才能启动实时恢复;不加就是使用archivelog日志恢复;
12c后,不需要加using current logfile就能启动实时恢复,如果要启动archivelog日志恢复是单独的语句:using archived logfile disconnect;

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-16 08:04 , Processed in 0.137257 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表