oracle 11g 手动收集用户统计信息
发表于:2025-01-23 作者:千家信息网编辑
千家信息网最后更新 2025年01月23日,日常手动收集统计信息,常用参数如下。用户名为ROIDBAexec dbms_stats.gather_schema_stats('ROIDBA',estimate_percent=>20,no_inv
千家信息网最后更新 2025年01月23日oracle 11g 手动收集用户统计信息
日常手动收集统计信息,常用参数如下。用户名为ROIDBA
exec dbms_stats.gather_schema_stats('ROIDBA',estimate_percent=>20,no_invalidate=>DBMS_STATS.AUTO_INVALIDATE,method_opt=>'for all columns size auto',force=>TRUE,cascade=>TRUE,degree=>4);
GATHER_SCHEMA_STATS ProceduresThis procedure gathers statistics for all objects in a schema.SyntaxDBMS_STATS.GATHER_SCHEMA_STATS ( ownname VARCHAR2, estimate_percent NUMBER DEFAULT to_estimate_percent_type (get_param('ESTIMATE_PERCENT')), block_sample BOOLEAN DEFAULT FALSE, method_opt VARCHAR2 DEFAULT get_param('METHOD_OPT'), degree NUMBER DEFAULT to_degree_type(get_param('DEGREE')), granularity VARCHAR2 DEFAULT GET_PARAM('GRANULARITY'), cascade BOOLEAN DEFAULT to_cascade_type(get_param('CASCADE')), stattab VARCHAR2 DEFAULT NULL, statid VARCHAR2 DEFAULT NULL, options VARCHAR2 DEFAULT 'GATHER', objlist OUT ObjectTab, statown VARCHAR2 DEFAULT NULL, no_invalidate BOOLEAN DEFAULT to_no_invalidate_type ( get_param('NO_INVALIDATE')), force BOOLEAN DEFAULT FALSE, obj_filter_list ObjectTab DEFAULT NULL);DBMS_STATS.GATHER_SCHEMA_STATS ( ownname VARCHAR2, estimate_percent NUMBER DEFAULT to_estimate_percent_type (get_param('ESTIMATE_PERCENT')), block_sample BOOLEAN DEFAULT FALSE, method_opt VARCHAR2 DEFAULT get_param('METHOD_OPT'), degree NUMBER DEFAULT to_degree_type(get_param('DEGREE')), granularity VARCHAR2 DEFAULT GET_PARAM('GRANULARITY'), cascade BOOLEAN DEFAULT to_cascade_type(get_param('CASCADE')), stattab VARCHAR2 DEFAULT NULL, statid VARCHAR2 DEFAULT NULL, options VARCHAR2 DEFAULT 'GATHER', statown VARCHAR2 DEFAULT NULL, no_invalidate BOOLEAN DEFAULT to_no_invalidate_type ( get_param('NO_INVALIDATE'), force BOOLEAN DEFAULT FALSE, obj_filter_list ObjectTab DEFAULT NULL);ParametersTable 142-43 GATHER_SCHEMA_STATS Procedure ParametersParameter DescriptionownnameSchema to analyze (NULL means current schema)estimate_percentPercentage of rows to estimate (NULL means compute): The valid range is [0.000001,100]. Use the constant DBMS_STATS.AUTO_SAMPLE_SIZE to have Oracle determine the appropriate sample size for good statistics. This is the default.The default value can be changed using the SET_DATABASE_PREFS Procedure, SET_GLOBAL_PREFS Procedure, SET_SCHEMA_PREFS Procedure and SET_TABLE_PREFS Procedure.block_sampleWhether or not to use random block sampling instead of random row sampling. Random block sampling is more efficient, but if the data is not randomly distributed on disk, then the sample values may be somewhat correlated. Only pertinent when doing an estimate statistics.method_optAccepts:FOR ALL [INDEXED | HIDDEN] COLUMNS [size_clause]FOR COLUMNS [size clause] column [size_clause] [,column [size_clause]...]size_clause is defined as size_clause := SIZE {integer | REPEAT | AUTO | SKEWONLY}column is defined as column := column_name | extension name | extension- integer : Number of histogram buckets. Must be in the range [1,254].- REPEAT : Collects histograms only on the columns that already have histograms- AUTO : Oracle determines the columns on which to collect histograms based on data distribution and the workload of the columns.- SKEWONLY : Oracle determines the columns on which to collect histograms based on the data distribution of the columns.The default is FOR ALL COLUMNS SIZE AUTO.The default value can be changed using the SET_DATABASE_PREFS Procedure, SET_GLOBAL_PREFS Procedure, SET_SCHEMA_PREFS Procedure and SET_TABLE_PREFS Procedure.degreeDegree of parallelism. The default for degree is NULL. The default value can be changed using the SET_DATABASE_PREFS Procedure, SET_GLOBAL_PREFS Procedure, SET_SCHEMA_PREFS Procedure and SET_TABLE_PREFS Procedure. NULL means use the table default value specified by the DEGREE clause in the CREATE TABLE or ALTER TABLE statement. Use the constant DBMS_STATS.DEFAULT_DEGREE to specify the default value based on the initialization parameters. The AUTO_DEGREE value determines the degree of parallelism automatically. This is between 1 (serial execution) and DEFAULT_DEGREE (the system default value based on number of CPUs and initialization parameters) according to the size of the object. When using DEGREE=>NULL, DEGREE=>n, or DEGREE=>DBMS_STATS.DEFAULT_DEGREE, the current implementation of DBMS_STATS may use serial execution if the size of the object does not warrant parallel execution.granularityGranularity of statistics to collect (only pertinent if the table is partitioned).'ALL' - Gathers all (subpartition, partition, and global) statistics'AUTO'- Determines the granularity based on the partitioning type. This is the default value.'DEFAULT' - Gathers global and partition-level statistics. This option is obsolete, and while currently supported, it is included in the documentation for legacy reasons only. You should use the 'GLOBAL AND PARTITION' for this functionality. Note that the default value is now 'AUTO'.'GLOBAL' - Gathers global statistics'GLOBAL AND PARTITION' - Gathers the global and partition level statistics. No subpartition level statistics are gathered even if it is a composite partitioned object.'PARTITION '- Gathers partition-level statistics'SUBPARTITION' - Gathers subpartition-level statistics.cascadeGather statistics on the indexes as well. 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. Use the constant DBMS_STATS.AUTO_CASCADE to have Oracle determine whether index statistics to be collected or not. This is the default. The default value can be changed using the SET_DATABASE_PREFS Procedure, SET_GLOBAL_PREFS Procedure, SET_SCHEMA_PREFS Procedure and SET_TABLE_PREFS Procedure.stattabUser statistics table identifier describing where to save the current statisticsstatidIdentifier (optional) to associate with these statistics within stattaboptionsFurther specification of which objects to gather statistics for:GATHER: Gathers statistics on all objects in the schema.GATHER AUTO: Gathers all necessary statistics automatically. Oracle implicitly determines which objects need new statistics, and determines how to gather those statistics. When GATHER AUTO is specified, the only additional valid parameters are ownname, stattab, statid, objlist and statown; all other parameter settings are ignored. Returns a list of processed objects.GATHER STALE: Gathers 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: Gathers statistics on objects which currently have no statistics. also, return a list of objects found to have no statistics.LIST AUTO: Returns a list of objects to be processed with GATHER AUTO.LIST STALE: Returns list of stale objects as determined by looking at the *_tab_modifications views.LIST EMPTY: Returns list of objects which currently have no statistics.objlistList of objects found to be stale or emptystatownSchema containing stattab (if different than ownname)no_invalidateDoes not invalidate the dependent cursors if set to TRUE. The procedure invalidates the dependent cursors immediately if set to FALSE. Use DBMS_STATS.AUTO_INVALIDATE. to have Oracle decide when to invalidate dependent cursors. This is the default. The default can be changed using the SET_DATABASE_PREFS Procedure, SET_GLOBAL_PREFS Procedure, SET_SCHEMA_PREFS Procedure and SET_TABLE_PREFS Procedure.forceGather statistics on objects even if they are lockedobj_filter_listA list of object filters. When provided, GATHER_SCHEMA_STATS will gather statistics only on objects which satisfy at least one object filter in the list as needed. In a single object filter, we can specify the constraints on the object attributes. The attribute values specified in the object filter are case- insensitive unless double-quoted. Wildcard is allowed in the attribute values. Suppose non-NULL values s1, s2, ... are specified for attributes a1, a2, ... in one object filter. An object o is said to satisfy this object filter if (o.a1 like s1) and (o.a2 like s2) and ... is true. See Applying an Object Filter List.
信息
手动
用户
统计
参数
常用
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
移动软件开发工程师学一些什么
长沙软件开发大概多少价格
长沙互联网科技产业园区
安徽常用软件开发参考价格
nacos 注册中心内置数据库
山东师范大学网络安全考研学校
完美服务器异常
在服务器里怎么制作新手装备
方块方舟怎么修改对方的服务器
千方科技产业互联网
饥荒服务器如何中途改模式
服务器 远程管理端口未过滤
猎鹰网络安全代理
嘉昆太网络安全比赛
服务器游戏性能
超宇宙服务器
软件开发必备电脑配置
ztree加载大数据库
小程序显示服务器错误无法抢购
长沙宽睿互联网科技
什么服务器能玩tbc
地图数据库和下载地址
小学生网络安全培训内容
手机老联不到服务器怎么办
车检站网络技术员
楚雄服务器租用公司
住宿住宿行业网络安全制度
iss是什么数据库
白泽龙 网络安全
数据和数据库含义是一样的