If you will be accessing the SAMPLE database on the server from a remote client that is
running a different version of Db2® database product, you
need to bind the database utilities to the SAMPLE database.
About this task
Binding creates the package that the database manager
needs in order to access the database when an application is executed.
Binding can be done explicitly by running the BIND command
against the bind file created during precompilation.
You bind
the database utilities differently depending on the platform of the
client workstation you are using.
Procedure
- On a Linux® or UNIX client workstation:
- Connect to the SAMPLE database by entering:
db2 connect to sample user userid using password
where userid and password are
the user ID and password of the instance where the SAMPLE database
is located.
-
Bind the utilities to the database by entering:
db2 bind BNDPATH/@db2ubind.lst blocking all sqlerror continue \
messages bind.msg grant public
db2 bind BNDPATH/@db2cli.lst blocking all sqlerror continue \
messages cli.msg grant public
where BNDPATH is the path where the bind files are located, such as
$HOME/sqllib/bnd, where $HOME is the home
directory of the Db2 instance
owner.
- Verify that the bind was successful by checking the
bind message files bind.msg and cli.msg.
- On a client workstation running a Windows operating system:
- Select .
The command window displays.
- Connect to the SAMPLE database by entering:
db2 connect to sample user userid using password
where userid and password are
the user ID and password of the instance where the SAMPLE database
is located.
-
Bind the utilities to the database by entering:
db2 bind "%DB2PATH%\bnd\@db2ubind.lst" blocking all
sqlerror continue messages bind.msg grant public
db2 bind "%DB2PATH%\bnd\@db2cli.lst" blocking all
sqlerror continue messages cli.msg grant public
where DB2PATH is the path where the Db2 database product is
installed.
- Exit the command window, and verify that the bind was
successful by checking the bind message files, bind.msg and cli.msg.
- For all clients accessing host servers, specify one of
the following
.lst
files instead of db2ubind.lst:
- ddcsmvs.lst
- for Db2 for z/OS®
- ddcsvm.lst
- for Db2 for
VM
- ddcsvse.lst
- for Db2 for
VSE
- ddcs400.lst
- for Db2 for IBM® i
For example:
If accessing a
Db2 for z/OS server
from a Linux or UNIX client, enter:
db2 bind BNDPATH/@ddcsmvs.lst blocking all sqlerror continue \
messages bind.msg grant public
If accessing
a
Db2 for z/OS server
from a Windows client, enter:
db2 bind "%DB2PATH%\bnd\@ddcsmvs.lst" blocking all
sqlerror continue messages bind.msg grant public