SlideShare a Scribd company logo
Renaming a Data File                                                             Administration Tips




Renaming a Data File

There is only one question to ask yourself before carrying out this task: Is the Data File to
be renamed part of the SYSTEM tablespace, or not?

If the answer is "YES", then the procedure is as follows:

Shutdown the database
At the operating system, use appropriate O/S commands to actually rename the file
Issue the command STARTUP MOUNT;
Issue the command ALTER DATABASE RENAME FILE '/OLDFILENAME' TO '/NEWFILENAME';
Issue the command ALTER DATABASE OPEN;

If the answer is "NO", then the procedure is as follows:

Offline the relevant tablespace by issuing the command ALTER TABLESPACE BLAH OFFLINE;
At the operating system, use appropriate O/S commands to actually rename the file
Issue the command ALTER TABLESPACE RENAME DATAFILE '/OLDFILENAME' TO '/NEWFILENAME';
Bring the tablespace back online with the command ALTER TABLESPACE BLAH ONLINE;

Actually, you could do the deed in this case by following exactly the same procedure as
indicated for when it's the SYSTEM data file being renamed. However, the procedure
described here has the distinct advantage of not requiring the entire database to be out of
commission for the duration of the exercise. Any User wanting access to data contained
within the affected tablespace will be stuffed, of course. But Users accessing data in
other tablespaces will not even know that such maintenance is being performed.

Incidentally, the crucial point to realise here is that, despite the various Oracle commands
saying "rename datafile" or "rename file", Oracle never actually does any such thing!
Renaming or moving or deleting files at the Operating System is strictly a job for the
operating system itself (at least until you get to Oracle 9i). All the commands actually do
is to re-jig the pointers to the file as stored within the Control File. Important stuff, no
doubt -but the command is somewhat misleading as to its scope.




Copyright © Howard Rogers 2001             10/17/2001                                     Page 1 of 1

More Related Content

What's hot

A Complete Installation Guide for Orangescrum
A Complete Installation Guide for OrangescrumA Complete Installation Guide for Orangescrum
A Complete Installation Guide for Orangescrum
Orangescrum
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
vivaankumar
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
maclean liu
 
Installing oracle timesten database On Linux
Installing oracle timesten database On Linux Installing oracle timesten database On Linux
Installing oracle timesten database On Linux
Osama Mustafa
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different host
Osama Mustafa
 
Less15 Backups
Less15 BackupsLess15 Backups
Less15 Backups
vivaankumar
 
Les 04 Config Bu
Les 04 Config BuLes 04 Config Bu
Les 04 Config Bu
vivaankumar
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklist
praveen_01236
 
Les 09 Tspitr
Les 09 TspitrLes 09 Tspitr
Les 09 Tspitr
vivaankumar
 
Less02 Installation
Less02 InstallationLess02 Installation
Less02 Installation
vivaankumar
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Bu
vivaankumar
 
Content server installation guide
Content server installation guideContent server installation guide
Content server installation guide
Naveed Bashir
 
Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6
Osama Mustafa
 
Les 08 Dupe Db
Les 08 Dupe DbLes 08 Dupe Db
Les 08 Dupe Db
vivaankumar
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
vivaankumar
 
Readme
ReadmeReadme
Readme
ingecom
 
Less17 Util
Less17  UtilLess17  Util
Less17 Util
vivaankumar
 
patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack
David McNish
 
Les 03 Catalog
Les 03 CatalogLes 03 Catalog
Les 03 Catalog
vivaankumar
 

What's hot (19)

A Complete Installation Guide for Orangescrum
A Complete Installation Guide for OrangescrumA Complete Installation Guide for Orangescrum
A Complete Installation Guide for Orangescrum
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
 
Installing oracle timesten database On Linux
Installing oracle timesten database On Linux Installing oracle timesten database On Linux
Installing oracle timesten database On Linux
 
Step by Step Restore rman to different host
Step by Step Restore rman to different hostStep by Step Restore rman to different host
Step by Step Restore rman to different host
 
Less15 Backups
Less15 BackupsLess15 Backups
Less15 Backups
 
Les 04 Config Bu
Les 04 Config BuLes 04 Config Bu
Les 04 Config Bu
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklist
 
Les 09 Tspitr
Les 09 TspitrLes 09 Tspitr
Les 09 Tspitr
 
Less02 Installation
Less02 InstallationLess02 Installation
Less02 Installation
 
Les 05 Create Bu
Les 05 Create BuLes 05 Create Bu
Les 05 Create Bu
 
Content server installation guide
Content server installation guideContent server installation guide
Content server installation guide
 
Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6Install oracle grid infrastructure on linux 6.6
Install oracle grid infrastructure on linux 6.6
 
