Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday, July 16, 2017

Database File name change

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

startup mount;
@dbmove.sql
alter database open;

No comments:

Post a Comment