SYSPROC.ACCEL_GET_TABLES_INFO

For all or a subset of the tables on an accelerator, this stored procedure returns the XML specifications that were used to define these tables using the SYSPROC.ACCEL_ADD_TABLES stored procedure. In addition, this stored procedure returns status information about the specified tables, including accelerator-only tables.

Since the output can be very large, the XML table specifications and the table information are returned in result sets that are stored in two global temporary tables. These tables are created during the installation of IBM Db2 Analytics Accelerator for z/OS by the following SQL statements:
For the XML table specifications:
CREATE GLOBAL TEMPORARY TABLE DSNAQT.ACCEL_TABLES_INFO_SPEC
( SEQID INTEGER
, TABLE_SPECIFICATION VARCHAR(32698)
) CCSID UNICODE;
For the table status information:
CREATE GLOBAL TEMPORARY TABLE DSNAQT.ACCEL_TABLES_INFO_STATES
( SEQID INTEGER
, TABLE_STATES VARCHAR(32698)
) CCSID UNICODE;
The concatenation of the result set string column in ascending order of SEQNO provides an XML document:
  • The first result set contains a table specification that can be used as input for the table_specification parameter of the SYSPROC.ACCEL_ADD_TABLES stored procedure. The result set can be empty if no tables exist or missing if an error occurred. The XML document conforms to the structure of the tableSpecifications element in the SAQTSAMP(AQTSXSD1) data set.
  • The second result set contains status information about the set of tables on the accelerator. The result set can be empty if no tables exist or missing if an error occurred.

    A loadStatus value of ArchivingInProgress indicates that Db2 for z/OS data is currently being archived on an accelerator. This state prevents load or update operations, incremental updates, or the changing of a distribution key or organizing keys at the same time.

    Accelerator-only tables can be identified by their type attribute, whose value is always AcceleratorOnly, and by their loadStatus. The loadStatus value Operational is reserved for accelerator-only tables, and indicates that the table is ready for processing.

    The stored procedure does not list or create output for a table if the creation of the accelerator-only table has not been committed. Likewise, the procedure might still list and produce output for a table whose removal has not been committed.

    Referencing accelerator-only tables that were created for federated access can also be identified by their type, which is FederatedReference. The output is slightly different, depending on the Db2 subsystem that sent the stored procedure call: The result set includes the load status if the call comes from the Db2 subsystem that owns the tables; if the call comes from the referencing Db2 subsystem, the load status is always FederatedTableOperational.

    Furthermore, the output includes the location name of the remote Db2 subsystem if you call the stored procedure from the referencing Db2 subsystem. This is not the case if you call the stored procedure from the remote Db2 subsystem because the tables are local tables if viewed from the perspective of the remote Db2 subsystem.

    The ouput XML document conforms to the structure of the tableInformation element in the SAQTSAMP(AQTSXSD1) data set.

Syntax

CALL SYSPROC.ACCEL_GET_TABLES_INFO
(accelerator_name,
table_set,
message); 

Options description

accelerator_name
The unique name of the accelerator. This accelerator must have been defined by the SYSPROC.ACCEL_ADD_ACCELERATOR stored procedure.
table_set
A list of the tables that you want to process. The XML string that you specify as input for this parameter must conform to the structure of the tableSet element in the SAQTSAMP(AQTSXSD1) data set.

The tables must be accelerator-shadow tables, defined by the SYSPROC.ACCEL_ADD_TABLES stored procedure, or accelerator-only tables. The same table name must not appear more than once in the table set.

You can set this parameter to NULL, in which case the stored procedure returns information about all tables that are defined in the SYSACCEL.SYSACCELERATEDTABLES table or that are present on the specified accelerator. This allows you to detect orphaned or incompletely deleted tables, which are listed with an integrity status of ViolatedOnAccelerator or ViolatedInDatabaseManagementSystem in the TABLE_INFORMATION element of the result set. You cannot restore such tables, but the rests of such tables can be cleaned up by using the ACCEL_REMOVE_TABLES stored procedure.
Example:
<?xml version="1.0" encoding="UTF-8" ?>
   <aqttables:tableSet xmlns:aqttables="http://www.ibm.com/xmlns/prod/dwa/2011" 
    version="1.0">
      <table name="SALES"   schema="BCKE" />
      <table name="PRODUCT" schema="BCKE" />
   </aqttables:tableSet>

