RMAN Switch command script to rename the datafile

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
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 ';
}

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer