IBM Db2 for SAP Deployment Guide

This deployment guide shows you how to deploy the Google Cloud Platform (GCP) resources for an IBM Db2 for Linux, Unix and Windows system that supports SAP applications.

For details on planning your deployment, see the IBM Db2 for SAP Planning Guide.

Prerequisites

If you do not already have a Google Cloud Platform project with billing enabled, you must create one before you can deploy a VM for your IBM Db2 installation.

To create a project:

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. Select or create a GCP project.

    Go to the Manage resources page

  3. Make sure that billing is enabled for your project.

    Learn how to enable billing

Configuring the gcloud command environment

These instructions use Cloud Shell to enter gcloud commands that deploy or configure your GCP resources. Cloud Shell is accessed through the GCP console in your browser.

Cloud Shell runs on a VM that GCP provisions each time you start Cloud Shell. The first time you use Cloud Shell, GCP also creates a persistent $HOME directory for you, which is restored each time you open Cloud Shell.

The provisioned VM includes the latest Cloud SDK, which provides the gcloud command-line interface. Therefore, the gcloud commands that you use in Cloud Shell are the same as those you would use in a locally installed instance of the Cloud SDK.

If you have the Cloud SDK installed, you can issue the gcloud commands that are used in these instructions from your local machine. However, with a locally installed Cloud SDK you must always make sure that you are using the latest version of the Cloud SDK.

Whether you use Cloud Shell or Cloud SDK, you can can set and change the properties of your gcloud command environment and save them as a configuration. Configurations are collections of key-value pairs that influence the behavior of the gcloud commands.

Some basic actions you can take with a configuration in Cloud Shell include:

  • Initialize a configuration with gcloud init

  • Check the settings of your current gcloud configuration with gcloud config list

  • Change the GCP project you are working in with gcloud config set project [PROJECT_ID]

  • Set a default region with gcloud config set compute/region [REGION]

  • Set a default zone with gcloud config set compute/zone [ZONE]

  • Create a new configuration with gcloud config configurations create [NAME]

For more information about working with configurations, see Managing SDK Configurations.

Creating a network

When you create a project, a default network is created for your project. However, for security purposes, you should create a new network and specify firewall rules to control who has access.

To set up networking:

  1. Go to Cloud Shell.

    Go to Cloud Shell

  2. To create a new network in the custom subnetworks mode, run:

    gcloud compute networks create [YOUR_NETWORK_NAME] --subnet-mode custom

    where [YOUR_NETWORK_NAME] is the name of the new network. The network name can contain only lowercase characters, digits, and the dash character (-).

    Make sure to specify the custom flag instead of using an automatic subnetwork. An automatic subnetwork always has the same assigned IP address range, which can cause issues if you have multiple subnetworks and want to use VPN.

  3. Create a subnetwork, and specify the region and IP range:

    gcloud compute networks subnets create [YOUR_SUBNETWORK_NAME]
            --network [YOUR_NETWORK_NAME] --region [YOUR_REGION] --range [YOUR_RANGE]

    where:

    • [YOUR_SUBNETWORK_NAME] is the new subnetwork.
    • [YOUR_NETWORK_NAME] is the name of the network you created in the previous step.
    • [REGION] is the region where you want the subnetwork.
    • [YOUR_RANGE] is the IP address range, specified in CIDR format, such as 10.1.0.0/24. If you plan to add more than one subnetwork, assign non-overlapping CIDR IP ranges for each subnetwork in the network. Note that each subnetwork and its internal IP ranges are mapped to a single region.
  4. Optionally, repeat the previous step and add additional subnetworks.

Setting up a NAT gateway

If you intend to create one or more VMs that will not have public IP addresses, you must create a NAT gateway so that your VMs can access the Internet to download Google's monitoring agent.

If you intend to assign an external public IP address to your VM, you can skip this step.

