6.4. Configuring Database Connections Using the Configuration Assistant
If you don't feel comfortable using DB2 commands, you can use the Configuration Assistant (CA ), a graphical tool to configure connections on a client machine. The CA catalogs the DB2 directories for you.The CA's Add Database Wizard offers three methods to configure a database connection from a client machine.
- Search the network :
With this method, you do not need to know any communication-specific information about the database server, such as the TCP/IP port and database name. The CA will find that out for you using DB2's Discovery ability and will update the DB2 directories. - Use a profile :
A profile contains all the information necessary to create a connection between a client and a server. Using the information from a given profile, the CA will update the DB2 directories of the client to allow connections to the chosen database. - Manually configure a connection to a database :
You must know the specific connection information to the server, such as host name, port number, and database name. The CA will update the DB2 directories based on the information you provide.
The following sections discuss each of these methods in more detail.NOTEYou can only use the Configuration Assistant to configure connections from a client to a server. You still need to enable the server to accept client connections manually before you start using the CA to configure the client.
6.4.1. Configuring a Connection Using DB2 Discovery in the Configuration Assistant
You can perform Discovery in one of two ways.
- The search discovery method searches the network for any DB2 servers accessible by clients. You do not need to know the name of the server. The CA returns a list of valid servers and their database information. Use this method only in a small network where there are not many hubs, otherwise the search process may take a long time to complete.
- The known discovery method requires you to provide the server name you want to access, and the CA returns the instance and database information on that server.
Table 6.9 shows the parameters that control DB2 Discovery at the server and the files where they are located.
Configuration File | Parameter Name | Possible Values | Explanation |
---|---|---|---|
DAS configuration file | DISCOVER | SEARCH | The default value. Both search and known discovery can be used. |
KNOWN | Only known discovery can be used. | ||
DISABLE | Discovery method can't be used for instances. | ||
DBM configuration file | DISCOVER _INST | ENABLE | The default value. The instance can be discovered. |
DISABLE | The instance can't be discovered. | ||
Database configuration file | DISCOVER_DB | ENABLE | The default value. The database can be discovered. |
DISABLE | The database can't be discovered. |
Configuration File | Parameter Name | Possible Values | Explanation |
---|---|---|---|
DBM configuration file | DISCOVER | SEARCH | The default value. The client can issue search and known discovery requests |
KNOWN | The client can only issue known discovery requests. | ||
DISABLE | Discovery is disabled at the client. |
Figure 6.16. Discovery hierarchy

1. | Open the CA from the IBM DB2 menu or enter db2ca from a command line. Figure 6.17 shows the CA interface.Figure 6.17. The Configuration Assistant[View full size image] ![]() |
2. | The databases that are already cataloged on the client are displayed in the CA window. To add more connections, click Selected and choose Add Database Using Wizard . You will see the Add Database Wizard, shown in Figure 6.18.Figure 6.18. Add Database WizardConfiguration methods[View full size image] ![]() |
3. | Choose Search the network to use the DB2 Discovery methods. This displays the window shown in Figure 6.19. The systems the client currently knows are displayed in the Known systems folder. SYLVIA2 is the only known system to this client. If the database server you want to connect to is already in the Known systems folder, expand the tree to look for it. If the database server is not listed, you need to add it to the list.Figure 6.19. Add Database WizardAdding a system using the known discovery method[View full size image] ![]() |
4. | You have two choices to add the new system.
|
5. | Figure 6.20 shows the search result for the system name you entered. In this example, the system name is SYLVIA1 . Expand the tree to see all databases visible on this system. Select the database you want to connect to. If you do not want to specify an alias for the database and register this database as an ODBC data source, you can finish the configuration by clicking the Finish button. Otherwise, click Next .Figure 6.20. Add Database WizardNetwork search result[View full size image] ![]() |
6. | In Figure 6.21 you can specify a database alias. This is the name you will use during all connect requests. Click Finish or Next .Figure 6.21. Add Database WizardSpecify a database alias[View full size image] ![]() |
7. | In Figure 6.22, you have the choice to register this database as an ODBC data source. When you click the Finish button to complete the configuration, an Add Database Confirmation window displays. You can click Close to return to the CA main window or Test Connection to verify the connection to the database.Figure 6.22. Register database as an ODBC data source[View full size image] ![]() |
Figure 6.23 shows the window displayed if you choose to test the connection. The user ID must be valid on the database server.
Figure 6.23. Test connection to the new system

Figure 6.24. Test connection result window

Figure 6.25. Updated node directory and database directory
[View full size image]

