- Log on to the system with a user account that belongs to the Local
Administrators group.
-
Create an instance on the DB2 server using the db2icrt
command. This instance will contain a database, that you will create,
where tables containing columns of the DATALINK data type will reside.
For more information, refer to the Administration
Guide.
In our example, we will create an instance called VALIDATE by
entering the following command:
db2icrt validate
- Log out.
- Log on to the system with a valid DB2 user ID that has System
Administrative (SYSADM) authority on the VALIDATE instance that you
created. By default, any user that belongs to the Local
Administrators group has SYSADM authority on an instance. For
more information, refer to your server's Quick Beginnings
manual.
- Ensure that the VALIDATE instance is the current instance by
entering the following command:
db2 get instance
This command should return the following output:
The current database manager instance is: VALIDATE
If you did not receive this output, enter the following commands:
set DB2INSTANCE=VALIDATE
db2 get instance
- Set the DATALINKS database manager configuration parameter to YES
in the VALIDATE instance's configuration file by entering the
following command:
db2 update dbm cfg using datalinks yes
To disable DB2 Data Links Manager functionality on your DB2 server, set the
DATALINKS database manager configuration parameter to no.
- Start the VALIDATE instance by entering the db2start
command.
Note: | If you change a setting in an instance's database manager configuration
file, you must ensure that you stop and restart the instance (using the
db2stop and db2start commands) for the changes to take
effect. In our example, we had not started the VALIDATE
instance and that is why we only issued the db2start
command. For more information, refer to the Administration Guide.
|
- Create a database using the db2 create database command.
This database will contain a table using the DATALINK data type. For
more information on the db2 create database command, refer to the
Command Reference.
For our example, create a database called STAFF by entering the
following command:
db2 create database staff
- Connect to the STAFF database by entering the following
command:
db2 connect to staff
- Create a table called EMPLOYEE, in the STAFF
database that you just created, that has a column defined with a
DATALINK data type by entering the following command:
db2 "create table employee (id int, fname varchar(30), lname varchar(30),
picture datalink linktype url file link control integrity all
read permission db write permission blocked recovery yes on
unlink restore)"
- Terminate all connections to this database by entering the following
command:
db2 connect reset
- Log out.