Skip to Content
Technical Articles

nZDM Java Part 2 for Microsoft SQL Server (MSS) Databases: Create the Target System

This is the second installment of our nZDM Java process example. This blog post is specific for systems running on Microsoft SQL Server (MSS) databases. First you should prepare the target hosts as described in the blog post nZDM Java Part 1: Prepare the Physical Host of your Target System.

For performing the system copy or cloning, you can use any procedure and tool of your preference. Here we describe an example where you can copy the system using Software Provisioning Manager (SWPM). You should use the database-specific homogeneous system copy procedure to create the target system. Note that this cloning method generally requires more time and effort than virtualization-based cloning methods.

Performing the database backup on the source system

NOTE: Keep in mind that throughout this blog post we use “database” when we mean “NetWeaver database”, for the sake of readability.

You should create online backup of your database system. You can use different approach provided by your database. There are several database-specific methods that are available. We describe just one of them.

For information see the System Copy – Target Databases Other than SAP HANA  relevant for your system, section MS SQL Server-Specific Procedure.

You can use Microsoft SQL Server Management Studio to backup the data.

  1. Login to the source system host as <sid>adm via mstsc.
  2. Start Microsoft SQL Server Management Studio and connect to the database.
  3. Expand Databases and select the database SID.
  4. Right-click the database and point to Tasks -> Back Up.
  5. In the appeared Back Up Database dialog box for Database and Backup Type list box leave the default values (which are respectively database SID and Full).
  1. To check the advanced options, click Options in the Select a page and check Reliability -> Verify backup when finished option. Then choose OK.
  2. After a successful execution, navigate to the directory where the backup was created. Copy the database backup file to the Backup folder in the target system host.

Starting the system copy

  1. Login to your target system host as the <administrator> user.
  2. Create the installation directory.
  3. Download to the installation directory the latest version of the Software Provisioning Manager 1.0 archive SWPM10SP<Support_Package_Number>_<Version_Number>.SAR from https://support.sap.com/sltoolset>System Provisioning ->Download Software Provisioning Manager.
  4. Copy SAPCAR from your source system kernel directory (DIR_CT_RUN) to your target system host installation directory.
  5. Unpack the Software Provisioning Manager SAR archive by executing the following command in your installation directory:
SAPCAR -xvf SWPM10SPxxxxxxxx.SAR
  1. Start sapinst in your installation directory with the appropriate switches:
sapinst SAPINST_USE_HOSTNAME=<source_hostname> JAVA_COPY_REMOVE_INSTANCES_IN_DB=no

For additional information, see the nZDM user documentation for your system, section Creating the Target System.

Installing the target system

Install database server software. Afterwards install target system on one host or on several hosts.

1. Install target system with all instances on the same host

  1. Restore database backup taken from source database system. To do this you can execute section Restoring the Database Backup on Microsoft SQL Server (MSS) database.
  2. Start SWPM to install target system. Choose following from product catalog:
    <SAP Product> -> MSS SQL Server -> System Copy -> Target System -> Standard System -> Based on Java -> Standard System
  3. Fill in all required information in the system copy screens. Make sure that all parameters, such as SID, instance numbers, ports, and passwords exactly match the same parameters of the source system. Pay attention to the following screens:
    • On the Welcome to SAP Installation screen, choose the option that matches the release, database platform, and distribution of the source system.
    • On the SAP System Database screen, choose Homogeneous System Copy (MSS SQL Server -Specific: Detach/Atach or Backup/Restore).
    • On the Java System Copy screen, leave Target System Will Replace Source System unselected.
    • Choose Local Domain
    • On the MS SQL Server Tempdb Configuration, see recommended size of Tempdb Files. Use Microsoft SQL Server Management Studio to set these values.

As a result of a successful execution, the target system is ready for use. The SCS and SMD Agent instances are running, and the Java instance is not running. You can start it manually at this point or follow the steps described in section Copying Kernel and JVM Files from the Source System before starting it.

2. Installing the distributed system

If the system is distributed on several hosts, choose Distributed:

<SAP Product> -> MSS SQL Server -> System Copy -> Target System -> Distributed System -> Based on Java

