Skip to main content

Overview of DBMS_STATS

The DBMS_STATS package is used to view and modify statistics collected by the optimizer for database objects.

DBMS_STATS

The DBMS_STATS package in seekdb supports the following operations:

  • Collecting optimizer statistics

  • Setting column, table, and index information

  • Deleting statistics

  • Locking and unlocking statistics

Overview of DBMS_STATS procedures

The following table lists the DBMS_STATS procedures supported by seekdb and provides a brief description for each.

SubprogramDescription
ALTER_STATS_HISTORY_RETENTIONModifies the retention interval for historical statistics. The default retention interval is 31 days.
CREATE_STAT_TABLECreates a table in the specified schema to store statistics.
DELETE_COLUMN_STATSDeletes column-level statistics.
DELETE_INDEX_STATSDeletes statistics related to indexes.
DELETE_TABLE_STATSDeletes table-level statistics.
DELETE_SCHEMA_STATSDeletes statistics for all tables in the specified schema.
DELETE_SCHEMA_PREFSDeletes the statistics preferences (Prefs) for all tables in the specified schema.
DELETE_SYSTEM_STATSDeletes system statistics
DELETE_TABLE_PREFSDeletes the statistics preferences (Prefs) for tables owned by the specified user.
DROP_STAT_TABLEDrops the user statistics table.
EXPORT_COLUMN_STATSExports column-level statistics.
EXPORT_INDEX_STATSRetrieves statistics for the specified index and stores them in the statistics table.
EXPORT_TABLE_STATSExports table-level statistics.
EXPORT_SCHEMA_STATSExports statistics for all tables in the schema.
FLUSH_DATABASE_MONITORING_INFOFlushes memory monitoring information for all tables to the dictionary.
GATHER_INDEX_STATSCollects index statistics.
GATHER_TABLE_STATSCollects statistics for tables and columns.
GATHER_SCHEMA_STATSCollects statistics for all objects in the schema.
GATHER_SYSTEM_STATSCollects system statistics
GET_STATS_HISTORY_AVAILABILITYRetrieves the earliest available time of historical statistics. Statistics for a time earlier than this time cannot be restored.
GET_STATS_HISTORY_RETENTIONRetrieves the retention interval for historical statistics.
GET_PARAMRetrieves the default values of the parameters of the procedures in the DBMS_STATS package.
GET_PREFSRetrieves the default value of the specified preferences (Prefs).
IMPORT_INDEX_STATSRetrieves statistics for the specified index from the user statistics table and stores them in the dictionary.
IMPORT_COLUMN_STATSImports column-level statistics.
IMPORT_TABLE_STATSImports table-level statistics.
IMPORT_SCHEMA_STATSImports statistics for all tables in the specified schema.
LOCK_PARTITION_STATSLocks statistics for the specified partition.
LOCK_SCHEMA_STATSLocks statistics for all tables in the specified schema.
LOCK_TABLE_STATSLocks statistics for the specified table.
RESTORE_TABLE_STATSRestores table-level historical statistics at the specified time.
RESTORE_SCHEMA_STATSRestores schema-level historical statistics at the specified time.
RESET_GLOBAL_PREF_DEFAULTSResets global preferences to their default values.
RESET_PARAM_DEFAULTSResets all parameters to their recommended database values.
PURGE_STATSDeletes historical statistics before the specified time.
SET_COLUMN_STATSSets column-level basic statistics.
SET_INDEX_STATSSets index-related information.
SET_TABLE_STATSSets table-level basic statistics.
SET_GLOBAL_PREFSSets global statistics preferences.
SET_PARAMSets default values for parameters of procedures in the DBMS_STATS package.
SET_SCHEMA_PREFSSets statistics preferences for the specified schema.
SET_SYSTEM_STATSSets system statistics
SET_TABLE_PREFSSets statistics preferences for tables owned by the specified user.
UNLOCK_PARTITION_STATSUnlocks statistics for the specified partition.
UNLOCK_SCHEMA_STATSUnlocks statistics for all tables in the specified schema.
UNLOCK_TABLE_STATSUnlocks statistics for the specified table.
CANCEL_GATHER_STATSUsed to cancel a statistics collection command.