Starting CLPPlus from the Db2 Warehouse host container

Command line processor plus (CLPPlus) provides a command-line user interface that you can use to define, edit, and run statements, scripts, and commands. It is included in the Db2® Warehouse container, but you need root authority to use it.

Before you begin

You can install the CLPPlus client by using the Db2 driver package. For instructions, see Starting a CLPPlus client session.

For details on syntax and usage, see CLPPLUS command topic.

About this task

You cannot pass parameters on the command line.

You must have root authority to perform this task.

Procedure

  1. To start a CLPPlus session, issue the following command from the container host command line:
    docker exec -it Db2wh clpplus
  2. Provide the connection string to connect to the database:
    connect username/password@localhost:50000/bludb

Results

The CLPPlus prompt (SQL>) is available, and you are connected to the specified database.

If you are loading data into your Db2 Warehouse database via CLPPLus, you first need to copy the files to the /mnt/clusterfs/scratch directory, and then specify them in the command using the path /mnt/bludata0/scratch.

Example

User Someuser wants to use a script b.sql to automate the loading of data via CLPPlus.
  1. Someuser copies b.sql to /mnt/clusterfs/scratch.
    cp /home/someuserscripts/b.sql /mnt/clusterfs/scratch/
  2. Someuser initiates the CLPPlus session.
    docker exec -it Db2wh clpplus
  3. Someuser connects to the database and specifies the script.
    connect someuser/Db2wh@localhost:50000/bludb @/mnt/bludata0/scratch/b.sql

What to do next

To end the CLPPLus session, issue the EXIT or QUIT CLPPlus command.