ITPub博客

首页 > Linux操作系统 > Linux操作系统 > rman set newname switch 用法

rman set newname switch 用法

原创 Linux操作系统 作者:paulyibinyi 时间:2007-12-20 11:08:13 0 删除 编辑

前提是已经有个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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
oracle 10g ocm oracle 10g/11g/12c ocp aix 6.1 administrator,ogg expert,ITSS 技术交流群 201703254 微信公众号 paulyibin 探讨技术,开心工作 电话 13719354869 ,深入研究数据库和开始研究big data

注册时间:2007-12-11

  • 博文量
    905
  • 访问量
    6490693