当前位置:网站首页>[dream database] add the task of automatically collecting statistical information
[dream database] add the task of automatically collecting statistical information
2022-07-07 03:17:00 【E-cology】
Damon database has a weakness , When the amount of query data is large , The query speed becomes very slow , Engineers usually update statistical information , But users cannot operate manually from time to time , So I did a regular homework , Let the system do it regularly .
— Add a task to automatically collect statistics ( Every Saturday 1 Click to collect the statistics of the whole database ), stay SYSDBA Execute under the user
SP_INIT_JOB_SYS(1); ---- If this statement reports an error , object [SYSMAILINFO] Already exists Just wait for the information to be ignored , It indicates that the system operation has been started and will not affect
call SP_CREATE_JOB('statistics',1,0,'',0,0,'',0,'');
call SP_JOB_CONFIG_START('statistics');
call SP_ADD_JOB_STEP('statistics', 'statistics1', 0, 'begin for rs in (select ''sf_set_SESSION_para_value(''''HAGR_HASH_SIZE'''',(select cast( case when max(table_rowcount(owner,table_name))<=(select max_value from v$dm_ini where para_Name=''''HAGR_HASH_SIZE'''') and max(table_rowcount(owner,table_name))>=( select min_value from v$dm_ini where para_Name=''''HAGR_HASH_SIZE'''') then max(table_rowcount(owner,table_name)) when max(table_rowcount(owner,table_name))<( select min_value from v$dm_ini where para_Name=''''HAGR_HASH_SIZE'''') then (select min_value from v$dm_ini where para_Name=''''HAGR_HASH_SIZE'''') else (select max_value from v$dm_ini where para_Name=''''HAGR_HASH_SIZE'''') end as bigint) from dba_tables where owner=''''''||NAME||''''''));'' sql1,''DBMS_STATS.GATHER_SCHEMA_STATS(''''''||NAME||'''''',100,TRUE,''''FOR ALL COLUMNS SIZE AUTO'''');'' sql2 from SYS.SYSOBJECTS where TYPE$=''SCH'' ) loop execute immediate rs.sql1; execute immediate rs.sql2; end loop; end;', 0, 0, 0, 0, NULL, 0);
call SP_ADD_JOB_SCHEDULE('statistics', 'statistics1', 1, 2, 1, 64, 0, '01:00:00', NULL, '2021-11-08 14:54:37', NULL, '');
call SP_JOB_CONFIG_COMMIT('statistics');
边栏推荐
- Starting from 1.5, build a micro Service Framework -- log tracking traceid
- Install redis from zero
- input_ delay
- Redis getting started complete tutorial: replication configuration
- Cryptography series: detailed explanation of online certificate status protocol OCSP
- 商城商品的知识图谱构建
- Lavel PHP artisan automatically generates a complete set of model+migrate+controller commands
- How to find file accessed / created just feed minutes ago
- Opencv environment, and open a local PC camera.
- Jericho is in non Bluetooth mode. Do not jump back to Bluetooth mode when connecting the mobile phone [chapter]
猜你喜欢
MOS transistor realizes the automatic switching circuit of main and auxiliary power supply, with "zero" voltage drop and static current of 20ua
Cryptography series: detailed explanation of online certificate status protocol OCSP
Es6中Promise的使用
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
Left path cloud recursion + dynamic planning
Leetcode 77: combination
Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]
首届“量子计算+金融科技应用”研讨会在京成功举办
uniapp的表单验证
mos管實現主副電源自動切換電路,並且“零”壓降,靜態電流20uA
随机推荐
Shell programming basics
Unity使用MaskableGraphic画一条带箭头的线
How does C language (string) delete a specified character in a string?
腾讯云原生数据库TDSQL-C入选信通院《云原生产品目录》
存储过程与函数(MySQL)
Matlab Error (Matrix dimensions must agree)
Data analysis from the perspective of control theory
Jerry's phonebook acquisition [chapter]
DOMContentLoaded和window.onload
Install redis from zero
从0开始创建小程序
Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]
源代码保密的意义和措施
uniapp的表单验证
Hazel engine learning (V)
杰理之关于 DAC 输出功率问题【篇】
Jerry's FM mode mono or stereo selection setting [chapter]
美国空军研究实验室《探索深度学习系统的脆弱性和稳健性》2022年最新85页技术报告
OC, OD, push-pull explanation of hardware
Nuggets quantification: obtain data through the history method, and use the same proportional compound weight factor as Sina Finance and snowball. Different from flush