IBM Provided Utility Scripts for Db2
by Vikram Khatri | Sep 28, 2017
- The Db2 Warehouse client container provides a toolkit that has very nice utility scripts that can be downloaded from http://ibm.biz/db2warehousetools .
- The list of tools available in the tool kit are shown as below:
- dbsql – This is like Db2 CLP but based upon Netezza command tool nzsql.
- Scripts available in the tool are shown below. You can test these commands by providing -d switch with the name of the database alias that was generated in the previous section.
- db_ddl_database – It shows the script that was used to create a database. Use the alias name generated.
- db_ddl_function – To generate the DDL used to define user defined functions.
- db_ddl_procedure – To generate DDL for user created stored procedures.
- db_ddl_security – To generate DDL for security objects.
- db_ddl_sequence – To generate DDL for sequences
- db_ddl_synonym – To generate DDL for synonyms
- db_ddl_table – To generate DDL for user defined tables
- db_ddl_view – To generate DDL for user defined views.
- db_genstats – To generate statistics on tables that do not have up-to-date statistics.
- db_getstats – To get statistics on all tables or for a specific table.
- db_migrate – Migrate Netezza database to Db2 Warehouse
- db_size – Get the amount of storage space used by each table
- db_tables – List all tables in a database with other useful information
- db_ddl_diff – Reports any DDL differences between two schemas within the database
- db_ddl_grant_group – Dumps out the SQL DDL statement that was used to grant access to a group
- db_ddl_grant_user: Dumps out the SQL/DDL statement that was used to grant access to a user
- db_ddl_object: Dumps out the SQL DDL statements that were used to create any object of any type
- db_plan: Analyzes query plans and generates a report of important details in the specified plan
- db_skew: Exports the details of database skew for all the tables in a specified database