Home » RDBMS Server » Server Administration » Renaming the Database
Renaming the Database [message #194423] Fri, 22 September 2006 02:11 Go to next message
M.Shakeel Azeem
Messages: 226
Registered: September 2006
Senior Member
Dear All
did u ever gone through the process of renaming a database
I have read a document (an excellent one)
It was working fine but i got a severe problem almost at end of the process
Database ID 'TEST1',Not in Control File which is TEST(Old Database)
(Perhaps Control still using the old DBname which is TEST )
Attachment file have blue coloured lines where i got the problem
Can u please have a quick look at the attachment
If it is understandable then can u please suggests me where i done it wrong
Or if u have another tested and simplified process then please guide me in this regard

Please Read the Document and last 3/4 lines

Re: Renaming the Database [message #194449 is a reply to message #194423] Fri, 22 September 2006 05:11 Go to previous messageGo to next message
gkrishn
Messages: 491
Registered: December 2005
Location: Putty a dark screen
Senior Member
see following procedure i workedout.. meantime i will try to findout whts bug in ur code
Re: Renaming the Database [message #194452 is a reply to message #194423] Fri, 22 September 2006 05:13 Go to previous message
gkrishn
Messages: 491
Registered: December 2005
Location: Putty a dark screen
Senior Member
Rename a database from ECPA to ECPA1
-------------------------------------


1)Shutdown ECPA database
SQL> shutdown immediate;

2)edit pfile with new database name(ie,ECPA1)
db_name = "ECPA1"
instance_name = ECPA1

SQL> startup
ORACLE instance started.

Total System Global Area 83519516 bytes
Fixed Size 75804 bytes
Variable Size 24948736 bytes
Database Buffers 58417152 bytes
Redo Buffers 77824 bytes
----------
ORA-01103: database name 'ECPA' in controlfile is not 'ECPA1'
----------

ie,Control file still have value for Database Identifier as ECPA.so control file value need to be changed by creating
a new control file from backup control file.


3)Take a backup control file when database is up .


SQL> alter database backup controlfile to trace;
Database altered.
go to UDUMP location and edit control file backup and save to CONTROL.SQL

Change to be made is
CREATE CONTROLFILE SET DATABASE "ECPA1" NORESETLOGS ARCHIVELOG


4)Startup database in nomount
5)Execute CONTROL.SQL
SQL>@CONTROL.SQL

----------
ERROR:
CREATE CONTROLFILE SET DATABASE "ECPA1" NORESETLOGS ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01223: RESETLOGS must be specified to set a new database name
----------

ie,Edit CONTROL.SQL and replace NORESETLOGS with RESETLOGS and...
execute CONTROL.SQL once again in nomount state.


----------
ERROR:
ORA-01503: CREATE CONTROLFILE failed
ORA-00200: controlfile could not be created
ORA-00202: controlfile: 'D:\oracle\oradata\ECPA\control01.ctl'
ORA-27038: skgfrcre: file exists
OSD-04010: <create> option specified, file already exists
----------

ie,Control files used by old database (ECPA) Still exist and this should be removed before
creation of new control files .


6)SQL> @D:\oracle\admin\ECPA\udump\control.sql

Control file created.


Note:If we have same old value(ECPA) in pfile,we will get the following error during control file creation .
---------
CREATE CONTROLFILE SET DATABASE "ECPA1" RESETLOGS ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01504: database name 'ECPA1' does not match parameter db_name 'ECPA'

startup after editing pfile
---------


7)Since we have created control file,we can open the database.

SQL> select status from v$instance;

STATUS
-------
MOUNTED

SQL> alter database open noresetlogs;

----------
alter database open noresetlogs
*
ERROR at line 1:
ORA-01588: must use RESETLOGS option for database open
----------

SQL> alter database open resetlogs;

Database altered.

SQL> select name from v$database;

NAME
---------
ECPA1


But GLOBAL_NAME will still show old DB name .

SQL> select * from global_name;

GLOBAL_NAME
--------------------------------

ECPA


SQL> ALTER DATABASE RENAME GLOBAL_NAME TO ECPA1;

Database altered.


SQL> select * from global_name;

GLOBAL_NAME
-------------------------------

ECPA1
Previous Topic: connect database from 7i to 9i
Next Topic: Dictionary Managed Tablespace to Locally Managed
Goto Forum:
  


Current Time: Thu Nov 27 16:23:40 CST 2014

Total time taken to generate the page: 0.10255 seconds