Linux Target Host

IBM

Audience
Public
Product
FlashArray
Technology Integrations
IBM
Source Type
Documentation

Linux supports multiple file systems and logical volume management. While the use of Logical Volume Manager (LVM) is optional, two cases are described:

The DB2 Server installation and DB2 instance creation are identical regardless of the disk management method.

Install DB2 Server

The DB2 Server must be installed on the target host before the the instance and database are created. For DB2 Server installation instructions see IBM Knowledge Center.

Create DB2 Instance

The DB2 instance must exist before the database is mounted on the target host. The basic command syntax and examples are provided below. For additional details and options consult IBM Knowledge Center.


db2icrt -u FenceUser instance

Example:


db2icrt -u db2fenc1 db2inst1

Direct Disk Management (no LVM)

As root user, invoke rescan-scsi-bus.sh script - see manual page (man rescan-scsi-bus.sh). This script is available as a part of sg3-utils package.

Example:


/usr/bin/rescan-scsi-bus.sh

Obtain the device name for the new disk.


fdisk -l

Example:

The new disk is /dev/sdb.

Create a mount point and mount the new disk (/dev/sdb).

Example:


mount /dev/sdb /tbs1

Optionally edit /etc/fstab to mount the new volume automatically upon the system boot.

If the instance owner user ID on the target is not the same instance owner user ID on the source system, it will be necessary to change the owner and group of the imported file system.

Logical Volume Management (LVM)

As user root invoke rescan-scsi-bus.sh script - see manual page (man rescan-scsi-bus.sh). This script is available as a part of sg3-utils package.

Example:


/usr/bin/rescan-scsi-bus.sh

Scan all disks using pvscan command. Depending on the Logical Volume Manager configuration the newly detected physical volumes and volume group may be automatically activated - see /etc/lvm/lvm.conf file.

To show only active volume groups:


vgdisplay -A

The <instance_home>/sqllib/db2nodes.cfg file may need to be modified to reflect the different hostname or IP address of the DB2 node.

As an instance owner start the database server (db2start) and catalog database.


db2 catalog database-name on drive

Example:


db2 catalog db tpcc on /db2/

Activate or connect to the database.


db2 activate database database-alias user username
db2 connect to database-alias user username

Example:


db2 connect to tpcc1 user db2inst1

For additional details refer to Linux Recommended Settings articles.