当前位置:网站首页>[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');
边栏推荐
- Shangsilicon Valley JVM Chapter 1 class loading subsystem
- [swift] learning notes (I) -- familiar with basic data types, coding styles, tuples, propositions
- The whole process of knowledge map construction
- Simple bubble sort
- Introduction to ins/gps integrated navigation type
- Jerry's ble exiting Bluetooth mode card machine [chapter]
- centerX: 用中国特色社会主义的方式打开centernet
- Redis getting started complete tutorial: common exceptions on the client
- Room rate system - login optimization
- 杰理之FM 模式单声道或立体声选择设置【篇】
猜你喜欢

Es6中Promise的使用

硬件之OC、OD、推挽解释

尚硅谷JVM-第一章 类加载子系统

Redis getting started complete tutorial: replication topology

Redis introduction complete tutorial: replication principle

IDEA重启后无法创建Servlet文件的解决方案

CVPR 2022 最佳论文候选 | PIP: 6个惯性传感器实现全身动捕和受力估计

上个厕所的功夫,就把定时任务的三种调度策略说得明明白白
![[socket] ① overview of socket technology](/img/91/dccbf27a17418ea632c343551bccc0.png)
[socket] ① overview of socket technology

树莓派设置静态ip
随机推荐
Don't you know the relationship between JSP and servlet?
HDU ACM 4578 Transformation-&gt;段树-间隔的变化
Change your posture to do operation and maintenance! GOPs 2022 Shenzhen station highlights first!
硬件之OC、OD、推挽解释
Starting from 1.5, build a micro Service Framework -- log tracking traceid
HDU 4337 King Arthur&#39;s Knights 它输出一个哈密顿电路
cocos3——8.实现初学者指南
Appx代码签名指南
[socket] ① overview of socket technology
C language string sorting
Cocos2d-x Box2D物理引擎编译设置
【安全的办公和生产力应用程序】上海道宁为您提供ONLYOFFICE下载、试用、教程
【达梦数据库】备份恢复后要执行两个sql语句
How to analyze fans' interests?
c语言字符串排序
装饰设计企业网站管理系统源码(含手机版源码)
uniapp适配问题
How to find file accessed / created just feed minutes ago
Matlab Error (Matrix dimensions must agree)
知识图谱构建全流程