Tuesday, February 28, 2012

How to change the database name

1. sqlplus "/as sysdba"
   alter system switch logfile;
   alter database backup controlfile to trace resetlogs;
   shutdown normal
2. find the trace file, copy from "STARTUP NOMOUNT" to the "alter database open resetlogs", and save it to xxx.sql
3. edit your xxx.sql change
    FROM: CREATE CONTROLFILE REUSE DATABASE "olddbname" RESETLOGS
      TO: CREATE CONTROLFILE set DATABASE "newdbname"  RESETLOGS
   also comment out "RECOVER DATABASE USING BACKUP CONTROLFILE" line
4. delete or rename your old control file
5. change the db_name in your init.ora
6. sqlplus "/as sysdba" @xxx.sql

This also apply to EBS database, and for EBS database, you need to run the adcfgclone.pl appsTier after you done above steps, then run autoconfig on apps tier, and db.

No comments:

Post a Comment