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

PDF
Oracle database hot backup and recovery
PDF
Refresh development from productions
PDF
Oracle api gateway installation as cluster and single node
PDF
Ebs clone r12.2.4
PDF
12c on RHEL7
PPT
Les 07 Rman Rec
DOCX
Upgrade EBS DB from 11g to 12c.
Oracle database hot backup and recovery
Refresh development from productions
Oracle api gateway installation as cluster and single node
Ebs clone r12.2.4
12c on RHEL7
Les 07 Rman Rec
Upgrade EBS DB from 11g to 12c.

What's hot (19)

PDF
A Complete Installation Guide for Orangescrum
PPT
Les 06 Perform Rec
PPT
2011 384 hackworth_ppt
PDF
Installing oracle timesten database On Linux
PDF
Step by Step Restore rman to different host
PPT
Less15 Backups
PPT
Les 04 Config Bu
PDF
Backup andrecoverychecklist
PPT
Les 09 Tspitr
PPT
Less02 Installation
PPT
Les 05 Create Bu
DOCX
Content server installation guide
PDF
Install oracle grid infrastructure on linux 6.6
PPT
Les 08 Dupe Db
PPT
Les 02 Config Rec
TXT
Readme
PPT
Less17 Util
PPTX
patchVantage Cloud Starter Pack
PPT
Les 03 Catalog
A Complete Installation Guide for Orangescrum
Les 06 Perform Rec
2011 384 hackworth_ppt
Installing oracle timesten database On Linux
Step by Step Restore rman to different host
Less15 Backups
Les 04 Config Bu
Backup andrecoverychecklist
Les 09 Tspitr
Less02 Installation
Les 05 Create Bu
Content server installation guide
Install oracle grid infrastructure on linux 6.6
Les 08 Dupe Db
Les 02 Config Rec
Readme
Less17 Util
patchVantage Cloud Starter Pack
Les 03 Catalog
Ad

Similar to Datafilerename (20)

PDF
02-Oracle 19c-Storage-Management de Base de Datos
PPT
Les 07 rman_rec
PPT
Les 02 config
PPT
Week 10-11 Managing Tablespaces and Data Files.ppt
PDF
Completerecovery
PDF
GLOC 2014 NEOOUG - Oracle Database 12c New Features
PPT
Les 06 rec
PPTX
Big file tablespaces
PDF
Tablespaces
PDF
PDF
Rename with Confidence – Building Dynamic FileMaker Systems
DOCX
Change DB Name
PPTX
Sql plsql online training
PPT
Less07 storage
PDF
Unit ivos - file systems
PPT
5895640.ppt
PDF
File handling in qbasic
PPTX
Oracle ASM Training
DOCX
Moving 12c database from NON-ASM to ASM
PPT
011300 Intro To Dos
02-Oracle 19c-Storage-Management de Base de Datos
Les 07 rman_rec
Les 02 config
Week 10-11 Managing Tablespaces and Data Files.ppt
Completerecovery
GLOC 2014 NEOOUG - Oracle Database 12c New Features
Les 06 rec
Big file tablespaces
Tablespaces
Rename with Confidence – Building Dynamic FileMaker Systems
Change DB Name
Sql plsql online training
Less07 storage
Unit ivos - file systems
5895640.ppt
File handling in qbasic
Oracle ASM Training
Moving 12c database from NON-ASM to ASM
011300 Intro To Dos
Ad

More from oracle documents (20)

PPT
Applyinga blockcentricapproachtotuning
PDF
Windowsosauthent
PDF
Whatistnsnames
PDF
Whatisadatabaselink
PDF
Varraysandnestedtables
PDF
Usertracing
PDF
Userpasswrd
PDF
Userlimit
PDF
Undo internalspresentation
PDF
Undo internals paper
PDF
Tablespacelmt
PDF
Tablerename
PDF
Sql scripting sorcerypresentation
PDF
Sql scripting sorcerypaper
PDF
Sql for dbaspresentation
PDF
Sequencereset
PDF
Rollbacksizes
PDF
Rollbackshrinks
PDF
Rollbacklmt
PDF
Rollbackblocking
Applyinga blockcentricapproachtotuning
Windowsosauthent
Whatistnsnames
Whatisadatabaselink
Varraysandnestedtables
Usertracing
Userpasswrd
Userlimit
Undo internalspresentation
Undo internals paper
Tablespacelmt
Tablerename
Sql scripting sorcerypresentation
Sql scripting sorcerypaper
Sql for dbaspresentation
Sequencereset
Rollbacksizes
Rollbackshrinks
Rollbacklmt
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