Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

renaming a database 2

Status
Not open for further replies.

nontrad

MIS
Jan 10, 2001
83
US
I created a database on Friday using DBASSIST. It currently has no data.

The owner now wants it by another name. I have the procedures from Metalink how to do this but it seems like it is more work than just deleting the database and recreating it under the new name even though it takes about 6 hours.

Does this seem to be what others have experienced? Maybe if there was actual data tables in the DB, going through all the renaming would be the safest method.
 
not sure what instructions you got but just renaming DB only takes ~5 min (I do it all the time when we build new boxes; push hot backup from existing & rename for new one). just do the following:

1) alter database backup controlfile to trace;

2) change db_name in init<SID>.ora to new name

3) change instance_name in init<SID>.ora to new name (optional but recomended).

4) edit trace file from step 1 to:

A. insert keyword &quot;SET&quot; before keyword &quot;DATABASE&quot;

B. replace old name w/new name

C. insert keyword &quot;RESETLOGS&quot; after new name

D. insert keyword &quot;RESETLOGS&quot; after ALTER DATABASE OPEN

5) shutdown instance

6) export ORACLE_SID=<new name per 4B>

7) run script created in 1 and modified in 4

if you're wanting to move data/log/control files around then obviously you'll need to modify init<SID>.ora (control)and do ALTER DATABASE RENAME '<old data/log file>' to '<new>' (this can be automated w/SQL*Plus script; can post if U need).

good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top