|
P5
|
发表于 2013-1-19 12:14:04
SQL> select tablespace_name,file_id from dba_data_files where tablespace_name='TEST';
TABLESPACE_NAME FILE_ID
------------------------------ ----------
TEST 7
SQL> alter tablespace test offline;
Tablespace altered.
SQL> select tablespace_name,status from dba_tablespaces where tablespace_name='TEST';
TABLESPACE_NAME STATUS
------------------------------ ---------
TEST OFFLINE
RMAN> backup datafile 7 format '/backup/full_%T_%s_%p';
Starting backup at 19-JAN-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=145 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00007 name=/home/oracle/oradata/s1/test01.dbf
channel ORA_DISK_1: starting piece 1 at 19-JAN-13
channel ORA_DISK_1: finished piece 1 at 19-JAN-13
piece handle=/backup/full_20130119_127_1 tag=TAG20130119T200413 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 19-JAN-13
RMAN> backup datafile 7 format '/backup/full_%T_%s_%p';
Starting backup at 19-JAN-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00007 name=/home/oracle/oradata/s1/test01.dbf
channel ORA_DISK_1: starting piece 1 at 19-JAN-13
channel ORA_DISK_1: finished piece 1 at 19-JAN-13
piece handle=/backup/full_20130119_128_1 tag=TAG20130119T200421 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 19-JAN-13
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
107 Full 88.00K DISK 00:00:01 19-JAN-13
BP Key: 103 Status: AVAILABLE Compressed: NO Tag: TAG20130119T200413
Piece Name: /backup/full_20130119_127_1
List of Datafiles in backup set 107
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
7 Full 1178865 19-JAN-13 /home/oracle/oradata/s1/test01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
108 Full 88.00K DISK 00:00:00 19-JAN-13
BP Key: 104 Status: AVAILABLE Compressed: NO Tag: TAG20130119T200421
Piece Name: /backup/full_20130119_128_1
List of Datafiles in backup set 108
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
7 Full 1178865 19-JAN-13 /home/oracle/oradata/s1/test01.dbf
RMAN>
RMAN> run{
2> sql 'alter system archive log current';
3> backup database format '/backup/full_%T_%s_%p'
4> include current controlfile;
5> }
sql statement: alter system archive log current
Starting backup at 19-JAN-13
using channel ORA_DISK_1
skipping datafile 7; already backed up 2 time(s)
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/home/oracle/oradata/s1/system01.dbf
input datafile fno=00003 name=/home/oracle/oradata/s1/sysaux01.dbf
input datafile fno=00002 name=/home/oracle/oradata/s1/undotbs01.dbf
input datafile fno=00005 name=/home/oracle/oradata/s1/example01.dbf
input datafile fno=00004 name=/home/oracle/oradata/s1/users01.dbf
input datafile fno=00008 name=/home/oracle/oradata/s1/tp01_01.dbf
input datafile fno=00009 name=/home/oracle/oradata/s1/tp02_01.dbf
input datafile fno=00010 name=/home/oracle/oradata/s1/tp03_01.dbf
input datafile fno=00011 name=/home/oracle/oradata/s1/tp04_01.dbf
input datafile fno=00006 name=/home/oracle/oradata/s1/vip01.dbf
channel ORA_DISK_1: starting piece 1 at 19-JAN-13
channel ORA_DISK_1: finished piece 1 at 19-JAN-13
piece handle=/backup/full_20130119_129_1 tag=TAG20130119T200451 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 19-JAN-13
channel ORA_DISK_1: finished piece 1 at 19-JAN-13
piece handle=/backup/full_20130119_130_1 tag=TAG20130119T200451 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 19-JAN-13
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
107 Full 88.00K DISK 00:00:01 19-JAN-13
BP Key: 103 Status: AVAILABLE Compressed: NO Tag: TAG20130119T200413
Piece Name: /backup/full_20130119_127_1
List of Datafiles in backup set 107
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
7 Full 1178865 19-JAN-13 /home/oracle/oradata/s1/test01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
108 Full 88.00K DISK 00:00:00 19-JAN-13
BP Key: 104 Status: AVAILABLE Compressed: NO Tag: TAG20130119T200421
Piece Name: /backup/full_20130119_128_1
List of Datafiles in backup set 108
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
7 Full 1178865 19-JAN-13 /home/oracle/oradata/s1/test01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
109 Full 916.34M DISK 00:01:38 19-JAN-13
BP Key: 105 Status: AVAILABLE Compressed: NO Tag: TAG20130119T200451
Piece Name: /backup/full_20130119_129_1
List of Datafiles in backup set 109
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/system01.dbf
2 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/undotbs01.dbf
3 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/sysaux01.dbf
4 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/users01.dbf
5 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/example01.dbf
6 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/vip01.dbf
8 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/tp01_01.dbf
9 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/tp02_01.dbf
10 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/tp03_01.dbf
11 Full 1179072 19-JAN-13 /home/oracle/oradata/s1/tp04_01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
110 Full 7.14M DISK 00:00:01 19-JAN-13
BP Key: 106 Status: AVAILABLE Compressed: NO Tag: TAG20130119T200451
Piece Name: /backup/full_20130119_130_1
Control File Included: Ckp SCN: 1179099 Ckp time: 19-JAN-13
RMAN>
可以看出把test表空间offline后,对单独备份,还是会再次备份,而对全备则不会再次备份 |
|