How do I rename an XE database on a Windows 2003 Server?
522411Jul 11 2006 — edited Jul 19 2006Ok. I'm attempting to rename a freshly installed XE database on a Windows 2003 Server. It looks like there is no getting around the fact that the database gets named "XE" during installation. Because there could potentially be multiple installations of XE in my organization, I thought it'd be a good idea to disambiguate the installations by renaming them to match their function. In this particular case, I'd like to rename the database to "CTXMGMT". It will be a data repository for our Citrix farm administration programs.
Here is what I've performed thus far:
1. Installed Oracle 10g XE on one of our Windows 2003 Server, Standard Edition machines.
2. Verified that the installation was performed correctly by making sure the 'Database Home Page' loads correctly through Internet Explorer, and by performing a few Select statements on the database (i.e. select name from v$database;)
* * I then began following instructions from this document (http://www.utexas.edu/its/unix/reference/oracledocs/v92/B10501_01/server.920/a96652/ch14.htm#1004735) to rename the database. Note: I'm only trying to change the name of the database, not the ID.
3. Shutdown the database
4. Opened the database in MOUNT mode
5. Ran the NID utility. Here's the actual input/output to/from the NID utility:
-----------------------------------------------------------------------------------------------------------------
C:\oraclexe\app\oracle\product\10.2.0\server\BIN>nid target=sys/manager@xe DBNAME=CTXMGMT SETNAME=YES
DBNEWID: Release 10.2.0.1.0 - Production on Mon Jul 10 15:55:10 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to database XE (DBID=2476560070)
Connected to server version 10.2.0
Control Files in database:
C:\ORACLEXE\ORADATA\XE\CONTROL.DBF
Change database name of database XE to CTXMGMT? (Y/[N]) => Y
Proceeding with operation
Changing database name from XE to CTXMGMT
Control File C:\ORACLEXE\ORADATA\XE\CONTROL.DBF - modified
Datafile C:\ORACLEXE\ORADATA\XE\SYSTEM.DBF - wrote new name
Datafile C:\ORACLEXE\ORADATA\XE\UNDO.DBF - wrote new name
Datafile C:\ORACLEXE\ORADATA\XE\SYSAUX.DBF - wrote new name
Datafile C:\ORACLEXE\ORADATA\XE\USERS.DBF - wrote new name
Datafile C:\ORACLEXE\ORADATA\XE\TEMP.DBF - wrote new name
Control File C:\ORACLEXE\ORADATA\XE\CONTROL.DBF - wrote new name
Instance shut down
Database name changed to CTXMGMT.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.
-------------------------------------------------------------------------------------------------------------
6. After running the NID utility from a separate DOS Window, I attempt to shutdown the newly renamed database from the first DOS Window I used in steps 3 & 4 from above (i.e. to shutdown the database and then start it in MOUNT mode) but I receive this error:
ORA-03113: end-of-file on communication channel
This is somewhat expected since the SQL*Plus connection in this window probably had "the bottom pulled out from under it" when the database was renamed.
However at this point I'm unsure about what state the database is in. Is it down? Is it up? Logic would sort of dictate that the database was left in the MOUNT state, which is the state it was in when the database name was changed. However, the only way I'm able to get back in to the database is by doing the following
a. Opened a new DOS window
b. entered "set ORACLE_HOME=C:\oraclexe\app\oracle\product\10.2.0\server"
c. entered "set ORACLE_SID=XE"
d. entered " sqlplus "/ as sysdba" "
e. at SQL> prompt, entered "startup"... which produces:
-----------------------------------------------------------------------------------------------
SQL> startup;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1287016 bytes
Variable Size 92277912 bytes
Database Buffers 188743680 bytes
Redo Buffers 2904064 bytes
ORA-01103: database name 'CTXMGMT' in control file is not 'XE'
SQL>
--------------------------------------------------------------------------------------------------------
From here I don't know what to do. According to the ORA-01103 error message, it looks like I need to change the database name in the control file to "CTXMGMT", but I'm not sure how I should go about that. The control file is a binary file, so I can't just open it up with Notepad and type in a new database name.
I suspect that even once that is done that the listener.ora (and maybe the tnsnames.ora file?) will have to be edited to include the new "CTXMGMT" name, but I'm not sure how exactly those files should look to incorporate the new database name.
Also, would the names of services have to be changed in Windows as well? (i.e. Would the Windows service named "OracleServiceXE" have to be renamed to "OracleServiceCTXMGMT" ?)
In short, I really just need to know how to rename an XE database on Windows appropriately. The steps described above represent as far as I've gotten. If I'm going about it incorrectly could someone shed some light on the correct steps to follow? The more detailed the better. Thanks.
- Gary