FLUSH FEDERATED CACHE statement
The FLUSH FEDERATED CACHE statement flushes the federated cache, allowing fresh metadata to be obtained the next time an SQL statement is issued against the remote table or view using a federated three part name.
When an SQL statement is issued against a remote table or view using a federated three part name, if the remote table or view is being referenced for the first time, the metadata and statistics for the remote object are retrieved and stored in a federated cache.
Invocation
This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared.
Authorization
The privileges held by the authorization ID of the statement must include either SQLADM or DBADM authority.
Syntax
Description
- FOR ALL
- Flushes the federated cache information for all objects from all data sources. This is the default.
- FOR remote-object-name
- Flushes the federated cache information for a specific remote table or view.
- FOR data-source-name.schema-name.*
- Flushes the federated cache information for all objects in the schema identified by schema-name from the specific data source identified by data-source-name.
- FOR data-source-name.*.*
- Flushes the federated cache information for all objects from the specific data source identified by data-source-name.
- FOR SERVER data-source-name
- Flushes the federated cache information for all objects from the specific data source identified by data-source-name.
Notes
- Package invalidation: Flushing the federated cache causes packages with a dependency on the three-part name to be invalidated. This action could have a performance impact since the invalidated packages need to be recompiled whenever statements from the package are executed.
- View invalidation: Flushing the federated cache will not cause the views depending on the three part name to be invalidated. The next time the view is used, it will implicitly revalidate the view. If there are changes to the remote object, it is possible that the statement using the view could return an error.
Examples
- Example 1: Flush the federated cache information for the
remote-table-name t1 in the remote-schema-name rschema on
the data source rudb.
FLUSH FEDERATED CACHE FOR rudb.rschema.t1
- Example 2: Flush the federated cache information for all
objects in the remote-schema-name rschema on
the data source rudb.
FLUSH FEDERATED CACHE FOR rudb.rschema.*
- Example 3: Flush the federated cache information for all
objects from the data source rudb.
An alternative to this syntax is as follows:FLUSH FEDERATED CACHE FOR rudb.*.*
FLUSH FEDERATED CACHE FOR SERVER rudb