Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3494392
  • 博文数量: 738
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7745
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(738)

文章存档

2023年(75)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客

分类: Oracle

2021-08-15 23:41:10


  1. 备库
  2. RECOVER MANAGED STANDBY DATABASE CANCEL;
  3. select min(s) min_scn from(SELECT CURRENT_SCN s FROM V$DATABASE 
  4. union select min(checkpoint_change#) from v$datafile_header);
  5. 假设这里的{BANNED}最佳小scn是3162298 

  6. 主库识别这些新增的文件
  7. SELECT FILE#, NAME FROM V$DATAFILE WHERE CREATION_CHANGE# >3162298;
  8. 假设这里有678三个新增文件

  9. backup datafile 6,7,8 format '/tmp/ForStandby_%U' tag 'FORSTANDBY';
  10. backup incremental from SCN 3162298 database format '/tmp/ForStandby_%U' tag 'FORSTANDBY';
  11. backup current controlfile for standby format '/tmp/ForStandbyCTRL.bck';
  12. scp /tmp/ForStandby* 备库:/tmp

  13. 备库
  14. shutdown immediate;
  15. startup nomount;
  16. restore standby controlfile from '/tmp/ForStandbyCTRL.bck';
  17. alter database mount;
  18. CATALOG START WITH '/tmp/ForStandby';

  19. run
  20. {
  21. allocate channel c1 type disk;
    allocate channel c2 type disk;
    allocate channel c3 type disk;
    allocate channel c4 type disk;
    set newname for datafile 6 to '+DISKGROUP';
  22. set newname for datafile 7 to '+DISKGROUP';
  23. set newname for datafile 8 to '+DISKGROUP';
  24. restore datafile 6,7,8;
  25. }

  26. CATALOG START WITH '备库文件位置'; --例如:+DATA/orcldg/datafile/
  27. SWITCH DATABASE TO COPY;
    1. run
    2. {
    3. allocate channel c1 type disk;
      allocate channel c2 type disk;
      allocate channel c3 type disk;
      allocate channel c4 type disk;
  28.  RECOVER DATABASE NOREDO;
    1. }

  29. ALTER DATABASE FLASHBACK OFF; --根据需要
  30. ALTER DATABASE FLASHBACK ON;

  1. 备库
  2. sqplus / as sysdba
  3. ALTER DATABASE CLEAR LOGFILE GROUP 1;
  4. ALTER DATABASE CLEAR LOGFILE GROUP 2;
  5. ALTER DATABASE CLEAR LOGFILE GROUP 3;
  6. RECOVER MANAGED STANDBY DATABASE DISCONNECT;


参考:
将数据文件添加到主数据库时使用 RMAN 增量备份前滚备用数据库的步骤(文档 ID 1531031.1)
阅读(6279) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~