To create a NAT gateway:

  1. Create a VM to act as the NAT gateway in the subnet you just created:

    gcloud compute instances create [YOUR_VM_NAME] --can-ip-forward \
            --zone [YOUR_ZONE]  --image-family [YOUR_IMAGE_FAMILY] \
            --image-project [YOUR_IMAGE_PROJECT] \
            --machine-type=[YOUR_MACHINE_TYPE] --subnet [YOUR_SUBNETWORK_NAME] \
            --metadata startup-script="sysctl -w net.ipv4.ip_forward=1; iptables \
            -t nat -A POSTROUTING -o eth0 -j MASQUERADE" --tags [YOUR_VM_TAG]

    where:

    • [YOUR_VM_NAME] is the name of the VM you are creating that want to use for the NAT gateway.
    • [YOUR_ZONE] is the zone where you want the VM.
    • [YOUR_IMAGE_FAMILY] and [YOUR_IMAGE_PROJECT] specify the image you want to use for the NAT gateway.
    • [YOUR_MACHINE_TYPE] is any supported machine type. If you expect high network traffic, choose a machine type with that has at least eight virtual CPUs.
    • [YOUR_SUBNETWORK_NAME] is the name of the subnetwork where you want the VM.
    • [YOUR_VM_TAG] is a tag that is applied to the VM you are creating. If you use this VM as a bastion host, this tag is used to apply the related firewall rule only to this VM.
  2. Create a route that is tagged so that traffic passes through the NAT VM instead of the default Internet gateway:

    gcloud compute routes create [YOUR_ROUTE_NAME] \
            --network [YOUR_NETWORK_NAME] --destination-range 0.0.0.0/0 \
            --next-hop-instance [YOUR_VM_NAME] --next-hop-instance-zone \
            [YOUR_ZONE] --tags [YOUR_TAG_NAME] --priority 800

    where:

    • [YOUR_ROUTE_NAME] is the name of the route you are creating.
    • [YOUR_NETWORK_NAME] is the network you created.
    • [YOUR_VM_NAME] is the VM you are using for your NAT gateway.
    • [YOUR_ZONE] is the zone where the VM is located.
    • [YOUR_TAG_NAME] is the tag on the route that directs traffic through the NAT VM.
  3. If you also want to use the NAT gateway VM as a bastion host, run the following command. This command creates a firewall rule that allows inbound SSH access to this instance from the Internet:

    gcloud compute firewall-rules create allow-ssh --network [YOUR_NETWORK_NAME] --allow tcp:22 --source-ranges 0.0.0.0/0 --target-tags "[YOUR_VM_TAG]"

    where:

    • [YOUR_NETWORK_NAME] is the network you created.
    • [YOUR_VM_TAG] is the tag you specified when you created the NAT gateway VM. This tag is used so this firewall rule applies only to the VM that hosts the NAT gateway, and not to all VMs in the network.

Deploying a VM for Db2 on GCP

When you create a VM, you can specify several options, including the operating system, region, machine type, and persistent disks. You must also specify a startup script to install Google's monitoring agent on the VM.

To create a VM:

  1. Go to the Images page in the GCP Console:

    Go to the Images page

  2. To use a public image, choose a supported image from the list. SAP has certified the following images for IBM Db2 on GCP:

    • Red Hat Enterprise Linux 7.4
    • SUSE Linux Enterprise Server 12 SP2 or above
    • Windows Server 2012 R2 and above
  3. Click Create Instance.

  4. Enter a name for your VM. Limit the name to 13 characters, as this is the maximum supported by SAP. For more information, see SAP Note 611361: Hostnames of SAP servers.
  5. Select the zone for your VM based on the location of your internal resources and users, and the machine type you want to use.

    See the following guides and SAP Notes for more details on the zones supported for SAP Netweaver:

  6. Change the machine type to one of the supported machine types. To see the supported machine types and their persistent-disk limitations, see the IBM Db2 for SAP Planning Guide.

  7. Optionally, in the Boot disk section, click Change to enter the Boot disk dialog. In this dialog, you can configure the size and type of your boot disk. After you finish configuring your boot disk, click Select to commit your changes.

  8. Expand the Management, security, disks, networking, sole tenancy section.
  9. In the Management tab, under Availability policy, verify that the following defaults are set:

    • To ensure availability of your SAP systems, keep the Preemptibility setting set to Off (recommended).
    • To ensure that your VM can restart if there's a maintenance or failure event, keep the Automatic restart setting set to On (recommended).
    • To ensure that your VM is migrated to other hardware during infrastructure maintenance, keep the On host maintenance setting set to Migrate VM instance (recommended).
  10. In the Disks tab, deselect the Delete boot disk when instance is deleted checkbox.

