How do you rename a database?

Showing Answers 1 - 3 of 3 Answers

Manoj

  • May 2nd, 2005
 

-- To change the name of the database 
-- For this script to run properly do the following: 
 
-- Backup the Control fiel to Trace 
ALTER DATABASE BACKUP CONTROLFILE TO TRACE; 
 
-- Shutdown the database to make the changes 
SHUTDOWN IMMEDIATE; 
 
-- Edit the trace file and change the CREATE CONTROLFILE command  
-- CREATE CONTROLFILE REUSE SET DATABASE "NEW_SID_NAME" RESETLOGS 
-- (note the SET keyword) 
 
Change the name in Control file and Init.ora 
The first line of Control file should be "CREATE CONTROLFILE REUSE SET DATABASE "" RESETLOGS ARCHIVELOG" 
 
- modify the db_name parameter in the init.ora 
 
-- Startup the datbase nomount with changed PFile 
STARTUP NOMOUNT; 
 
-- Execute the create controlfile command. 
@create_control.sql; 
 
-- Cancel base recovery of the database 
Recover database USING BACKUP CONTROLFILE until cancel; 
CANCEL 
 
-- Open resetlogs the database 
ALTER DATABASE OPEN RESETLOGS; 
 
-- Rename GLOBAL_NAME to  
ALTER DATABASE RENAME GLOBAL_NAME TO ;  
 
-- Create SPFile, IF required give NAME and PATH of the PFILE 
CREATE SPFILE FROM PFILE; 
 
select name from v$database;

  Was this answer useful?  Yes

Amit

  • May 7th, 2005
 

You can change Database my by simple do some steps. 
 
1. Alter Database backup control file to trace; 
2. Above step will create a text control file. 
3. Change the Database name there and in init.ora file. 
4. create new control file by running script (from backup control file) 
5. Startup mount 
6.open database resetlogs. 
And your database anme will be changed 
 

  Was this answer useful?  Yes

wendyliu

  • Oct 17th, 2006
 

use nid utility.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions