As part of a fix pack installation on the server, binding of
the database utilities (IMPORT, EXPORT,
REORG, the Command Line Processor) and the CLI bind files occurs
automatically.
However, if you install a fix pack on the client or an error occurs, you
can manually bind the database utilities and the CLI bind files. Different
subsets of bind files must be bound for Db2® and host or System i® database servers.
Before you begin
Ensure
that you have the necessary authority to perform the BIND command.
About this task
To
ensure that not all users have access to databases created with RESTRICTIVE mode, do not grant
privileges to PUBLIC for a database created with the RESTRICTIVE mode.If
you have existing federated databases, you must bind the
db2dsproc.bnd and
db2stats.bnd bind files after you install a
Db2 fix pack. To bind the
bind files, you must have one of the following authorities:
- DBADM authority
- ALTERIN privilege on the schema
- BIND privilege on the package
Procedure
To bind the bind files:
-
If you installed the fix pack on Db2 database products
that have existing databases, perform the following commands once for each database:
db2 terminate
db2 CONNECT TO dbname user USERID using PASSWORD
db2 BIND path\db2schema.bnd BLOCKING ALL GRANT PUBLIC SQLERROR CONTINUE
db2 BIND path\@db2ubind.lst BLOCKING ALL GRANT PUBLIC ACTION ADD
db2 BIND path\@db2cli.lst BLOCKING ALL GRANT PUBLIC ACTION ADD
db2 terminate
where
dbname represents the name of a database to which the files should be bound, and
where
path is the full path name of the directory where the bind files are
located, such as
INSTHOME\sqllib\bnd where
INSTHOME represents the home directory of the
Db2 instance.
db2ubind.lst and
db2cli.lst contain lists of required bind
files used by
Db2 database products. Packages that are already bound will return an SQL0719N error. This is
expected.
- Optional:
If you installed the fix pack on Db2 database products
that have existing databases, rebind the packages by running the REBIND or
db2rbind command.
After you install a fix pack, some packages are marked as invalid. Packages marked as invalid are
implicitly rebound the first time an application uses them. To eliminate this overhead and to ensure
that the rebind is successful, manually rebind all packages. For example, issue the
db2rbind command:
db2rbind dbname -l logfile all
where
dbname represents the name of a database whose packages are to be revalidated,
and where
logfile is the name of the file to be used for recording errors during
the package revalidation procedure.
-
If you installed the fix pack on Db2 database products
that have existing spatial-enabled databases, perform the following commands once for each
database:
db2 terminate
db2 CONNECT TO dbname
db2 BIND path\BND\@db2gse.lst
db2 terminate
where
dbname represents the name of a database to which the files should be bound, and
where
path is the full path name of the directory where the bind files are
located, such as
INSTHOME\sqllib\bnd where
INSTHOME represents the home directory of the
Db2 instance.
db2gse.lst contains the names of the bind files for the stored procedures that
Db2 Spatial
Extender provides.
-
If you connect to Db2 databases on host or
System i servers, perform the following actions:
- For Db2 for z/OS® or OS/390®:
db2 terminate
db2 CONNECT TO dbname user USERID using PASSWORD
db2 BIND path\@ddcsmvs.lst BLOCKING ALL SQLERROR CONTINUE GRANT PUBLIC ACTION ADD
db2 terminate
- For Db2
databases on
VM:
db2 terminate
db2 CONNECT TO dbname user USERID using PASSWORD
db2 BIND path\@ddcsvm.lst BLOCKING ALL SQLERROR CONTINUE GRANT PUBLIC ACTION ADD
db2 terminate
- For Db2
databases on
VSE:
db2 terminate
db2 CONNECT TO dbname user USERID using PASSWORD
db2 BIND path\@ddcsvse.lst BLOCKING ALL SQLERROR CONTINUE GRANT PUBLIC ACTION ADD
db2 terminate
- For Db2
databases on System
i:
db2 terminate
db2 CONNECT TO dbname user USERID using PASSWORD
db2 BIND path\@ddcs400.lst BLOCKING ALL SQLERROR CONTINUE GRANT PUBLIC ACTION ADD
db2 terminate
where dbname represents the name of a host or System i database to which the files should be bound, and where
path is the full path name of the directory where the bind files are located,
such as INSTHOME\sqllib\bnd where
INSTHOME represents the home directory of the Db2 instance.
-
If you connect to databases that are running on different operating systems (Linux®, UNIX or Windows) or at different Db2 versions or service
levels, bind the database utilities and CLI bind files against
those databases.
Note:
- The actions required are the same irrespective of whether you connect to a database on another
Db2 database
system or in another Db2 copy on the same
machine.
- If you have installed the fix pack in multiple locations, perform the actions once from each
unique combination of operating system and Db2 version or service
level.
Perform the following actions:
db2 terminate
db2 CONNECT TO dbname user USERID using PASSWORD
db2 BIND path\@db2ubind.lst BLOCKING ALL GRANT PUBLIC ACTION ADD
db2 BIND path\@db2cli.lst BLOCKING ALL GRANT PUBLIC ACTION ADD
db2 terminate
where
dbname represents the name of a database to which the files should be bound, and
where
path is the full path name of the directory where the bind files are
located, such as
INSTHOME\sqllib\bnd where
INSTHOME represents the home directory of the instance where you are issuing the
commands.
db2ubind.lst and
db2cli.lst contain lists of
required bind files used by
Db2 database products.
Packages that are already bound will return an SQL0719N error. This is expected.
-
If you are using a federated database, connect to the database and run the
BIND command on the db2dsproc.bnd and
db2stats.bnd bind files.
Perform the following actions:
db2 CONNECT TO dbname user USERID using PASSWORD
db2 bind path/db2dsproc.bnd blocking all grant public
db2 bind path/db2stats.bnd blocking all grant public
db2 terminate
where,
dbname represents the name of the federated database, and
path
represents the full path name of the directory where the bind files are located, such as
$HOME/sqllib/bnd where
$HOME represents
the
Db2 instance
home directory.