当前位置:网站首页>[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');
边栏推荐
- Matlab Error (Matrix dimensions must agree)
- 凌云出海记 | 易点天下&华为云:推动中国电商企业品牌全球化
- Centerx: open centernet in the way of socialism with Chinese characteristics
- Nuggets quantification: obtain data through the history method, and use the same proportional compound weight factor as Sina Finance and snowball. Different from flush
- Cocos2d-x Box2D物理引擎编译设置
- Cglib agent in agent mode
- uniapp的表单验证
- 2022.6.28
- 体会设计细节
- Redis getting started complete tutorial: replication topology
猜你喜欢
![Jericho turns on the display icon of the classic Bluetooth hid mobile phone to set the keyboard [chapter]](/img/f4/8464bf9b66a1215265ac873f286688.png)
Jericho turns on the display icon of the classic Bluetooth hid mobile phone to set the keyboard [chapter]

杰理之开启经典蓝牙 HID 手机的显示图标为键盘设置【篇】

Do you know the five most prominent advantages of E-bidding?

Intelligent static presence detection scheme, 5.8G radar sensing technology, human presence inductive radar application

「小样本深度学习图像识别」最新2022综述
![Jericho is in non Bluetooth mode. Do not jump back to Bluetooth mode when connecting the mobile phone [chapter]](/img/ce/baa4acb1b4bfc19ccf8982e1e320b2.png)
Jericho is in non Bluetooth mode. Do not jump back to Bluetooth mode when connecting the mobile phone [chapter]

How to analyze fans' interests?

源代码保密的意义和措施

Form validation of uniapp

尚硅谷JVM-第一章 类加载子系统
随机推荐
Shangsilicon Valley JVM Chapter 1 class loading subsystem
你知道电子招标最突出的5大好处有哪些吗?
[2022 national tournament simulation] polygon - computational geometry, binary answer, multiplication
凌云出海记 | 易点天下&华为云:推动中国电商企业品牌全球化
从 1.5 开始搭建一个微服务框架——日志追踪 traceId
Starting from 1.5, build a micro Service Framework -- log tracking traceid
Jerry's RTC clock development [chapter]
How to find file accessed / created just feed minutes ago
Codeforces Round #264 (Div. 2) C Gargari and Bishops 【暴力】
c语言字符串排序
Centerx: open centernet in the way of socialism with Chinese characteristics
Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]
首届“量子计算+金融科技应用”研讨会在京成功举办
Oauth2协议中如何对accessToken进行校验
Jerry's phonebook acquisition [chapter]
A complete tutorial for getting started with redis: problem location and optimization
制作(转换)ico图标
[tools] basic concept of database and MySQL installation
How does C language (string) delete a specified character in a string?
Cglib agent in agent mode