startup
set pages 0 lines 400
spool move.sh
select 'mv '|| file_name ||' /oracle/TEST/datafile/'||tablespace_name||'_'||file_id||'.dbf' from dba_data_files;
spool off
spool dbmove.sql
select 'alter database rename file '||''''|| file_name ||''''||' to '||''''||'/oracle/TEST/datafile/'||tablespace_name||'_'||file_id||'.dbf'||''''||';' from dba_data_files order by file_id;
spool off
shut immediate
sh move.sh
set pages 0 lines 400
spool move.sh
select 'mv '|| file_name ||' /oracle/TEST/datafile/'||tablespace_name||'_'||file_id||'.dbf' from dba_data_files;
spool off
spool dbmove.sql
select 'alter database rename file '||''''|| file_name ||''''||' to '||''''||'/oracle/TEST/datafile/'||tablespace_name||'_'||file_id||'.dbf'||''''||';' from dba_data_files order by file_id;
spool off
shut immediate
sh move.sh
startup mount;
@dbmove.sql
alter database open;
No comments:
Post a Comment