rman set newname switch 用法

paulyibinyi發表於2007-12-20

前提是已經有個backup tablespace tools 備份了

set newname 的作用是恢復到一個新的路徑

switch 做切換把新路徑檔案寫到控制檔案中

恢復到一個新的路徑

C:\Documents and Settings\Paul Yi>rman target / catalog paultest/paultest@dev
Recovery Manager: Release 9.2.0.4.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database: PAUL (DBID=1605165889)
connected to recovery catalog database

RMAN> run{
2> allocate channel c1 type disk;
3> set newname for datafile 4 to 'd:\oracle\oradata\paul\tools01.dbf';
4> restore datafile 4;
5> switch datafile 4;
6> recover datafile 4;
7> sql 'alter tablespace tools online';
8> release channel c1;
9> }

starting full resync of recovery catalog
full resync complete
allocated channel: c1
channel c1: sid=13 devtype=DISK

executing command: SET NEWNAME

Starting restore at 20-DEC-07

channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to D:\ORACLE\ORADATA\PAUL\TOOLS01.DBF
channel c1: restored backup piece 1
piece handle=D:\BACKUP\21J42O1U_1_1 tag=TAG20071220T105806 params=NULL
channel c1: restore complete
Finished restore at 20-DEC-07

datafile 4 switched to datafile copy
input datafilecopy recid=17 stamp=641819216 filename=D:\ORACLE\ORADATA\PAUL\T
S01.DBF
starting full resync of recovery catalog
full resync complete

Starting recover at 20-DEC-07

starting media recovery
media recovery complete

Finished recover at 20-DEC-07

sql statement: alter tablespace tools online
starting full resync of recovery catalog
full resync complete

released channel: c1

RMAN>

 

 

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-928/,如需轉載,請註明出處,否則將追究法律責任。

相關文章