All mandatory instances are distributed on separate hosts. Mandatory instances of an SAP system are:

  • Central services instance (SCS instance)
  • Database instance
  • Application server instance

You can have one or more additional application server instances. You can find the installation for additional application server instances in Additional SAP System Instances.

<SAP Product> -> MSS SQL Server -> Installation -> Additional SAP System Instances

2.1. Installing the SCS instance

<SAP Product> -> MSS SQL Server -> System Copy -> Target System -> Distributed System -> Based on Java -> SCS instance

Fill in all required information in the system copy screens. Make sure that all parameters, such as SID, instance numbers, ports, and passwords, exactly match the same parameters of the source system. Pay attention to the following screens:

  • On the Welcome to SAP Installation screen, choose the option that matches the release, database platform, and distribution of the source system.
  • Choose Local Domain.

2.2. Install the Database instance

  1. Restore the database backup taken from source database system. To do this, execute section Restoring the Database Backup on Microsoft SQL Server (MSS) database.
  2. Start SWPM to install database instance. Choose following from product catalog:<SAP Product> -> MSS SQL Server -> System Copy -> Target System -> Distributed System -> Based on Java -> Database instance
  3. Fill-in all required information in the system copy screens. Make sure that all parameters, such as SID, instance numbers, ports, and passwords, exactly match the same parameters of the source system. Pay attention to the following screens:
    • On the Welcome to SAP Installation screen, choose the option that matches the release, database platform, and distribution of the source system.
    • On the SAP System Database screen, choose Homogeneous System Copy (MSS SQL Server-Specific: Detach/Atach or Backup/Restore).
    • On the Java System Copy screen, leave Target System Will Replace Source System unselected.
    • Choose Local Domain
    • On the MS SQL Server Tempdb Configuration, see recommended size of Tempdb Files. Use Microsoft SQL Server Management Studio to set these values.

As a result of a successful execution, the target DB instance is ready for use.

Restoring the Database on the Target System

For information see the System Copy – Target Databases Other than SAP HANA guide relevant for your system, section MS SQL Server-Specific Procedure.

You can use Microsoft SQL Server Management Studio to restore the data.

  1. Login to the target system host as windows administrator.
  2. Start Microsoft SQL Server Management Studio and connect to the database server.
  3. Right-click Databases and point Restore Database, which opens Restore Database dialog box
  4. In the Restore Database dialog box enter the Source System database SID for To Database, choose the radio button From Device, which opens Specify Backup, and then navigate to the destination of the previously copied backup file.
  5. Check on the Restore check-box and choose OK.

Finishing the System Copy

Return to the SAPinst GUI and click OK to continue the system copy. The procedure resumes and runs without further manual steps to the end. The warning message An error occurred updating the system history for Java… might appear. You can ignore it and continue.

Install the Application Server instance

If the system is distributed on several hosts, install the application server instance.

  • On the Welcome to SAP installation screen, choose the option that matches the release, database platform, and distribution of the source system.
  • On the Java System Copy screen, leave Target System Will Replace Source System unselected.
  • Choose Local Domain.

As a result of a successful execution, the target system is ready for use. The SCS and SMD Agent instances are running, and the Java instance is not running. You can start it manually at this point or follow the steps described in section Copying Kernel and JVM Files from the Source System before starting it.

For additional information, see the nZDM user documentation for your system, section Creating the Target System.

Copying Kernel and JVM Files from the Source System

For additional information, see the nZDM user documentation for your system, section Creating the Target System.

To have a completely identical target system, it is recommended to copy the kernel and JVM files from the source system. In some cases, you may be forced to do this if you have issues with starting the Java instance due to a kernel that is too old for the OS.

1. Copying Kernel and JVM Files on Linux OS

  1. Make sure that all target system instances (SCS and Java) are stopped. On Linux, you can stop them by logging as <sid>adm and executing the following command for each instance:
sapcontrol -nr <nr> -function Stop

You can monitor the status of the instance processes by running sapcontrol -nr <nr> -function GetProcessList, and the status of the Java processes by running sapcontrol -nr <nr> -function J2EEGetProcessList.

  1. Rename all target system executable directories. On Linux, login to your target system host as <sid>adm and execute the following commands:
