How to Rename datafile in Oracle

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • ANKUSH THAVALI
  • 10 Jun, 2019
  • 0 Comments
  • 35 Secs Read

How to Rename datafile in Oracle

How to rename Datafile in Oracle 12c


SQL> SELECT name FROM v$datafile WHERE name LIKE '%users01%';

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/cdb1/users01.dbf

SQL> ALTER TABLESPACE users OFFLINE NORMAL;

Rename the file on server level HOST mv /u01/app/oracle/oradata/cdb1/users01.dbf /u01/app/oracle/oradata/cdb1/users02.dbf

ALTER TABLESPACE users
    RENAME DATAFILE '/u01/app/oracle/oradata/cdb1/users01.dbf' TO '/u01/app/oracle/oradata/cdb1/users02.dbf';

ALTER TABLESPACE users ONLINE;

SQL> SELECT name FROM v$datafile WHERE name LIKE '%users02%';

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/cdb1/users02.dbf

SQL>