tion, and global) statistics.
cascade : Gather statistics on the indexes as well.
Index statistics gathering is not parallelized. Using this option is equivalent to running the gather_index_stats procedure on each of the indexes in the schema in addition to gathering table and column statistics.
stattab : User stat table identifier describing where to save the current statistics.
statid : Identifier (optional) to associate with these statistics within stattab.
options : Further specification of which objects to gather statistics for:
GATHER: Gather statistics on all objects in the schema.GATHER STALE: Gather statistics on stale objects as determined by looking at the *_tab_modifications views. Also, return a list of objects found to be stale.GATHER EMPTY: Gather statistics on objects which currently have no statistics. also, return a list of objects found to have no statistics.LIST STALE: Return list of stale objects as determined by looking at the *_tab_modifications views.LIST EMPTY: Return list of objects which currently have no statistics.
objlist : List of objects found to be stale or empty.
statown : Schema containing stattab (if different than ownname).
Export Schema Stats(从数据字典导出到用户表)
DBMS_STATS.export_schema_stats (
ownname VARCHAR2,
stattab VARCHAR2,
statid VARCHAR2 DEFAULT NULL,
statown VARCHAR2 DEFAULT NULL);
ownname : Name of the schema.
stattab : User stat table identifier describing where to store the statistics.
statid : Identifier (optional) to associate with these statistics within stattab.
statown : Schema containing stattab (if different than ownname).
Import Schema Stats(从用户表导入到数据字典)
DBMS_STATS.import_schema_stats (
ownname VARCHAR2,
stattab VARCHAR2,
statid VARCHAR2 DEFAULT NULL,
statown VARCHAR2 DEFAULT NULL);
ownname : Name of the schema.
stattab : User stat table identifier describing from where to retrieve the statistics.
statid : Identifier (optional) to associate with these statistics within stattab.
statown : Schema containing stattab (if different than ownname).
Delete Schema Stats
DBMS_STATS.delete_schema_stats (
ownname VARCHAR2,
stattab VARCHAR2 DEFAULT NULL,
statid VARCHAR2 DEFAULT NULL,
statown VARCHAR2 DEFAULT NULL);
ownname : Name of the schema.
stattab : User stat table identifier describing from where to delete the statistics. If stattab is NULL, then the statistics are deleted directly in the dictionary.
statid : Identifier (optional) to associate with these statistics within stattab (Only pertinent if stattab is not NULL).
statown : Schema containing stattab (if different than ownname).
Set Table Stats
DBMS_STATS.set_table_stats (
ownname VARCHAR2,
tabname VARCHAR2,
partname VARCHAR2 DEFAULT NULL,
stattab VARCHAR2 DEFAULT NULL,
statid VARCHAR2 DEFAULT NULL,
numrows NUMBER DEFAULT NULL,
numblks NUMBER DEFAULT NULL,
avgrlen NUMBER DEFAULT NULL,
flags NUMBER DEFAULT NULL,
statown VARCHAR2 DEFAULT NULL);
ownname : Name of the schema.
tabname : Name of the table.
partname : Name of the table partition in which to store the statistics. If the table is partitioned and partname is NULL, then the statistics are stored at the global table level.
stattab : User stat table identifier describing where to store the statistics. If stattab is NULL, then the statistics are stored directly in the dictionary.
statid : Identifier (optional) to associate with these statistics within stattab (Only pertinent if stattab is not NUL