ANALYZE_CATALOG table function
The ANALYZE_CATALOG table function returns one row for each inconsistency it finds in the database catalog.
If no rows are returned, no inconsistencies were identified. Multiple rows can be returned for the same object.
Authorization: The caller must have *ALLOBJ special authority.
- option
- A character or graphic string expression that identifies the type of catalog analysis to perform.
- DBXREF
- Analysis will be done for objects in the database cross reference files. This is the default.
- DBXREF SERVER
- Analysis will be done of the database cross reference servers. The database cross reference servers will be verified to ensure they are functioning properly. One or more result rows with DBXREF SERVER in the CATEGORY column indicate the current database cross reference server status.
- library-name
- A character or graphic string expression that identifies the library to be analyzed. This
parameter only applies when option is DBXREF.
- *ALL
- All *FILE objects within all libraries will be analyzed, including any in independent auxiliary storage pools that are accessible. This is the default.
- name
- All *FILE objects within this library will be analyzed.
The result of the function is a table containing one row for each reported item with the format shown in the following table. All the columns are nullable.
Column Name | Data Type | Description |
---|---|---|
LIBRARY_NAME | VARCHAR(10) | Name of the library containing the database object. Can contain the null value when CATEGORY is DBXREF SERVER. |
OBJECT_NAME | VARCHAR(128) | Name of the database object. Can contain the null value when CATEGORY is DBXREF SERVER. |
OBJECT_TYPE | VARCHAR(30) | Type of database object. Can contain the null value when CATEGORY is DBXREF SERVER. |
SEVERITY | VARCHAR(7) | The severity of the reported item.
|
CATEGORY | VARCHAR(20) | The category of this catalog row.
|
DESCRIPTION | VARCHAR(250) | A text description of the inconsistency in the database catalog. |
DETAIL | VARCHAR(128) | Additional detail about the inconsistency.
Contains the null value if this row does not have additional detail information. |
CATALOG_LIBRARY | VARCHAR(10) | The name of the library containing the catalog. Contains the null value if this row is not related to a specific catalog. |
CATALOG_NAME | VARCHAR(10) | The catalog table that contains inconsistent information. Contains the null value if this row is not related to a specific catalog. |
Example
- Determine if there are any constraint inconsistencies for any database files on the
system.
SELECT * FROM TABLE(QSYS2.ANALYZE_CATALOG(OPTION => 'DBXREF'));
- Determine if there are any constraint inconsistencies for database files in library
APPLIB.
SELECT * FROM TABLE(QSYS2.ANALYZE_CATALOG(OPTION => 'DBXREF', LIBRARY_NAME =>'APPLIB'));
- Examine how the database cross reference servers are running. If they are behind on processing,
the DESCRIPTION and DETAIL columns will indicate the number of entries in the queue that are waiting
to be
processed.
SELECT * FROM TABLE(QSYS2.ANALYZE_CATALOG(OPTION => 'DBXREF SERVER'));