🧩 How to Rename a Datafile in Oracle Database
🧩 How to Rename a Datafile in Oracle Database
Renaming a datafile is sometimes necessary after restoring from backup or reorganizing your storage structure ⚙️
Let’s see how to safely rename a datafile in just a few steps 👇
🔍 Step-by-Step Guide
1️⃣ Identify the datafile you want to rename:
SELECT file_id, file_name FROM dba_data_files;
2️⃣ Shutdown the database cleanly:
SHUTDOWN IMMEDIATE;
3️⃣ Rename the file at the OS level:
mv /u01/oradata/PROD/users01.dbf /u01/oradata/PROD/users_data.dbf
4️⃣ Start the database in MOUNT mode:
STARTUP MOUNT;
5️⃣ Update the control file with the new name:
ALTER DATABASE RENAME FILE '/u01/oradata/PROD/users01.dbf'
TO '/u01/oradata/PROD/users_data.dbf';
6️⃣ Open the database:
ALTER DATABASE OPEN;
✅ That’s it! Your datafile has been successfully renamed.
💡 DBA Tip
Always take a control file backup after renaming datafiles — it helps during future recovery operations.
💬 Like this post?
👉 Follow my page for more Oracle DBA tips and practical guides!
👉 Facebook: https://www.facebook.com/people/Oracle-On-Linux-Tips/61581062542160/
📘 Blog: https://oracleinlinuxbyabosalma.blogspot.com

Comments
Post a Comment