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: Changing dbname of startup database

Re: Changing dbname of startup database

From: David Gustafson <davidgustafson_at_ibm.net>
Date: Sun, 28 Mar 1999 15:52:05 -0700
Message-ID: <36FEB295.6D318C11@ibm.net>


First let me say that in no way do I except any responsibility for the following procedure. The following is a suggested procedure that is not intended to be fully complete.


The basic steps are for cloning an existing database.

logon to the source database.
alter database backup controlfile to trace; Find the source trace file and make it look something like this.

STARTUP NOMOUNT
CREATE CONTROLFILE set DATABASE "<TARGET>" resetlogs NOARCHIVELOG

    MAXLOGFILES 32
    MAXLOGMEMBERS 2
    MAXDATAFILES 30
    MAXINSTANCES 8
    MAXLOGHISTORY 800
LOGFILE

  GROUP 1 '/u12/ORACLE/<TARGET>/redo00_grp1.log'  SIZE 50M,
  GROUP 2 '/u12/ORACLE/<TARGET>/redo00_grp2.log'  SIZE 50M,
  GROUP 3 '/u13/ORACLE/<TARGET>/redo00_grp3.log'  SIZE 50M
DATAFILE
'/u06/ORACLE/<TARGET>/system01.dbf',
'/u10/ORACLE/<TARGET>/rbs01.dbf',
'/u08/ORACLE/<TARGET>/temp01.dbf',
'/u11/ORACLE/<TARGET>/tools01.dbf',
'/u11/ORACLE/<TARGET>/users_new01.dbf',
'/u07/ORACLE/<TARGET>/data01.dbf',
'/u09/ORACLE/<TARGET>/index01.dbf'

;
# Recovery is required if any of the datafiles are restored backups,
# or if the last shutdown was not normal or immediate.
########RECOVER DATABASE
# Database can now be opened normally.
##ALTER DATABASE OPEN RESETLOGS;

Shutdown the source database.
Move the datafiles to there new directories. Assuming you're using Oracle's OFA.

Rename and cleanup the admin directory to reflect the new database name. Modify the init.ora files to reflect the new directories and database name. Remove any control.ctl files

At this point there shouldn't be any reference to the old DB.

cd admin/../create
connect to svrmgrl
connect internal
@control.txt

If everything works OK, then:
ALTER DATABASE OPEN RESETLOGS; shutdown
startup
shutdown

If you get an error, shutdown, remove the new control files, fix the error then restart the database.

Modify the listener.


This concepts of this procedure are routinely used for building testing environments. It will also work just fine for renaming an existing database.

Peter Gill wrote:

> Thanks for this.  I've tried just changing the alias but this didn't work.
> When you say 'clone' the database, do you mean create a new set of datafiles
> based on the current one, or is it possible to attach the existing datafiles
> to a new control file with a different dbname?
>
> Thanks again.
>
> David Gustafson wrote in message <36FD688C.5A3DCFC1_at_ibm.net>...
> >You have two options.
> >
> >1.) If the "oracle" database is distinct on the server simply change the
> alias
> >name in tnsnames.ora. By default the alias name is the same as the DB name.
> >2.) After DB creation clone the database to a new DB name.
> >
> >Dave...
> >
> >Peter Gill wrote:
> >
> >> I want to use the startup database that the Oracle Installation program
> >> creates, but I need to give it a different name (dbname) (otherwise I get
> >> problems when I try to create database links to other databases on the
> >> network which also have the default dbname of 'oracle').
> >>
> >> Does anyone know how I can change the dbname either before I install
> Oracle
> >> or afterwards?  Or is there another way round this problem?
> >>
> >> Thanks.
> >

Received on Sun Mar 28 1999 - 16:52:05 CST

Original text of this message

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