instance - checklist for changing sid and hostname
TRANSCRIPT
CHECKLIST – CHANGE SID
Followings all the abbreviation used in this procedure/checklist<SID> = SAP SIDSSID = Source SIDTSID = Target SID<HOST> = Host name<##> = SAP Instance number<SAPINSTNAM> = SAP Instance name (e.g. DVEBMGS00)<SAPORAHOME> = Home directory of SAP Oracle user<SAPADMHOME> = Home directory of SAP Administrator<SAPPROFILE> = Directory containing SAP profiles<ORATNSHOME> = Directory containing oracle TNS control files<ORAHOME> = Oracle Home
Related Notes :
Metalink Oracle : 15390.1 How to Determine and Change DB_NAME or ORACLE_SID131321.1 How to Relink Oracle Database Software on UNIX
SAP :SAP R3 Homogenous System Copy Guides 4.6cSR2
No
Activities Script/Notes/App Start Time End Time Status/Remark
Stop all instance & database (if instance is up). For Flashcopy approach, do not shutdown the instanceSaplicense –temp (installed new temp license as different hardware key)Change hostname – refer note 8307
1. /usr/sap/TCP/SYS/profiles (DEFAULT.PFL, TCP_DV*, START_*)
2. /home/tcpadm (stopsap* & startsap*)3. .dbenv* .sapenv* (/home/tcpadm &
/oracle/TCP)4. TPPARAM & TPPARAM_TNB.PFL5. tnsnames.ora & listener.ora6. adapt table INSTVERS
Create new group (if not exist)- sapsys- dba- oper
Create new userid for new instance (if not exist)
- ora<sid> (group : dba, oper)- <sid>adm (sapsys,dba,oper)
Reconfigure the mount point (Veritas) to accommodate the SID name
Appendix A
Change owner/group for following files/directoriesDirectory
- /usr/sap/<TSID> <sid>adm:sapsys- /export/sapmnt/<TSID>
<sid>adm:sapsys- /usr/sap/trans <sid>adm:sapsys- /oracle ora<sid>adm:dba- /oracle/<TSID> ora<sid>adm:dba- /oracle/<TSID>/sapreorg
ora<sid>adm:dba- /oracle/<TSID>/saparch
ora<sid>adm:dba- /oracle/<TSID>/sapdata<n>
ora<sid>adm:dba- /oracle/<TSID>/orilog<n>
ora<sid>adm:dba- /oracle/<TSID>/mirrlog<n>
ora<sid>adm:dba
chown: runInstaller: A file or directory in the path name does not exist.chown: libnavhoa.a: A file or directory in the path name does not exist.chown: hsdb_ora.so: A file or directory in the path name does
Remove softlink and create new link with new location
not exist.chown: hsdb_odbc.so: A file or directory in the path name does not exist.chown: hsdb_syb.so: A file or directory in the path name does not exist.chown: ldflags: A file or directory in the path name does not exist.chown: JRE: A file or directory in the path name does not exist.chown: libctxx9.so: A file or directory in the path name does not exist.
Change ownershipMs
coSedwRename the following files or the contents (database)
<ORAHOME>/init<TSID>.ora <ORAHOME>/init<TSID>.sap <ORAHOME>/init<TSID>.dba <ORAHOME>/init<TSID>.utl <ORAHOME>/init<TSID>.bki <SAPORAHOME>/.dbenv_<HOST>.csh <SAPORAHOME>/.dbenv_<HOST>.sh <SAPORAHOME>/.sapenv_<HOST>.csh <SAPORAHOME>/.sapenv_<HOST>.sh <ORATNSHOME>/tnsnames.ora &
listener.ora
Appendix B
Rename the following files/contents (SAP Instance)
<SAPADMHOME>/startsap_<HOST>_<##>
<SAPADMHOME>/stopsap_<HOST>_<##>
<SAPADMHOME>/.dbenv_<HOST>.csh <SAPADMHOME>/.dbenv_<HOST>.sh <SAPADMHOME>/.sapenv_<HOST>.csh <SAPADMHOME>/.sapenv_<HOST>.sh <SAPPROFILE>/
<SID>_<SAPINSTNAM>_<HOST> o /START_<SAPINSTNAM>_<HOST> o /DEFAULT.PFL o /usr/sap/<TSID>/<SAPINSTNAM>
Relinking OracleOnly needed if :
An OS upgrade has occurred.
A change has been made to the OS system libraries. This can occur during the application of an OS patch.
A new install failed during the relinking phase.
Individual Oracle executables core dump during initial startup.
An individual Oracle patch has been applied (However, explicit relink instructions are usually either included in the README or integrated into the patch install script)
# su – ora<sid># relink all
Dump control file to trace from source instancesqlplus ‘/as sysdba’alter database backup controlfile to trace;Rename trace file to control.sql# cd /oracle/TCC/saptrace/usertrace# ls –ltrrename the last trace file to control.sqlFtp control.sql from source to target instance(location : /oracle/<SID>Edit control.sql
1. change all source <SSID> to new TSIDa. vi control.sqlb. :%s/<SSID>/<TSID>/g
2. change location of datafiles to accommodate new SIDa. (1st step already do that)
3. set database to resetlogs noarchivelog
Refer Appendix C for sample of control.sql
a. vi control.sqlb. change CREATE CONTROLFILE REUSE DATABASE ‘SSID’ NORESETLOGS ARCHIVELOG;toCREATE CONTROLFILE SET DATABASE ‘TSID’ RESETLOGS ARCHIVELOG;
Remove existing controlfilesStartup database with new control.sql# sqlplus ‘/as sysdba’SQL > startup nomountSQL > @control.sqlSQL > RECOVER DATABASE USING BACKUP CONTROLFILE;SQL > alter database open resetlogs;
exec(): 0509-036 Cannot load program oracleTCC because of the following errors: 0509-150 Dependent module libjox9.a(shr.o) could not be loaded. 0509-022 Cannot load module libjox9.a(shr.o). 0509-026 System error: A file or directory in the path name does not exist.ERROR:ORA-12547:
TNS:lost contact
The global database name may also need to be changed: SQL > alter database rename global_name to <newdb_name>.<domain> Change entry in /etc/services
- sapms<SSID> to sapms<TSID>Check sap license and hardware keyChange NFS setting /usr/sap/trans to point to production serverStart up SAP & oracle ermsr3stg02:
tccadm 26> startsap r3
Starting SAP-Collector Daemon------------------------------******************************************************************************* This is Saposcol Version COLL 20.79 03/08/22 46D - AIX v4.14 5L-64 bit 031027* Usage: saposcol -l:
Start OS Collector* saposcol -k: Stop OS Collector* saposcol -d: OS Collector Dialog Mode* saposcol -s: OS Collector Status* Starting collector (create new process)******************************************************************************/usr/sap/tmp/dev_coll moved to /usr/sap/tmp/dev_coll.old saposcol on host ermsr3prd03 started
Checking SAP R/3 TCC
Database------------------------------ Database is runningrm: 0653-609 Cannot remove /tmp/o.Operation not permitted. Could not remove directory /tmp/o Remove this directory manually and restart again
Starting SAP R/3 Instance------------------------------ Startup-Log is written to /home/tccadm/startsap_ermsr3stg02_00.log Startup of Instance failed See
/home/tccadm/startsap_ermsr3stg02_00.log for details
Check ORACLE_SID and DB_NAMESQL> select instance from v$thread; INSTANCE DB_SID To find the current value of DB_NAME: SQL> select name from v$database; NAME DBNAME
Check SAP SM21 (System Logs) ST22 (Abap dump) SM51 (Instance Information) SMLG (remove load balancing group) SM37 (remove all jobs belongs to old
SID)Post Installation SE06 – Choose database copy or migrationClick post installation processingReconfigure STMS- delete old STMS configuration and create new TMS- change /etc/hosts to accommodate new IPChange database to noarchivelog modeStart client copy
Appendix A
Unmounting Old Filesystem#!/bin/sh
echo "Start /sbin/helpers/vxfs/bin/umounting Veritas File Systems..."
umount /export/sapmnt/TCPumount/usr/sap/TCPumount /export/usr/sap/transumount /oracleumount /oracle/TCPumount /oracle/TCP/sapreorgumount /oracle/TCP/origlogAumount /oracle/TCP/origlogBumount /oracle/TCP/mirrlogAumount /oracle/TCP/mirrlogBumount /oracle/TCP/saparchumount /oracle/TCP/sapdata1umount /oracle/TCP/sapdata2umount /oracle/TCP/sapdata3umount /oracle/TCP/sapdata4umount /oracle/TCP/sapdata5umount /oracle/TCP/sapdata6umount /oracle/TCP/sapdata7umount /oracle/TCP/sapdata8umount /oracle/TCP/sapdata9/sbin/helpers/vxfs/bin/umount -o suid /dev/vx/dsk/sapprddg/intf /export/intf/sbin/helpers/vxfs/bin/umount -o suid /dev/vx/dsk/sapprddg/ixosexchange /export/ixos-exchange/sbin/helpers/vxfs/bin/umount -o suid /dev/vx/dsk/sapprddg/infastage /export/infastage
Mounting New Filesystem#!/bin/sh
echo "Start /sbin/helpers/vxfs/bin/mounting Veritas File Systems..."
/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapmnt /export/sapmnt/TCC/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/saphome /usr/sap/TCC/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/saptrans /export/usr/sap/trans/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/oracle /oracle/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/orahome /oracle/TCC/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapreorg /oracle/TCC/sapreorg/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/origlogA /oracle/TCC/origlogA/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/origlogB /oracle/TCC/origlogB/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/mirrlogA /oracle/TCC/mirrlogA/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/mirrlogB /oracle/TCC/mirrlogB/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/saparch /oracle/TCC/saparch/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapdata1 /oracle/TCC/sapdata1/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapdata2 /oracle/TCC/sapdata2/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapdata3 /oracle/TCC/sapdata3/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapdata4 /oracle/TCC/sapdata4/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapdata5 /oracle/TCC/sapdata5/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapdata6 /oracle/TCC/sapdata6/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapdata7 /oracle/TCC/sapdata7/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapdata8 /oracle/TCC/sapdata8/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/sapdata9 /oracle/TCC/sapdata9/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/intf /export/intf/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/ixosexchange /export/ixos-exchange/sbin/helpers/vxfs/bin/mount -o suid /dev/vx/dsk/sapprddg/infastage /export/infastage
Appendix B
Parameters need to be changed
init<TSID>.ora
db_name = TSIDcontrol_files = new locationbackground_dump_dest = new locationuser_dump_dest = new locationcore_dump_dest = new locationlog_archive_dest = new locationIFILE = new location (where applicable)
init<TSID>.sap
backup_root_dir = new locationstage_root_dir = new location compress_dir = new locationarchive_copy_dir = new locationarchive_stage_dir = new locationvolume_archive = new naming conventionvolume_backup = new naming conventionutil_par_file = new location
initTCP.utl
BACKUPIDPREFIX = TSID_CONFIG_FILE = new location
Appendix CSample of control.sql
## Set #2. RESETLOGS case## The following commands will create a new control file and use it# to open the database.# The contents of online logs will be lost and all backups will# be invalidated. Use this only if online logs are damaged.STARTUP NOMOUNTCREATE CONTROLFILE SET DATABASE "TCC" RESETLOGS ARCHIVELOG-- SET STANDBY TO MAXIMIZE PERFORMANCE MAXLOGFILES 255 MAXLOGMEMBERS 3 MAXDATAFILES 254 MAXINSTANCES 50 MAXLOGHISTORY 18151LOGFILE GROUP 15 ( '/oracle/TCC/origlogA/log_g15m1.dbf', '/oracle/TCC/mirrlogA/log_g15m2.dbf' ) SIZE 80M, GROUP 16 ( '/oracle/TCC/origlogB/log_g16m1.dbf', '/oracle/TCC/mirrlogB/log_g16m2.dbf' ) SIZE 80M, GROUP 17 ( '/oracle/TCC/origlogA/log_g17m1.dbf', '/oracle/TCC/mirrlogA/log_g17m2.dbf' ) SIZE 80M, GROUP 18 ( '/oracle/TCC/origlogB/log_g18m1.dbf', '/oracle/TCC/mirrlogB/log_g18m2.dbf' ) SIZE 80M, GROUP 19 ( '/oracle/TCC/origlogA/log_g19m1.dbf', '/oracle/TCC/mirrlogA/log_g19m2.dbf' ) SIZE 80M, GROUP 20 (
'/oracle/TCC/origlogB/log_g20m1.dbf', '/oracle/TCC/mirrlogB/log_g20m2.dbf' ) SIZE 80M, GROUP 21 ( '/oracle/TCC/origlogA/log_g21m1.dbf', '/oracle/TCC/mirrlogA/log_g21m2.dbf' ) SIZE 80M, GROUP 22 ( '/oracle/TCC/origlogB/log_g22m1.dbf', '/oracle/TCC/mirrlogB/log_g22m2.dbf' ) SIZE 80M-- STANDBY LOGFILEDATAFILE '/oracle/TCC/sapdata1/system_1/system.data1', '/oracle/TCC/sapdata1/roll_1/roll.data1', '/oracle/TCC/sapdata1/roll_2/roll.data2', '/oracle/TCC/sapdata1/roll_3/roll.data3', '/oracle/TCC/sapdata1/roll_4/roll.data4', '/oracle/TCC/sapdata2/temp_1/temp.data1', '/oracle/TCC/sapdata2/temp_2/temp.data2', '/oracle/TCC/sapdata2/temp_3/temp.data3', '/oracle/TCC/sapdata2/temp_4/temp.data4', '/oracle/TCC/sapdata5/stabi_1/stabi.data1', '/oracle/TCC/sapdata5/stabi_2/stabi.data2', '/oracle/TCC/sapdata5/stabi_3/stabi.data3', '/oracle/TCC/sapdata2/stabd_1/stabd.data1', '/oracle/TCC/sapdata2/stabd_2/stabd.data2', '/oracle/TCC/sapdata4/stabd_3/stabd.data3', '/oracle/TCC/sapdata4/stabd_4/stabd.data4', '/oracle/TCC/sapdata5/btabi_1/btabi.data1', '/oracle/TCC/sapdata5/btabi_2/btabi.data2', '/oracle/TCC/sapdata6/btabi_3/btabi.data3', '/oracle/TCC/sapdata6/btabi_4/btabi.data4', '/oracle/TCC/sapdata1/btabi_5/btabi.data5', '/oracle/TCC/sapdata1/btabi_6/btabi.data6', '/oracle/TCC/sapdata1/btabi_7/btabi.data7', '/oracle/TCC/sapdata4/btabi_8/btabi.data8',
'/oracle/TCC/sapdata4/btabi_9/btabi.data9', '/oracle/TCC/sapdata4/btabi_10/btabi.data10', '/oracle/TCC/sapdata7/btabi_11/btabi.data11', '/oracle/TCC/sapdata2/btabd_1/btabd.data1', '/oracle/TCC/sapdata2/btabd_2/btabd.data2', '/oracle/TCC/sapdata2/btabd_3/btabd.data3', '/oracle/TCC/sapdata3/btabd_4/btabd.data4', '/oracle/TCC/sapdata3/btabd_5/btabd.data5', '/oracle/TCC/sapdata3/btabd_6/btabd.data6', '/oracle/TCC/sapdata3/btabd_7/btabd.data7', '/oracle/TCC/sapdata3/btabd_8/btabd.data8', '/oracle/TCC/sapdata4/btabd_9/btabd.data9', '/oracle/TCC/sapdata4/btabd_10/btabd.data10', '/oracle/TCC/sapdata4/btabd_11/btabd.data11', '/oracle/TCC/sapdata5/btabd_12/btabd.data12', '/oracle/TCC/sapdata5/btabd_13/btabd.data13', '/oracle/TCC/sapdata5/btabd_14/btabd.data14', '/oracle/TCC/sapdata6/btabd_15/btabd.data15', '/oracle/TCC/sapdata6/btabd_16/btabd.data16', '/oracle/TCC/sapdata6/btabd_17/btabd.data17', '/oracle/TCC/sapdata7/btabd_18/btabd.data18', '/oracle/TCC/sapdata7/btabd_19/btabd.data19', '/oracle/TCC/sapdata7/btabd_20/btabd.data20', '/oracle/TCC/sapdata7/btabd_21/btabd.data21', '/oracle/TCC/sapdata8/btabd_22/btabd.data22', '/oracle/TCC/sapdata8/btabd_23/btabd.data23', '/oracle/TCC/sapdata8/btabd_24/btabd.data24', '/oracle/TCC/sapdata8/btabd_25/btabd.data25', '/oracle/TCC/sapdata8/btabd_26/btabd.data26', '/oracle/TCC/sapdata6/pooli_1/pooli.data1', '/oracle/TCC/sapdata1/poold_1/poold.data1', '/oracle/TCC/sapdata1/clui_1/clui.data1', '/oracle/TCC/sapdata2/clud_1/clud.data1', '/oracle/TCC/sapdata5/clud_2/clud.data2', '/oracle/TCC/sapdata4/ddici_1/ddici.data1', '/oracle/TCC/sapdata1/ddicd_1/ddicd.data1', '/oracle/TCC/sapdata6/docui_1/docui.data1',
'/oracle/TCC/sapdata2/docud_1/docud.data1', '/oracle/TCC/sapdata4/el46ci_1/el46ci.data1', '/oracle/TCC/sapdata6/el46cd_1/el46cd.data1', '/oracle/TCC/sapdata5/loadi_1/loadi.data1', '/oracle/TCC/sapdata1/loadd_1/loadd.data1', '/oracle/TCC/sapdata2/proti_1/proti.data1', '/oracle/TCC/sapdata3/protd_1/protd.data1', '/oracle/TCC/sapdata6/es46ci_1/es46ci.data1', '/oracle/TCC/sapdata7/es46cd_1/es46cd.data1', '/oracle/TCC/sapdata1/sourcei_1/sourcei.data1', '/oracle/TCC/sapdata4/sourced_1/sourced.data1', '/oracle/TCC/sapdata2/user1d_1/user1d.data1', '/oracle/TCC/sapdata3/user1i_1/user1i.data1', '/oracle/TCC/sapdata3/protd_2/protd.data2', '/oracle/TCC/sapdata8/ybmci_1/ybmci.data1', '/oracle/TCC/sapdata8/ybmcd_1/ybmcd.data1', '/oracle/TCC/sapdata8/bmcd_1/bmcd.data1', '/oracle/TCC/sapdata9/ybmci_2/ybmci.data2', '/oracle/TCC/sapdata9/ybmcd_2/ybmcd.data2', '/oracle/TCC/sapdata9/clud_3/clud.data3'CHARACTER SET WE8DEC;# Recovery is required if any of the datafiles are restored backups,# or if the last shutdown was not normal or immediate.# RECOVER DATABASE USING BACKUP CONTROLFILE# Database can now be opened zeroing the online logs.# ALTER DATABASE OPEN RESETLOGS;# No tempfile entries found to add.#