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: Rename database

Re: Rename database

From: Indy <inderpalj_at_hotmail.com>
Date: 4 Oct 2001 15:04:58 -0700
Message-ID: <cd4c3152.0110041404.1b0ba4b4@posting.google.com>


"Franky Thiel" <franky.thiel_at_infohos.be> wrote in message news:<3bbc4cd5$0$36471$ba620e4c_at_news.skynet.be>...
> Is it possible to rename a database or should I do an export from the old
> database, drop database and recreate new database and do an import ?
>
> What is the maximum length of the name of a database in Oracle ?
>
>
>
> Regards and thanks in advance,
>
>
>
> Franky

Hi Frank

Here is the answer to your question but let me review ur question. So you might be looking for any one of the option 1) Change the Oracle_sid
2) Change the Db_name as well as Oracle_sid

Part 1



You can change the ORACLE_SID as follows SQL> shutdown immediate
$ export ORACLE_SID=newname
$ cp $ORACLE_HOME/dbs/init$oldSID.ora $ORACLE_HOME/dbs/newSID.ora
$ cp $ORACLE_HOME/dbs/orapwoldsid $ORACLE_HOME/dbs/orapwNEWSID --Skip
if you are not using orapasswd file
SQL>startup the database

Part 2



Step 1
SQL> alter database backup controlfile to trace resetlogs;

Step 2
SQL> show parameter user_dump_dest

Step 3
SQL> shutdown immediate

Step 4
$ cd USER_DUMP_DEST -- as found in above output $ ls -ltr -- cut the last file in the output as this file contains the control file command

Step 5
Now open the file identified in step 4 and remove all the junk lines from this file until you got the line STARTUP NOMOUNT

Now Modify the create controlfile statement to: CREATE CONTROLFILE SET DATABASE NewDatabaseB RESETLOGS NOARCHIVELOG or if the database is in archive log mode: CREATE CONTROLFILE SET DATABASE NewDatabaseB RESETLOGS ARCHIVELOG

And save the file as indy.sql

Step 6

a. Copy initDatabaseA.ora to initDatabaseB.ora. 
b. Copy configDatabaseA.ora to configDatabaseB.ora. 
c. Modify initDatabaseB.ora to point to the config.ora of DatabaseB. 
d. Modify the following parameters in initDatabaseB.ora [ If Any] : 
IFILE = configDatabaseB.ora
CONTROL_FILE = new control files names
DB_NAME = new database name

Step 7
Change the ORACLE_SID environmental variable $ export ORACLE_SID=DatabaseB

Step 8
$ Sqlplus internal
SQL> @indy

Step 9
SQL> alter database rename global_name to DatabaseB;

Good Luck
Inderpal Johal Received on Thu Oct 04 2001 - 17:04:58 CDT

Original text of this message

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