The sample XML code instructs the stored procedure to work on the SALES and PRODUCT tables.

message
For the description, follow the appropriate link under Related reference at the end of this topic.

Example of a result set containing XML table specifications

<?xml version="1.0" encoding="UTF-8" ?>
<aqttables:tableSpecifications xmlns:aqt="http://www.ibm.com/xmlns/prod/dwa/2011" 
	version="1.0">
  <table name="SALES" schema="BCKE">
	<distributionKey>
		<column name="STOREID"  />
		<column name="PRODUCTID" />
	</distributionKey>
	<organizingKey name="CUSTOMERID" />
	<organizingKey name="ORDERDATE" />
  </table>
  <table name="PRODUCT" schema="BCKE" /> <!-- sub-elements are optional -->
</aqttables:tableSpecifications>

What you see is the content or value of the table_specifications parameter that was used when you defined the table by using the SYSPROC.ACCEL_ADD_TABLES stored procedure. This example shows the original XML specifications for two tables, SALES and PRODUCT. Both tables belong to the BCKE schema. For the SALES table, a distribution key is selected, which consists of the STOREID and PRODUCTID columns. In addition, the CUSTOMERID and ORDERDATE columns are listed as organizing keys for the table. You can define a maximum of four columns in a distribution key, and a maximum of four organizing keys (consisting of one column each). For more information about the terms distribution key and organizing key, see Related concepts at the end of this topic..

Examples of result sets containing table status information

<?xml version="1.0" encoding="UTF-8" ?>
<dwa:tableInformation 
 xmlns:dwa="http://www.ibm.com/xmlns/prod/dwa/2011" version="1.3">
   <table schema=”BCKE” name="SALES">
      <status loadStatus="InitialLoadPending" accelerationStatus="false" 
       integrityStatus="Unimpaired" replicationEnabled="true" />
      <statistics usedDiskSpaceInMB="1" rowCount="2" skew="0.3" 
       capturePointTimestamp="2012-01-09T11:55:27.997141Z" />
   </table>
</dwa:tableInformation>

<?xml version="1.0" encoding="UTF-8" ?>
<dwa:tableInformation 
 xmlns:dwa="http://www.ibm.com/xmlns/prod/dwa/2011" version="1.3">
   <table schema="BCKE" name="SALES">
       <status loadStatus="Loaded" accelerationStatus="true" 
       integrityStatus="Unimpaired" 
       archiveStatus="true" archiveProblemDetected="false" />
       <statistics usedDiskSpaceInMB="1" rowCount="2" 
        archiveDiskSpaceInMB="100" 
        archiveRowCount="10000" skew="0.3" organizedPercent="95.00" 
        lastLoadTimestamp="2012-01-09T11:53:27.997141Z" />
   </table>
</dwa:tableInformation>

<?xml version="1.0" encoding="UTF-8" ?>
</dwa:tableInformation 
 xmlns:dwa="http://www.ibm.com/xmlns/prod/dwa/2011" version="1.3">
   <table schema=”BCKE” name="PRODUCT">
      <status loadStatus="Loaded" accelerationStatus="true" 
       integrityStatus="Unimpaired" replicationEnabled="true" />
      <statistics usedDiskSpaceInMB="100" rowCount="600000" skew="0.1" 
       capturePointTimestamp="2012-01-09T11:55:27.997141Z" />
   </table>
</dwa:tableInformation>

<?xml version="1.0" encoding="UTF-8"?>
<dwa:TTableInformation xmlns:dwa="http://www.ibm.com/xmlns/prod/dwa/2011" 
 name="TEST3A" schema="Db2O">
  <status accelerationStatus="true" archiveStatus="false" 
   integrityStatus="Unimpaired" 
   loadStatus="FederatedTableOperational" replicationStatus="false" 
   type="FederatedReference"/>
  <statistics organizedPercent="0.000" rowCount="0" skew="0.000" 
   usedDiskSpaceInMB="0"/>
</dwa:TTableInformation>

The example shows status information about two three tables, SALES, PRODUCT, and TEST3A.

The loadStatus of the SALES table is InitialLoadPending. The acceleration status is false because the table cannot be used for accelerated queries in its current state.

