www.krengeltech.com

DB2WSE Commands

From Wiki

User Guide

DB2WSE includes a number of commands which allow you to install, configure and report on DB2WSE. It also includes two licensing commands, which are used by all [http://www.krengeltech.com/i Krengel Tech] products.

Contents

DB2WSE-specific commands

CRTDWEPRF (Create DB2WSE Profile)

The Create DB2WSE Profile (CRTDWEPRF) command allows you to create a new profile (or update an existing profile) for use by DB2WSE. These profiles are only needed if DB2WSE is running under the DB2WSE Authority Model (DAM).

If an existing profile is specified for the USRNAM parameter, it will be updated with the PASSWD and PRFSTS values. Otherwise, a new profile will be created.

Parameters

USRNAM (User name)
Specifies the user name for the profile. IBM i (AS/400, iSeries, System i) naming rules must be used for this parameter.
PASSWD (Password)
Specifies the password for the profile.
If the CONVERT_PASSWD_CASE configuration value is set to *YES, then the password will be converted to upper-case before being saved. When a password is passed in a request, it will be converted to upper-case before being checked.
If the CONVERT_PASSWD_CASE configuration value is set to *NO, the password can be mixed-case. Care must be taken that the password passed in a request exactly matches this password.
PRFSTS (Profile status)
Specifies the status of the profile. Can take values of either *ACTIVE or *INACTIVE
AUTLVL (Authority level)
Specifies the authority level of the user profile. The authority level of a profile specifies the maximum authority level of predefined queries that can be run by the profile. AUTLVL can be specified as any value from 1 to 999. If the special value of *DFT is used, the value held in the DEFAULT_AUTH_LEVEL configuration value is used.

Example

CRTDWEPRF USRNAM(DEMO) PASSWD(DEMO) PRFSTS(*ACTIVE) AUTLVL(*DFT)

This will create a DB2WSE profile called DEMO with a password of DEMO. The profile will be active and will use the default authority level (as held in the DEFAULT_AUTH_LEVEL configuration value).


CRTDWEAUT (Create DB2WSE Authority)

The Create DB2WSE Authority (CRTDWEAUT) command allows you to create an authority row which will be associated with a DB2WSE profile. These authorities are only needed if DB2WSE is running under the DB2WSE Authority Model (DAM).

A DB2WSE authority specifies the authority that the associated DB2WSE profile has to a specific table or tables. The authority can specify whether the profile can read, update, delete or write to the table.

The associated DB2WSE profile must already have been created using the CRTDWEPRF command.

Parameters

USRNAM (User name)
Specifies the user name for the profile. IBM i naming rules must be used for this parameter.
TBLLIB (Table library)
Specifies the name of the library where the specified table (file) exists. The library does not need to exist when this command is run.
TBLNAM (Table name)
Specifies the name of the table (file) to which the profile should be granted authority. The table (file) does not need to exist when this command is run.
AUTINS (Insert authority)
Specifies whether the specified user has write authority to the table (file) specified in the TBLLIB and TBLNAM parameters. This equates to the ability to run INSERT statements over the table. It can take values of either *NO or *YES
AUTDLT (Delete authority)
Specifies whether the specified user has delete authority to the table (file) specified in the TBLLIB and TBLNAM parameters. This equates to the ability to run DELETE statements over the table. It can take values of either *NO or *YES
AUTUPD (Update authority)
Specifies whether the specified user has update authority to the table (file) specified in the TBLLIB and TBLNAM parameters. This equates to the ability to run UPDATE statements over the table. It can take values of either *NO or *YES
AUTDSP (Display authority)
Specifies whether the specified user has display authority to the table (file) specified in the TBLLIB and TBLNAM parameters. This equates to the ability to run SELECT statements over the table. It can take values of either *YES or *NO

Example

CRTDWEAUT USRNAM(DEMO) TBLLIB(PETSTORE) TBLNAM(*ALL) AUTINS(*NO) AUTDLT(*NO) AUTUPD(*NO) AUTDSP(*YES)

This will create a DB2WSE authority which will allow DB2WSE profile DEMO to access any of the tables in the PETSTORE library using an SQL SELECT statement. However, DEMO will not be able to insert, delete or update any rows in any tables in the PETSTORE library.

CRTDWEQRY (Create DB2WSE Query)

The Create DB2WSE Query (CRTDWEQRY) command allows you to create a predefined SQL query, which consists of a single SQL SELECT statement. This SQL statement can be run from a DB2WSE request by specifying the QUERYID attribute to the STATEMENT element in a full DB2WSE request or by specifying the query number instead of the library and table name in a simple REST-format DB2WSE request. When a DB2WSE query is created, it is assigned a unique number.

Parameters

AUTLVL (Authority level)
Specifies the authority level of the query. The authority level of a query specifies the minimum authority level of DB2WSE profiles that can run the query. AUTLVL can be specified as any value from 1 to 999. If the special value of *DFT is used, the value held in the DEFAULT_AUTH_LEVEL configuration value is used.
QRYSTR (Query statement)
Specifies the SQL SELECT statement that should be run when this query is invoked.

Example

CRTDWEQRY AUTLVL(*DFT) QRYSTR('select * from petstore/item')

This will create a DB2WSE query which will run the specified SELECT statement. Any DB2WSE profile with an AUTLVL greater than or equal to the *DFT level will be able to run the query. When the above statement is run, the query is created and a completion message is issue stating query identifier.


DLTDWEPRF (Delete DB2WSE Profile)

The Delete DB2WSE Profile (DLTDWEPRF) command allows you to delete an existing DB2WSE profile. Both the profile and all authority rows associated with the profile will be deleted.

Parameters

USRNAM (User name)
Specifies the user name for the profile. IBM i naming rules must be used for this parameter.

Example

DLTDWEPRF USRNAM(DEMO)

This will delete the DEMO DB2WSE profile, and any authority rows which have been created for the DEMO DB2WSe profile.


INSTDB2WSE (Install DB2WSE)

The Install DB2WSE (INSTDB2WSE) command allows you to install DB2WSE on your IBM i.

Parameters

DB2WSELIB (DB2WSE library)
Specifies the name of the DB2WSE library which is being installed.
PORT (HTTP server instance port)
Specifies the port number to use for the HTTP server instance which will be used by DB2WSE. When the HTTP server instance is started (either through the STRTCP or the STRTCPSVR command), the HTTP server instance will listen at the specified port number for client requests.
HTTPSVR (HTTP server instance)
Specifies the name of the HTTP server instance which will be created.

Example

INSTDB2WSE DB2WSELIB(DB2WSE) PORT(8282) HTTPSVR(*DB2WSELIB)

This will initialize the DB2WSE library, and create an HTTP server instance called DB2WSE, which will listen for requests on port 8282.


PRTDWECFG (Print DB2WSE Configuration)

This command allows you to print a list of the DB2WSE Configuration, profile and authority rows. This command has no parameters.


Licensing commands

APYKTILIC (Apply KTI License)

The Apply KTI License (APYKTILIC) command allows the user to apply a license key for one or more [http://www.krengeltech.com/i Krengel Tech] products.

A license key for a product allows you to use that product, according to the terms of the license, until the license expiration date.

A license key consists of a 32-character string composed of valid hexadecimal characters (0-9, A-F). All 32 characters must be entered into the LICKEY field.

After executing this command, the license key is automatically validated and the list of component products to which it applies are displayed, showing the expiration date for the license.

Parameters

LICKEY (License key)
A license key consists of valid hexadecimal characters (0-9, A-F) only.

Example

APYKTILIC LICKEY(ABCDEFA1234567890ABCDEF123456789)

Note: The above license key value is for example purposes only and is not a valid license key.


DSPKTILIC (Display KTI License)

This command allows you to display the license code for DB2WSE, showing the expiration date.