12/11/2008

Install DB2 on Fedora8

If you are about to install DB2 on Fedora 8 or other linux platform , maybe this entry is worth reading.
When you use root user to install the DB2 database, you 'll find it does not take your much efforts to install it successfully. But if you intend to use the normal user to install DB2 in your home directory, there are somethings needed to be configured.
1. Enable DB2 Authentication using local operating system security and reserve the remote connection
When you installed DB2 in the home dir of normal user , you will find there is no security authentication . And the remote connection also does not work. To enable this , create a configuration file and execute db2rfe command.
Under /sqllib/instance directory , there is shell script named db2rfe. The comment for this command gives the clue it is to check system before installation. Do not know if it needs some update. At least I used it to set my db2 instance attribute.
Write the following configuration file for this db2ref script and save it as file db2ref.cfg:
** ============================================================================
INSTANCENAME=jimma
** This is required keyword.
** ----------------------------------------------------------------------------
** Enable DB2 High Availability (HA) feature
** ----------------------------------------------------------------------------
** Valid value is NO and YES. Change to YES if you need to enable this feature.
ENABLE_HA=YES
** ------------------------------------------------------------------------------
** ENABLE DB2 Authentication on the server using local operating system security.
** ------------------------------------------------------------------------------
** Valid value is NO and YES. Change to YES if you need to enable this feature.
ENABLE_OS_AUTHENTICATION=YES
** --------------------------------------------
** Reserve DB2 remote connection service entry
** --------------------------------------------
** Valid value is NO and YES. Change to YES if you need to do the reservation.
** If SVCENAME and/or SVCEPORT are defined and valid, the DB2 database manager
** configuration will be updated accordingly.
RESERVE_REMOTE_CONNECTION=YES

After db2rfe is executed, you will find you can use "db2 connect sample using sampleuser" to connect your database.
The remote service port also takes effect , you can use a JDBC client to connect the database you created.

2. Change the service port
Use the normal user install DB2, you may find the service port is not common used 50000. Use this command to change it :
db2 update dbm cfg using SVCENAME 50000, restart db2 instance .

After follow this two steps, the db2 works fine to be connected with a remote java client .

No comments:

Post a Comment