Connecting to your Amazon 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
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
-
Run
./db2_install
. -
Run
clientInstallDir/instance/db2icrt -s client
instance_name
. Replaceinstance_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
-
Review the command syntax. In the following example, replace
clientDir
with the location where the client is installed.cd
clientDir
/bin ./clpplus -h -
Configure your Db2 server. In the following example, replace
dsn_name
,database_name
,endpoint
, andport
with the DSN name, database name, endpoint, and port for your RDS for Db2 DB instance. For more information, see Finding the endpoint of your Amazon RDS for Db2 DB instance.db2cli writecfg add -dsn
dsn_name
-databasedatabase_name
-hostendpoint
-portport
-parameter "Authentication=SERVER_ENCRYPT" -
Connect to your RDS for Db2 DB instance. In the following example, replace
master_username
anddsn_name
with the master username and DSN name../clpplus -nw
master_username
@dsn_name
-
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
-
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>