Next, create a set of disk volumes for your database data, database logs, and stored procedures. For each disk volume, perform the following steps:

  1. In the Disks tab, under Additional disks, click Add item to add persistent disks for storage.
  2. Under the Name heading, select Create disk from the dropdown.
  3. In the Create a disk window, under Disk Type, select your preferred disk type for the disk.
  4. Under Source type, select None (blank disk).
  5. Specify the size of your disk. Disk sizes are subject to SAP and IBM Db2 requirements. See:
  6. Click Create to create the disk.
  7. Repeat the preceding steps for each disk you need for your system.

Finally, configure your networking details and create the VM:

  1. In the Networking tab, under Network interfaces, choose the network that you created earlier.
  2. If you are using a NAT gateway, under Network tags, add the tag that you specified as [YOUR_TAG_NAME] when you set up the route directing traffic through the gateway.
  3. In the SSH Keys tab, select Block project-wide SSH keys.
  4. Click Create to create and start the VM.

Adding firewall rules

By default, incoming connections from outside your GCP network are blocked. To allow incoming connections, set up a firewall rule for your VM. Firewall rules regulate only new incoming connections to a VM. After a connection is established with a VM, traffic is permitted in both directions over that connection.

You can create a firewall rule to allow access to specified ports, or to allow access between VMs on the same subnetwork.

Create firewall rules to allow access for such things as:

  • The default ports used by SAP NetWeaver, as documented in TCP/IP Ports of All SAP Products.
  • Connections from your computer or your corporate network environment to your Compute Engine VM instance. If you are unsure of what IP address to use, talk to your company's network administrator.
  • Communication between VMs in a 3-tier or scaleout configuration. For example, if you are deploying a 3-tier system, you will have at least 2 VMs in your subnetwork: the VM for SAP NetWeaver, and another VM for the database server. To enable communication between the two VMs, you must create a firewall rule to allow traffic that originates from the subnetwork.

To create a firewall rule:

  1. In the GCP Console, go to the Firewall Rules page.

    OPEN FIREWALL RULES

  2. At the top of the page, click Create firewall rule.

    • In the Network field, select the network where your VM is located.
    • In the Targets field, select All instances in the network.
    • In the Source filter field, select one of the following:
      • IP ranges to allow incoming traffic from specific IP addresses. Specify the range of IP addresses in the Source IP ranges field.
      • Subnets to allow incoming traffic from a particular subnetwork. Specify the subnetwork name in the following subnets field. You can use this option to allow access between the VMs in a 3-tier or scaleout configuration.
    • In the Protocols and ports section, select Specified protocols and ports and specify tcp:[PORT_NUMBER];.
  3. Click Create to create your firewall rule.

Connecting to your VM

Next, establish a connection to your VM.

Linux

The easiest ways to connect to a Linux VM are to connect from your browser through the GCP Console, or from the command line through the gcloud command-line tool. You can also connect to a Linux VM using common SSH tools.

Alternatively, you can generate a new key-pair for your Linux VM and apply it to your project, which allows you to connect using third-party tools, such as PuTTY on Windows workstations. For more details, see Creating a new SSH key pair.

You can also connect to your VM using other configurations. For a list of supported environments and known issues, see SSH from the Browser.

Console

To SSH directly from your web browser in the GCP Console:

  1. In the GCP Console, go to the VM Instances page.

    Go to the VM Instances page

  2. In the list of virtual machine instances, click SSH in the row of the instance that you want to connect to.

gcloud

The gcloud command-line tool manages your SSH keys for you by generating and applying new project-wide SSH keys when you need them. To connect through the gcloud tool, run the following command, substituting [VM_NAME] with your VM name:

gcloud compute ssh [VM_NAME]

You can now use the terminal to run commands on your Linux VM. When you are done, use the exit command to disconnect from the VM.

Windows

To connect to a Windows-based VM, you must first generate a password for the VM. You can then connect to the VM using RDP or PowerShell.

