Section 6.4. Configuring Database Connections Using the Configuration Assistant


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.

NOTE

You 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.

Table 6.9. The Parameters That Control Discovery at the Server

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.


Table 6.10 shows the parameter that controls DB2 Discovery at the client.

Table 6.10. The Parameter That Controls Discovery at the Client

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.


By default all the instances and databases of a database server are visible to all clients using the CA. If you have security concerns, you can control the level of visibility by modifying the values of these parameters. For example, if you set DISCOVER_ INST=DISABLE at the instance level, then the instance and all its databases will not be visible by clients who try to discover them using the CA.

Figure 6.16 shows an example of a database server with two instances and different values for the parameters affecting DB2 discovery.

Figure 6.16. Discovery hierarchy


In Figure 6.16, the client can use the CA to see the database server because DISCOVER is set to SEARCH in the server's DAS. The client can see instance 2 but not instance 1. In instance 2, the client can see database B but not A.

The DAS on the server also needs to have the parameter DISCOVER_COMM set to TCP/IP, which is the only protocol the discovery method supports.

NOTE

The DAS on each DB2 server you want to locate using Discovery must be configured and running.


The procedure to add a database connection using the discovery method in the CA is:

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


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


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


4.

You have two choices to add the new system.

  • To use the search discovery method, double-click on the Other systems (Search the network) folder. The CA will then search for and display all database servers that have Discovery enabled on the system.

  • To use the known discovery method, click on the Add System button. This displays the Add System window (see Figure 6.19). Enter the information as required. The Node Name and Comment fields are optional.

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


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


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


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 shows the window after testing a successful connection.

Figure 6.24. Test connection result window


The CA automatically updates the node directory and database directory, as shown in Figure 6.25. Note that the node name is an arbitrary name chosen by the CA.

Figure 6.25. Updated node directory and database directory


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.

  • All creates a profile that contains all of the databases cataloged on the system. In addition, the profile includes specific information about the system, such as the DB2 registry variables and Database Manager Configuration.

  • Database Connections creates a profile that contains only the database catalog information.

  • Customize lets you select specific databases that are cataloged on the system.

Figure 6.26. Exporting an access profile using the CA


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 window


3.

From the Available database aliases list, choose the database(s) for which you would like to export the connection information. Then click the > button to transfer it to the Selected database aliases list.

4.

Enter a file name for the access profile.

5.

If you want to export specific information about the system, such as DBM Configuration parameters or the DB2 registry, you can do so by checking the boxes beside each option.

6.

Click the Export 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


There are two options when importing a profile.

  • All imports all of the configuration information from a given profile.

  • Customize lets you select the information you would like to import.

2.

If you choose Customize, the window shown in Figure 6.30 is displayed.

Figure 6.30. The Customize Import Profile window


3.

Enter the name of the access profile you would like to import and click the Load button.

This loads the information in the profile into the Items available for import section of the window. You can choose the database(s) you want from the Available database aliases list and transfer it to the Selected database aliases list.

4.

If the profile contains information such as DBM configuration parameters, the DB2 registry, or CLI parameters, the corresponding checkboxes will be available. You can click the checkbox for each to import that information as well. In Figure 6.30 they are grayed out because they are not contained in the access profile.

5.

Click the Import 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


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


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.

Table 6.11. Information Required in the Add Database Wizard for the Communication Protocol

Communication Protocol

Information Required

NetBIOS

Server workstation name and adapter number

Named Pipes

Server computer name and instance name

APPC

Server symbolic destination name


Figure 6.34. Add Database WizardSpecify TCP/IP communications parameters


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


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


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


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


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




Understanding DB2(R. Learning Visually with Examples)
Understanding DB2: Learning Visually with Examples (2nd Edition)
ISBN: 0131580183
EAN: 2147483647
Year: 2004
Pages: 313

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net