oracle数据库rman set newname switch 用法

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:593

oracle数据库rman set newname switch 用法

前提是已经有个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> [color=sienna]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>

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】