db_check_views

You can run the db_check_views command to find stale or corrupted views in a database or schema.

A view turns stale when you create a view on a table and then change the table definition.

Usage

db_check_views [-h] [-host HOST] [-db DB] [-dsn DSN] [-schema SCHEMA] [-view VIEW] [-user USER] [-pw PW]

Basic parameters

-h | --help
Displays help for the command.

Optional parameters

-host HOST
Specifies the hostname for which you want to get details.

The current IP is the default value.

-db DB
Specifies the database for which you want to get stats. The default is BLUDB.
-dsn DSN
An alternative for the -db and -host options.
-schema SCHEMA
Specifies the schema under which the view exists.
-view VIEW
Specifies the views in the schema. Separate the views with a comma. If the parameter is not provided, all views in the schema are selected.
-user USER
Specifies the database user.
-pw PW
Specifies the database password.

Examples

  • [bluadmin@host - Db2wh support_tools]$ db_check_views
     Invalid Views
    VIEW_NAME