RAC+ADG 异机恢复,控制文件自动恢复
admin
2023-04-17 13:01:41
0

1、首先要设置控制文件自动备份
2、自动化恢复脚本,使用如下命令

restore controlfile from autobackup;

此命令会找到最新的控制文件进行恢复,以下做一个测试来验证。
多次备份数据文件,生成多个控制文件备份。然后进行恢复操作,发现找到最近备份的控制文件进行恢复,我们也可以按照时间进行控制文件的删除。操作过程如下:


RMAN> show all;

RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl1.f'; # default
RMAN>  delete backup of controlfile completed before 'sysdate-1/10';

using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
2       2       1   1   AVAILABLE   DISK        /u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1515642676-20180927-00
4       4       1   1   AVAILABLE   DISK        /u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1515642676-20180927-01

Do you really want to delete the above objects (enter YES or NO)? no

RMAN> 

RMAN> list backup of controlfile;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time     
------- ---- -- ---------- ----------- ------------ --------------------
2       Full    17.70M     DISK        00:00:02     27-SEP-2018 11:08:08
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20180927×××10806
        Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1515642676-20180927-00
  Control File Included: Ckp SCN: 794221       Ckp time: 27-SEP-2018 11:08:06

BS Key  Type LV Size       Device Type Elapsed Time Completion Time     
------- ---- -- ---------- ----------- ------------ --------------------
4       Full    17.70M     DISK        00:00:05     27-SEP-2018 11:09:18
        BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: TAG20180927×××10913
        Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1515642676-20180927-01
  Control File Included: Ckp SCN: 794259       Ckp time: 27-SEP-2018 11:09:13

BS Key  Type LV Size       Device Type Elapsed Time Completion Time     
------- ---- -- ---------- ----------- ------------ --------------------
6       Full    17.70M     DISK        00:00:01     27-SEP-2018 14:13:46
        BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: TAG20180927×××41345
        Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1515642676-20180927-02
  Control File Included: Ckp SCN: 801298       Ckp time: 27-SEP-2018 14:13:45

BS Key  Type LV Size       Device Type Elapsed Time Completion Time     
------- ---- -- ---------- ----------- ------------ --------------------
8       Full    17.70M     DISK        00:00:01     27-SEP-2018 14:15:02
        BP Key: 8   Status: AVAILABLE  Compressed: NO  Tag: TAG20180927×××41501
        Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1515642676-20180927-03
  Control File Included: Ckp SCN: 801359       Ckp time: 27-SEP-2018 14:15:01

BS Key  Type LV Size       Device Type Elapsed Time Completion Time     
------- ---- -- ---------- ----------- ------------ --------------------
10      Full    17.70M     DISK        00:00:01     27-SEP-2018 14:16:06
        BP Key: 10   Status: AVAILABLE  Compressed: NO  Tag: TAG20180927×××41605
        Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1515642676-20180927-04
  Control File Included: Ckp SCN: 801655       Ckp time: 27-SEP-2018 14:16:05

BS Key  Type LV Size       Device Type Elapsed Time Completion Time     
------- ---- -- ---------- ----------- ------------ --------------------
12      Full    17.70M     DISK        00:00:01     27-SEP-2018 14:16:27
        BP Key: 12   Status: AVAILABLE  Compressed: NO  Tag: TAG20180927×××41626
        Piece Name: /u01/app/oracle/product/11.2.0/dbhome_1/dbs/c-1515642676-20180927-05
  Control File Included: Ckp SCN: 801678       Ckp time: 27-SEP-2018 14:16:26

RMAN> restore controlfile to '/tmp/control01.clt' from autobackup;

Starting restore at 27-SEP-2018 14:28:50
using channel ORA_DISK_1

channel ORA_DISK_1: looking for AUTOBACKUP on day: 20180927
channel ORA_DISK_1: AUTOBACKUP found: c-1515642676-20180927-05
channel ORA_DISK_1: restoring control file from AUTOBACKUP c-1515642676-20180927-05
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
Finished restore at 27-SEP-2018 14:28:53

RMAN> 

相关内容

热门资讯

终于懂了“宝宝浙江游戏可以开挂... 有 亲,根据资深记者爆料宝宝浙江游戏是可以开挂的,确实有挂(咨询软件无需...
提案降低罢免赖清德门槛挨批,翁... 海峡导报综合报道 国民党民代翁晓玲提案降低罢免台湾地区领导人门槛,遭民进党民代批是打造斗争工具来。翁...
终于明白“猜宝控制器有没有挂?... 终于明白“猜宝控制器有没有挂?”(其实是有挂)您好,猜宝控制器这个游戏其实有挂的,确实是有挂的,需要...
商务部:对进口牛肉实施保障措施 根据《中华人民共和国保障措施条例》(以下称《保障措施条例》)的规定,2024年12月27日,商务部(...
印度经济超越日本,位列全球第四... 据观察者网报道,当地时间12月29日,印度政府发布了一份经济状况简报。简报中宣称,如果按照名义GDP...
今日重大消息“竞技圈怎么开挂?... 家人们!今天小编来为大家解答竞技圈透视挂怎么安装这个问题咨询软件客服徽9784099的挂在哪里买很多...
终于懂了“桂麻圈怎么开挂?”(... 有 亲,根据资深记者爆料桂麻圈是可以开挂的,确实有挂(咨询软件无需打开直...
今日重大通报“超稳炸/金/花开... 您好:超稳炸/金/花这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9784099】很多玩家在这...
【第一资讯】“哪吒重生开挂器?... 【第一资讯】“哪吒重生开挂器?”(必胜开挂神器)您好,哪吒重生这个游戏其实有挂的,确实是有挂的,需要...
玩家攻略科普“皇豪众娱牛牛有没... 玩家攻略科普“皇豪众娱牛牛有没有挂?”(太坑了果然有挂)您好,皇豪众娱牛牛这个游戏其实有挂的,确实是...