You can change the wrapper that you use to access a data
source after you upgrade. You might change a wrapper when you want
to upgrade for new wrapper functionality.
About this task
Version 8.1 supported more than one wrapper for some data
sources, such as the SQLNET and NET8 wrappers for Oracle data sources
and the DBLIB and CTLIB wrappers for Sybase data sources. Since version
8.2 to today, the SQLNET wrapper is not supported for Oracle data
sources and the DBLIB wrapper is not supported for Sybase data sources.
You can change the wrapper by either reissuing all the
SQL statements manually, or you can use the db2look command
to obtain the correct syntax necessary for each data source configuration
statement.
Tip: The db2look command generates DDL statements from the metadata
in the Db2®
catalogs. If you use the db2look command, you can edit the statements with your
specific information.
Procedure
- Run the db2look command to create the
necessary DDL statements. For example:
db2look -d database_name -wrapper wrapper_name -e -o federated.sql
This
command creates an output file named
federated.sql that
contains the DDL statements for all the federated objects of the wrapper
that you specify.
- Edit the SQL statement in the federated.sql file
to specify the new wrapper information.
- If the wrapper that you plan to drop accesses remote tables
that you created by using transparent DDL, create nicknames again
for the remote tables. You can add the SQL statements for these nicknames
to the federated.sql file.
- Drop the wrapper.
- Register the new wrapper with the federated database.
- Add the client paths to the db2dj.ini file:
- Edit the db2dj.ini file to include
the client paths for the data source that you are using.
-
For all wrappers except for the Sysbase CTLIB, ODBC, and JDBC wrappers, issue the
djxlink script to create new libraries in the Db2 installation
directories.
- Issue the db2stop command.
- Issue the db2iupdt command to update
your instances.
-
Issue the db2start command to restart the Db2 instance.
- Issue the SQL statements in the federated.sql file
to configure access to the data source.
For example:
db2 -tvf federated.sql
- Bind any application packages that were invalidated when
you dropped the wrapper. Packages that can be invalidated contain
static SQL that references nicknames that were dropped and recreated.
- Recreate any federated views that were invalidated when
you dropped the wrapper. Views that were invalidated are the views
that reference nicknames that were dropped and recreated.