Home » RDBMS Server » Server Administration » Rename a oracle database
Rename a oracle database [message #192127] Mon, 11 September 2006 02:17 Go to next message
barjunreddy
Messages: 8
Registered: August 2006
Location: Hyderabad
Junior Member
Hi Gurus,
I Would like to rename the existing abc database as xyz. Could anyone tell me the steps to rename a database to the new name.

I tried the following steps

SQL>SELECT NAME FROM V$DATABASE;
ABC

SQL>ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
DATABASE ALTERED;

SQL>SHOW PARAMETER USER_DUMP_
D:\oracle\admin\XYZ\udump

SQL>SHUTDOWN IMMEDIATE;
CD TO USER_DUMP DIRECTORY

Copied the Newly generated .trc file and copied the content of the trace file to the ABC_trace.sql and i modified the xyz_trace.sql file as
1. I renamed the Instance_name from abc to xyz.CREATE
2. CREATE CONTROLFILE REUSE DATABASE "ABC" RESETLOGS ARCHIVELOG

TO
CREATE CONTROLFILE REUSE DATABASE "ABC" NORESTLOGS ARCHIVELOG

I ran the xyz_trace.sql by just startup nomount state.

After that i renamed the instance,DB_names in the init.ora file of the xyz database.

SQL>ALTER DATABASE OPEN RESETLOGS;

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open



Then after i dono what to do??

Regards,
Nagarjun
Re: Rename a oracle database [message #192211 is a reply to message #192127] Mon, 11 September 2006 07:50 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Why not just use NID? For oracle versions 9i and above on windows, NID gives a simple method.
http://www.oracle-base.com/articles/9i/DBNEWID.php
Re: Rename a oracle database [message #192213 is a reply to message #192127] Mon, 11 September 2006 07:51 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
>> SQL>ALTER DATABASE OPEN RESETLOGS;
Hope this is not a production mode database.
Please read documentation, google and make sure what you are doing.
Re: Rename a oracle database [message #192221 is a reply to message #192127] Mon, 11 September 2006 08:03 Go to previous messageGo to next message
Liza79
Messages: 74
Registered: September 2006
Member
open that trace file, change the name of the database in the CREATE CONTROLFILE statement and copy it.

Then open your data base in nomount stage.

Execute the CREATE CONTROLFILE statement.

then ALTER DATABASE OPEN RESETLOGS.


Regards,

Liza
Re: Rename a oracle database [message #192260 is a reply to message #192127] Mon, 11 September 2006 10:29 Go to previous messageGo to next message
goudelly
Messages: 52
Registered: August 2006
Location: India
Member

Hi,

How does one rename a database?

Follow these steps to rename a database:

1. Start by making a full database backup of your database (in case you need to restore if this procedure is not working).

2. Execute this command from sqlplus while connected to 'SYS AS SYSDBA':

ALTER DATABASE BACKUP CONTROLFILE TO TRACE RESETLOGS;

2. Locate the latest dump file in your USER_DUMP_DEST directory (show parameter USER_DUMP_DEST) - rename it to something like dbrename.sql.

3. Edit dbrename.sql, remove all headers and comments, and change the database's name. Also change "CREATE CONTROLFILE REUSE ..." to "CREATE CONTROLFILE SET ...".

4. Shutdown the database (use SHUTDOWN NORMAL or IMMEDIATE, don't ABORT!) and run dbrename.sql.

5. Rename the database's global name:

ALTER DATABASE RENAME GLOBAL_NAME TO new_db_name;


Thanks,

Mohan Reddy G
Re: Rename a oracle database [message #192263 is a reply to message #192260] Mon, 11 September 2006 10:38 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
You have been warned once.
CREDIT THE SOURCE!!!
http://www.orafaq.com/faq/how_does_one_rename_a_database

PS:
Google will be helpfull both ways.

[Updated on: Mon, 11 September 2006 10:39]

Report message to a moderator

Re: Rename a oracle database [message #193934 is a reply to message #192127] Wed, 20 September 2006 00:41 Go to previous message
Shamsher
Messages: 18
Registered: September 2006
Junior Member
You need to recreate controlfile using "SET" option it will work.You use SET insist of Reuse or renaming the database.

ex

CREATE CONTROLFILE REUSE DATABASE "ABC" RESETLOGS ARCHIVELOG

CREATE CONTROLFILE SET DATABASE "ABC" RESETLOGS ARCHIVELOG


Regards
Shamsheer
Previous Topic: Switching Logfile
Next Topic: create a tablespace in solaris OS
Goto Forum:
  


Current Time: Fri Sep 20 08:30:57 CDT 2024