6.4.2. Configuring a Connection Using Access Profiles in the Configuration Assistant
An access profile is a file that contains all the information necessary to create a connection between a client and a server. This process automatically catalogs the DB2 directories on the client. Use access profiles if you have many clients that need to be configured to connect to the same DB2 servers.You can obtain an access profile either from a configured client or from the server itself.
- If you have a client that has been configured to connect to DB2 servers, use this client's CA to export its configuration to the access profile file. You can then transfer this file to other clients and configure them using this information.
- You can use the server's CA to export an access profile that contains information about all the instances that have DISCOVER_INST=ENABLE in the Database Manager Configuration file and all databases that have DISCOVER_DB=ENABLE in the database configuration file. You can then transfer this access profile to clients and configure them using the information in this file.
6.4.2.1 Using the Configuration Assistant to Export an Access Profile
1. | In the Configuration Assistant, choose Configure > Export Profile . (You can also do this by using the db2cfexp command.) Figure 6.26 shows the three Export Profile options.
Figure 6.26. Exporting an access profile using the CA[View full size image] ![]() |
2. | In this example, let's select Customize . This displays the Customize Export Profile window (see Figure 6.27).Figure 6.27. The Customize Export Profile windowExport button. Figure 6.28 shows the export result. If the operation is successful, an access profile file is created in the specified directory. Figure 6.28. Export access profile result![]() |
6.4.2.2 Using the Configuration Assistant to Import an Access Profile
After you have obtained an access profile from either a client or a server, you can use this profile to configure other clients. You transfer the file over to the client you want to configure and start the CA on the client.There are two ways to import an access profile using the Configuration Assistant.
- Use the CA's Import function
- Use the CA's Add Database Wizard
6.4.2.2.1 Importing an Access Profile Using the CA's Import Profile Function
1. | In the CA, choose Configure > Import Profile as shown in Figure 6.29 (You can also do this using the db2cfimp command.)Figure 6.29. Importing the access profile using the CA[View full size image] ![]()
|
2. | If you choose Customize , the window shown in Figure 6.30 is displayed.Figure 6.30. The Customize Import Profile windowImport button and the window shown in Figure 6.31 appears. Figure 6.31. Import access profile result![]() |
If the import is successful, you now have the ability to connect to the database(s) you have chosen. The client's node directory and system database directory have been updated to include this new database.
6.4.2.2.2 Importing an Access Profile Using the CA's Add Database Wizard
You can also import the information in an access profile using the Configuration Assistant's Add Database Wizard. However, when using this method you can only add one database at a time. If you want to add multiple databases, using the Import function discussed in the previous section is a better choice.
1. | From the Select how you want to set up a connection window (shown in Figure 6.18), select Use a profile . |
2. | The window shown in Figure 6.32 appears. Enter the access profile file name and click the Load button. This loads the information from the profile into the window.Figure 6.32. Add Database WizardSelect a database from a profile[View full size image] ![]() |
3. | You can click on Next to configure an alias for the database and register the database as an ODBC data source. These steps are identical to those discussed in the previous section. If you don't click Next , click Finish to complete the configuration. |
6.4.3. Configuring a Connection Manually Using the Configuration Assistant
You can also manually configure a connection in the Configuration Assistant. Using this method, you must know the specific server connection information, such as host name, port number, and database name. The CA will update the DB2 directories based on the information you provide.
1. | In the CA, choose Selected > Add Database Using Wizard . Choose Manually configure a connection to a database (see Figure 6.18) and click Next . The window shown in Figure 6.33 appears.Figure 6.33. Add Database WizardSelect a communications protocol[View full size image] ![]() | ||||||||
2. | Select the protocol you will use to connect to the database. Also, if the database resides on a host system, check the corresponding box. Click Next . | ||||||||
3. | Enter the host name or TCP/IP address of the server and the service name or port number that the DB2 instance is using on the server, as shown in Figure 6.34. If you are using a different communication protocol, refer to Table 6.11 for the required communication information. Click Next .
Figure 6.34. Add Database WizardSpecify TCP/IP communications parameters[View full size image] ![]() | ||||||||
4. | Enter the database name, as shown in Figure 6.35. The database name in this entry corresponds to the database alias on the server. If you want, complete the optional Database alias and Comment fields. The alias is what you will use in the CONNECT statement. Click Next .Figure 6.35. Add Database WizardSpecify database name[View full size image] ![]() | ||||||||
5. | Once you have completed the screen shown in Figure 6.36, you can choose to either continue through the next screens or you can click Finish . If you continue to any of the subsequent screens, you can click Finish at any time.Figure 6.36. Add Database WizardRegister this database as a ODBC data source[View full size image] ![]() | ||||||||
6. | In the screen shown in Figure 6.37, specify the operating system and instance name on the database server. Since this information affects the behavior of the Control Center, it is important that you fill them in. Click Next .Figure 6.37. Add Database WizardSpecify the node options[View full size image] ![]() | ||||||||
7. | In Figure 6.38, enter the system name and host name. The system name is the name you want to use for the database server. If you click on the View Details button, the CA will retrieve the TCP/IP name and address information for the server. Click Next .Figure 6.38. Add Database WizardSpecify the system options[View full size image] ![]() | ||||||||
8. | In Figure 6.39, choose a security option for this connection and then click Finish . The CA will automatically update DB2 directories.Figure 6.39. Add Database WizardSpecify the security options[View full size image] ![]() |