Query to Moving data files between disks

set trimspool on wrap off
set heading off
set verify off
set pages 1000 lines 1000
spool rename.sql

select    ‘alter database rename file ”’ ||
     name || ”’ to ”’ ||
     replace(name || ”’;’, ‘/u01’, ‘/u02’)
from     v$datafile
/

select    ‘alter database rename file ”’ ||
    member || ”’ to ”’ ||
    replace(member || ”’;’, ‘/u01’, ‘/u02’)
from    v$logfile
/
spool off

  • January 23, 2019 | 15 views
  • Comments