rman备份数据文件和归档指定不同的filesperset

客户说带库上抓小文件会导致带库紧张。

大部分的备份软件都会用filesperset参数来做备份,这样恢复速度快,而且也有利于带库重复删除。

客户用的plus archivelog的形式,一条命令的做全备,现在就有filesperset不区分dbf和arc的情况,反而影响了恢复的效率。

我看了下官方手册,发现backupOperand和backupSpecOperand都有filesperset的设置

rman备份数据文件和归档指定不同的filesperset_第1张图片

 那就整个活

备份前的日志情况

[oracle@oracle11g ~]$ ls -l /data/oracle/flash_recovery_area/ORCL/archivelog/2023_08_29/
total 14564
-rw-r----- 1 oracle dba 14885888 Aug 29 16:38 o1_mf_1_503_lgvcnns7_.arc
-rw-r----- 1 oracle dba     1024 Aug 29 16:38 o1_mf_1_504_lgvcno54_.arc
-rw-r----- 1 oracle dba     3584 Aug 29 16:38 o1_mf_1_505_lgvcnpn0_.arc
-rw-r----- 1 oracle dba     1024 Aug 29 16:38 o1_mf_1_506_lgvcnpnj_.arc
-rw-r----- 1 oracle dba     1024 Aug 29 16:38 o1_mf_1_507_lgvcnwl0_.arc
-rw-r----- 1 oracle dba     1024 Aug 29 16:38 o1_mf_1_508_lgvcnwlf_.arc
-rw-r----- 1 oracle dba     1024 Aug 29 16:38 o1_mf_1_509_lgvcnzlx_.arc

备份命令及日志

[oracle@oracle11g ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Tue Aug 29 16:39:51 2023

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1659508461)

RMAN> 

RMAN> 

RMAN> backup full database filesperset 1 format '/home/oracle/db_%U.dbf' plus archivelog filesperset 64 format '/home/oracle/arc_%U.dbf';


Starting backup at 29-AUG-23
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=70 device type=DISK
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=503 RECID=1 STAMP=1146155925
input archived log thread=1 sequence=504 RECID=2 STAMP=1146155925
input archived log thread=1 sequence=505 RECID=3 STAMP=1146155926
input archived log thread=1 sequence=506 RECID=4 STAMP=1146155926
input archived log thread=1 sequence=507 RECID=5 STAMP=1146155932
input archived log thread=1 sequence=508 RECID=6 STAMP=1146155932
input archived log thread=1 sequence=509 RECID=7 STAMP=1146155935
input archived log thread=1 sequence=510 RECID=8 STAMP=1146156058
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/arc_0h251t0r_1_1��.dbf tag=TAG20230829T164059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-AUG-23

Starting backup at 29-AUG-23
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/data/oracle/orcl/sysaux01.dbf
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/db_0i251t0s_1_1.dbf tag=TAG20230829T164100 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/data/oracle/orcl/system01.dbf
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/db_0j251t13_1_1.dbf tag=TAG20230829T164100 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/home/oracle/rel1.dbf
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/db_0k251t1a_1_1.dbf tag=TAG20230829T164100 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=/home/oracle/tmp.dbf
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/db_0l251t1c_1_1.dbf tag=TAG20230829T164100 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/data/oracle/orcl/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/db_0m251t1d_1_1.dbf tag=TAG20230829T164100 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/db_0n251t1e_1_1.dbf tag=TAG20230829T164100 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/data/oracle/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/db_0o251t1g_1_1.dbf tag=TAG20230829T164100 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/db_0p251t1h_1_1.dbf tag=TAG20230829T164100 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-AUG-23

Starting backup at 29-AUG-23
current log archived
using channel ORA_DISK_1
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=511 RECID=9 STAMP=1146156082
channel ORA_DISK_1: starting piece 1 at 29-AUG-23
channel ORA_DISK_1: finished piece 1 at 29-AUG-23
piece handle=/home/oracle/arc_0q251t1i_1_1��.dbf tag=TAG20230829T164122 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-AUG-23

RMAN> 

RMAN> exit

备份文件情况

[oracle@oracle11g ~]$ ls -ltr
total 1500204
drwxr-x--- 3 oracle dba         18 Mar 17 16:27 oradiag_oracle
-rw-r--r-- 1 oracle dba        109 Apr 25 22:38 sales.lst
-rwxrwxrwx 1 root   root      5332 Apr 25 22:42 csv.sql
-rw-r--r-- 1 oracle dba       1215 Apr 25 22:43 csv.tmp
-rw-r--r-- 1 oracle dba       1226 Apr 25 22:43 SALGRADE.lst
-rw-r--r-- 1 oracle dba       1562 Apr 25 22:45 SALGRADE.log
-rw-r--r-- 1 oracle dba       7878 Apr 26 23:55 sample-oracle.sql
-rw-r--r-- 1 oracle dba        186 Jun 20 16:32 txt
-rw-r----- 1 oracle dba    1097728 Jun 20 16:34 20230620_081v6lvv_1_1.dbf
-rw-r--r-- 1 oracle dba       4748 Aug 25 14:55 move.sql
-rw-r--r-- 1 oracle dba       6178 Aug 25 15:12 pl.sql
-rw-r--r-- 1 oracle dba       6202 Aug 25 15:13 pl2.sql
-rw-r--r-- 1 oracle dba       6220 Aug 25 15:15 pl3.sql
-rw-r--r-- 1 oracle dba       6173 Aug 25 15:31 release_dbf.sql
-rw-r----- 1 oracle dba   14894080 Aug 29 16:40 arc_0h251t0r_1_1??.dbf
-rw-r----- 1 oracle dba  646946816 Aug 29 16:41 db_0i251t0s_1_1.dbf
-rw-r----- 1 oracle dba  630808576 Aug 29 16:41 db_0j251t13_1_1.dbf
-rw-r----- 1 oracle dba    1089536 Aug 29 16:41 db_0k251t1a_1_1.dbf
-rw-r----- 1 oracle dba   17178624 Aug 29 16:41 db_0l251t1c_1_1.dbf
-rw-r----- 1 oracle dba    2367488 Aug 29 16:41 db_0m251t1d_1_1.dbf
-rw-r----- 1 oracle dba    9797632 Aug 29 16:41 db_0n251t1e_1_1.dbf
-rw-r----- 1 oracle dba    2113536 Aug 29 16:41 db_0o251t1g_1_1.dbf
-rw-r----- 1 oracle dba      98304 Aug 29 16:41 db_0p251t1h_1_1.dbf
-rw-r----- 1 oracle dba  104865792 Aug 29 16:41 rel1.dbf
-rw-r----- 1 oracle dba  104865792 Aug 29 16:41 tmp.dbf
-rw-r----- 1 oracle dba       3072 Aug 29 16:41 arc_0q251t1i_1_1??.dbf

总结:可行,可以分开指定。

backup full database filesperset 1 format '/home/oracle/db_%U.dbf' plus archivelog filesperset 64 format '/home/oracle/arc_%U.dbf';

你可能感兴趣的:(数据库,fillesperset,rman,oracle)