Subject: Renaming Database Files
Last Revision Date: 11 September 1994
Author:Suw and i Harnyo
----------------------------------------------------------------------
To rename or move database files to another directory:
[1] shutdowm immediate /* Very important */
[2] copy the database files to the new directory except the
control file.
[3] startup mount
[4] connect internal
[5] alter database rename file 'oldfilename' to 'newfilename';
Repeat for other database files such as online redo logs.
[6] shutdown the database
[7] If you want to rename the control file, add the control_files
parameter in the initSID.ora file to reflect the new path.
This step should be taken after all the database files have
been renamed and the database is shutdown.
[8] startup /* The database is now using the new database files */
/* You can then remove the old database files */
Example:
--------------------------------------------------------------------
SQL*DBA: Version 6.0.26.9.1 - Production on Fri Apr 20 06:54:43 1990
Copyright (c) Oracle Corporation 1979, 1988. All rights reserved.
ORACLE RDBMS V6.0.26.9.1, transaction processing option - Beta
SQLDBA> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQLDBA>
<<<<<< MOVE OR RENAME YOUR DATABASE FILES AT O/S LEVEL >>>>
#
$ cp /home/oracle/dbs/dbss6026.dbf /newhome/oracle/dbs/dbsfile1.dbf
$ cp /home/oracle/dbs/log1s6026.dbf /newhome/oracle/log/log1A.dbf
$ cp /home/oracle/dbs/log2s6026.dbf /newhome/oracle/log/log2A.dbf
#
#
SQLDBA> startup mount
Oracle instance started
Database mounted
SQLDBA> connect internal
Connected.
SQLDBA> alter database rename file '?/dbs/dbss6026.dbf' to
2> '/newhome/oracle/dbs/dbsfile1.dbf';
Statement processed.
SQLDBA> alter database rename file '?/dbs/log1s6026.dbf' to
2> '/newhome/oracle/log/log1A.dbf';
Statement processed.
SQLDBA> alter database rename file '?/dbs/log2s6026.dbf' to
2> '/newhome/oracle/log/log2A.dbf';
Statement processed.
SQLDBA> shutdown
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQLDBA>exit
<<< Rename or move the control file at O/S level >>>
$cp /home/oracle/dbs/control1s6026.dbf /newhome/control1A.dbf
# Edit the initSID.ora file to include the new control filename
# in the control_files parameter.
# i.e. control_files = (/newhome/control1A.dbf)
$ sqldba startup /* The database starts up using the new
/* database files.