Les 08 Dupe Db
Les 08 Dupe DbLes 08 Dupe Db
Les 08 Dupe Db
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
 
Readme
ReadmeReadme
Readme
 
Less17 Util
Less17  UtilLess17  Util
Less17 Util
 
patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack patchVantage Cloud Starter Pack
patchVantage Cloud Starter Pack
 
Les 03 Catalog
Les 03 CatalogLes 03 Catalog
Les 03 Catalog
 

Similar to Datafilerename

Createclone
CreatecloneCreateclone
Createclone
oracle documents
 
Cloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureCloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step Procedure
Orazer Technologies
 
DMS
DMSDMS
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
Nelson Calero
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
Gustavo Rene Antunez
 
Completerecovery
CompleterecoveryCompleterecovery
Completerecovery
oracle documents
 
Rman cloning guide
Rman cloning guideRman cloning guide
Rman cloning guide
Amit87_dba
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan user
Desty Yani
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
Femi Adeyemi
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
Femi Adeyemi
 
Oracle 10g to 11g upgrade on sap(10.2.0.5.0 to 11.2.0.3)
Oracle 10g to 11g upgrade on sap(10.2.0.5.0 to 11.2.0.3)Oracle 10g to 11g upgrade on sap(10.2.0.5.0 to 11.2.0.3)
Oracle 10g to 11g upgrade on sap(10.2.0.5.0 to 11.2.0.3)
yoonus ch
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
Yogiji Creations
 
Oracle dba interview question
Oracle dba interview questionOracle dba interview question
Oracle dba interview question
Amarendra Sharma
 
Backup beyond just a strategy with SQL Server
Backup beyond just a strategy with SQL ServerBackup beyond just a strategy with SQL Server
Backup beyond just a strategy with SQL Server
Vinod Kumar
 
Rman backup and recovery 11g new features
Rman backup and recovery 11g new featuresRman backup and recovery 11g new features
Rman backup and recovery 11g new features
Nabi Abdul
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under control
Marcin Przepiórowski
 
Hotbackup
HotbackupHotbackup
Hotbackup
oracle documents
 
21
2121
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
Manish Mudhliyar
 
Les 06 rec
Les 06 recLes 06 rec
Les 06 rec
Femi Adeyemi
 

Similar to Datafilerename (20)

Createclone
CreatecloneCreateclone
Createclone
 
Cloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step ProcedureCloning Oracle EBS R12: A Step by Step Procedure
Cloning Oracle EBS R12: A Step by Step Procedure
 
DMS
DMSDMS
DMS
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
 
Completerecovery
CompleterecoveryCompleterecovery
Completerecovery
 
Rman cloning guide
Rman cloning guideRman cloning guide
Rman cloning guide
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan user
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
 
Oracle 10g to 11g upgrade on sap(10.2.0.5.0 to 11.2.0.3)
Oracle 10g to 11g upgrade on sap(10.2.0.5.0 to 11.2.0.3)Oracle 10g to 11g upgrade on sap(10.2.0.5.0 to 11.2.0.3)
Oracle 10g to 11g upgrade on sap(10.2.0.5.0 to 11.2.0.3)
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
Oracle dba interview question
Oracle dba interview questionOracle dba interview question
Oracle dba interview question
 
Backup beyond just a strategy with SQL Server
Backup beyond just a strategy with SQL ServerBackup beyond just a strategy with SQL Server
Backup beyond just a strategy with SQL Server
 
Rman backup and recovery 11g new features
Rman backup and recovery 11g new featuresRman backup and recovery 11g new features
Rman backup and recovery 11g new features
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under control
 
Hotbackup
HotbackupHotbackup
Hotbackup
 
21
2121
21
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
 
Les 06 rec
Les 06 recLes 06 rec
Les 06 rec
 

More from oracle documents

Applyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuningApplyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuning
oracle documents
 
Windowsosauthent
WindowsosauthentWindowsosauthent
Windowsosauthent
oracle documents
 
Whatistnsnames
WhatistnsnamesWhatistnsnames
Whatistnsnames
oracle documents
 
Whatisadatabaselink
WhatisadatabaselinkWhatisadatabaselink
Whatisadatabaselink
oracle documents
 
Varraysandnestedtables
VarraysandnestedtablesVarraysandnestedtables
Varraysandnestedtables
oracle documents
 
Usertracing
UsertracingUsertracing
Usertracing
oracle documents
 
Userpasswrd
UserpasswrdUserpasswrd
Userpasswrd
oracle documents
 
Userlimit
UserlimitUserlimit
Userlimit
oracle documents
 
Undo internalspresentation
Undo internalspresentationUndo internalspresentation
Undo internalspresentation
oracle documents
 
