SAP Java – changing instance name after refreshing the system with production data
In the following scenario, we’ll focus on changing the instance name (SID). The data of the SAP Java test instance will be replaced with data from the production system. The database refresh process itself will be the subject of a separate article.
At this moment, we will focus on the steps that should be taken after such a refresh of the database, on the server where we have the JAVA instance running. Let’s assume that:
- test Java instance name is “TST”, host: test01, instance numbers: J47 and SCS46;
- the name of the production JAVA instance is “PRD”, host: prod01, instance numbers J47 and SCS46;
- before refreshing, the TST system was embedded on NetWeaver 7.4, while the production system was already in NetWeaver 7.5;
- the TST instance has been overwritten with data from the PRD system.
Steps to follow for the above scenario:
- On the host test01 we should backup the directories: /usr/sap/TST oraz /sapmnt/TST.
- After completing step one, we should delete the contents of the directories: /usr/sap/TST oraz /sapmnt/TST.
- Now, we should log in to the host: prod01 and synchronize the /usr/sap/TST and /sapmnt/TST directories with the test01 host:
- rsync -rcavz –progress /sapmnt/PRD/* tstadm@test01:/sapmnt/TST/
- rsync -rcavz –progress /usr/sap/PRD/* tstadm@test01:/usr/sap/TST/
- After the above synchronization, we now have to change the following files:
- We have to edit the indicated files and replace the SIDs from PRD to TST in them: /usr/sap/TST/J47/j2ee/configtool/config.properties and /usr/sap/TST/J47/j2ee/configtool/configtool.sh
- After completing the first step, we can now run the tool: configtool.sh and make changes in the Secure Store:
- Make new symbolic links, which will be point to the right place in the below locations: /usr/sap/TST/SYS and /usr/sap/TST/SYS/exe.
- Replace the SID from PRD to TST in the file: /sapmnt/TST/global/security/data/SecStore.properties
- In the location: /sapmnt/TST/profile, the profiles should be replaced with the correct names (i.e. TST_J47_test01 and TST_SCS46_test01). We change the name of the installation from PRD to TST in these profiles + DEFAULT.PFL. We also have to change the host: from prod01 to test01.
- We set the appropriate server for the database in the tnsnames.ora file: /sapmnt/TST/profile/oracle/tnsnames.ora
- Before we start the TST instance, it would be good to do the following:
- clear trace directory: /usr/sap/TST/J47/work;
- kill all active processes which still are running on tstadm user;
- delete all .sapstream * files in the /tmp location owned by the tstadm user