Understanding the Java Instance ID issue
A few years ago, fellow colleague Alessandro Parolin wrote a great article in the then SCN, explaining the so called Java Instance ID issue.
Years have passed since then and so this article should get an update too.
In accordance with Alessandro and the moderators, I will present a new version of it.
Remember, this is about SAP NetWeaver 7.0 based SAP systems (Application Server for Java and Dual-stack systems).
First of all, let’s understand how a Java instanceID is generated.
Each SAP Java system contains the so-called box number, which is composed by 3 values: <SID> + <Instance Number> + <Hostname>. The Java ID is then generated from the box number. For sakes of demonstration, let S01 and S02 be two SAP Java systems as follows:
|Calculated Java ID||ID184962||ID224865|
The table above shows the information of each system and the ID they generated, which is stored at database level. Currently, each system should be working just fine.
If by any chance one decides to copy the database from S01 and restore it over S02 system (which by the way is not supported), what will happen is the following:
|Calculated Java ID||ID184962||ID184962|
The Java ID of S01 is now in the DB of system S02. Then, the box number of S02 no longer matches its Java ID, causing an inconsistency.
The same would happen if any of the parameters of the box numbers were changed in an unsupported way. Then, the ID would still be the same, but the box number and ID would no longer match.
Some tools, such as SWPM (during system copies) and SUM check if the Java ID is consistent with the box number. If it is not, the tools stop the procedure with an error. Currently, the only available solution to fix that is to perform a system copy of the system that is inconsistent. However, as already mentioned, SWPM checks the consistency of the IDs and it will fail. Therefore, to overcome this, one must:
- Start the system copy with SWPM
- After the export of the Central Instance, edit file SOURCE.PROPERTIES located in the export directory
- The source parameters must be adjusted to the ones that generated the current ID located in the Database. In this case, after the export, the following content will be present in SOURCE.PROPERTIES file:src.ci.sid=S02
- However, as per the first table, the above information generates ID224865, which no longer exists in the DB. So, one must adapt it to:src.ci.sid=S01
- After that, the installation of the target system can be started. During the target CI installation, Java Migration Toolkit will be executed to correctly adjust the IDs of the Java system. It will migrate the current one (ID184962), to the correct ID that matches the box number of the target system. This box number is composed by the values provided to SWPM during the target system installation.
The consistency check of the Java ID with the box number can be done by following the steps from SAP Note 1156185, section V/ Preparing the Upgrade, c) Java ONLY.
Even though this note is about SAP NetWeaver 7.1 EHP 1, the consistency check procedure is independent of this product.
You can easily check for correctness of the earlier mentioned box number in your source system
by following the steps from SAP Note 1644265. Be careful to check in all of the shown places in the configtool.
How to correct an inconsistency in the Box number
In case of an inconsistency in the box number or with the instanceID during a system copy, Software Provisioning Manager 1.0 SP10 and higher for SAP NetWeaver 7.0 based systems (70SWPM…) now offers the option to easily correct it in your system.
You find the service as shown in the screenshot below:
The associated SAP Note is 2259748