Undo internals paper
Undo internals paperUndo internals paper
Undo internals paper
oracle documents
 
Tablespacelmt
TablespacelmtTablespacelmt
Tablespacelmt
oracle documents
 
Tablerename
TablerenameTablerename
Tablerename
oracle documents
 
Sql scripting sorcerypresentation
Sql scripting sorcerypresentationSql scripting sorcerypresentation
Sql scripting sorcerypresentation
oracle documents
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
oracle documents
 
Sql for dbaspresentation
Sql for dbaspresentationSql for dbaspresentation
Sql for dbaspresentation
oracle documents
 
Sequencereset
SequenceresetSequencereset
Sequencereset
oracle documents
 
Rollbacksizes
RollbacksizesRollbacksizes
Rollbacksizes
oracle documents
 
Rollbackshrinks
RollbackshrinksRollbackshrinks
Rollbackshrinks
oracle documents
 
Rollbacklmt
RollbacklmtRollbacklmt
Rollbacklmt
oracle documents
 
Rollbackblocking
RollbackblockingRollbackblocking
Rollbackblocking
oracle documents
 

More from oracle documents (20)

Applyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuningApplyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuning
 
Windowsosauthent
WindowsosauthentWindowsosauthent
Windowsosauthent
 
Whatistnsnames
WhatistnsnamesWhatistnsnames
Whatistnsnames
 
Whatisadatabaselink
WhatisadatabaselinkWhatisadatabaselink
Whatisadatabaselink
 
Varraysandnestedtables
VarraysandnestedtablesVarraysandnestedtables
Varraysandnestedtables
 
Usertracing
UsertracingUsertracing
Usertracing
 
Userpasswrd
UserpasswrdUserpasswrd
Userpasswrd
 
Userlimit
UserlimitUserlimit
Userlimit
 
Undo internalspresentation
Undo internalspresentationUndo internalspresentation
Undo internalspresentation
 
Undo internals paper
Undo internals paperUndo internals paper
Undo internals paper
 
Tablespacelmt
TablespacelmtTablespacelmt
Tablespacelmt
 
Tablerename
TablerenameTablerename
Tablerename
 
Sql scripting sorcerypresentation
Sql scripting sorcerypresentationSql scripting sorcerypresentation
Sql scripting sorcerypresentation
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
 
Sql for dbaspresentation
Sql for dbaspresentationSql for dbaspresentation
Sql for dbaspresentation
 
Sequencereset
SequenceresetSequencereset
Sequencereset
 
Rollbacksizes
RollbacksizesRollbacksizes
Rollbacksizes
 
Rollbackshrinks
RollbackshrinksRollbackshrinks
Rollbackshrinks
 
Rollbacklmt
RollbacklmtRollbacklmt
Rollbacklmt
 
Rollbackblocking
RollbackblockingRollbackblocking
Rollbackblocking
 

Datafilerename

  • 1. Renaming a Data File Administration Tips Renaming a Data File There is only one question to ask yourself before carrying out this task: Is the Data File to be renamed part of the SYSTEM tablespace, or not? If the answer is "YES", then the procedure is as follows: Shutdown the database At the operating system, use appropriate O/S commands to actually rename the file Issue the command STARTUP MOUNT; Issue the command ALTER DATABASE RENAME FILE '/OLDFILENAME' TO '/NEWFILENAME'; Issue the command ALTER DATABASE OPEN; If the answer is "NO", then the procedure is as follows: Offline the relevant tablespace by issuing the command ALTER TABLESPACE BLAH OFFLINE; At the operating system, use appropriate O/S commands to actually rename the file Issue the command ALTER TABLESPACE RENAME DATAFILE '/OLDFILENAME' TO '/NEWFILENAME'; Bring the tablespace back online with the command ALTER TABLESPACE BLAH ONLINE; Actually, you could do the deed in this case by following exactly the same procedure as indicated for when it's the SYSTEM data file being renamed. However, the procedure described here has the distinct advantage of not requiring the entire database to be out of commission for the duration of the exercise. Any User wanting access to data contained within the affected tablespace will be stuffed, of course. But Users accessing data in other tablespaces will not even know that such maintenance is being performed. Incidentally, the crucial point to realise here is that, despite the various Oracle commands saying "rename datafile" or "rename file", Oracle never actually does any such thing! Renaming or moving or deleting files at the Operating System is strictly a job for the operating system itself (at least until you get to Oracle 9i). All the commands actually do is to re-jig the pointers to the file as stored within the Control File. Important stuff, no doubt -but the command is somewhat misleading as to its scope. Copyright © Howard Rogers 2001 10/17/2001 Page 1 of 1