Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Change the DB_NAME How to ?

Re: Change the DB_NAME How to ?

From: Brett Neumeier <neumebm_at_hpd.abbott.com>
Date: 1997/08/15
Message-ID: <33F492E2.DD5FA357@hpd.abbott.com>#1/1

Rich Woods wrote:
> Erik Oosterling wrote:

 [..]
> > Is there a way to change the database name used in the INIT.ORA
 [..]
> alter database rename global_name to <newdbname>.<domain>;

        That doesn't do the whole job. Here's how I had to do it:

  1. Back up the database. This isn't really required, but it's a really good idea.
  2. Start up the database; connect to it and issue the command: "alter database backup controlfile to trace;". This will create a trace file with a "create controlfile" command, in the USER_DUMP_DEST.
  3. Shut down the database.
  4. Modify the "create controlfile" statement in the trace file so that instead of saying:

create controlfile reuse database "OLD" noresetlogs

        it says instead:

create controlfile reuse set database "NEW" resetlogs

(OLD and NEW should be changed to the old and new database names, of course.)

        While you are modifying the trace file, remove all the commands other than the CREATE CONTROLFILE command.

5) Modify the INIT.ORA file so that the DB_NAME is the new one. 6) Modify the SQL*Net configuration files LISTENER.ORA and TNSNAMES.ORA

        to reflect the new database name.

7) Erase the old control files.  (You *did* back them up, right?)
8) Use Server Manager or SQL*DBA to connect, and do a STARTUP NOMOUNT.
9) Run the "create controlfile" script from step 4.
10) Issue the command "alter database open resetlogs;" ...and wait a while

        for the command to complete.
11) Do a shutdown/restart just to make sure. 12) If you're using a dumb Microsoft operating system (NT), you may need to

        rebuild the SID using oradim.
13) When the database is open again, issue the "alter database rename

        global_name..." command as suggested by Mr. Woods.

HTH, -Brett Neumeier Received on Fri Aug 15 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US