Command descriptions and use
Commands consist of one or a few required words followed by additional keywords, options, and input parameters.
Command summary
| Command name | Command type | Use to |
|---|---|---|
get configuration repository |
Repository related | Display information about the current configuration repository |
list datastores |
Repository related | List available datastore connections |
list instances |
Repository related | List available instances |
list databases |
Repository related | List available managed databases |
set configuration repository |
Repository related | Initialize the configuration repository |
info |
Connection related | Display information about the current managed database |
| Connection related | Specify the managed database to be processed | |
set database log
level |
Connection related | Specify the database logging level. |
apply
SQL |
Action | Perform Redo/Undo SQL generated by Log Analysis |
export
report |
Action | Export Log Analysis report results |
export
SQL |
Action | Export Redo/Undo SQL generated by Log Analysis |
run
ddlmaker |
Action | Produce DDL from the schema level repository (SLR) for specified objects |
run
la |
Action | Run Log Analysis |
run
ox |
Action | Run Object Extract tool |
run slr |
Action | Run commands to create or update the SLR |
get
slr info |
Status and session | Display SLR information |
save
session |
Status and session | Preserve the specified session ID so that the related data is not deleted. The @ symbol can be used to substitute the session ID that was created by the previous run command. |
delete session |
Status and session | Release the specified saved session ID so that the session data can be deleted and the ID can be reused by a new session. |
list sessions |
Status and session | List all sessions related to the current datastore. |
delete
password |
Stored password | Deletes the specified stored password. |
generate cipher |
Stored password | Generates a key used to encrypt and decrypt stored passwords. |
list
properties |
Stored password | List stored password property names. (These are not the actual decrypted password values). |
set
password |
Stored password | Sets an encrypted password value string and a property name to call it through. |
help or ? |
Other | Display help or message details inside the command shell. |
quitor q |
Other | Exit the command shell |
Command and option details
Each command accepts a set of additional keywords, options, and input parameters that define the details of the command.
Words in the usage descriptions that are shown in plain text must be entered exactly as shown.
Words enclosed inside angle brackets (such as <connection name>) represent
replaceable parameters that are defined in each Description section.
Options inside square brackets (such as [show detail] ) can be omitted or
specified in any order on the command line.
apply SQL- Perform the Redo or Undo SQL statements that were generated by a previous Log Analysis command
that was run with the option to generate Redo or Undo SQL. The supplied session ID identifies the
Log Analysis session from which the SQL will be obtained. The ID usually relates to the immediately
previous command.
- Usage:
-
apply SQL from session <session_id> [user <user> [[password <password>] | [stored-password <property-name]]] [stoponerror] [commitscope <numoperations>] - Options:
-
numoperations- The number of operations that will occur between commits in the exported SQL file. Specify 0 (zero) to preserve the commit frequency used by the original transactions.
password- Password used with the specified user name.
If the password value that you specify matches a product keyword, then you must enclose the value in quotation marks (
"). stored-password- Enter a property name associated with a stored encrypted password value instead of a plain text
password. The command processor will use the property name to look up the stored password value to
use as part of the authentication credentials.Note: The
stored-passwordoption cannot be used in the same command as thepasswordoption. session_id- Identifies the related Log Analysis session that generated the SQL that will be applied. The
@symbol can be used to substitute the session ID that was created by the previousruncommand. stoponerror- Indicates to stop if an error is encountered when applying the SQL.
user- User name that can connect to the Db2 database (optional). If not specified, authentication parameters will be requested at time of connection.
- Example:
-
apply SQL from session @ stoponerror
delete password- Deletes the specified stored password
property-nameand corresponding value from the list of stored properties.- Usage:
-
delete password <property-name>
delete session- Release the specified saved session ID and delete the session immediately, so that the ID can be
reused by a new session. This command replaces the old
unsave sessioncommand.- Usage:
delete session <session-id-list | session-id-range>- Where:
session-id-list = <session-id> [<session-id> ...]session-id-range = <session-id1>-<session-id2>- Option:
-
session-id- Identifies the related Log Analysis session.
export report- Export a report generated by a previous Log Analysis command to a file on the local client system.
- Usage:
-
export report from session <session_id> into <directory> as <text | xml | csv> level <summary | details | full | quiet> [threshold <time>] [statisticsonly] [filename <name>] - Options:
-
- Directory
- Directory or file name in which to store the output file on the client system where the command
is run. Make sure that the base directory exists, and that you have permission to write to the
specified location. When you specify a directory, the output is stored in one of the following
default file names for exports:
- txt (report.txt)
- xml (report.xml)
- csv (ary.csv)
session_id- Identifies the related Log Analysis session that generated the SQL that will be applied. Use the
@symbol to substitute the session ID that was created by the previousruncommand. summary | details | full | quiet- These options control the content of the report file.
summary- Statistics and transaction summary only.
details- Transaction details only.
full- Statistics, summary, and transaction details.
statisticsonly- Report only the statistics totals.
quiet- Report on periods during which no active transactions were modifying a set of table spaces and tables on the selected database.
threshold- Specify the minimum length of quiet times to be included in the quiet time report.
Use the format
[[hh.]mm.]ssor#<s|m|h>, where hh and h = hours, mm and m = minutes, and s and ss = seconds. For example, 30m for 30 minutes. Hours and minutes are optional, and default to 0 if not specified.The default value, 00:30:00, indicates that only quiet times of 30 minutes or longer are included in the report. The minimum valid threshold is 1 second, 00:00:01, or 1s.
text | xml | csv- These options controls the format of the output for the exported report.
text- Human readable text format.
xml- XML format.
csv- Comma separated value file format.
Example:
export report from session@into/tmp/export1as text level summary
export SQL- Export the Redo or Undo SQL statements generated by a previous Log Analysis command to a file on
the local client system.
- Usage:
-
export SQL from session <session_id> into <path> [commitscope <numoperations>] [includeddl] [includelong] [withcomments] [filename <name>] - Options:
-
- path
- Directory or file name in which to store the output file on the client system where the command is run. Make sure that the base directory exists, and that you have permission to write to the specified location. When you specify a directory, the output is stored in ary.sql the default file name for SQL exports.
includeddl- Include DDL statements that occur with transactions in the generated Redo SQL output. DDL statements are not available when generating Undo SQL.
includelong- Include LONG and LOB column data with the exported output. If specified, the long data is written to files in the specified output directory. When using this option, it is recommended to place the output file in a new, empty directory, because many additional files might be created for the LOB data.
numoperations- The number of operations that will occur between commits in the exported SQL. Specify 0 (zero) to preserve the commit frequency used by the original transactions.
session_id- Identifies the related Log Analysis session that generated the SQL that will be applied. The
@symbol can be used to substitute the session ID that was created by the previous run command. withcomments- Include transaction comments in the output file.
Example:
export SQL from session @ into /tmp/exportSQL commitscope 1000 includeddl
generate cipher- Use this command to generate a new random encryption key that will be used to encrypt and
decrypt stored passwords. Passwords can be stored with the
set passwordcommand, and are accessed by thestored-passwordcommand option. If a previously defined cipher key is not found during command processor startup, a default key is used for encryption.- Usage:
generate cipher
get configuration repository- Displays the current configuration repository host, port, database, user ID, and connection
status (connected or invalid). The configuration repository is a database that holds information about datastores and managed databases that were added by using the browser client. To process commands, the CLP must connect to a configuration repository.
- Usage:
-
get configuration repository - Options:
- None.
get slr info- Display the SLR status information for the current managed database. This information shows whether the
SLR exists for the database, and if so, shows details
about its current state.
- Usage:
-
get slr info [user <user> [[password <password>] | [stored-password <property-name]]] - Options:
-
user- User name that can connect to the Db2 database (optional). If not specified, authentication parameters will be requested at time of connection.
password- Password used with the specified user name.
stored-password- Enter a property name associated with a stored encrypted password value instead of a plain text
password. The command processor will use the property name to look up the stored password value to
use as part of the authentication credentials.Note: The
stored-passwordoption cannot be used in the same command as thepasswordoption. - Example of command and results:
-
get slr info user user1 password passwd1SLR status: Created Database registration timestamp: 2010/09/27 14:30:25 SLR last update timestamp: 2010/09/27 14:31:00 SLR start log: S0000000.LOG SLR end log: S0000000.LOG SLR start timestamp: 2010/09/27 14:30:25 SLR end timestamp: 2010/09/27 14:31:00 SLR start LSN: 00000000010B30EC SLR end LSN: 00000000013882F5
help- To display a help summary in interactive shell mode, type
helpor?(question mark). To display additional details about a command, typehelpor?(question mark) followed by the specific command name. Type all of the words that make up the command name as shown in the command list.You can also type help or ? (question mark), followed by a product message key (for example, ARY4065E) to display a complete message description, explanation, and user response details.
- Usage:
-
help [<command_name>] ? [<command_name>] ? <message key> - Options:
-
command_name- Name of command to display help about.
- Examples:
-
?- Displays general summary help.
help export report- Displays help about the specified command.
- ? ARY4065E
- Displays complete message details for the specified message.
info- Displays the database alias, instance name, host name, and port number of the current managed database.
- Usage:
-
info - Options:
- None.
- Example of command and results:
-
info Current managed database Alias: DB1, Instance name: a91a2, Host: abc-s-def2.socketsoftware.com, Port: 50004
list databases- Displays the name, ID and the associated datastore for each managed database, grouped by
instance name.
- Usage:
-
list databases - Options:
- None.
- Example of command and output:
-
Managed databases for instance with name: Db2, Host: abc-d-090, Port: 50000 ID: 1, Name: Q1A8219, Datastore: ds_for_example Managed databases for instance with name: a92b1, Host: abc-s-def2.socketsoftware.com, Port: 50004 ID: 2, Name: DUCKY , Datastore: default_datastore ID: 4, Name: SAMPLE , Datastore: default_datastore
list datastores- List the set of currently defined datastores that are available for use by the CLP.
- Usage:
-
list datastores [show detail] - Options:
-
- show detail
- Display details about each connection.
list instances- List information about the Db2 instances in which managed
databases are located.
- Usage:
-
list instances - Options:
- None.
- Example:
-
list instances Number of instances: 2 1. Instance name: Db2, host: abc-d-090, port: 50000 2. Instance name: a92b1, host: abc-s-def2.socketsoftware.com, port: 50004
list properties- List stored password property names. Corresponding encrypted password values are shown as
asterisks, instead of showing the original clear text values.
- Usage:
-
list properties
list sessions- List all sessions related to the current datastore.
- Usage:
list sessions [current-database]- Options:
- current-database.
quitq- Exit from the command shell. The command is permitted, but not required, in the batch input file.
- Usage:
quit- Options:
- None.
run ddlmaker- Generate DDL statements for the specified database object.
- Usage:
-
run ddlmaker objecttype <table | tablespace | index | procedure | bufferpool | eventmonitor | dbpartitiongroup | schema | datatype | stogroup | function | module | sequence | variable> name [schema.]<name> serverfile <file> from <time> [specificname] [user <user> [[password <password>] | [stored-password <property-name]]] - Options:
-
file- The directory or file path name where the output will be written on the database server system.
In physically partitioned environments, the file will be located on the host computer where the
datastore connection was defined.
If an existing directory name is specified, the DDL output will be created in this directory using a file name consisting of the schema, table or other object name provided on the command. Otherwise, the specified output file will be created, if necessary, and the DDL statements will be written to the file.
objecttype- Values can
be:
table | tablespace | index | procedure | bufferpool | eventmonitor | dbpartitiongroup | schema | datatype | stogroup | function | module | sequence | variableIf you want the product to generate DDL for an object's privileges, then specify one of the following privilege type values by using the
objecttypeoption:TABLEAUTH | TABLESPACEAUTH | INDEXAUTH | VARIABLEAUTH | MODULEAUTH | PROCEDUREAUTH | FUNCTIONAUTH | SCHEMAAUTH | SEQUENCEAUTHPrivilege types
PROCEDUREAUTHandFUNCTIONAUTHrequire the addition of thespecificnameoption and the specific name of the procedure or function.ddlmakerdoes not generate routine privileges by routine name; the specific name must be used. password- Password used with the specified user name.
If the password value that you specify matches a product keyword, then you must enclose the value in quotation marks (
"). stored-password- Enter a property name associated with a stored encrypted password value instead of a plain text
password. The command processor will use the property name to look up the stored password value to
use as part of the authentication credentials.Note: The
stored-passwordoption cannot be used in the same command as thepasswordoption.
[schema].name- Identifies the name of the database object. Specify the optional schema name if needed to identify a table.
specificname- The specific name of the
CREATE PROCEDURE (SQL)statement.To generate DDL for privilege types
PROCEDUREAUTHandFUNCTIONAUTH, specify optionspecificnameand the specific name of the procedure or function. time- Timestamp that identifies the version of the object to generate DDL for in the
format:
[utc]YYYYMMDDHHMMSS[.uuuuuu]For more information, see Using timestamps.
user- User name that can connect to the Db2 database (optional). If not specified, authentication parameters will be requested at time of connection.
- Example:
-
run ddlmaker objecttype table name Db2INST1.ORG serverfile /tmp/ddl1.txt from 20100625123916
run la- Run the Log Analysis command against the specified database with options set to control the report and optional SQL that will be generated.
run ox- Run the Object Extract command against the specified
database to extract table data from a specified backup image into an output file located on the
database server. This data file can then be loaded into a database with a matching table structure
using the Db2 LOAD command.
- Usage:
-
run ox from <backuptime> format <del | ixf> <tidfid ... | tables ...> serverdir <serverdirectory> [user <user> [[password <password>] | [stored-password <property-name]]] [nolong] [partition <partition>] [offline] [lobsinfile] [backups <dirlist>] [logs <dirlist>] [savesession [session-lifetime <time-minutes>]] - Options:
-
backups <dirlist>- Specify optional list of alternate directories for locating backups.
For more information, see Specifying additional locations to search for backups and log files.
backuptime- Identifies the backup image timestamp in the format:
This timestamp is always in terms of the database server time zone, so it matches the filename of the actual backup image.YYYYMMDDHHMMSS format del | ixf- Specifies if the output file will be created in
DELorIXFformat. lobsinfile- Include LOB data in the output file.
logs <dirlist>- Specify optional list of alternate directories for locating logs.
For more information, see Specifying additional locations to search for backups and log files.
nolong- Omit LONG and LOB column data from processing.
offline-
Indicates to process an online backup in offline mode. Database logs are not processed and any in-flight transactions are not taken into account when extracting the data, therefore the data is not guaranteed to be consistent when using this option. This option is not recommended, but might be useful in certain cases where the user knows that the data in the backup was in a static state or when it is considered acceptable to retrieve the data in this way.
This option has no effect when processing an offline backup.
partition <partition>- Specifies the database partition number to process.Note: If the option partition of run ox is not set, run ox is started on the catalog partition of the target database.For Database Partitioning Facility (DPF) environments, this option is mandatory. If the database partition does not exist, the CLP displays the following error message:
ARY4235E: The partition "<db-partition-number>" does not exist.
For non-DPF databases, this option is optional and the default catalog partition number is used.
password- Password used with the specified user name.
If the password value that you specify matches a product keyword, then you must enclose the value in quotation marks (
"). savesession [session-lifetime <time-minutes>]- This parameter preserves the session data until you run the
delete sessioncommand to release the session ID. You can use the optionalsession-lifetimesetting to save the session for a limited amount of time, in minutes. stored-password- Enter a property name associated with a stored encrypted password value instead of a plain text
password. The command processor will use the property name to look up the stored password value to
use as part of the authentication credentials.Note: The
stored-passwordoption cannot be used in the same command as thepasswordoption. serverdirectory- Specifies path name on the database server where the extracted data will be written. The user must ensure that they have permission to write into the specified directory.
tables [list]- Specify a list of tables for extracting data, included in quotes, separated by spaces. The table
names have the form:
where the schema prefix is optional.[schema.]name tidfid [list]- Specify list of
TID:FIDpairs for extracting table data.TIDis the catalog table space ID.FIDis the table File ID.Format is:
TID:FIDMultiple
TID:FIDpairs can be specified separated by commas or spaces. If spaces are used, the entire option string must be surrounded by quotes. user- User name that can connect to the Db2 database (optional). If not specified, authentication parameters will be requested at time of connection.
- Example:
-
run ox from 20100905142316 partition 15 format del tidfid 2:15 serverdir /data/export/user1
run slr- Run the specified command to create or maintain the schema level repository (SLR) for the specified database. The SLR contains history about the database objects over the
lifetime of the database within a specific starting and ending point in the recovery logs.
- Usage:
-
run slr perform <create | update | rebuild | drop | prune> [user <user> [[password <password>] | [stored-password <property-name]]] [from <backuptime>] [to <endtime>] [backups <dirlist>] [logs <dirlist>] [savesession [session-lifetime <time-minutes>]] - Options:
-
backups <dirlist>- Specify an optional list of alternate directories for locating backups.
For more information, see Specifying additional locations to search for backups and log files.
backuptime- Identifies the backup image timestamp in the following
format:
This timestamp is always in terms of the database server time zone, so it matches the filename of the actual backup image.YYYYMMDDHHMMSSIf this option is omitted, the command will choose the most recent supported backup image that includes the database catalog table space (SYSCAYSPACE).
create- Create new SLR from specified database backup image.
drop- Drop SLR.
endtime- Timestamp that identifies the timestamp in the database logs to update the SLR
to:
[utc]YYYYMMDDHHMMSS[.uuuuuu]For more information, see Using timestamps.
logs <dirlist>- Specify optional list of alternate directories for locating logs.
For more information, see Specifying additional locations to search for backups and log files.
password- Password used with the specified user name.
If the password value that you specify matches a product keyword, then you must enclose the value in quotation marks (
"). savesession [session-lifetime <time-minutes>]- This parameter preserves the session data until you run the
delete sessioncommand to release the session ID. You can use the optionalsession-lifetimesetting to save the session for a limited amount of time, in minutes. stored-password- Enter a property name associated with a stored encrypted password value instead of a plain text
password. The command processor will use the property name to look up the stored password value to
use as part of the authentication credentials.Note: The
stored-passwordoption cannot be used in the same command as thepasswordoption. prune- Prune old SLR information before specified timestamp.
rebuild- Re-create existing SLR using specified database backup.
update- Update existing SLR to specified end point.
user- User name that can connect to the Db2 database (optional). If not specified, authentication parameters will be requested at time of connection.
- Examples:
-
The following examples create the SLR from a specified backup, and update it until the end of logs (default behavior when
endtimeoption is not specified).run slr perform create from 20100905142316run slr perform update
save session- Preserve the specified session ID so that the related data is not deleted. The @ symbol can be
used to substitute the session ID that was created by the previous run command.
- Usage:
-
save session <session-id> [session-lifetime <time-minutes>] [comment <comment>] - Options:
-
comment- Short user description for saved session.
session_id- Identifies the related Log Analysis session.
session-lifetime- A user-specified lifetime in minutes (e.g., 60 for an hour, 1440 for a day), for the session.
set database- Specifies the managed database to be processed.
- Usage:
-
set database <database_number> set database name <database_name> host <host_name> port <port> - Options:
-
database name- The managed database that will be processed. Use the first format in interactive mode, and specify the name or ID of the database in the repository. Use the second format in batch mode when you do not know the database number.
host- Host name of the database server.
port- Connection port number.
- Example:
-
set database name dbmeta host abc-s-def2 port 50000
set database log level- Specifies the managed database diagnostic logging level for the current database. This setting
is used when it is necessary to gather diagnostic details for requests that run on the Db2 server, such as SLR creation or Log Analysis. The
info command will display the current logging level after a working database is set.
- Usage:
-
set database log level {None | Fatal | Error | Warning | Info | Debug | Trace} - Options:
-
None- Do not log (=0) for the current database.
Fatal- Log down to Fatal (1) diagnostic information for the current managed database.
Error- Log down to Error (2) diagnostic information for the current managed database.
Warning- Log down to Warning (3) diagnostic information for the current managed database.
Info- Log down to Info (4) diagnostic information for the current managed database.
Debug- Log down to Debug (5) diagnostic information for the current managed database.
Trace- Log down to Trace (6) diagnostic information for the current managed database.
- Example:
- The following steps explain how to collect diagnostic information for your current managed database:
- Set the log level to
Debug
set database log level Debug - Perform the request. For example, use one of the following commands:
-
run slr -
run la
-
- Reset the log level back to
Info
set database log level Info - Gather the diagnostic files from the Db2 server to provide to IBM® Software Support for analysis.
- Set the log level to
Debug
set configuration repository- Specifies the configuration repository to which to connect. The configuration repository is a database that holds information about datastores and managed databases that were added by using the browser client. To process commands, the CLP must connect to a configuration repository. You must set the repository before using other
commands. You only need to set the repository once; the information is saved for future sessions.
You can also use the command to change the repository definition.
- Usage:
-
set configuraƟon repository to host <hostname> port <port-number> database <database-name> [connection_type [tcpip | ssl truststore_location <path-to-storage> truststore_password [<password]>]]] [user <user> password [<password>]] - Options:
-
host- Host name of the configuration repository.
port- Connection port number.
database- Database name that will be processed.
connection_type- Type of the connection.
user- User that can connect to the host.
password- Password used with the specified user ID.
- Example:
-
set configuration repository to host abc-s-def2 port 50004 database dbmeta user user1 password passwd1
set password- Use this command to define a property whose value is a password. The property value is encrypted
and stored for use in this or future sessions.
- Usage:
set password <property-name> [<value>]