DB2 Version 9.7 for Linux, UNIX, and Windows

Command Line Processor (CLP) samples

UNIX directory: sqllib/samples/clp. Windows directory: sqllib\samples\clp.

Table 1. Command Line Processor (CLP) sample scripts.
Sample file name File description
const.db2 Creates a table with a CHECK CONSTRAINT clause.
cte.db2 Demonstrates a common table expression.
datecompat.db2 Demonstrates the date formats and scalar functions.
flt.db2 Demonstrates a recursive query.
implicitcasting.db2 How to use implicit casting.
join.db2 Demonstrates an outer join of tables.
scalarfunction.db2 Demonstrates the use of improved scalar functions.
stock.db2 Demonstrates the use of triggers.
tablestatesize.db2 How to use SYSPROC.ADMIN_GET_TAB_INFO and SYSIBMADM.ADMINTABINFO views to obtain the size and status information for a table.
tbast.db2 How to use staging table for updating deferred AST.
tbcompress.db2 How to create tables with null and default value compression option.
tbconstr.db2 How to create, use, and drop constraints.
tbread.db2 How to read tables.
tbtemp.db2 How to use a declared temporary table.
tbumqt.db2 How to use user-maintained materialized query tables (summary tables).
testdata.db2 Uses DB2 built-in functions such as RAND() and TRANSLATE() to populate a table with randomly generated test data.
tsinfo.db2 How to get the table space information for all the table spaces.

The following table lists the sample scripts provided to demonstrate administration tasks. Currently, these are only available as CLP scripts. These are located in the UNIX directory: sqllib/samples/admin_scripts. Windows directory: sqllib\samples\admin_scripts

The README file in this directory contains information regarding these samples.

Table 2. Administration Scripts - Command Line Processor (CLP) samples
Sample file name File description
admincmd_tbload.db2 How to load data into a table using ADMIN_CMD routine on UNIX.
admincmd_tbload.db2 How to load data into a table using ADMIN_CMD routine on Windows.
alterpartition.db2 How to perform addition/deletion of partitions on a partitioned table
audit.db2 How to create, alter, and remove audit policies and archive and view audit data on UNIX.
audit.db2 How to create, alter, and remove audit policies and archive and view audit data on Windows.
autocfg.db2 How to automatically configure database and database manager configuration parameters based on the Performance Configuration wizard's recommendations.
autodb.db2 How to use DB2_ENABLE_AUTOCONFIG_DEFAULT registry variable to enable/disable Configuration Advisor at database creation
autonomous_transaction.db2 How to track the events when the user tries to access any restricted data.
autorestore.db2 How to restore a database with automatic storage on UNIX.
autorestore.db2 How to restore a database with automatic storage on Windows.
autostore.db2 How to create, backup and restore databases enabled with automatic storage on UNIX.
autostore.db2 How to create, backup and restore databases enabled with automatic storage on Windows.
cgtt.db2 How to use created temporary tables with procedures, functions, triggers and views.
checkv9limits.db2 To check if any of the Version 9 identifier length limits have been exceeded in the database.
contacts.db2 How to add, update and drop contacts and contactgroups
databaseroles.db2 How to create roles, transfer object ownership using roles, use roles instead of groups, and grant and revoke privileges through roles using role hierarchy.
fasterrollout.db2 How to change the MDC rollout type from immediate index cleanup to deferred index cleanup.
gethealthconfig.db2 How to get definition, alert configuration and default alert configurations
getlogs.db2 How to get the customer view of diagnostic log file entries
globvarsupport.db2 How to create and delete global variables and use global variables in triggers and stored procedures.
healthmon.db2 How to use Table Functions for Health Monitor Snapshot.
largerid.db2 How to enable Large RIDs support on both new tables/tablespaces and existing tables/tablespaces
lbac.db2 How to take advantage of DB2 LBAC (Label Based Access Control) feature.
monitor.db2 How to retrieve the snapshot statistics of applications, utilities, tablespaces.
onlineload.db2 How to do online loading using the ALLOW READ ACCESS option.
partitionindex.db2 How to create indexes on a partitioned table.
public_alias.db2 Demonstrates the use of public aliases for database objects.
redistribute_cmd.db2 How to use the various options in the REDISTRIBUTE utility.
rollindata.db2 How to perform data-roll-in into a partitioned table.
rolloutdata.db2 How to perform data-roll-out from a partitioned table.
security.db2 How to query details about the groups, authorities, privileges and ownerships without using various catalog tables.
setintegrity.db2 How to perform online SET INTEGRITY on a table.
ssv_backup_db.db2 How to run the BACKUP DATABASE command to back up all partitions of a multi-partition database at once on UNIX.
ssv_backup_db.db2 How to run the BACKUP DATABASE command to back up all partitions of a multi-partition database at once on WINDOWS.
ssv_backup_tbsp.db2 How to perform a tablespace backup on a multi-partition database on UNIX.
ssv_backup_tbsp.db2 How to perform a tablespace backup on a multi-partition database on WINDOWS.
ssv_db_cfg.db2 How to update database configuration parameters across multiple partitions in a partitioned database environment on UNIX.
ssv_db_cfg.db2 How to update database configuration parameters across multiple partitions in a partitioned database environment on WINDOWS.
tablepartition.db2 How to create a partitioned table.
tbeventmon.db2 How to create and use event monitors written to a table.
tbonlineinx.db2 How to create and reorg indexes on a table.
tbrowcompress.db2 How to perform row compression on a table and use the Automatic Dictionary Creation enhancement.
tbrunstats.db2 How to perform runstats on a table.
tbsreduce.db2 How to free up and reuse unused storage at the end of a table space.
wlmtiersdefault.db2 How to set up a DB2 WLM tiered service class configuration for a database and demonstrate the use of service classes, workloads, and thresholds.
wlmtiersdrop.db2 How to drop all service classes, thresholds, workloads, work classes, and work action sets that were created by wlmtiersdefault.db2 and wlmtierstimerons.db2 scripts.
wlmtierstimerons.db2 How to set up a DB2 WLM tiered service class configuration for a database and take the estimated cost into account when initially mapping DML activities to service classes.