当前位置:网站首页>[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');
边栏推荐
- 安装 torch 0.4.1
- HDU 4337 King Arthur&#39;s Knights 它输出一个哈密顿电路
- 新标杆!智慧化社会治理
- SSL证书错误怎么办?浏览器常见SSL证书报错解决办法
- 尚硅谷JVM-第一章 类加载子系统
- The whole process of knowledge map construction
- leetcode
- 2022年信息安全工程师考试大纲
- centerX: 用中国特色社会主义的方式打开centernet
- [secretly kill little partner pytorch20 days] - [Day1] - [example of structured data modeling process]
猜你喜欢

input_delay

Use of tensorboard

存储过程与函数(MySQL)

杰理之开启经典蓝牙 HID 手机的显示图标为键盘设置【篇】
![Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]](/img/8c/e8f7e667e4762a4815e97c36a2759f.png)
Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]

Uniapp adaptation problem

“去虚向实”大潮下,百度智能云向实而生

Cryptography series: detailed explanation of online certificate status protocol OCSP

How to verify accesstoken in oauth2 protocol

Form validation of uniapp
随机推荐
Centerx: open centernet in the way of socialism with Chinese characteristics
Redis getting started complete tutorial: replication topology
SQL Tuning Advisor一个错误ORA-00600: internal error code, arguments: [kesqsMakeBindValue:obj]
A complete tutorial for getting started with redis: problem location and optimization
leetcode
Cocos2d-x box2d physical engine compilation settings
安装 torch 0.4.1
源代码保密的意义和措施
[cpk-ra6m4 development board environment construction based on RT thread studio]
Redis introduction complete tutorial: client case analysis
2022年信息安全工程师考试大纲
The solution of unable to create servlet file after idea restart
尚硅谷JVM-第一章 类加载子系统
新标杆!智慧化社会治理
Lingyun going to sea | yidiantianxia & Huawei cloud: promoting the globalization of Chinese e-commerce enterprise brands
如何分析粉丝兴趣?
密码学系列之:在线证书状态协议OCSP详解
uniapp的表单验证
Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]
opencv环境的搭建,并打开一个本地PC摄像头。