Oracle DBA, How To, Error, Cause and Action

Rename Datafile (2/2)

Rename Datafile (1/2)
Rename Datafile (2/2) [You are here]

2. Rename datafile with database mounted

Procedure renaming datafile with mounted Database:
- Shutdown
- Startup mount
- Alter database or alter tablespace to the rename file command
- Alter database open

In this example my objective is to change the my_tbs_01.dbf to my_tbs_1000.dbf

1. Shutdown database gracefully

Shutdown database gracefully means that you are shutdown database with either with SHUTDOWN NORMAL, SHUTDOWN IMMEDIATE, or SHUTDOWN TRANSACTIONAL.
With above method of shutdown, Oracle will conclude all active transaction, and you will have good copy of database.

SHUTDOWN IMMEDIATE



2. Startup mount



3. Alter database or alter tablespace to the rename file command

There are two methods of renaming datafile, you may can choose one from here.

ALTER DATABASE RENAME FILE '/datafiles/edba01/edba01/my_tbs_01.dbf' TO '/datafiles/edba01/edba01/my_tbs_1000.dbf';


or

ALTER TABLESPACE my_tbs RENAME DATAFILE '/datafiles/edba01/edba01/my_tbs_01.dbf' TO '/datafiles/edba01/edba01/my_tbs_1000.dbf';


4. Alter database open


Check the status of the new file

Rename Datafile (1/2)
Rename Datafile (2/2) [You are here]

No comments:

Post a Comment

Thanks for your comment.