Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Rename database
"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
$ 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 --Skipif you are not using orapasswd file
Part 2
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
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