advertisements
_____________________________________________________________________________________________________________________
Overview: RMAN switch command is equivalent to the alter database rename file. By default the RMAN will restore the file to the original location of the file and it will overwrite the file already present in the original location. If you wanted to restore a datafile to different location you need to run “set rename” command.
rman target /
RMAN > run {
copy datafile '/data/oracle/oradata/proddb9/test.dbf' TO '/data/oracle/oradata/backup/test.dbf';
set newname for datafile '/data/oracle/oradata/proddb9/test.dbf' to '/data/oracle/oradata/backup/test.dbf’;
switch datafile all;
host 'rm /data/oracle/oradata/proddb9/test.dbf ';
}
set newname for datafile '/data/oracle/oradata/proddb9/test.dbf' to '/data/oracle/oradata/backup/test.dbf’;
switch datafile all;
host 'rm /data/oracle/oradata/proddb9/test.dbf ';
}
_____________________________________________________________________________________________________________________
0 comments:
Post a Comment