Retrieving nickname statistics

You can retrieve the statistics for a nickname to ensure that the query optimizer uses the information about the nickname that is available at the data source. You can update nickname statistics for a single nickname, multiple nicknames, or all nicknames.

About this task

The query optimizer gathers statistics, including the HIGH2KEY and LOW2KEY nickname statistics, for data source objects that use label-based access control or Oracle Label Security. For databases that are use these types of security, only users with the appropriate access level can see the statistics. For unrestricted databases, you can restrict access or set the HIGH2KEY and LOW2KEY nickname statistics to an empty or meaningless value.

By default, statistics collection is attempted for all columns and all indexes of a nickname. You can limit statistics to specific columns and indexes and specify a log file.

Before you begin

The following prerequisites apply when you use the command line prompt to update statistics:
  • The federated server creates the log file on the server. The directories that you list in the path must exist.
  • The privileges for the fenced user ID of the federated instance must include the privilege to create the log file in the specified location.

Restrictions

The user ID that you use to connect to the federated database must be mapped to the remote data source table.

If the local column name or type does not represent the default type mapping from the remote column name or type, the nickname statistics update utility does not retrieve column statistics.

Procedure

Call the stored procedure SYSPROC.NNSTATS to update nickname statistics from the command line or within an application.