( contributed by Indradeb Chatterjee – IBM Global service )
There is no comprehensive document for changing SAP SID in Windows/Oracle based systems in SAP or IBM resource centres. We found no resources in web either. The following methodology was developed completely in-house and was tested on R/3 4.7 Enterprise edition as well as BW 3.5 ( both systems were based on Windows 2003/ Oracle 126.96.36.199.0) . It can be followed for other ABAP systems based on BASIS 6.20 or 6.40.
This document gives a step by step procedure for changing SID without the need of re-installing the central instance and /or database. The SID change is done in-situ.
It is advisable to upgrade your system to latest SAP kernel and DB tools before running the procedure. We also advise strongly to keep an offline backup of the database and Oracle controlfile creation scripts before starting the process.
The document assumes that the system was installed with Oracle Schema id: SAPDAT (which is always useful if you need to create systems copied from this). In case the schema id is default (SAP), change the value in step 2.3.1 and 2.6.3 from SAPDAT to SAP. The source Schema id would not change in the system renaming.
2 SAP System renaming procedure for Windows/ Oracle
Login as adm. Login to database using SQLPLUS ( / as sysdba) . Run command:
Alter database backup controlfile to trace;
A file named _ora_.trc will be created in :\Oracle\\saptrace\usertrace. Rename the file to crcontrolfile.sql and save in a separate folder (e.g. Y:\)
Login as adm and stop SAP server. Shutdown Oracle. Stop Windows Services SAP_nn, SAPOSCOL and OracleService. Disable service SAP_nn.
Stop all scheduled database jobs for . If any job is running kill it from Windows Task Manager
Login as adm and create following user groups from Computer management:
Create users adm and SAPService and assign them to following groups:
Create Directory Structure and adapt SAP and Oracle profiles:
Login to server as adm
Copy :\Oracle\ to :\Oracle\. Empty the contents of
Copy :\usr\sap\ to :\usr\sap\ ( Copy might fail for SAPSYS.pse in DVEBMGS\sec. Skip the file and copy the rest)
In Folder :\oracle\ora92\database, create init.dba, init.ora and init.sap copied from init* files. Replace by in each of these files.
In Folder :\oracle\ora92\Network\Admin, modify tnsnames.ora and listener.ora. Replace by in both the files
In :\usr\sap\\SYS\profile, modify default, start and instance profiles to replace by . Rename _DVEBMGS_ to _DVEBMGS_
Create environment variables and modify registry:
Create following variables in user environment of adm
• DBMS_TYPE = ORA
• DBS_ORA_SCHEMA = SAPDAT
• dbs_ora_tnsname =
• NLS_LANG = AMERICAN_AMERICA.UTF8
• ORACLE_HOME = :\Oracle\ora92
• ORACLE_SID =
• PATH = :\usr\sap\\SYS\EXE\run
• SAPDATA_HOME = :\Oracle\
• SAPEXE = :\usr\sap\\SYS\EXE\run
• SAPLOCALHOST =
• TMP = C:\Windows\Temp
• TEMP = C:\Windows\Temp
Run Regedit and create a node for under
Create a new String Value AdmUsr under this node with value = /adm
Create a sub-node called Environment under the node created above. This node should have same strings as adm environment variables (3.1).
(Note that some strings are of type REG_SZ and some are of type REG_EXPAND_SZ)
Modify node SAPOSCOL under HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services. Change ImagePath value; replace by . Change Objectname value from ./SAPService to ./SAPService.
Put SapService password in SAPOSCOL service properties ( Windows
Re-login as adm to activate the environment
Create/Start SAP and Oracle Services
Replace entry sapms by sapms in Windows services file
Run sapstartsrv.exe from :\usr\sap\SYS\EXE\run
Operation: Install service + Register COM Interface + Start Service
NR: Sys Nr. (same as )
Startprofil: :\usr\sap\\SYS\profile\START_ DVEBMGS_
Password: sapservice password
The Output would be error messag: ‘failed to start service’
Open Windows Services console, double-click on SAP_nn. Re-enter SAPService password in Log On Tab. Start the service again. (./SAPService should now have the access to logon as service). This time service should start without error.
(You can uninstall services using the same program)
Start SAPOSCOL service
From command prompt run:
Oradim -NEW -SID : This creates OracleService
Oradim -Delete -SID : This deletes OracleService
Logout and re-login as adm
Check OracleService in Windows services. If not running, start it.
Make sure you have SAPMMC.DLL in c:\windows\system32
Run command ‘REGSVR32.EXE SAPMMC.DLL’ to register the snap-in
Run SAPSTARTSRV.EXE -t to register the existing DCOM library in the executable.
Confirm this without any changes.
Start SAP Management Console from desktop. It should now have the new entry for
Start TGT server. Wait till all the process turns Green and stays Green. Save
SAPMMC.SRC while coming out
(refer to OSS note 373963 for SAP MMC set up)
2.5 Create Database
2.5.1 Stop SAP system. Stop Services: OracleService and SAP__
2.5.2 Rename all folders named \Oracle\ in all drives to \Oracle\
2.5.3 Delete control files of database. ( Locations can be found from :\Oracle\ora92\database\init.ora)
2.5.4 Delete archived logs of from F:\Oracle\\Oraarch
2.5.5 Delete online redologs of database from :\Oracle\\OriglogA, :\Oracle\\OriglogB, :\Oracle\\MirrLogA, :\Oracle\\MirrlogB
2.5.6 If you want to change controlfile locations, change it in the file :\Oracle\ora92\database\init.ora. Make sure the controlfile folders are created.
2.5.7 Copy crcontrolfile.sql (created in step 1.1) to crcontrolfile.sql. Find the line that contains ‘startup nomount’. Delete all lines including this one, till the beginning of the file. Now look for the first semi-colon (;). Delete all lines starting with the line next to semi-colon till the end of the file.
Now change all occurrences of to .
Change first line of the file from
CREATE CONTROLFILE REUSE DATABASE “” NORESETLOGS ARCHIVELOG
CREATE CONTROLFILE SET DATABASE “” RESETLOGS ARCHIVELOG
Change Online redo-log sizes if you want to.
2.5.8 Copy crcontrolfile.sql (created in step 1.1) to crtempts.sql. Find the line that contains alter temporary tablespace statement. (alter tablespace PSAPTEMP…). Keep this statement and delete everything else. Replace by .
2.5.9 Start OracleService ( Listener should be running)
2.5.10 From command prompt :
sqlplus “/ as sysdba”
@crcntrlfile.sql (output should be ‘control files created’)
alter database open resetlogs; (Output should be ‘database altered’)
@crtempts.sql (Output should be ‘tablespace altered’)
2.6 Start SAP
2.6.1 Copy sapdba_role.sql from :\usr\sap\\SYS\exe\run to Y:\
2.6.2 Copy oradbusr.sql from DB instance Installation folder to Y:\TGT
2.6.3 From Y:\ run following commands
sqlplus /nolog @oradbusr.sql SAPDAT NT
Output from above command should be similar to below
. Oracle Version: 188.8.131.52.0
. Parametervalue os_authent_prefix: OPS$
. Schema Id: DAT
. Database User (Schema): SAPDAT
. SAP R/3 Administrator: OPS$\ADM
. SAP R/3 Serviceuser: OPS$\SAPSERVICE
2.6.4 From Y:\ run following commands
sqlplus /nolog @sapdba_role DAT NT
All grants from above command should be successful
2.6.5 Start service SAPOSCOL and SAP__
2.6.6 Start SAP server from SAP Management Console
2.7 Post Conversion activities
2.7.1 Install License
2.7.2 Configure TMS
Log in to client 000 of the TMS domain controller
„X Select transaction STMS -> Overview -> Systems
„X Select the system by single clicking on it.
„X Now select SAP System -> Delete…
„X When prompted to distribute the STMS configuration, answer YES.
Do not log out of the domain controller, but open another logon in client 000 of the System
Select Transaction STMS and choose Save…You should get a message saying that this system is waiting to join the domain.
„X Go back to the session that is logged into the domain controller.
„X Once again select transaction STMS -> Overview -> Systems
„X Select the system configuration by single clicking on it
„X Now chose SAP System -> Approve…When prompted about distributing the configuration, answer YES.
„X Select the system configuration by double clicking on it.
„X Click on the “Transport Tool” Tab
„X Get Into “Change” mode
„X Put cursor on any row in the display
„X Click the “Add Row” Icon
„X Save The Configuration
„X Reply “YES” to “Should configuration be distributed immediately”
TMS is now configured.
2.7.3 Configure RDD Jobs on System
Logon as ID DDIC client 000 and all customer clients.
This job is to be executed separately for Client 000 and all the other clients of the
Server from User Id. DDIC only.
Execute RDDNEWPP from SE38 in every client
(This will schedule job RDDIMPDP in every client)
2.7.4 Run BDLS to change logical system name of the clients
2.7.5 Configure/import new instances and profiles
Import the profiles of all the active servers using,
transaction RZ10 -> Utilities -> Import profiles -> Of active servers.
Using transaction RZ04 -> Maintain instances -> Operation mode view,
select each instance and choose Instance -> Delete entry.
After all entries have been deleted, select Instance -> Save.
Now select Settings -> Based on current status -> New instances -> Generate.
Select Instance -> Save
Using transaction RZ03
Control -> Switch Operation Mode -> All Servers
2.7.6 Configure Logon, RFC and Background server groups ( SMLG, RZ12 and SM61)
2.7.7 Carry out other post installation activities as required by your specific installation