

| |
How can you change Oracle SID?
- Startup database .
- Running this command: alter database backup controlfile to trace.
- After this, find the trace file:
 | At UNIX : ORACLE_HOME/RDBMS/LOG/ora???.trc |
 | At Windows NT: ORANT\RDBMS73\TRACE\ora????.trc |
 | At SAP (in UNIX Level),sometimes,: ORACLE_HOME/RDBMS/SAPTRACE/USER*/ora???.trc |
- Edit this trace file: (the location of control file, data file and log file must same
with your environment) :
* Check the bold character.
STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "<NEW_SID>" RESETLOGS
NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXDATAFILES 32
MAXINSTANCES 16
MAXLOGHISTORY 1600
LOGFILE
GROUP 1 'D:\ORANT\DATATEST\REDO11.LOG' SIZE 4M, 'D:\ORANT\DATATEST\REDO12.LOG' SIZE 4M,
GROUP 2 'D:\ORANT\DATATEST\REDO21.LOG' SIZE 4M, 'D:\ORANT\DATATEST\REDO22.LOG' SIZE 4M,
GROUP 3 'D:\ORANT\DATATEST\REDO31.LOG' SIZE 4M, 'D:\ORANT\DATATEST\REDO32.LOG' SIZE 4M
DATAFILE
'D:\ORANT\DATATEST\SYS1ORCL.ORA',
'D:\ORANT\DATATEST\ROLLBACK.ORA',
'D:\ORANT\DATATEST\ROLLBA1.ORA',
'D:\ORANT\DATATEST\TEMP.ORA',
'D:\ORANT\DATATEST\USERS.ORA',
'D:\ORANT\DATATEST\IFSAPP_DATA.ORA',
'D:\ORANT\DATATEST\IFSAPP_DATA1.ORA',
'D:\ORANT\DATATEST\IFSAPP_INDEX.ORA',
'D:\ORANT\DATATEST\IFSAPP_INDEX1.ORA',
'D:\ORANT\DATATEST\IFSAPP_REPORT.ORA'
;
ALTER DATABASE OPEN RESETLOGS;
- Shutdown database.
- Copy file init<SID>.ora to init<NEW_SID>.ora à cp init<SID>.ora init< NEW_SID>.ora.
- Dont forget to copy config<SID>.ora to
config<NEW_SID>.ora if you have.
- If you have file config<NEW_SID>.ora, edit the ifile in that file:
ifile = /opt/oracle/dbs/config<NEW_SID>.ora.
- Edit file listener.ora , edit the SID of ORACLE.
LISTENER=
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=tcp)
(HOST=aiopr4)
(PORT=1521)
)
)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=<NEW_SID>)
(ORACLE_HOME=<ORACLE_HOME>)
)
)
}
CONNECT_TIMEOUT_LISTENER=10
STOP_LISTENER=YES
DBA_GROUP=dba
- Setting SID at the environment:
 | For UNIX: login as oracle user and check and edit "ORACLE_SID" at the .profile
file : ORACLE_SID=<NEW_SID>; export ORACLE_SID
|
 | For Windows NT: Running this command at the command com (DOS Prompt) like this: SET
ORACLE_SID = <NEW_SID>
|
- Running svrmgr or sqldba lmode=y.
- Running trace file that have been edited.
 | SVRMGR (or SQLDBA)>connect internal |
 | @<directory that trace placed>/ora??.trc |
- If no error, so you can get the new control file and database will be opened and can be
used as usual.
Note :
- Dont forget to backup control files, data files and log files.
- Be careful when create controlfile, because if control file break, you cant use
this database again.
- After you edit listener.ora, you must stop the listener service and start again this
service with the new listener.ora.
|