Starting ControlFile and SPFILE Autobackup at 23-MAY-12
piecehandle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-00 comment=NONE
Finished ControlFile and SPFILE Autobackup at 23-MAY-12
RMAN>
1.2.2备份USER表空间
RMAN>backuptablespace users;
Starting backupat 23-MAY-12
using channelORA_DISK_1
channelORA_DISK_1: starting full datafile backupset
channelORA_DISK_1: specifying datafile(s) in backupset
input datafilefno=00004 name=/DBData/WWL/users01.dbf
channelORA_DISK_1: starting piece 1 at 23-MAY-12
channelORA_DISK_1: finished piece 1 at 23-MAY-12
piecehandle=/DBBak/bak_WWL_05_23_0cnbn2a3_1_1 tag=TAG20120523T133147 comment=NONE
channelORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backupat 23-MAY-12
Starting ControlFile and SPFILE Autobackup at 23-MAY-12
piece handle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-01comment=NONE
Finished ControlFile and SPFILE Autobackup at 23-MAY-12
RMAN>
1.2.3备份数据文件
RMAN> backup datafile 1,2,3;
Starting backupat 23-MAY-12
using channelORA_DISK_1
channelORA_DISK_1: starting full datafile backupset
channelORA_DISK_1: specifying datafile(s) in backupset
input datafilefno=00001 name=/DBData/WWL/system01.dbf
input datafilefno=00003 name=/DBData/WWL/sysaux01.dbf
input datafile fno=00002name=/DBData/WWL/undotbs01.dbf
channelORA_DISK_1: starting piece 1 at 23-MAY-12
channelORA_DISK_1: finished piece 1 at 23-MAY-12
piecehandle=/DBBak/bak_WWL_05_23_0enbn2bk_1_1 tag=TAG20120523T133235 comment=NONE
channelORA_DISK_1: backup set complete, elapsed time: 00:01:48
Finished backupat 23-MAY-12
Starting ControlFile and SPFILE Autobackup at 23-MAY-12
piecehandle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-02 comment=NONE
Finished ControlFile and SPFILE Autobackup at 23-MAY-12
RMAN>
1.2.4备份控制文件
RMAN> backup current controlfile;
Starting backupat 23-MAY-12
using channelORA_DISK_1
channelORA_DISK_1: starting full datafile backupset
channelORA_DISK_1: specifying datafile(s) in backupset
includingcurrent control file in backupset
channelORA_DISK_1: starting piece 1 at 23-MAY-12
channelORA_DISK_1: finished piece 1 at 23-MAY-12
piecehandle=/DBBak/bak_WWL_05_23_0gnbn2je_1_1 tag=TAG20120523T133645 comment=NONE
channelORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backupat 23-MAY-12
Starting ControlFile and SPFILE Autobackup at 23-MAY-12
piecehandle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-03 comment=NONE
Finished ControlFile and SPFILE Autobackup at 23-MAY-12
RMAN>
1.2.5备份spfile文件
RMAN> backup spfile;
Starting backupat 23-MAY-12
using channelORA_DISK_1
channelORA_DISK_1: starting full datafile backupset
channelORA_DISK_1: specifying datafile(s) in backupset
includingcurrent SPFILE in backupset
channelORA_DISK_1: starting piece 1 at 23-MAY-12
channelORA_DISK_1: finished piece 1 at 23-MAY-12
piecehandle=/DBBak/bak_WWL_05_23_0inbn2l2_1_1 tag=TAG20120523T133737 comment=NONE
channelORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backupat 23-MAY-12
Starting ControlFile and SPFILE Autobackup at 23-MAY-12
piecehandle=/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-04 comment=NONE
Finished ControlFile and SPFILE Autobackup at 23-MAY-12
RMAN>
1.2.6查看我们刚才备份的信息:
RMAN> list backup; 如下信息是之前做的备份:
using target database control file instead of recoverycatalog
List of Backup Sets
===================
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
2Full 522.59MDISK 00:00:59 18-MAY-12
BP Key:2 Status: AVAILABLE Compressed: NO Tag: TAG20120518T185700
Piece Name:/DBBak/bak_WWL_05_18_04nbaffs_1_1
List of Datafilesin backup set 2
File LV Type CkpSCN Ckp Time Name
---- -- -------------- --------- ----
1 Full 618100 18-MAY-12 /DBData/WWL/system01.dbf
2 Full 618100 18-MAY-12 /DBData/WWL/undotbs01.dbf
3 Full 618100 18-MAY-12 /DBData/WWL/sysaux01.dbf
4 Full 618100 18-MAY-12 /DBData/WWL/users01.dbf
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
3Full 6.80MDISK 00:00:02 18-MAY-12
BP Key:3 Status: AVAILABLE Compressed: NO Tag: TAG20120518T185806
Piece Name:/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120518-01
Control FileIncluded: Ckp SCN: 618100 Ckp time:18-MAY-12
SPFILE Included:Modification time: 18-MAY-12
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
4Full 523.54MDISK 00:01:09 21-MAY-12
BP Key:4 Status: AVAILABLE Compressed: NO Tag: TAG20120521T145403
Piece Name:/DBBak/bak_WWL_05_21_06nbhucb_1_1
List of Datafilesin backup set 4
File LV Type CkpSCN Ckp Time Name
---- -- -------------- --------- ----
1 Full 622304 21-MAY-12 /DBData/WWL/system01.dbf
2 Full 622304 21-MAY-12 /DBData/WWL/undotbs01.dbf
3 Full 622304 21-MAY-12 /DBData/WWL/sysaux01.dbf
4 Full 622304 21-MAY-12 /DBData/WWL/users01.dbf
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
5Full 6.80MDISK 00:00:01 21-MAY-12
BP Key:5 Status: AVAILABLE Compressed: NO Tag: TAG20120521T145520
Piece Name:/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120521-00
Control FileIncluded: Ckp SCN: 622304 Ckp time:21-MAY-12
SPFILE Included:Modification time: 21-MAY-12
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
6Full 368.00KDISK 00:00:00 21-MAY-12
BP Key:6 Status: AVAILABLE Compressed: NO Tag: TAG20120521T151349
Piece Name:/DBBak/bak_WWL_05_21_08nbhvhe_1_1
List of Datafilesin backup set 6
File LV Type CkpSCN Ckp Time Name
---- -- -------------- --------- ----
4 Full 622968 21-MAY-12 /DBData/WWL/users01.dbf
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
7Full 6.80MDISK 00:00:01 21-MAY-12
BP Key:7 Status: AVAILABLE Compressed: NO Tag: TAG20120521T151351
Piece Name:/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120521-01
Control FileIncluded: Ckp SCN: 622968 Ckp time:21-MAY-12
SPFILE Included:Modification time: 21-MAY-12
今天的备份信息如下: 如下是全库备份信息:
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
8Full 524.66MDISK 00:01:36 23-MAY-12
BP Key:8 Status: AVAILABLE Compressed: NO Tag: TAG20120523T121210
Piece Name:/DBBak/bak_WWL_05_23_0anbmtkr_1_1
List of Datafilesin backup set 8
File LV Type CkpSCN Ckp Time Name
---- -- -------------- --------- ----
1 Full 649219 23-MAY-12 /DBData/WWL/system01.dbf
2 Full 649219 23-MAY-12 /DBData/WWL/undotbs01.dbf
3 Full 649219 23-MAY-12 /DBData/WWL/sysaux01.dbf
4 Full 649219 23-MAY-12 /DBData/WWL/users01.dbf
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
9Full 6.80MDISK 00:00:01 23-MAY-12
BP Key:9 Status: AVAILABLE Compressed: NO Tag: TAG20120523T121358
Piece Name:/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-00
Control FileIncluded: Ckp SCN: 649233 Ckp time:23-MAY-12
SPFILE Included:Modification time: 23-MAY-12
如下是备份USER表空间信息:
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
10Full 432.00KDISK 00:00:01 23-MAY-12
BP Key: 10 Status: AVAILABLE Compressed: NO Tag: TAG20120523T133147
Piece Name:/DBBak/bak_WWL_05_23_0cnbn2a3_1_1
List of Datafilesin backup set 10
File LV Type CkpSCN Ckp Time Name
---- -- -------------- --------- ----
4 Full 651081 23-MAY-12 /DBData/WWL/users01.dbf
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
11Full 6.80MDISK 00:00:03 23-MAY-12
BP Key:11 Status: AVAILABLE Compressed: NO Tag: TAG20120523T133151
Piece Name:/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-01
Control FileIncluded: Ckp SCN: 651086 Ckp time:23-MAY-12
SPFILE Included:Modification time: 23-MAY-12
如下是备份数据文件1,2,3的信息:
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
12Full 524.61MDISK 00:01:42 23-MAY-12
BP Key:12 Status: AVAILABLE Compressed: NO Tag: TAG20120523T133235
Piece Name:/DBBak/bak_WWL_05_23_0enbn2bk_1_1
List of Datafilesin backup set 12
File LV Type CkpSCN Ckp Time Name
---- -- -------------- --------- ----
1 Full 651104 23-MAY-12 /DBData/WWL/system01.dbf
2 Full 651104 23-MAY-12 /DBData/WWL/undotbs01.dbf
3 Full 651104 23-MAY-12 /DBData/WWL/sysaux01.dbf
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
13Full 6.80MDISK 00:00:01 23-MAY-12
BP Key:13 Status: AVAILABLE Compressed: NO Tag: TAG20120523T133424
Piece Name:/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-02
Control FileIncluded: Ckp SCN: 651119 Ckp time:23-MAY-12
SPFILE Included:Modification time: 23-MAY-12
如下备份的是控制文件信息:
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
14Full 6.77MDISK 00:00:01 23-MAY-12
BP Key:14 Status: AVAILABLE Compressed: NO Tag: TAG20120523T133645
Piece Name:/DBBak/bak_WWL_05_23_0gnbn2je_1_1
Control FileIncluded: Ckp SCN: 651150 Ckp time:23-MAY-12
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
15Full 6.80MDISK 00:00:01 23-MAY-12
BP Key:15 Status: AVAILABLE Compressed: NO Tag: TAG20120523T133648
Piece Name:/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-03
Control FileIncluded: Ckp SCN: 651154 Ckp time:23-MAY-12
SPFILE Included:Modification time: 23-MAY-12
如下是备份spfile文件的信息:
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
16Full 80.00KDISK 00:00:01 23-MAY-12
BP Key:16 Status: AVAILABLE Compressed: NO Tag: TAG20120523T133737
Piece Name:/DBBak/bak_WWL_05_23_0inbn2l2_1_1
SPFILE Included:Modification time: 23-MAY-12
BS KeyType LVSize Device Type Elapsed TimeCompletion Time
------- ---- -- ---------- ----------- ---------------------------
17Full 6.80MDISK 00:00:02 23-MAY-12
BP Key:17 Status: AVAILABLE Compressed: NO Tag: TAG20120523T133740
Piece Name:/DBSoft/product/10.2.0/db_1/dbs/c-5520179-20120523-04
Control FileIncluded: Ckp SCN: 651175 Ckp time:23-MAY-12
SPFILE Included:Modification time: 23-MAY-12
2、要恢复首先要将数据库启动到mount状态才能恢复
[oracle@wwldb dbs]$ sqlplus / as sysdba
SQL*Plus:Release 10.2.0.1.0 - Production on Wed May 23 17:03:42 2012
Copyright (c)1982, 2005, Oracle. All rights reserved.
Connected to anidle instance.
SQL> startup
ORA-01078:failure in processing system parameters
LRM-00109: couldnot open parameter file '/DBSoft/product/10.2.0/db_1/dbs/initWWL.ora'
SQL>
3、因为数据库没有参数文件,起不来,只能能启动到nomount状态
[oracle@wwldb dbs]$ rman target /
RecoveryManager: Release 10.2.0.1.0 - Production on Wed May 23 17:06:32 2012
Copyright (c)1982, 2005, Oracle. All rights reserved.
connected totarget database (not started)
RMAN> startup force nomount;
startup failed:ORA-01078: failure in processing system parameters
LRM-00109: couldnot open parameter file '/DBSoft/product/10.2.0/db_1/dbs/initWWL.ora'
starting Oracleinstance without parameter file for retrival of spfile
Oracle instancestarted
Total System GlobalArea 159383552 bytes
Fixed Size 1218244 bytes
VariableSize 58722620 bytes
DatabaseBuffers 92274688 bytes
RedoBuffers 7168000 bytes
RMAN>
4、开始恢复参数文件,只有恢复了参数文件和控制文件数据库才能到mount状态来恢复数据文件:
RMAN> restorespfile from autobackup;
Starting restoreat 23-MAY-12
using targetdatabase control file instead of recovery catalog
allocatedchannel: ORA_DISK_1
channelORA_DISK_1: sid=36 devtype=DISK
RMAN-00571:===========================================================
RMAN-00569:=============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571:===========================================================
RMAN-03002:failure of restore command at 05/23/2012 17:08:42
RMAN-06495: mustexplicitly specify DBID with SET DBID command
SQL> exit
Disconnectedfrom Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With thePartitioning, OLAP and Data Mining options
[oracle@wwldb dbs]$ rman target /
RecoveryManager: Release 10.2.0.1.0 - Production on Wed May 23 19:04:15 2012
Copyright (c)1982, 2005, Oracle. All rights reserved.
connected totarget database: WWL (DBID=5520179, not open)