babihoo 发表于 2014-2-26 10:01:44

[备份恢复] 关于自动备份的问题


1、用catalog可以看到两个备份文件没有注册,可是貌似注册不了,没有任何错误提示,用list也看不到。
2、11.2版本开启自动控制文件备份之后,改变数据结构M000会备份控制文件吗,怎么我都等了一天了也没见自动备份啊,好奇怪的说!
以上两个问题不知道有没有大大知道答案啊,求赐教。
-------------------------
操作系统是:Linux babihoo 2.6.9-55.EL #1 Wed May 2 13:52:16 EDT 2007 i686 i686 i386 GNU/Linux
oracle版本:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0    Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

问题1:
RMAN> catalog db_recovery_file_dest;

searching for all files in the recovery area

List of Files Unknown to the Database
=====================================
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840451559_9jr0z96j_.bkp
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840456666_9jr5yv5c_.bkp

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840451559_9jr0z96j_.bkp
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840456666_9jr5yv5c_.bkp

RMAN> list backup of controlfile;

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

BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5       Full    9.36M      DISK      00:00:04   25-FEB-14      
      BP Key: 5   Status: AVAILABLECompressed: NOTag: TAG20140225T120700
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840456420_9jr5q6bl_.bkp
Control File Included: Ckp SCN: 914584       Ckp time: 25-FEB-14

BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6       Full    9.33M      DISK      00:00:00   25-FEB-14      
      BP Key: 6   Status: AVAILABLECompressed: NOTag: TAG20140225T121059
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/backupset/2014_02_25/o1_mf_ncnnf_TAG20140225T121059_9jr5ypwr_.bkp
Control File Included: Ckp SCN: 914735       Ckp time: 25-FEB-14

BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
7       Full    9.33M      DISK      00:00:05   25-FEB-14      
      BP Key: 7   Status: AVAILABLECompressed: NOTag: TAG20140225T163047
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/backupset/2014_02_25/o1_mf_ncnnf_TAG20140225T163047_9jro5w9v_.bkp
Control File Included: Ckp SCN: 926276       Ckp time: 25-FEB-14

BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
8       Full    9.36M      DISK      00:00:03   25-FEB-14      
      BP Key: 8   Status: AVAILABLECompressed: NOTag: TAG20140225T163055
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840472255_9jro61vb_.bkp
Control File Included: Ckp SCN: 926284       Ckp time: 25-FEB-14

@babihoo 2014_02_25]$ pwd
/opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25
$ ll
total 38464
-rw-r-----1 oracle oinstall 9830400 Feb 25 10:46 o1_mf_s_840451559_9jr0z96j_.bkp
-rw-r-----1 oracle oinstall 9830400 Feb 25 12:07 o1_mf_s_840456420_9jr5q6bl_.bkp
-rw-r-----1 oracle oinstall 9830400 Feb 25 12:11 o1_mf_s_840456666_9jr5yv5c_.bkp
-rw-r-----1 oracle oinstall 9830400 Feb 25 16:30 o1_mf_s_840472255_9jro61vb_.bkp

这两个文件都没有删除过。而且这两个文件曾经都用来恢复过控制文件。
RMAN> restore controlfile from autobackup;
(省略)
channel ORA_DISK_1: AUTOBACKUP /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840451559_9jr0z96j_.bkp found in the recovery area
RMAN> recover database;
(省略)
List of Cataloged Files
=======================
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840451559_9jr0z96j_.bkp
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 9 is already on disk as file /opt/oracle/oradata/babihoo11g/redo03.log
archived log file name=/opt/oracle/oradata/babihoo11g/redo03.log thread=1 sequence=9
media recovery complete, elapsed time: 00:00:08
Finished recover at 25-FEB-14

恢复之后,就看不到这个自动备份文件了。
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    9.33M      DISK      00:00:07   24-FEB-14      
      BP Key: 1   Status: AVAILABLECompressed: NOTag: TAG20140224T193923
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/backupset/2014_02_24/o1_mf_ncnnf_TAG20140224T193923_9jpcvk7m_.bkp
Control File Included: Ckp SCN: 888738       Ckp time: 24-FEB-14


BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    9.36M      DISK      00:00:03   24-FEB-14      
      BP Key: 2   Status: AVAILABLECompressed: NOTag: TAG20140224T193932
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_24/o1_mf_s_840397172_9jpcvp66_.bkp
Control File Included: Ckp SCN: 888747       Ckp time: 24-FEB-14


BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    9.33M      DISK      00:00:05   25-FEB-14      
      BP Key: 3   Status: AVAILABLECompressed: NOTag: TAG20140225T104551
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/backupset/2014_02_25/o1_mf_ncnnf_TAG20140225T104551_9jr0z3vp_.bkp
Control File Included: Ckp SCN: 912680       Ckp time: 25-FEB-14

在接下来的恢复控制文件实验中,o1_mf_s_840451559_9jr0z96j_.bkp又出现了:

RMAN> recover database;
(省略)
List of Cataloged Files
=======================
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/backupset/2014_02_25/o1_mf_ncnnf_TAG20140225T104551_9jr0z3vp_.bkp
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840451559_9jr0z96j_.bkp
(省略)

但是用list backup 命令看不到

之后我又备份了一次控制文件。就是o1_mf_s_840456666_9jr5yv5c_.bkp用来做控制文件恢复实验。
RMAN> list backupset of controlfile;
List of Backup Sets
===================
BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5       Full    9.36M      DISK      00:00:04   25-FEB-14      
      BP Key: 5   Status: AVAILABLECompressed: NOTag: TAG20140225T120700
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840456420_9jr5q6bl_.bkp
Control File Included: Ckp SCN: 914584       Ckp time: 25-FEB-14


BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6       Full    9.33M      DISK      00:00:04   25-FEB-14      
      BP Key: 6   Status: AVAILABLECompressed: NOTag: TAG20140225T121059
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/backupset/2014_02_25/o1_mf_ncnnf_TAG20140225T121059_9jr5ypwr_.bkp
Control File Included: Ckp SCN: 914735       Ckp time: 25-FEB-14


BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
7       Full    9.36M      DISK      00:00:02   25-FEB-14      
      BP Key: 7   Status: AVAILABLECompressed: NOTag: TAG20140225T121106
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840456666_9jr5yv5c_.bkp
Control File Included: Ckp SCN: 914745       Ckp time: 25-FEB-14

这次实验没有用自动备份,用的是备份集o1_mf_ncnnf_TAG20140225T121059_9jr5ypwr_.bkp,在恢复的时候也可以看到o1_mf_s_840456666_9jr5yv5c_.bkp。
RMAN> recover database;
(省略)
List of Cataloged Files
=======================
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/backupset/2014_02_25/o1_mf_ncnnf_TAG20140225T121059_9jr5ypwr_.bkp
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840451559_9jr0z96j_.bkp
File Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840456666_9jr5yv5c_.bkp
(省略)

但是恢复后打开数据库,却看不到这个自动备份了。
RMAN> alter database open resetlogs;   
database opened
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5       Full    9.36M      DISK      00:00:04   25-FEB-14      
      BP Key: 5   Status: AVAILABLECompressed: NOTag: TAG20140225T120700
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/autobackup/2014_02_25/o1_mf_s_840456420_9jr5q6bl_.bkp
Control File Included: Ckp SCN: 914584       Ckp time: 25-FEB-14


BS KeyType LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6       Full    9.33M      DISK      00:00:00   25-FEB-14      
      BP Key: 6   Status: AVAILABLECompressed: NOTag: TAG20140225T121059
      Piece Name: /opt/oracle/flash_recovery_area/BABIHOO11G/backupset/2014_02_25/o1_mf_ncnnf_TAG20140225T121059_9jr5ypwr_.bkp
Control File Included: Ckp SCN: 914735       Ckp time: 25-FEB-14

之前的那次恢复之后,report obsolete也看不到o1_mf_s_840451559_9jr0z96j_.bkp.delete obsolete也没有删除这个文件。这次恢复之后,查看过期的备份也没有这两个文件的任何痕迹。
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
no obsolete backups found

好诡异的说!该怎么解释这种现象呢。


问题2:
RMAN> show controlfile autobackup;
RMAN configuration parameters for database with db_unique_name BABIHOO11G are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;

然后删除一个表空间:
SQL> drop tablespace newts including contents and datafiles;
Tablespace dropped.

可是,等了一天时间,也没有生成一个自动备份的控制文件备份。
NAME                           VALUE                     ISDEFAULT ISMOD      ISADJ
------------------------------ ------------------------- --------- ---------- -----
_controlfile_autobackup_delay300                     TRUE      FALSE      FALSE

babihoo 发表于 2014-2-26 10:52:52

如果时间单位是秒,_controlfile_autobackup_delay值是300,那么5分钟之后就应该能看到自动备份了啊。

土匪 发表于 2014-3-26 10:57:50

学习学习

fly8007 发表于 2014-6-23 14:13:05

学习了:lol:lol:lol
页: [1]
查看完整版本: [备份恢复] 关于自动备份的问题