cd /usr/sap/<SID>/SYS/exe/uc/
mv linuxx86_64 linuxx86_64.1
cd /usr/sap/<SID>/SYS/exe/jvm/
mv linuxx86_64 linuxx86_64.1
cd /usr/sap/<SID>/J<nr>
mv exe exe.1
cd /usr/sap/<SID>/SCS<nr>
mv exe exe.1
  1. Copy all executable directories from the source system host. On Linux, login to your source system host as <sid>adm and execute the following commands:
cd /usr/sap/<SID>/SYS/exe/uc/
scp -p -r ./linuxx86_64 <sid>adm@<hostname1>:/usr/sap/<SID>/SYS/exe/uc/
cd /usr/sap/<SID>/SYS/exe/jvm/
scp -p -r ./linuxx86_64 <sid>adm@<hostname1>:/usr/sap/<SID>/SYS/exe/jvm/
cd /usr/sap/<SID>/J<nr>
scp -p -r ./exe <sid>adm@<hostname1>:/usr/sap/<SID>/J<nr>/
cd /usr/sap/<SID>/SCS<nr>
scp -p -r ./exe <sid>adm@<hostname1>:/usr/sap/<SID>/SCS<nr>/
  1. Edit the Java instance profile and specify the correct value for the SAPJVM_VERSION parameter.
  2. Start all instances that were previously running. On Linux, you do that by logging as <sid>adm and executing the following command for each instance:
sapcontrol -nr <nr> -function Start

or you can use sapstart if it exists

sapstart

6. You can perform the above steps to copy the kernel and JVM files also for the SMD Agent instance. Make sure you login as the correct user since this instance is installed under a different SID, usually DAA.

2. Copying Kernel and JVM Files on Windows OS

  1. Make sure that all target system instances (SCS and Java) are stopped.
  2. Rename all target system executable directories:
    • <drive>:\usr\sap\<SID>\SYS\exe\uc\NTAMD64 to <drive>:\usr\sap\<SID>\SYS\exe\uc\NTAMD64.old
    • <drive>:\usr\sap\<SID>\SYS\exe\jvm\NTAMD64 to <drive>:\usr\sap\<SID>\SYS\exe\jvm\NTAMD64.old
    • <drive>:\usr\sap\<SID>\J<nr>\exe to <drive>:\usr\sap\<SID>\J<nr>\exe.old
  1. Copy all executable directories from the source system host to the target system host. From the target system copy do the following:
  • Copy \\<Source_System_IP>\saploc\<SID>\SYS\exe\uc\NTAMD64 to <drive>:\usr\sap\<SID>\SYS\exe\uc\NTAMD64
  • Copy \\<Source_System_IP>\saploc\<SID>\SYS\exe\jvm\NTAMD64 to <drive>:\usr\sap\<SID>\SYS\exe\jvm\NTAMD64
  • Copy \\<Source_System_IP>\saploc\<SID>\J<nr>\exe to <drive>:\usr\sap\<SID>\J<nr>\exe
  1. Edit the Java instance profile and specify the correct value for the SAPJVM_VERSION parameter:
    • Open folder <drive>:\usr\sap\<SID>\SYS\exe\jvm\NTAMD64 and check name of folder sapjvm_<digits> (The <digits> are the SAPJVM_VERSION value)
    • Open file <drive>:\usr\sap\<SID>\SYS\profile\<SID>J<nr><source_system>
    • Change value of SAPJVM_VERSION to <digits>
    • Save the file.
  1. Start all instances.
  2. Copying Kernel and JVM Files from the Source System to the Target System SMD Agent

Perform the above steps to copy the kernel and JVM files for the SMD Agent instance as well.

This instance is installed under a different SID, usually DAA.

  • Instead of J<nr> use SMD<xx>.
  • For parameter SAPJVM_VERSION use value from <drive>:\usr\sap\DAA\SMDA<xx>\exe\sapjvm_<nr>\buildinfo.txt -> parameter vmVersion.

Connect to the target system

Connect to the target system via IP address or target hostname of the target system. You should not use virtual hostnames (in this case it is source hostnames) as it is common for both source and target system.

Also, you should use IP address to connect to the source system in nZDM Java UI to connect to the source system.

Also see the following resources:

Be the first to leave a comment
You must be Logged on to comment or reply to a post.