Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to Change Databasename
One option is to recreate the controlfiles for the Database
In SQLDBA, type
alter database 'database name' backup controlfile to trace;
(this will create you a map of your database)
Remove everything up to the STARTUP NOMOUNTand evrything after the datafile section, it should end up looking something like the following (My controlfile, cut down version on logfile/datafile names)
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE SET DATABASE 'new database name' RESETLOGS
NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXDATAFILES 120
MAXINSTANCES 16
MAXLOGHISTORY 1600
LOGFILE
GROUP 1 'DISK$FOUR:[TEST.DBS]TEST_REDO1.RDO' SIZE 5000K,
GROUP 2 'DISK$FOUR:[TEST.DBS]TEST_REDO2.RDO' SIZE 5000K
DATAFILE
'DISK$ONE:[TEST.DBS]TEST_SYSTEM1.DBS' SIZE 10M, 'DISK$TWO:[TEST.DBS]CSLIVE_SYSRBS01.DBF' SIZE 24M, 'DISK$THREE:[TEST.DBS]CSLIVE_DATA01.DBF' SIZE 24M;
(SAVE AS NEW_DATABASE_NAME.SQL)
$ sqldba lmode=y
connect internal
@new_database_name.sql
recover database using backup controlfile;
disk$FOUR:[TEST.DBS]TEST_REDO1.RDO
disk$FOUR;[TEST.DBS]TEST_REDO2.RDO
***** for all redo logs until media recovery is complete *****
alter database open resetlogs;
exit
This will give you the result you require but if you screw up the controlfile you can corrupt you database. I recommend requesting article <Note:29034.1> from Oracle Support as this explains in more detail. Make your DB_NAME parameter null while you do this.
Oosterling_at_compuserve.com (Erik Oosterling) wrote:
>Hello all,
>Is there a way to change the database name used in the INIT.ORA
>now it is:
>DB_NAME = ORACLE
>But i want to use
>DB_NAME = TEST or
>DB_NAME = PROD
>Okay i know you have to the db a name when you create him but it was
>not job to create them but it is my job to support them.
>PLEASE HELP
>Erik Oosterling
>The Netherlands
matthew.lemoine_at_butterworths.co.uk
"All opinions are my own at not necessarily that of my Company"
Received on Thu Jul 31 1997 - 00:00:00 CDT