1. 备份全库RMAN>
backup database format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_%U';Starting backup at 14-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=I:\INTEL_DATA\O07DMS0\SYSTEM_01.O07DMS0
input datafile file number=00002 name=I:\INTEL_DATA\O07DMS0\SYSAUX_01.O07DMS0
input datafile file number=00004 name=I:\INTEL_DATA\O07DMS0\USERS_01.O07DMS0
input datafile file number=00003 name=I:\INTEL_DATA\O07DMS0\UNDO_01.O07DMS0
input datafile file number=00005 name=I:\INTEL_DATA\O07DMS0\APP01_01.O07DMS0
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_0AMP1RDE_1_1 tag=TAG20111014T013230 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 14-OCT-11
Starting Control File Autobackup at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-00 comment=NONE
Finished Control File Autobackup at 14-OCT-11
RMAN>
list backup of database;BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
8 Full 102.92M DISK 00:00:24 14-OCT-11
BP Key: 8 Status: AVAILABLE Compressed: YES Tag: TAG20111014T013230
Piece Name:
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_0AMP1RDE_1_1 List of Datafiles in backup set 8
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 8257303 14-OCT-11 I:\INTEL_DATA\O07DMS0\SYSTEM_01.O07DMS0
2 Full 8257303 14-OCT-11 I:\INTEL_DATA\O07DMS0\SYSAUX_01.O07DMS0
3 Full 8257303 14-OCT-11 I:\INTEL_DATA\O07DMS0\UNDO_01.O07DMS0
4 Full 8257303 14-OCT-11 I:\INTEL_DATA\O07DMS0\USERS_01.O07DMS0
5 Full 8257303 14-OCT-11 I:\INTEL_DATA\O07DMS0\APP01_01.O07DMS0
RMAN>
delete backupset 8;2. 备份表空间RMAN>
backup tablespace users format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_USERS_%U';Starting backup at 14-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=I:\INTEL_DATA\O07DMS0\USERS_01.O07DMS0
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_USERS_0CMP1T6E_1_1 tag=TAG20111014T020253 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 14-OCT-11
Starting Control File Autobackup at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-01 comment=NONE
Finished Control File Autobackup at 14-OCT-11
此时有两份users表空间的备份,第一份是第1步中备份全库时产生的。
RMAN>
list backup of tablespace users;List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10 Full 13.89M DISK 00:00:04 14-OCT-11
BP Key: 10 Status: AVAILABLE Compressed: YES Tag: TAG20111014T020253
Piece Name: H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_USERS_0CMP1T6E_1_1
List of Datafiles in backup set 10
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 Full 8258746 14-OCT-11 I:\INTEL_DATA\O07DMS0\USERS_01.O07DMS0
RMAN>
delete backupset 10;3. 备份数据文件先找出要备份数据文件的ID或Name:
select FILE_NAME,FILE_ID from dba_data_files;
FILE_NAME FILE_ID
-------------------------------------------------------------------------------- ----------
I:\INTEL_DATA\O07DMS0\SYSTEM_01.O07DMS0 1
I:\INTEL_DATA\O07DMS0\SYSAUX_01.O07DMS0 2
I:\INTEL_DATA\O07DMS0\UNDO_01.O07DMS0 3
I:\INTEL_DATA\O07DMS0\USERS_01.O07DMS0 4
I:\INTEL_DATA\O07DMS0\APP01_01.O07DMS0 5
RMAN>
backup datafile 5 format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_APP01_%U';Starting backup at 14-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=I:\INTEL_DATA\O07DMS0\APP01_01.O07DMS0
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_APP01_0EMP1TU9_1_1 tag=TAG20111014T021537 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-OCT-11
Starting Control File Autobackup at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-02 comment=NONE
Finished Control File Autobackup at 14-OCT-11
RMAN>
list backupset of datafile 5;List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12 Full 1.02M DISK 00:00:01 14-OCT-11
BP Key: 12 Status: AVAILABLE Compressed: YES Tag: TAG20111014T021537
Piece Name: H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_APP01_0EMP1TU9_1_1
List of Datafiles in backup set 12
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
5 Full 8259094 14-OCT-11 I:\INTEL_DATA\O07DMS0\APP01_01.O07DMS0
RMAN>
delete backupset 12;4. 备份控制文件当autobackup设置为on后,任何操作都会自动对控制文件备份。
RMAN>
show controlfile autobackup;RMAN configuration parameters for database with db_unique_name O07DMS0 are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
在1,2,3步做备份时,控制文件自动做了备份。
RMAN>
list backupset of controlfile;List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9 Full 9.33M DISK 00:00:01 14-OCT-11
BP Key: 9 Status: AVAILABLE Compressed: NO Tag: TAG20111014T013255
Piece Name: H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-00
Control File Included: Ckp SCN: 8257324 Ckp time: 14-OCT-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
11 Full 9.33M DISK 00:00:00 14-OCT-11
BP Key: 11 Status: AVAILABLE Compressed: NO Tag: TAG20111014T020301
Piece Name: H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-01
Control File Included: Ckp SCN: 8258755 Ckp time: 14-OCT-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
13 Full 9.33M DISK 00:00:01 14-OCT-11
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20111014T021539
Piece Name: H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-02
Control File Included: Ckp SCN: 8259101 Ckp time: 14-OCT-11
也可以手动给控制文件做备份。
RMAN>
backup current controlfile format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_controlfile_%U';Starting backup at 14-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed 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 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_CONTROLFILE_0IMP1UGP_1_1 tag=TAG20111014T022529 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-OCT-11
Starting Control File Autobackup at 14-OCT-11
piece handle=H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-04 comment=NONE
Finished Control File Autobackup at 14-OCT-11
5. 备份归档日志文件有两种方法:
1) RMAN>
backup archivelog all format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_arch_%U';Starting backup at 14-OCT-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=57 RECID=2 STAMP=749363952
input archived log thread=1 sequence=58 RECID=3 STAMP=749574089
input archived log thread=1 sequence=59 RECID=4 STAMP=749956794
input archived log thread=1 sequence=60 RECID=5 STAMP=750304866
input archived log thread=1 sequence=61 RECID=6 STAMP=750578449
input archived log thread=1 sequence=62 RECID=7 STAMP=751096852
input archived log thread=1 sequence=63 RECID=8 STAMP=751513475
input archived log thread=1 sequence=64 RECID=9 STAMP=751856864
input archived log thread=1 sequence=65 RECID=10 STAMP=752320897
input archived log thread=1 sequence=66 RECID=11 STAMP=752696011
input archived log thread=1 sequence=67 RECID=12 STAMP=752997673
input archived log thread=1 sequence=83 RECID=13 STAMP=764476212
input archived log thread=1 sequence=84 RECID=14 STAMP=764476302
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_ARCH_0KMP1USF_1_1 tag=TAG20111014T023142 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 14-OCT-11
Starting Control File Autobackup at 14-OCT-11
piece handle=H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-05 comment=NONE
Finished Control File Autobackup at 14-OCT-11
2)
RMAN> backup database format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_%U' plus archivelog format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_plus_arch_%U';Starting backup at 14-OCT-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=57 RECID=2 STAMP=749363952
input archived log thread=1 sequence=58 RECID=3 STAMP=749574089
input archived log thread=1 sequence=59 RECID=4 STAMP=749956794
input archived log thread=1 sequence=60 RECID=5 STAMP=750304866
input archived log thread=1 sequence=61 RECID=6 STAMP=750578449
input archived log thread=1 sequence=62 RECID=7 STAMP=751096852
input archived log thread=1 sequence=63 RECID=8 STAMP=751513475
input archived log thread=1 sequence=64 RECID=9 STAMP=751856864
input archived log thread=1 sequence=65 RECID=10 STAMP=752320897
input archived log thread=1 sequence=66 RECID=11 STAMP=752696011
input archived log thread=1 sequence=67 RECID=12 STAMP=752997673
input archived log thread=1 sequence=83 RECID=13 STAMP=764476212
input archived log thread=1 sequence=84 RECID=14 STAMP=764476302
input archived log thread=1 sequence=85 RECID=15 STAMP=764476589
input archived log thread=1 sequence=86 RECID=16 STAMP=764476681
input archived log thread=1 sequence=87 RECID=17 STAMP=764476863
input archived log thread=1 sequence=88 RECID=18 STAMP=764476965
input archived log thread=1 sequence=89 RECID=19 STAMP=764477072
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_PLUS_ARCH_0UMP1VKG_1_1 tag=TAG20111014T024432 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 14-OCT-11
Starting backup at 14-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=I:\INTEL_DATA\O07DMS0\SYSTEM_01.O07DMS0
input datafile file number=00002 name=I:\INTEL_DATA\O07DMS0\SYSAUX_01.O07DMS0
input datafile file number=00004 name=I:\INTEL_DATA\O07DMS0\USERS_01.O07DMS0
input datafile file number=00003 name=I:\INTEL_DATA\O07DMS0\UNDO_01.O07DMS0
input datafile file number=00005 name=I:\INTEL_DATA\O07DMS0\APP01_01.O07DMS0
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_0VMP1VM8_1_1 tag=TAG20111014T024528 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 14-OCT-11
Starting backup at 14-OCT-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=90 RECID=20 STAMP=764477153
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=
H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_PLUS_ARCH_10MP1VN2_1_1 tag=TAG20111014T024553 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-OCT-11
Starting Control File Autobackup at 14-OCT-11
piece handle=H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-08 comment=NONE
Finished Control File Autobackup at 14-OCT-11
6. 增量备份RMAN>
backup incremental level=0 database format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_level0_%U';Starting backup at 14-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=I:\INTEL_DATA\O07DMS0\SYSTEM_01.O07DMS0
input datafile file number=00002 name=I:\INTEL_DATA\O07DMS0\SYSAUX_01.O07DMS0
input datafile file number=00004 name=I:\INTEL_DATA\O07DMS0\USERS_01.O07DMS0
input datafile file number=00003 name=I:\INTEL_DATA\O07DMS0\UNDO_01.O07DMS0
input datafile file number=00005 name=I:\INTEL_DATA\O07DMS0\APP01_01.O07DMS0
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_LEVEL0_12MP20JG_1_1 tag=TAG20111014T030104 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 14-OCT-11
Starting Control File Autobackup at 14-OCT-11
piece handle=H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-09 comment=NONE
Finished Control File Autobackup at 14-OCT-11
RMAN>
backup incremental level=1 cumulative database format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_cum_%U';Starting backup at 14-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=I:\INTEL_DATA\O07DMS0\SYSTEM_01.O07DMS0
input datafile file number=00002 name=I:\INTEL_DATA\O07DMS0\SYSAUX_01.O07DMS0
input datafile file number=00004 name=I:\INTEL_DATA\O07DMS0\USERS_01.O07DMS0
input datafile file number=00003 name=I:\INTEL_DATA\O07DMS0\UNDO_01.O07DMS0
input datafile file number=00005 name=I:\INTEL_DATA\O07DMS0\APP01_01.O07DMS0
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_CUM_18MP20RV_1_1 tag=TAG20111014T030535 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 14-OCT-11
Starting Control File Autobackup at 14-OCT-11
piece handle=H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-0C comment=NONE
Finished Control File Autobackup at 14-OCT-11
RMAN>
backup incremental level=1 database format 'H:\INTEL_DB_DUMPS\O07DMS0\rman\O07DMS0_dif_%U';Starting backup at 14-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=I:\INTEL_DATA\O07DMS0\SYSTEM_01.O07DMS0
input datafile file number=00002 name=I:\INTEL_DATA\O07DMS0\SYSAUX_01.O07DMS0
input datafile file number=00004 name=I:\INTEL_DATA\O07DMS0\USERS_01.O07DMS0
input datafile file number=00003 name=I:\INTEL_DATA\O07DMS0\UNDO_01.O07DMS0
input datafile file number=00005 name=I:\INTEL_DATA\O07DMS0\APP01_01.O07DMS0
channel ORA_DISK_1: starting piece 1 at 14-OCT-11
channel ORA_DISK_1: finished piece 1 at 14-OCT-11
piece handle=H:\INTEL_DB_DUMPS\O07DMS0\RMAN\O07DMS0_DIF_1AMP2148_1_1 tag=TAG20111014T031000 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 14-OCT-11
Starting Control File Autobackup at 14-OCT-11
piece handle=H:\INTEL_DB_DUMPS\O07DMS0\RMAN\CF_O07DMS0_C-3672122205-20111014-0D comment=NONE
Finished Control File Autobackup at 14-OCT-11
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26277071/viewspace-709159/
,如需转载,请注明出处,否则将追究法律责任。