Generating passwords

After you create a Windows VM, you must generate a password for the VM before you can connect to it:

  1. Go to the VM instances page:

    Go to the VM Instance page

  2. Click the Windows instance where you want to generate a new password.

  3. On the instance details page, click the Create or reset Windows Password button. A password is generated for you.
net user [USERNAME] [NEW_PASSWORD]
  1. To create a new user and password, specify a user name.
  2. Click Set. Note the username and password so you can sign in to the VM.
Using RDP

You can use RDP to connect to a Windows instance and start a Remote Desktop session. Alternatively, you can connect to Windows instances using the PowerShell terminal.

Connect to the remote desktop on Windows instances using one of the following methods:

  • If you use the Chrome browser, you can connect through the Chrome RDP for Google Compute Engine extension from Fusion Labs. This extension allows you to connect through the GCP Console.
  • Download the RDP file and manually connect through the Windows Remote Desktop Connection client or a third-party client.

Console

  1. Go to the VM instances page in the in the GCP Console.

    Go to the VM Instances pages

  2. Click the RDP button next to the instance that you want to connect to. A new browser window opens with the Chrome RDP for Google Compute Engine extension.

  3. Enter your username and password. If this is your first time connecting to this instance, or if you have forgotten your password, create or reset your Windows password.
  4. Click OK to connect.

RDP Client

  1. Install an RDP client. If you don't have a preference, install the Chrome RDP for Google Compute Engine extension.
  2. Get your Windows VM's external IP address. Go to the VM instances page in the GCP Console or run gcloud compute instances list to see a list of your instances with their external IP values.
  3. In your RDP client, provide your VM's external IP address as the IP address to connect to. For example, in the Chrome RDP extension, you would enter the IP address in the following format:

    Screenshot of the instance creation window with the required options set

  4. Enter your sign-in information and leave the Domain field blank. If this is your first time connecting to this VM, or if you have forgotten your password, create or reset your Windows password.

    Screenshot of the instance creation window with the required options set

Using PowerShell
  1. If you have not created a username and password on the Windows VM yet, create or reset your Windows password.
  2. Add a firewall rule or edit your existing firewall rule to open port 5986 on the GCP network where your Windows Server VM is located.
  3. On your local workstation, open the PowerShell terminal.
  4. Optionally, you can initialize a variable to hold your user credentials so you do not need to enter them each time you connect to the instance. If you skip this step, you receive a prompt for your username and password later.

    $credentials = Get-Credential
    
  5. Use the Enter-PSSession command to start a remote PowerShell session and include the flags to use SSL and skip credentials checks.

    Enter-PSSession -ComputerName [IP_ADDRESS] -UseSSL -SessionOption
    (New-PSSessionOption -SkipCACheck -SkipCNCheck) -Credential $credentials
    

Formatting and mounting disk drives

Next, format your disk drives and mount them to your VM.

Linux

After you connect to your VM, format and mount your disk drives.

Optionally, you can use Logical Volume Manager (LVM) to format a single disk and split it into the required directories. Both LVM and non-LVM methods are shown in the following procedures.

Formatting and mounting disk drives without LVM

To format and mount your disk drives without LVM:

  1. In the terminal where you are connected to your VM, create directories to which you can mount each device:

    sudo mkdir -p /db2
    sudo mkdir -p /db2/[DB_SID]
    sudo mkdir -p /db2/[DB_SID]/log_dir
    sudo mkdir -p /db2/[DB_SID]/db2dump
    sudo mkdir -p /db2/[DB_SID]/sapdata
    sudo mkdir -p /db2/[DB_SID]/saptmp
    
  2. In the terminal, use the ls command to identify the disks that you want to mount.

    ls /dev/disk/by-id/
    
    google-example-instance
    google-example-instance-db2
    google-example-instance-db2-dbsid
    google-example-instance-db2-dump
    google-example-instance-db2-log-dir
    google-example-instance-db2-sapdata
    google-example-instance-db2-saptmp
    