The integrity status is Unimpaired, meaning that the information about this table in the SYSACCEL.SYSACCELERATEDTABLES table in Db2 is consistent with the information about the same table in the catalog of the accelerator. Were the table not mentioned in the accelerator catalog, but marked as eligible for accelerated queries in the SYSACCEL.SYSACCELERATEDTABLES table, its integrity status would be ViolatedOnAccelerator. If, on the other hand, the table were listed on the accelerator, but not marked as eligible for accelerated queries, its status would be ViolatedInDatabaseManagementSystem. The latter can happen if rows were accidentally deleted from the SYSACCEL.SYSACCELERATEDTABLES table or if a backup of the Db2 catalog was restored that did not contain the accelerator information at the time when the backup was created.

The replicationEnabled attribute indicates that incremental updates are enabled for this accelerator-shadow table and the capturePointTimestamp attribute shows when the last update started.
Important: The table status generated by the SYSPROC.ACCEL_GET_TABLES_INFO stored procedure depends on the installed stored procedure version. If back-level stored procedures are installed or a compatibliltyLevel lower than the current version is specified in the message parameter, then some parts of the output are omitted. See Table 1
Table 1. Generated output depending on the compatibility level
Compatibility level Output level Omission from output
compatibilityLevel=4 Version 1.2 replicationDetails and archiveProblemDetected attributes for tables
compatibilityLevel=3 Version 1.1 In addition to the omissions from version 1.2. output, all information related to the High Performance Storage Saver is left out.
compatibilityLevel=2 Version 1.0 In addition to the omissions from version 1.1. output, all information related to incremental updates is left out.

The table uses 1 MB of disk space and has just two rows. The skew value of 0.3 hints at a slightly uneven distribution of rows across the processing nodes.

The number and the data size of storage saver rows are computed asynchronously so that the display of changes might be delayed for some time after the storage saver operations.

You can interpret the information about the PRODUCT table analogously.

The TEST3A table is a referencing accelerator-only table, which has been created for federated access. You can see that its load status is FederatedTableOperational and that its type is FederatedReference.

Prerequisites

For the user ID that calls IBM Db2 Analytics Accelerator for z/OS stored procedures on z/OS, you must define an OMVS segment in the Resource Access Control Facility (RACF®).

Authorizations for z/OS

On z/OS, the user ID under which this stored procedure is invoked must have the following privileges:

  • EXECUTE on the stored procedure
  • EXECUTE on the SYSACCEL.* packages
  • MONITOR1 authorization
  • Read/write and execute access to the /tmp directory for the user who calls the stored procedure
  • RACF ACCESS(READ) on the data set that contains the AQTENV file in the started task procedure of the Workload Manager (WLM) environment.

Messages

The following messages are likely to occur in connection with the SYSPROC.ACCEL_GET_TABLES_INFO stored procedure:
AQT10000I
Success message indicating that the stored procedure could provide the requested table information in the result sets.
AQT10076W
Information about tables in Db2 for z/OS and on the accelerator is out of sync. As a result, one or more tables cannot be detected on either side. To solve the problem, remove the tables in question from the accelerator and then redefine these if they still exist in the Db2 subsystem.
AQT10134E
The SYSPROC.ACCEL_GET_TABLES_INFO stored procedure failed because one or more of the specified tables are not found in the Db2 for z/OS catalog table SYSIBM.SYSACCELERATEDTABLES.

The following scenario shows you which messages to expect under which conditions.

Table 2. Disparate table sets in the database and on the accelerator
Database Accelerator
T1  
T2 T2
  T3

Assume that you have the following set of tables in your database and on the accelerator:

In this case, you will receive the following messages, according to the input value of the table_set parameter:

Table 3. Error messages resulting from disparate table sets
Value of table_set Output returned by table_specifications and table_information for tables Messages
NULL T1, T2, T3
  • AQT10000I
  • Warning AQT10076W for table T1, which cannot be found on the accelerator
  • Warning AQT10076W for table T3. The table exists on the accelerator, but since it has not been specified as input (table_set is NULL), AQT10076W is returned instead of AQT10134E.
T1 T1
  • AQT10000I
  • Warning AQT10076W because table T1 cannot be found on the accelerator
T2 T2
  • AQT10000I
T3 T3
  • AQT10000I
  • Warning AQT10134E for table T3, which is not found in SYSIBM.SYSACCELERATEDTABLES
T4 No output
  • T4 is neither found on the accelerator, nor in SYSIBM.SYSACCELERATEDTABLES. In cases like this, just warning AQT10134E is issued.