[20160710]备份archivelog仅仅1次.txt

简介: [20160710]backup archivelog all not backed up 1 times.txt --我们生产系统archivelog总是保留1个月的时间不删除.

[20160710]backup archivelog all not backed up 1 times.txt

--我们生产系统archivelog总是保留1个月的时间不删除.这样在日常备份中为了避免重复备份archivelog,就要注意备份N次的
--archivelog,就不需要再备份.
--在rman脚本中写入:

backup archivelog all not backed up 1 times format '/home/oracle/backup/arch_%U';

--次数可以根据自己备份的需要修改,我这里选择1.这样后续的备份仅仅备份没有备份的archivelog.
--如果次数2,就仅仅备份已经备份1次以及还没有备份的archivelog.减少备份的空间占用.

--在测试环境测试看看;

1.环境:
SCOTT@book> @ &r/ver1

PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

RMAN> delete archivelog all completed before  'sysdate-1';
RMAN> list archivelog all ;

List of Archived Log Copies for database with db_unique_name BOOK
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
204     1    343     A 2016-07-10 08:24:16
        Name: /u01/app/oracle/archivelog/book/1_343_907434361.dbf

205     1    344     A 2016-07-10 13:10:21
        Name: /u01/app/oracle/archivelog/book/1_344_907434361.dbf

206     1    345     A 2016-07-10 22:04:43
        Name: /u01/app/oracle/archivelog/book/1_345_907434361.dbf

--保留1天的archivelog。为了测试需要,不要备份这个多archivelog。

2.备份第1次:
RMAN> backup archivelog all not backed up 1 times format '/home/oracle/backup/arch_%U';

Starting backup at 2016-07-11 08:40:09
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
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=343 RECID=204 STAMP=916837821
input archived log thread=1 sequence=344 RECID=205 STAMP=916869884
channel ORA_DISK_1: starting piece 1 at 2016-07-11 08:40:09
channel ORA_DISK_2: starting archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=345 RECID=206 STAMP=916907094
input archived log thread=1 sequence=346 RECID=207 STAMP=916908009
channel ORA_DISK_2: starting piece 1 at 2016-07-11 08:40:09
channel ORA_DISK_1: finished piece 1 at 2016-07-11 08:40:10
piece handle=/home/oracle/backup/arch_47radpv9_1_1 tag=TAG20160711T084009 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_2: finished piece 1 at 2016-07-11 08:40:10
piece handle=/home/oracle/backup/arch_48radpv9_1_1 tag=TAG20160711T084009 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
Finished backup at 2016-07-11 08:40:10

Starting Control File and SPFILE Autobackup at 2016-07-11 08:40:10
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2016_07_11/o1_mf_s_916908010_cr5tqbwl_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2016-07-11 08:40:11

RMAN> list archivelog all ;
List of Archived Log Copies for database with db_unique_name BOOK
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
204     1    343     A 2016-07-10 08:24:16
        Name: /u01/app/oracle/archivelog/book/1_343_907434361.dbf

205     1    344     A 2016-07-10 13:10:21
        Name: /u01/app/oracle/archivelog/book/1_344_907434361.dbf

206     1    345     A 2016-07-10 22:04:43
        Name: /u01/app/oracle/archivelog/book/1_345_907434361.dbf

207     1    346     A 2016-07-11 08:24:54
        Name: /u01/app/oracle/archivelog/book/1_346_907434361.dbf
--备份到seq=346,也就是做archivelog备份时,oracle切换一个archivelog。

3.备份第2次:
RMAN> backup archivelog all not backed up 1 times format '/home/oracle/backup/arch_%U';

Starting backup at 2016-07-11 08:41:56
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
skipping archived logs of thread 1 from sequence 343 to 346; 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=347 RECID=208 STAMP=916908116
channel ORA_DISK_1: starting piece 1 at 2016-07-11 08:41:56
channel ORA_DISK_1: finished piece 1 at 2016-07-11 08:41:57
piece handle=/home/oracle/backup/arch_4aradq2k_1_1 tag=TAG20160711T084156 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2016-07-11 08:41:57

Starting Control File and SPFILE Autobackup at 2016-07-11 08:41:57
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2016_07_11/o1_mf_s_916908117_cr5ttoy9_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2016-07-11 08:41:58

--//注意看~,前面的from sequence 343 to 346被跳过,仅仅备份seq =347.

RMAN> list archivelog all ;
List of Archived Log Copies for database with db_unique_name BOOK
=====================================================================
Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
204     1    343     A 2016-07-10 08:24:16
        Name: /u01/app/oracle/archivelog/book/1_343_907434361.dbf

205     1    344     A 2016-07-10 13:10:21
        Name: /u01/app/oracle/archivelog/book/1_344_907434361.dbf

206     1    345     A 2016-07-10 22:04:43
        Name: /u01/app/oracle/archivelog/book/1_345_907434361.dbf

207     1    346     A 2016-07-11 08:24:54
        Name: /u01/app/oracle/archivelog/book/1_346_907434361.dbf

208     1    347     A 2016-07-11 08:40:09
        Name: /u01/app/oracle/archivelog/book/1_347_907434361.dbf

目录
相关文章
|
Oracle 关系型数据库
[20180423]关于rman备份的问题2.txt
[20180423]关于rman备份的问题2.txt --//别人问的问题,rman备份放在哪里的问题. SCOTT@book> @ ver1 PORT_STRING                    VERSION        BANNER --...
928 0
|
Oracle 关系型数据库 Linux
[20180115]RMAN-06820.txt
[20180115]RMAN-06820.txt --//在备库做归档备份出现RMAN-06820的问题。就是如果在备库做全表,因为要做主库日志切换,一般执行rman target /会出现问题。
1416 0
|
Oracle 关系型数据库 测试技术
[20171225]RMAN-06808.txt
[20171225]RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect.txt --//朋友拿我的一些例子来测试遇到的RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect问题.
947 0
|
关系型数据库
[20171221]RMAN-05501.txt
[20171221]RMAN-05501 aborting duplication of target database.txt --//昨天使用rman duplicate建立dg,出现如下错误: rman > duplicate target database for standby from active database; .
1068 0
|
Oracle 关系型数据库
[20171130]关于rman的一些总结.txt
[20171130]关于rman的一些总结.txt --//最近一直做rman相关测试,测试那个乱,没办法.无法从周围的人获得帮助,纯粹是自己的乱猜,乱测,不知道别人是否能看懂我写的东西.
1087 0
|
Oracle 关系型数据库 测试技术
[20171122]rman backup as copy的备份问题
[20171122]rman backup as copy的备份问题.txt --//以前曾经写过一篇[20160524]rman备份与检查点4.txt=>链接:http://blog.
1137 0
|
关系型数据库 Linux 数据库
[20171116]11GR2控制文件自动备份.txt
20171116]11GR2控制文件自动备份.txt SYS@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ---------------------------...
956 0
|
Oracle 关系型数据库 API
[20170208]rman tape.txt
[20170208]rman tape.txt --前一阵子,同事测试使用磁带做rman备份,留下一些备份信息在控制文件,要清除. --我依稀记得我以前也干过这些事情,晚上看了一下书: Apress.
983 0
|
关系型数据库 Oracle Linux
[20161230]rman checksyntax2.txt
[20161230]rman checksyntax2.txt --曾经写过一篇rman checksyntax的问题,这个问题存在10g: http://blog.
757 0
|
Oracle 关系型数据库 Linux
[20161212]备份archivelog.txt
[20161212]备份archivelog.txt --许多人都知道如果执行backup database plus archivelog;实际上是先执行如下: 1.
729 0