The disk ID usually includes the name of the disk with a google- prefix or a scsi-0Google_ prefix. This example uses the google- ID.

  1. Format the disks. If you are using Db2 V11.1, either the xfs or ext4 file system is recommended, because both support the fast preallocation file system feature. Db2 V10.5 does not support xfs or ext4. The following commands format each disk with a single ext3 file system and no partition table:

    sudo mkfs.ext3 -F /dev/disk/by-id/google-example-instance-db2
    sudo mkfs.ext3 -F /dev/disk/by-id/google-example-instance-db2-dbsid
    sudo mkfs.ext3 -F /dev/disk/by-id/google-example-instance-db2-dump
    sudo mkfs.ext3 -F /dev/disk/by-id/google-example-instance-db2-sapdata
    sudo mkfs.ext3 -F /dev/disk/by-id/google-example-instance-db2-saptmp
    sudo mkfs.ext3 -F /dev/disk/by-id/google-example-instance-db2-log-dir
    
  2. Mount each disk to the VM:

    sudo mount -o discard,defaults /dev/disk/by-id/google-example-instance-db2 /db2
    sudo mount -o discard,defaults /dev/disk/by-id/google-example-instance-db2-dbsid /db2/[DB_SID]
    sudo mount -o discard,defaults /dev/disk/by-id/google-example-instance-db2-dump /db2/[DB_SID]/db2dump
    sudo mount -o discard,defaults /dev/disk/by-id/google-example-instance-db2-sapdata /db2/[DB_SID]/sapdata
    sudo mount -o discard,defaults /dev/disk/by-id/google-example-instance-db2-saptmp /db2/[DB_SID]/saptmp
    sudo mount -o discard,defaults /dev/disk/by-id/google-example-instance-db2-log-dir /db2/[DB_SID]/log_dir
    
  3. Configure read and write access to the device. For this example, grant write access to the device for all users:

    sudo chmod a+w /db2
    sudo chmod a+w /db2/[DB_SID]
    sudo chmod a+w /db2/[DB_SID]/db2dump
    sudo chmod a+w /db2/[DB_SID]/sapdata
    sudo chmod a+w /db2/[DB_SID]/saptmp
    sudo chmod a+w /db2/[DB_SID]/log_dir
    
  4. Optionally, you can add the persistent disks to the /etc/fstab file so that the device automatically mounts again when the VM restarts.

