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
Import and Configure Volume Group
The procedure outlined below shows how to import and configure volumes created from FlashArray snapshots.
As root user, invoke configuration manager to configure new devices (LUNs).
cfgmgr -v
List physical volumes.
lspv
The example below shows hdisk10 and hdisk12 not belonging to any volume groups.
Import the volume group. Please note that importvg command requires only one physical volume to import the volume group. Any additional volume group physical volumes (members) will be automatically included by importvg command. Upon the successful import the volume group will be activated automatically.
importvg -y VolumeGroup PhysicalVolume
Example:
importvg -y vgdb2 hdisk10
Verify that all physical volumes have been included in the volume group.
lspv
The example below shows hdisk10 and hdisk12 belonging to vgdb2 volume group.
Check volume group members.
lsvg -p VolumeGroup
Example:
lsvg -p vgdb2
Check logical volumes.
lsvg -l VolumeGroup
Example:
lsvg -l vgdb2
The example below shows fslv00 logical volume and its /db2 mount point.
Add the mount point and make the necessary entries to /etc/filesystems. This should now reflect the file system on the newly imported volume group and logical volume.
Example:
/db2:
dev = /dev/fslv00
vfs = jfs2
log = /dev/loglv00
mount = true
check = false
options = rw
account = false
Mount the logical volume.
Example:
mount /db2
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.
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 regarding AIX and FlashArray refer to the FlashArray Cloning for IBM AIX Filesystem white paper.