ifx_refreshMart() function

The ifx_refreshMart() function checks for data changes in individual partitions and refreshes the changed partitions.

Syntax


1  ifx_refreshMart ( ' accelerator_name ' , ' data_mart_name '  , '
2.1 NULL
2.1 locking_mode
1 '  , '
2.1 NULL
2.1 threshold
1 '  )
accelerator_name
The name of the accelerator that contains the data mart.
data_mart_name
The name of the data mart to refresh.
locking_mode
Specifies the level of data protection during the refresh. Use one of the following values, which must be in uppercase:
  • NULL = The locking level that you specified the last time you ran the ifx_loadMart() function is used
  • TABLE = Protects only the table that is being refreshed against changes. Each table is locked in share mode while it refreshes with data. The refreshed data is consistent within each table, but not necessarily across different tables.
  • MART = Protects all the tables that are referenced by the data mart against changes during the refresh operation. All the tables are locked in share mode until the data mart is refreshed. The refreshed data is consistent from all of the tables. All of the other user sessions are blocked from changing the data in the tables that are refreshing.
  • NONE = No locking. The data is read from the different tables without locking them. Other user sessions can change the data during the refresh operation. As a result, the refreshed data might be inconsistent. Data inconsistencies might be acceptable if the purpose of the data mart is to create statistics and discover trends, rather than to find the exact values of specific data rows.
threshold
Reserved for future use. Set to ’NULL’.

Usage

After you load a data mart, you can run the ifx_refreshMart() function to refresh the data. For a high-availability cluster, you can run the ifx_refreshMart() function on the primary server or on the secondary server.

If a fragment is detached from the dimension or fact table, the ifx_refreshMart() function drops the corresponding partition from the data mart. If a fragment is attached to the dimension or fact table, the ifx_refreshMart() function adds the partition to the data mart.

If trickle feed is enabled, the trickle feed task refreshes the fact tables and runs the ifx_refreshMart() function to refresh the dimension tables.

The ifx_refreshMart() function does not update the data mart definition. If a table is added or dropped from the database server, you must drop the data mart, update the data mart definition, and then re-create the data mart.

If you plan to use partial data refresh for data marts, including trickle feed, the value of the MAX_PDQPRIORITY configuration parameter must be set to 50 or greater during the initial data load and partial data refresh.

Return value

The ifx_refreshMart() function returns the text string "The operation was completed successfully." or an error message.

Note: Use the SQL statement set environment use_dwa 'loadpdq <value>'; in the same database session before calling the ifx_refreshMart() function to set the PDQPRIORITY for the database sessions that extract the data from the database tables. The value for parameter "loadpdq" is a positive integer between 0 and 100 (inclusive), default being 2.

Examples

The following statement refreshes a data mart named Datamart1 in an accelerator named MyAccelerator and specifies a locking mode of MART:

EXECUTE FUNCTION ifx_refreshMart('MyAccelerator', 'Datamart1', 'MART', 'NULL');