recover from service 修复备库gap

220阅读 0评论2023-10-27 brjl
分类:Oracle

先来个清日志脚本镇场
  1. SQL> begin
  2. for log_cur in ( select group# group_no from v$log )
  3. loop
  4. execute immediate 'alter database clear logfile group '||log_cur.group_no;
  5. end loop;
  6. end;
  7. /

  8. SQL> begin
  9. for log_cur in ( select group# group_no from v$standby_log )
  10. loop
  11. execute immediate 'alter database clear logfile group '||log_cur.group_no;
  12. end loop;
  13. end;
  14. /
DB Version 12.1.0.1 to 21.6 
  1. 备库上

  2. $ rman target /

  3. RMAN > run {
  4. allocate channel c1 type disk connect '/@';
  5. allocate channel c2 type disk connect '/@';
  6. allocate channel c3 type disk connect '/@';
  7. allocate channel c4 type disk connect '/@';
  8. allocate channel c5 type disk connect '/@';
  9. allocate channel c6 type disk connect '/@';
  10. allocate channel c7 type disk connect '/@';
  11. allocate channel c8 type disk connect '/@';
  12. recover database from service 'TS_PRI' section size 32G;
  13. }

  14. 观察进度
  15. select INST_ID,SID,SERIAL#,OPNAME, round((sofar/totalwork)*100,2) as "%complete",
  16.  ELAPSED_SECONDS, TIME_REMAINING
  17. from gv$session_longops
  18. where sofar<>totalwork and totalwork<>0
  19. and SID||SERIAL# in (select SID||SERIAL# from v$session);


参考:2850185.1
上一篇:关于达梦v$datafile的total_size=983040
下一篇:达梦修改表空间