oracle 10g rman备份与恢复之二
一、nocatalog备份
备份archivelog
backup database plus archivelog delete input 备份数据文件,控制文件,参数文件,归档日志文件,然后把备份完的归档日志文件进行删除)
备份表空间
backup tablespace users(对应的表空间)
备份控制文件
backup current controlfile
backup database include current controlfile
启动监听
lsnrctl start/stop/status
====================================================================================
实验:
Recovery Manager complete.
[oracle@redhat ~]$ rman nocatalog
Recovery Manager: Release 10.2.0.1.0 - Production on 星期六 4月 20 04:51:36 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN> connect target sys/123456
connected to target database: WOLF (DBID=3778783462)
using target database control file instead of recovery catalog
1、全备
RMAN> backup database plus archivelog delete input;
Starting backup at 20-4月 -13
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=158 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=2 recid=11 stamp=813214354
channel ORA_DISK_1: starting piece 1 at 20-4月 -13
channel ORA_DISK_1: finished piece 1 at 20-4月 -13
piece handle=/oracle/ora10g/flash_recovery_area/WOLF/backupset/2013_04_20/o1_mf_annnn_TAG20130420T045234_8q4otorc_.bkp
tag=TAG20130420T045234 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/oracle/ora10g/flash_recovery_area/WOLF/archivelog/2013_04_20/o1_mf_1_2_8q4otkmz_.arc recid=11 stamp=813214354
Finished backup at 20-4月 -13
Starting backup at 20-4月 -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=00001 name=/oracle/ora10g/oradata/wolf/system01.dbf
input datafile fno=00003 name=/oracle/ora10g/oradata/wolf/sysaux01.dbf
input datafile fno=00002 name=/oracle/ora10g/oradata/wolf/undotbs01.dbf
input datafile fno=00005 name=/oracle/ora10g/oradata/wolf/rmanwolf.dbf
input datafile fno=00004 name=/oracle/ora10g/oradata/wolf/users01.dbf
channel ORA_DISK_1: starting piece 1 at 20-4月 -13
channel ORA_DISK_1: finished piece 1 at 20-4月 -13
piece handle=/oracle/ora10g/flash_recovery_area/WOLF/backupset/2013_04_20/o1_mf_nnndf_TAG20130420T045240_8q4otrlk_.bkp
tag=TAG20130420T045240 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:06:45
Finished backup at 20-4月 -13
Starting backup at 20-4月 -13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=3 recid=12 stamp=813214765
channel ORA_DISK_1: starting piece 1 at 20-4月 -13
channel ORA_DISK_1: finished piece 1 at 20-4月 -13
piece handle=/oracle/ora10g/flash_recovery_area/WOLF/backupset/2013_04_20/o1_mf_annnn_TAG20130420T045925_8q4p7h2y_.bkp
tag=TAG20130420T045925 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/oracle/ora10g/flash_recovery_area/WOLF/archivelog/2013_04_20/o1_mf_1_3_8q4p7fts_.arc recid=12 stamp=813214765
Finished backup at 20-4月 -13
Starting Control File and SPFILE Autobackup at 20-4月 -13
piece handle=/oracle/ora10g/flash_recovery_area/WOLF/autobackup/2013_04_20/o1_mf_s_813214768_8q4p7jrs_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 20-4月 -13
RMAN>
-----------------------------------------------------------------------------------------------------------
2、备份表空间
RMAN> report schema;
Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 480 SYSTEM *** /oracle/ora10g/oradata/wolf/system01.dbf
2 25 UNDOTBS1 *** /oracle/ora10g/oradata/wolf/undotbs01.dbf
3 240 SYSAUX *** /oracle/ora10g/oradata/wolf/sysaux01.dbf
4 5 USERS *** /oracle/ora10g/oradata/wolf/users01.dbf
5 20 RMAN_WOLF *** /oracle/ora10g/oradata/wolf/rmanwolf.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /oracle/ora10g/oradata/wolf/temp01.dbf
RMAN> backup tablespace rman_wolf;
Starting backup at 20-4月 -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=00005 name=/oracle/ora10g/oradata/wolf/rmanwolf.dbf
channel ORA_DISK_1: starting piece 1 at 20-4月 -13
channel ORA_DISK_1: finished piece 1 at 20-4月 -13
piece handle=/oracle/ora10g/flash_recovery_area/WOLF/backupset/2013_04_20/o1_mf_nnndf_TAG20130420T050523_8q4plm6l_.bkp tag=TAG20130420T050523 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20-4月 -13
Starting Control File and SPFILE Autobackup at 20-4月 -13
piece handle=/oracle/ora10g/flash_recovery_area/WOLF/autobackup/2013_04_20/o1_mf_s_813215126_8q4plq2t_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 20-4月 -13
RMAN> list backupset
------------------------------------------------------------------------------
3、备份控制文件 (备份多分控制文件,在恢复时他会自动去找最新的那个)
RMAN> backup current controlfile;
Starting backup at 20-4月 -13
using channel ORA_DISK_1
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 20-4月 -13
channel ORA_DISK_1: finished piece 1 at 20-4月 -13
piece handle=/oracle/ora10g/flash_recovery_area/WOLF/backupset/2013_04_20/o1_mf_ncnnf_TAG20130420T052003_8q4qg39b_.bkp tag=TAG20130420T052003 comment=NONE
channel ORA_DISK_1: backup set complete, elapse