聊聊RMAN的ARCHIVELOG DELETION参数(2)

第二次备份,之前备份过的日志还出现在自动备份的列表中。但是,在第二次备份的时候,已经备份过两次(deletion policy)的日志并没有自动删除。

SQL> select count(*) from v$archived_log where archived='YES' and deleted='NO';

COUNT(*)

----------

17

归档日志还在fast recovery area中。

[oracle@Databaseintrawebpro fast_recovery_area]$ du -h

19M    ./XXXXDB/autobackup/2015_09_21

9.4M    ./XXXXDB/autobackup/2015_09_17

29M    ./XXXXDB/autobackup

151M    ./XXXXDB/onlinelog

6.0G    ./XXXXDB/backupset/2015_09_21

108K    ./XXXXDB/backupset/2015_09_17

6.0G    ./XXXXDB/backupset

125M    ./XXXXDB/archivelog/2015_09_19

27M    ./XXXXDB/archivelog/2015_09_21

4.0K    ./XXXXDB/archivelog/2015_09_15

127M    ./XXXXDB/archivelog/2015_09_18

121M    ./XXXXDB/archivelog/2015_09_20

4.0K    ./XXXXDB/archivelog/2015_09_16

32M    ./XXXXDB/archivelog/2015_09_17

431M    ./XXXXDB/archivelog

9.4M    ./XXXXDB/controlfile

6.6G    ./XXXXDB

6.6G    .

此时,归档日志和备份次数,在v$archived_log中可以方便的找出来。

SQL> alter system switch logfile;

System altered

SQL> select count(*) from v$archived_log where archived='YES' and deleted='NO';

COUNT(*)

----------

18

--注意这些已经备份过两次的recid编号

SQL> select recid, sequence#, archived, deleted, backup_count from v$archived_log where backup_count>1;

RECID  SEQUENCE# ARCHIVED DELETED BACKUP_COUNT

---------- ---------- -------- ------- ------------

12        100 YES      NO                2

13        101 YES      NO                2

14        102 YES      NO                2

15        103 YES      NO                2

16        104 YES      NO                2

17        105 YES      NO                2

18        106 YES      NO                2

19        107 YES      NO                2

20        108 YES      NO                2

21        109 YES      NO                2

22        110 YES      NO                2

23        111 YES      NO                2

24        112 YES      NO                2

25        113 YES      NO                2

26        114 YES      NO                2

15 rows selected

进行第三次备份。

RMAN> backup database plus archivelog;

Starting backup at 21-SEP-15

current log archived

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=498 device type=DISK

skipping archived logs of thread 1 from sequence 100 to 114; already backed up

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=115 RECID=27 STAMP=890990391

input archived log thread=1 sequence=116 RECID=28 STAMP=890990481

input archived log thread=1 sequence=117 RECID=29 STAMP=890990667

input archived log thread=1 sequence=118 RECID=30 STAMP=890993128

channel ORA_DISK_1: starting piece 1 at 21-SEP-15

channel ORA_DISK_1: finished piece 1 at 21-SEP-15

piece 

(篇幅原因,有省略…….)

Finished Control File and SPFILE Autobackup at 21-SEP-15

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/d07001578a37b0e990a58a148b25630e.html