When you specify the entry /etc/fstab file, be sure to include the nofail option so that the instance can continue to boot even if the disk is not present. For example, if you take a snapshot of the boot disk and create a new instance without any persistent disks attached, the instance can continue through the startup process and not pause indefinitely.

  1. Create the /etc/fstab entry. Use the blkid command to find the UUID for the file system on the device and edit the /etc/fstab file to include that UUID with the mount options. You can complete this step with a single command for each disk drive:

    echo UUID=`sudo blkid -s UUID -o value /dev/disk/by-id/google-example-instance-db2` /db2 ext3 discard,defaults,[NOFAIL] 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/disk/by-id/google-example-instance-db2-dbsid` /db2/[DB_SID] ext3 discard,defaults,[NOFAIL] 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/disk/by-id/google-example-instance-db2-log-dir` /db2/[DB_SID]/log_dir ext3 discard,defaults,[NOFAIL] 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/disk/by-id/google-example-instance-db2-dump` /db2/[DB_SID]/db2dump ext3 discard,defaults,[NOFAIL] 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/disk/by-id/google-example-instance-db2-sapdata` /db2/[DB_SID]/sapdata ext3 discard,defaults,[NOFAIL] 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/disk/by-id/google-example-instance-db2-saptmp` /db2/[DB_SID]/saptmp ext3 discard,defaults,[NOFAIL] 0 2 | sudo tee -a /etc/fstab
    

    where [NOFAIL] is the option that specifies what the system should do if it is unable to mount this disk.

  2. Use the cat command to verify that your /etc/fstab entries are correct:

    cat /etc/fstab
    

If you detach this persistent disk or create a snapshot from the boot disk for this instance, edit the /etc/fstab file and remove the entry for this persistent disk. Even with the nofail option in place, keep the /etc/fstab file in sync with the devices that are attached to your instance and remove these entries before you create your boot disk snapshot.

Formatting and mounting drives with LVM

To format and mount a single disk with logical volumes for all required drives by using LVM:

  1. Make sure the disk you have created for your drives is large enough to provide all volumes with the storage that they require. For example, in the following procedure, the size specified for the disk is 100 GB.

  2. Run pvscan to scan all disks for physical volumes:

    sudo mkdir -p /db2
    sudo mkdir -p /db2/[DB_SID]
    sudo mkdir -p /db2/[DB_SID]/log_dir
    sudo mkdir -p /db2/[DB_SID]/db2dump
    sudo mkdir -p /db2/[DB_SID]/sapdata
    sudo mkdir -p /db2/[DB_SID]/saptmp
    
  3. Initialize the disk or a partition for use by LVM:

    pvcreate /dev/sdb
    
  4. Create a volume group:

    vgcreate vg_db2 /dev/sdb
    
  5. Create logical volumes for each drive, using the sizes you need:

    lvcreate -L 8G -n db2 vg_db2
    lvcreate -L 8G -n db2dbsid vg_db2
    lvcreate -L 8G -n db2logdir vg_db2
    lvcreate -L 8G -n db2dump vg_db2
    lvcreate -L 8G -n db2saptmp vg_db2
    lvcreate -L 50G -n db2sapdata vg_db2
    
  6. Format the volumes. If you are using Db2 V11.1, either the xfs or ext4 file system is recommended, because both support the fast preallocation file system feature. Db2 V10.5 does not support xfs or ext4. The following commands format each volume with a single ext3 file system and no partition table:

    mkfs -t ext3 /dev/vg_db2/db2
    mkfs -t ext3 /dev/vg_db2/db2dbsid
    mkfs -t ext3 /dev/vg_db2/db2logdir
    mkfs -t ext3 /dev/vg_db2/db2dump
    mkfs -t ext3 /dev/vg_db2/db2saptmp
    mkfs -t ext3 /dev/vg_db2/db2sapdata
    
  7. Create a mount point:

    mkdir /db2
    
  8. Mount the file systems to the mount point:

    sudo mount -o discard,defaults /dev/vg_db2/db2dbsid /db2/[DB_SID]
    mkdir /db2/[DB_SID]/log_dir
    sudo mount -o discard,defaults /dev/vg_db2/db2logdir /db2/[DB_SID]/log_dir
    mkdir /db2/[DB_SID]/db2dump
    sudo mount -o discard,defaults /dev/vg_db2/db2dump /db2/[DB_SID]/db2dump
    mkdir /db2/[DB_SID]/saptmp
    sudo mount -o discard,defaults /dev/vg_db2/db2saptmp /db2/[DB_SID]/saptmp
    mkdir /db2/[DB_SID]/sapdata
    sudo mount -o discard,defaults /dev/vg_db2/db2sapdata /db2/[DB_SID]/sapdata
    

The resulting drives will look something like this:

    Filesystem             1K-blocks    Used  Available  Use%  Mounted
    ...                          ...
    dev/mapper/vg_db2-db2    8378368   32976    8345392    1%  /db2
    dev/mapper/vg_db2-db2    8378368   33024    8345344    1%  /db2/[DB_SID]
    dev/mapper/vg_db2-db2   52403200   32976   52370224    1%  /db2/[DB_SID]/sapdata
    dev/mapper/vg_db2-db2    8378368   32976    8345392    1%  /db2/[DB_SID]/saptmp
    dev/mapper/vg_db2-db2    8378368   32976    8345392    1%  /db2/[DB_SID]/log_dir
    dev/mapper/vg_db2-db2    8378368   32976    8345392    1%  /db2/[DB_SID]/db2dump
  1. Optionally, you can add the persistent disk to the /etc/fstab file so that the device automatically mounts again when the VM restarts.

When you specify the entry /etc/fstab file, be sure to include the nofail option so that the instance can continue to boot even if the disk is not present. For example, if you take a snapshot of the boot disk and create a new instance without any persistent disks attached, the instance can continue through the startup process and not pause indefinitely.

  1. Create the /etc/fstab entry. Use the blkid command to find the UUID for the file system on the device and edit the /etc/fstab file to include that UUID with the mount options. You can complete this step with a single command for each disk drive:

    echo UUID=`sudo blkid -s UUID -o value /dev/vg_db2/db2` /db2 ext3 discard,defaults,nofail 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/vg_db2/db2dbsid` /db2/[DB_SID] ext3 discard,defaults,nofail 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/vg_db2/db2logdir` /db2/[DB_SID]/log_dir ext3 discard,defaults,nofail 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/vg_db2/db2dump` /db2/[DB_SID]/db2dump ext3 discard,defaults,nofail 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/vg_db2/db2saptmp` /db2/[DB_SID]/saptmp ext3 discard,defaults,nofail 0 2 | sudo tee -a /etc/fstab
    echo UUID=`sudo blkid -s UUID -o value /dev/vg_db2/db2sapdata` /db2/[DB_SID]/sapdata ext3 discard,defaults,nofail 0 2 | sudo tee -a /etc/fstab
    

    where [NOFAIL] is the option that specifies what the system should do if it is unable to mount this disk.

  2. Use the cat command to verify that your /etc/fstab entries are correct:

    cat /etc/fstab
    

If you detach this persistent disk or create a snapshot from the boot disk for this instance, edit the /etc/fstab file and remove the entry for this persistent disk. Even with the nofail option in place, keep the /etc/fstab file in sync with the devices that are attached to your instance and remove these entries before you create your boot disk snapshot.

Windows

After you have connected to your Windows VM, format your disks so that you can begin using them. You also configure the Windows pagefile in the following steps:

  1. From the Start menu, search for and open the Server Manager.
  2. Select File and Storage Services and then select Disks.

    Server Manager

  3. In the Disks dialog box, right-click the first non-MBR disk, and then select New Volume.

  4. Proceed with the defaults and enter a disk label.
  5. When you get to the file-system-settings step, change the Allocation unit size to a value from the following list:

    • Database disks: 32 KB
    • Pagefile: 8 KB
    • Other disks: default of 4 KB.
  6. Enter a volume label that describes the disk with a meaningful name.

    New Volume Wizard

  7. Repeat the above steps for each additional disk.

Preparing the operating system

After you format and mount your disk drives, prepare your operating system.

Linux

After you have created your VM, consult the relevant SAP notes on installation and ensure that your system includes the software components specified:

Windows

Installing the database server

Now that your operating system is configured, you can install your IBM Db2 database server.

For guidance on installing SAP NetWeaver with IBM Db2, see the installation guide that is specific to your SAP NetWeaver system.

Linux

To install IBM Db2 on your VM:

  1. Establish an SSH connection to your Linux-based VM.
  2. Download or copy the complete SAP media set for Db2 to your VM. You can download the SAP media set from the SAP support portal.
  3. Install the IBM Db2 database server with the SAP Software Provisioning Manager.
  4. Install your IBM Db2 license file. For more information about installing a Db2 license that you obtained from SAP, see SAP Note 816773 - DB6: Installing an SAP OEM license.

Windows

To install IBM Db2 on your VM:

  1. Use RDP or Windows PowerShell to connect to your Windows-based VM.
  2. Download or copy the complete SAP media set for Db2 to your VM. You can download the SAP media set from the SAP support portal.
  3. Install the IBM Db2 database server.
  4. Install your IBM Db2 license file. For more information about installing a Db2 license that you obtained from SAP, see SAP Note 816773 - DB6: Installing an SAP OEM license.

Performing post-deployment tasks

Before using your IBM Db2 instance, we recommend that you perform the following post-deployment steps:

  1. Update your IBM Db2 software with the latest patches, if available.
  2. Install any additional components.
  3. Configure and back up your new IBM Db2 database.

For additional post-deployment guidance, see the Post-installation Tasks section of the installation guide that applies to the SAP system that you are using with IBM Db2.

Troubleshooting

This section contains information about how to correct common issues.

Troubleshooting connecting to your VM

If you are having issues connecting to your VM through SSH, ensure that you have created a firewall rule to open port 22 on the GCP network you are using.

For other possible issues, see Known issues for SSH from the browser.

Was this page helpful? Let us know how we did:

Send feedback about...