After creating a test environment on the DB2 UDB server, we must create a test environment on the DB2 Data Links server.
There are four sub-tasks involved in creating the test environment on the Data Links server:
You can choose to create a Journaled File System (JFS) or a DCE-DFS file system to test your Data Links Manager installation.
To create a JFS on the DB2 Data Links server:
mount = false vfs = dlfs
nodename = -
Note: | You must ensure that there are no blank spaces after the null character (-) for this entry. |
options = rw,Basefs=jfs
/usr/lpp/db2_07_01/instance/dlfmfsmd dlfm_mountpoint
where dlfm_mountpoint is the mount point of the JFS file system you are using.
For our example, enter the following command:
/usr/lpp/db2_07_01/instance/dlfmfsmd /test
To create a DCE-DFS file system on the DB2 Data Links server:
mklv -y aggregate_name -t aggregate_type lfs rootvg 1
where aggregate_name represents the name of the logical volume, aggregate_type represents the aggregate type, rootvg represents the logical volume type, and 1 represents the number of logical partitions.
newaggr -aggregate /dev/dmtest -block 8192 -frag 1024 -overwrite
where /dev/dmtest represents the aggregate name, given as a device file. Note that if this aggregate name already exists, the -overwrite option will delete all data in the aggregate.
mkdfslfs -d /dev/dmtest -n dmtest
where /dev/dmtest is the device name for the aggregate.
mkdfslfs -f dmtest1.ft -m /:/dmtest/dmtest1 -n dmtest
where /:/dmtest/dmtest1 represents the mountpoint in the DFS namespace and dmtest represents the name of the aggregate.
Note: | You must have a valid dce_login and the authority to create directories in the DFS namespace. |
# blkdev aggname aggtype aggid [UFS fsid] /dev/aggrdev1 aggrname1 lfs 1 /dev/aggrdev2 aggrname2 lfs 2
Change aggtype to dmlfs for all aggregates that are to be brought under Data Links control. Save and close the file.
Notes:
dmaggr -aggregate name [{-on | -off}] [{-needapp | -noneedapp}] [-help]
We recommend you always use the -needapp option when running this command.
dlfm add_prefix prefix_path
where prefix_path is the location of the file system that is under the control of a DLFF.
dlfm add_prefix for dfs rwpath prefix_path
This command specifies a read-only path for DCE-DFS.
dlfm add_prefix for dfs rwpath prefix_path localpath local_mount_point
where local_mount_point represents the native file system mount point of the prefix. The native file system mount point can be used to improve the performance of the archival and retrieval of files. For more information, see Performance Enhancements for Disk Backup in the DFS Environment.
Note: | You must issue all dlfm add_prefix commands from the node on which the DFS fileset resides. After issuing this command, you must issue a dlfm start command on the same node. |
To register our /test filesystem with the Data Links File Filter:
. INSTHOME/sqllib/db2profile (for bash, Bourne or Korn shell) source INSTHOME/sqllib/db2cshrc (for C shell)
where INSTHOME is the home directory of the instance owner.
If the Data Links File Manager back-end processes started successfully and are running, you will receive output similar to the following:
PID PPID PGID RUSER EUSER ETIME COMMAND 7624 49852 55994 dlfm dlfm 02:44 dlfmd 49852 1 55994 dlfm dlfm 02:44 dlfmd
·
·
·
56510 49852 55994 dlfm root 02:44 dlfm_chownd
lsfs -v dlfs
For our example, this command should return output similar to the following:
Name Nodename Mount Pt VFS Size Options /dev/dllv - /test dlfs -- rw,Basefs=jfs /dev/lv04 - /dlinks2 dlfs -- rw,Basefs=jfs
To verify that a DFS file server is under the control of a DLFF, enter the following command:
dfsexport | grep dmlfs
The output from this command should be similar to the following:
/dev/dlfs_test dlfs_test dmlfs 4
dlfm add_prefix prefix_path
where prefix_path is the location of the file system that is under the control of a DLFF.
For our example, register the Data Links server to use the Data Links Filesystem Filter on the test file system by entering the following command:
dlfm add_prefix /test
To update an existing prefix, enter the following command:
dlfm update_prefix prefix_path for dfs localpath local_mount_point
To register a new database with the Data Links File Manager:
dlfm add_db database instance hostname
where:
In our example, we will register a database called STAFF, which resides in the VALIDATE instance on a DB2 UDB server with a fully qualified hostname of db2server.services.com, by entering the following command:
dlfm add_db staff validate db2server.services.com
You should not specify the DLFM_DB when you run this command. The DLFM_DB is a local database that is used to keep track of files that are under the control of the Data Links File Manager.
To create a sample file:
mkdir filesystem_name/directory_name
where:
The DB2 Data Links Manager Administrator should never be the owner of any files or directories which are in a file system under the control of a Data Links Filesystem Filter.In our example, we will create the directory called pictures, on the file system /test, by entering the following command:
mkdir /test/pictures
chmod 777 /test/pictures
echo "This is a picture of Paul Smith." > /test/pictures/psmith.bmp
The sample file psmith.bmp is a text file, not a bitmap as the .bmp extension implies. For the purpose of verifying your installation, this file represents an employee's picture that was inserted into a table that was defined with the DATALINKS data type.