• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to rename Oracle-Managed Files (OMFs)

by admin

There are 2 different scenarios to consider:

  • Renaming an OMF to a non-OMF name.
  • Renaming an OMF to another OMF-compliant name.

Note that renaming an OMF to another OMF-compliant name is not normally recommended. You should allow Oracle to name the files. But, should you wish to rename one but maintain its OMF status, it can be accomplished.

Here are the 3 methods for renaming an OMF.

Method 1

Rename tablespace and make it offline.

SQL> ALTER TABLESPACE tsname OFFLINE

2. Move/Rename the file at the OS level. Depending on the underlying OS commands may be different.

3. Rename the datafiles from the “tsname” tablespace from old to new:

SQL> ALTER TABLESPACE tsname RENAME DATAFILE 'oldomfname' TO 'newnonomfname';

4. Make “tsname” tablespace online:

SQL> ALTER TABLESPACE tsname ONLINE

Method 2

1. Shutdown the database first.

SQL> SHUTDOWN IMMEDIATE (or normal)

2. Move/Rename the file at the OS level. Depending on the underlying OS commands may be different.

3. Start the database in Mount stage.

SQL> STARTUP MOUNT

4. Rename the datafile at database level:

SQL> ALTER DATABASE RENAME FILE 'oldomfname' TO 'newnonomfname';

5. Open database in read write mode.

SQL> ALTER DATABASE OPEN
NOTE: This method is only valid if renaming an OMF to a non-OMF name.

If you attempt to rename an OMF to another OMF-compliant name at the mount stage with the ALTER DATABASE command, you will receive the following errors:

ORA-01511: error in renaming log/data files
ORA-01276:  Cannot add a file with an Oracle Managed Files file name.

Method 3

1. Shutdown the database first:

SQL> SHUTDOWN IMMEDIATE (or normal)

2. Move/Rename the file at the OS level. Depending on the underlying OS commands may be different.

3. Recreate the controlfile with the desired name. For details on recreating the controlfile, refer to the below document.

How to recreate Control file in Oracle Database

Filed Under: oracle

Some more articles you might also be interested in …

  1. Oracle RMAN : Block-Level Media Recovery (Basics and Example)
  2. Types of Patches in Oracle Apps 11i/R12
  3. Starting, Stopping, and Checking the Status of the EM Cloud Control OMS
  4. How to Force ASM to Scan the Multipathed Device First using ASMLIB/oracleasm
  5. What are Oracle Data Guard Protection Modes (redo transport rules) and how to configure them
  6. CentOS / RHEL : Installing and Configuring ASMLib
  7. How to move ASM spfile to a different disk group
  8. What is Thread Dump in WebLogic
  9. Unable to Drop Undo tablespace Since Undo Segment is in Needs Recovery
  10. How to Modify spfile in Oracle Database

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright