Connecting to your RDS for Db2 DB instance with IBM CLPPlus - Amazon Relational Database Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Connecting to your RDS for Db2 DB instance with IBM CLPPlus

You can use a utility such as IBM CLPPlus to connect to an Amazon RDS for Db2 DB instance. This utility is part of IBM Data Server Runtime Client. To download the client from IBM Fix Central, see IBM Data Server Client Packages Version 11.5 Mod 8 Fix Pack 0 in IBM Support.

Important

We recommend that you run IBM CLPPlus on an operating system that supports graphical user interfaces such as macOS, Windows, or Linux with Desktop. If running headless Linux, use switch -nw with CLPPlus commands.

Installing the client

After downloading the package for Linux, install the client.

Note

To install the client on AIX or Windows, follow the same procedure but modify the commands for your operating system.

To install the client on Linux
  1. Run ./db2_install.

  2. Run clientInstallDir/instance/db2icrt -s client instance_name. Replace instance_name with a valid operating system user on Linux. In Linux, the Db2 DB instance name is tied to the operating system username.

    This command creates a sqllib directory in the home directory of the designated user on Linux.

Connecting to a DB instance

To connect to your RDS for Db2 DB instance, you need its DNS name and port number. For information about finding them, see Finding the endpoint. You also need to know the database name, master username, and master password that you defined when you created your RDS for Db2 DB instance. For more information about finding them, see Creating a DB instance.

To connect to an RDS for Db2 DB instance with IBM CLPPlus
  1. Review the command syntax. In the following example, replace clientDir with the location where the client is installed.

    cd clientDir/bin ./clpplus -h
  2. Configure your Db2 server. In the following example, replace dns_name, database_name, endpoint, and port with the DNS name, database name, endpoint, and port for your RDS for Db2 DB instance. For more information, see Finding the endpoint of your RDS for Db2 DB instance.

    db2cli writecfg add -dsn dns_name -database database_name -host endpoint -port port -parameter "Authentication=SERVER_ENCRYPT"
  3. Connect to your RDS for Db2 DB instance. In the following example, replace master_username and dns_name with the master username and DNS name.

    ./clpplus -nw master_username@dns_name
  4. A Java Shell window opens. Enter the master password for your RDS for Db2 DB instance.

    Note

    If a Java Shell window doesn't open, run ./clpplus -nw to use the same command line window.

    Enter password: *********

    A connection is made and produces output similar to the following example:

    Database Connection Information : --------------------------------- Hostname = database-1.abcdefghij.us-east-1.rds.amazonaws.com Database server = DB2/LINUXX8664 SQL110590 SQL authorization ID = admin Local database alias = DB2DB Port = 50000
  5. Run queries and view results. The following example shows a SQL statement that selects the database you created.

    SQL > select current server from sysibm.dual;

    This command produces output similar to the following example:

    1 -------------------- DB2DB SQL>