Purging Cache Programmatically
The Analytics
Server provides ODBC-extension functions for purging cache entries
programmatically. These functions are particularly useful for embedding
in an Extract, Transform, and Load (ETL) task. For example, after a
nightly ETL is performed, all Analytics Server cache can be purged. If
only the fact table was modified, only cache related to that table can
be purged. In some cases, you might need to purge the cache entries
associated with a specific database.
NOTE: Only administrators have the right to purge cache. Therefore scripts that call these ODBC-extension functions must run under an administrator logon ID.
The following ODBC functions affect cache entries associated with the repository specified by the ODBC connection:
- SAPurgeCacheByQuery. Purges a cache entry that exactly matches a specified query. For example, using the following query, you would have a query cache entry that retrieves the names of all employees earning more than $100,000:
- SAPurgeCacheByTable.
Purges all cache entries associated with a specified physical table
name (fully qualified) for the repository to which the client has
connected.
This function takes up to four parameters representing the four components (database, catalog, schema and table name proper) of a fully qualified physical table name. For example, you might have a table with the fully qualified name of DBName.CatName.SchName.TabName. To purge the cache entries associated with this table in the physical layer of the analytics repository, execute the following call in a script:
- SAPurgeAllCache. Purges all cache entries. The following is an example of this call:
- SAPurgeCacheByDatabase. Purges all cache entries associated with a specific physical database name. A record is returned as a result of calling any of the ODBC procedures to purge the cache. This function takes one parameter that represents the physical database name and the parameter cannot be null. The following is an example of this call:
No comments:
Post a Comment