A Oracle DBA's BLOG

Welcome to my ORACLE DBA blog. You will be Amazing!!!

Wednesday, November 7, 2012

Oracle rename data file tips

This article present easy way to change/rename datafile_name or Tablespace name_name.
First select your dba_datafile_name and choose a file for renaming.
SQL> SELECT FILE_NAME FROM DBA_DATA_FILES;
 
FILE_NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/users01.dbf
/u01/app/oracle/oradata/orcl/undotbs01.dbf
/u01/app/oracle/oradata/orcl/sysaux01.dbf
/u01/app/oracle/oradata/orcl/system01.dbf
/u01/app/oracle/oradata/orcl/test01.dbf
 

Now close your database;

 
SQL>shutdown immediate;
Now change the name of file
linux> mv /u01/app/oracle/oradata/orcl/test01.dbf ' '/u01/app/oracle/oradata/orcl/veysi01.dbf


Mount your database


SQL> Startup  mount;


Rename datafile


SQL>ALTER DATABASE   
RENAME file      
   '/u01/app/oracle/oradata/orcl/test01.dbf' 
TO 
   '/u01/app/oracle/oradata/veysi01.dbf'

sql>alter database open;

Renaming Tablespace

ALTER TABLESPACE TEST RENAME TO INTERBASE;


No comments:

Post a Comment