Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help renaming datafile...
Mike Burke wrote:
> > How can I rename a datafile used by the System tablespace? The only way I
> > can see to rename a datafile is to take the TS offline, which cannot be
> > done with the System TS.
>
> Allan,
>
> A SYSTEM tablespace datafile cannot be renamed while the database is open.
>
> Try this,
> SQLDBA> connect internal
> SQLDBA> shutdown normal
> SQLDBA> HOST copy 'original datafile' to 'new datafile'
> SQLDBA> startup restrict mount
> SQLDBA> alter database rename file 'original' to 'new';
> SQLDBA> alter database open
> SQLDBA> select * from DBA_DATA_FILES;
>
> If you've got time take a backup.
>
> Shutdown and restart the database.
Also, before and after you do anything which adds datafiles, changes them, adds tablespaces, etc., you should make a controlfile backup:
ALTER DATABASE BACKUP CONTROLFILE TO 'full path to control file'; ALTER DATABASE BACKUP CONTROLFILE TO TRACE NORESETLOGS; Do the above before and after. Obviously change the file name in the first statement each time. This will yield a control file copy and the corresponding SQL statements in a trace file to rebuild it if necessary.