Verifying Db2 installation using the command-line processor (CLP)

You can verify that Db2® is successfully installed using the command-line processor (CLP).

To verify that Db2 is installed using the command line processor, complete the following steps:

  1. Log on to the system as a user with SYSADM authority.
  2. Enter db2start to start the database manager.

    In operating systems such as AIX® and Linux®, you must source the db2profile before you run the db2start command. For more information about sourcing the profile, go to the IBM Spectrum® Control Knowledge documentation and search for Using the command line on AIX and Linux.

  3. Enter the db2sampl command to create the SAMPLE database.
    This command might take a few minutes to process. There is no completion message. When the command prompt returns, the process is complete. The SAMPLE database is automatically cataloged with the database alias SAMPLE when it is created.
  4. Enter the following commands in a Db2 command window to connect to the SAMPLE database, retrieve a list of all the employees who work in Department 20, and reset the database connection:
    db2 connect to sample
    db2 "select * from staff where dept = 20"
    db2 connect reset 
  5. After verifying the installation, remove the SAMPLE database to free up disk space.
    For more information about verifying Db2 installation, refer to the Db2 documentation for your operating system.
  6. Enter db2 drop database sample to drop the SAMPLE database.