step 1
tablespace
offline
alter tablespace tablespacename offline;
step 2 datafile offline
alter database datafile '$DatafilePath/datafilename' offline
step 3 use rman tools move datafile
rman target /
RMAN> copy datafile '$oldPath/datafilename' to '$newpath/rm_dat_ts1_01.dbf';
Starting backup at 2014-04-03 18:52:41
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=637 instance=**** device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00032 name=+DATA/*****.dbf
output file name=+DATA2/coredb/datafile/rm_dat_ts1_01.dbf tag=TAG20140403T185243 RECID=1 STAMP=843936775
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 2014-04-03 18:52:58
step 4 rename datafile
RMAN> run {
2> set newname for datafile '$oldPath/datafilename' to '$newpath /rm_dat_ts1_01.dbf';;
3> switch datafile all;
4> }
step 5 online datafile
alter database datafile '$NewPath/datafilename' online;
step 6 online tablespace
alter tablespace tablespacename online;
alter tablespace tablespacename offline;
step 2 datafile offline
alter database datafile '$DatafilePath/datafilename' offline
step 3 use rman tools move datafile
rman target /
RMAN> copy datafile '$oldPath/datafilename' to '$newpath/rm_dat_ts1_01.dbf';
Starting backup at 2014-04-03 18:52:41
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=637 instance=**** device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00032 name=+DATA/*****.dbf
output file name=+DATA2/coredb/datafile/rm_dat_ts1_01.dbf tag=TAG20140403T185243 RECID=1 STAMP=843936775
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 2014-04-03 18:52:58
step 4 rename datafile
RMAN> run {
2> set newname for datafile '$oldPath/datafilename' to '$newpath /rm_dat_ts1_01.dbf';;
3> switch datafile all;
4> }
step 5 online datafile
alter database datafile '$NewPath/datafilename' online;
step 6 online tablespace
alter tablespace tablespacename online;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26252696/viewspace-1135323/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26252696/viewspace-1135323/