Rabu, 18 Mei 2016

How to relocate datafile from one drive to other without shutdown db


  1. Login to SQL*Plus
  2. Connect as SYS DBA with CONNECT / AS SYSDBA command
  3. Make offline the affected tablespace
  4. ALTER TABLESPACE tablespace_name OFFLINE;
    
  5. Modify the name or location of datafiles in Oracle data dictionary using following command syntax:
  6. ALTER TABLESPACE tablespace_name
    RENAME DATAFILE 'fully qualified path to original data file name' 
    TO 'new or original fully qualified path to new or original data file name';
    
  7. Bring the tablespace online again
  8. ALTER TABLESPACE tablespace_name ONLINE;
    
  9. If you experienced this error : ORA-01113, execute this syntax:
  10. recover datafile 'new fully qualified path to original data file name'
    

source : otn