Home » RDBMS Server » Server Administration » renaming database???
renaming database??? [message #56400] Wed, 26 March 2003 13:17 Go to next message
raman
Messages: 66
Registered: February 2000
Member
Hi

I have created a database with few schemas and realized that the name's not used properly. Now I would like to change it without affecting the database. Can I do it? Could you please send me the instructions.

thankyou,
-Ramanujam
Re: renaming database??? [message #56404 is a reply to message #56400] Wed, 26 March 2003 15:51 Go to previous messageGo to next message
Anand
Messages: 161
Registered: August 1999
Senior Member
Hi,

If you want to rename the database, then you have to backup the controlfile and rebuild the controlfile with the new name.

Steps:

1. Login as server manager (svrmgrl or sqlplus )
2. connect internal
3. ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

This creates a trace file with controlfile dump in the trace directory. Open the file and change the name of the database.

Change "REUSE" to "SET".

Change " NORESETLOGS" to "RESETLOGS".

It should be something like ...

'CREATE CONTROLFILE SET DATABASE "dbname" RESETLOGS .....'

Rename the trace file to some "xyz.sql". Be careful not to change any other values in the file.

4. Shutdown database
5. Take a Cold backup
6. After backup, set the new env variables up, set the new directories (udump, trace, cdump, pfile etc )
7. Set ORACLE_SID, ORACLE_BASE accordingly.
8. Change init.ora parameter for dbname.

There would be a line in the file which goes like...

" RECOVER DATABASE..." .. hash this line out or remove this line completely.

9. Login to server manager again.
10. STARTUP MOUNT
11. Run the xyz.sql file.
12. ALTER DATABASE OPEN
12. Change the GLOBAL_NAME value as ...

ALTER DATABASE RENAME GLOBAL_NAME TO dbname.WORLD;

Hope this helps. Pls revert if you have any more questions
Re: renaming database??? [message #56416 is a reply to message #56400] Thu, 27 March 2003 16:28 Go to previous message
Trifon Anguelov
Messages: 514
Registered: June 2002
Senior Member
Read these articles on How to change SID of Oracle database - Click here and Click here

If you have any additional questions, let me know..

Hope that helps,

clio_usa
OCP - DBA

Visit our Web site

Previous Topic: DBMS_JOBs not running
Next Topic: maximum block size
Goto Forum:
  


Current Time: Fri Sep 20 09:34:35 CDT 2024