Once you have created a DB2® pureScale® instance, you must create the file systems for the database directories and log files, before you create a database.
You must have a list of storage paths that are connected to the hosts in the cluster. The disk cannot be currently used by any other file system on any host with connectivity to this disk. To perform this task, you must either own the disks and have read and write access to them, or be the DB2 cluster services administrator.
Once the file system has been created by the db2cluster command, the file system is mounted and available for usage on the local host. The instance owner has immediate read and write access to the file system. If a root user created the file system, there are no disk ownership checks.
ls -l /dev/hdisk3 /dev/hdisk4 /dev/hdisk5 /dev/hdisk6
brw------- 1 db2inst1 system 17, 12 Nov 11 10:39 /dev/hdisk3
brw------- 1 db2inst1 system 17, 14 Nov 11 10:39 /dev/hdisk4
brw------- 1 db2inst1 system 17, 12 Nov 11 10:39 /dev/hdisk5
brw------- 1 db2inst1 system 17, 14 Nov 11 10:39 /dev/hdisk6
The
DBA creates the file systems for the database: db2cluster -create -filesystem mydb2database -disk /dev/hdisk3,/dev/hdisk4 \
-mount /db2fs/mydb2database
Next, the DBA creates
the file systems for the log files: db2cluster -create -filesystem mydb2logs -disk /dev/hdisk5,/dev/hdisk6 \
-mount /db2fs/mydb2logs
mount | grep mydb2database
/dev/mydb2database /db2fs/mydb2database mmfs rw,mtime,atime,dev=mydb2database
If the file system was successfully mounted, the DBA can
check the amount of space on the file system:df /db2fs/mydb2database
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/mydb2database 1048576000 739581952 30% 263665 52% /db2fs/mydb2database
db2 create database testdb1 on /db2fs/mydb2database dbpath on /db2fs/mydb2logs
Once the file systems for the database directory and log directories are created, you can create a database. If the root user created the file system, the root user is required to create a directory (or change the ownership of the current mount point directory), so the instance owner has access to the file system.