Re: DB_NAME in init.ora

From: Mark Dedlow <mtdedlow_at_lbl.gov>
Date: 1995/11/27
Message-ID: <30B973B9.425_at_lbl.gov>#1/1


Paul Baumgartel wrote:
>
> Steve Butler <sbut-is_at_seatimes.com> wrote:
>
> >On Fri, 20 Oct 1995, Ken Huisman wrote:
> >> I was wondering if it is actually possible to change the database name. If it
> >> is, does anyone know how to do it? I know the name gets stuck in the
> >> control files, data files, and redo logs, and you would have to change it in
 

> >Only the control file -- see my other posting.
>
> I tried to do this last week: I recreated a control file with a different
> name, and changed the name of the SID, and init.ora DB_NAME, before instance
> startup...but what about the database name that's stored in the DB file
> headers? I couldn't open the database because the DB_NAME in the control file
> didn't match the name in the DB file headers. Did I miss something in these
> posts? There's no mention of this problem.
>
> Please enlighten me.

The proper way to rename a database is as follows:

  1. Do a backup!! 1a. Be sure you did a backup!!
  2. Startup restrict;
  3. Do ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
  4. shutdown NORMAL;
  5. Find the trace file created by step 3 (obscurely named usually in bdump dir)
  6. Edit the trace file to make a good CREATE CONTROLFILE command. You will have to change the script to use the options: SET DATABASE "NEWDBNAME" RESETLOGS (required when name is changed!)
  7. STARTUP MOUNT
  8. Run script with CREATE CONTROLFILE statement.
  9. ALTER DATABASE OPEN RESETLOGS;
  10. Shutdown normal and backup.

See the SQL Lang Ref for CREATE CONTROLFILE. This is where this technique is "documented". The "to trace" option of the controlfile backup is documented somewhere I thnk, but I don't know where (not in the SQL Lang ref)

Mark

PS. Take step 1 seriously. The wrong sequence of steps can render your database totally unrecoverable. Received on Mon Nov 27 1995 - 00:00:00 CET

Original text of this message