Skip to main content

How To: Properly MOVE or RENAME oracle datafile

    To properly move the datafile around or rename the datafile, follow this steps:

  •         Login to oracle SQLPlus or Connect to target database using any trird party tool.
    bash#sqlplus /nolog
    SQL> conn sys as sysdba
       
 
    Shutdown the database instance with SHUTDOWN command.
    SQL> shutdown immediate;
       
    Rename or/and move the datafiles at operating system level.
       
    Start Oracle database in mount state with STARTUP MOUNT command.
    SQL> startup mount;
      
    Modify the name or location of datafiles in Oracle data dictionary using following command syntax:
    SQL> ALTER DATABASE RENAME FILE ‘<fully qualified path to original data file name>’ TO ‘<new or original fully qualified path to new or original data file name>’;
       
    Open Oracle database instance completely with ALTER DATABASE OPEN command.
    SQL> alter database open;


=========================================================================

Thanks for reading this article.

Comments

Post a Comment