运维联盟俱乐部

 找回密码
 立即注册
查看: 295|回复: 0

[备份恢复] 激活备库后利用原主库rman备份快速搭建adg

[复制链接]
  • TA的每日心情
    开心
    2023-8-9 11:05
  • 发表于 2023-11-25 20:39:45 | 显示全部楼层 |阅读模式
    --adg 场景说明

    交换机故障,导致业务职能连接到备库,此时将备库强制切换成主库。
    在交换机故障修复后,需重新搭建adg,并利用上原主库的带库备份作为restore。

    实现过程如下:
    1.备库查询激活时的scn
    SQL> SELECT TO_CHAR(STANDBY_BECAME_PRIMARY_SCN) FROM V$DATABASE;
    TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)
    ----------------------------------------
    204292 <<<

    2.原主库
    1)切换到mount
    2)直接进行restore
    3)recover 到204292
       recover database until scn 204292;  《〈《这步如果能正常实现(会自动restore后并应用归档)
       RMAN> recover database until scn 204292;

    Starting recover at 25-NOV-23
    using channel ORA_DISK_1

    starting media recovery

    archived log for thread 2 with sequence 12 is already on disk as file +ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_12.1101.1153853905
    archived log for thread 2 with sequence 13 is already on disk as file +ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_13.1100.1153853905
    archived log for thread 2 with sequence 14 is already on disk as file +ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_14.1379.1153853905
    archived log for thread 2 with sequence 15 is already on disk as file +ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_15.1378.1153853907
    archived log for thread 2 with sequence 16 is already on disk as file +ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_16.1399.1153853995
    archived log file name=+ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_12.1101.1153853905 thread=2 sequence=12
    archived log file name=+ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_13.1100.1153853905 thread=2 sequence=13
    archived log file name=+ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_14.1379.1153853905 thread=2 sequence=14
    archived log file name=+ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_15.1378.1153853907 thread=2 sequence=15
    archived log file name=+ARCH/yldbp/archivelog/2023_11_25/thread_2_seq_16.1399.1153853995 thread=2 sequence=16
    media recovery complete, elapsed time: 00:00:00
    Finished recover at 25-NOV-23

    RMAN> exit
    4)将原主库转换为备库
    ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

    5)启动mount
    6)开启复制进程
    recover managed standby database using current logfile disconnect from session;
    alert会看到复制进程异常退出
    Sat Nov 25 19:12:11 2023
    Managed Standby Recovery starting Real Time Apply
    MRP0: Background Media Recovery terminated with error 38868
    Errors in file /u01/app/oracle/diag/rdbms/yldbp/yldbp2/trace/yldbp2_mrp0_13535.trc:
    ORA-38868: warning: the control file may have incorrect data file structure
    Managed Standby Recovery not using Real Time Apply
    MRP0: Background Media Recovery process shutdown (yldbp2)  《〈《
    7)新备库重新关闭并mount后就正常


    回复

    使用道具 举报

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

    本版积分规则

    运维联盟俱乐部 ( 冀ICP备19036648号 )

    GMT+8, 2024-5-10 15:41 , Processed in 0.054155 second(s), 21 queries , Gzip On.

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

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