Friday, December 30, 2011

RMAN_restore_setname

run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
set newname for datafile 1 to '/u02/oradata/prod/system.dbf';
set newname for datafile 2 to '/u02/oradata/prod/undo.dbf';
set newname for datafile 3 to '/u02/oradata/prod/sysaux.dbf';
set newname for datafile 4 to '/u02/oradata/prod/users.dbf';
restore database;
switch datafile all;
recover database;
alter database open resetlogs;
release channel c1;
release channel c2;
}


SQL> alter database mount;

Database altered.

SQL> alter database rename file '/u01/app/oracle/oradata/kiwi/redo01.log' to '/u02/oradata/prod/redo01.log';

Database altered.

SQL> alter database rename file '/u01/app/oracle/oradata/kiwi/redo02.log' to '/u02/oradata/prod/redo02.log';

Database altered.

SQL>

No comments: