2018. 7. 6. 14:26 오라클
rman set newnname 생성 PL/SQL
- rman set newnname 생성 PL/SQL
set serveroutput on;
declare
cursor df is select file#, name from v$datafile;
begin
dbms_output.put_line('run');
dbms_output.put_line('{');
for dfrec in df loop
dbms_output.put_line('set newname for datafile ' ||
dfrec.file# || ' to ''' || dfrec.name ||''' ;');
end loop;
dbms_output.put_line('restore database;');
dbms_output.put_line('switch all;');
dbms_output.put_line('}');
end;
/
run
{
set newname for datafile 1 to '/oradata/TEST/system01.dbf' ;
set newname for datafile 2 to '/oradata/TEST/sysaux01.dbf' ;
set newname for datafile 3 to '/oradata/TEST/undotbs01.dbf' ;
set newname for datafile 4 to '/oradata/TEST/users01.dbf' ;
set newname for datafile 5 to '/oradata/TEST/test01.dbf' ;
restore database;
switch all;
}
PL/SQL procedure successfully completed.