paperlined.org
apps > db2
document updated 2 years ago, on Jun 11, 2022

'db2' the command-line tool

Before you can use it, you have to source the db2profile script into your shell.

From the shell command-line, do this:

To list all tables, sorted by number of records:

db2 "SELECT tabschema CONCAT '.' CONCAT tabname AS table_name, card AS rows FROM syscat.tables ORDER BY card"

'db2' the command-line tool, reference

If you've started it in interactive mode, you can simply type ? for help.