当前位置:网站首页>[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');
边栏推荐
- 2022 spring recruitment begins, and a collection of 10000 word interview questions will help you
- 【Swift】学习笔记(一)——熟知 基础数据类型,编码风格,元组,主张
- Jerry's broadcast has built-in flash prompt tone to control playback pause [chapter]
- cocos3——8.实现初学者指南
- Jerry's FM mode mono or stereo selection setting [chapter]
- HDU 4337 King Arthur&#39; S Knights it outputs a Hamiltonian circuit
- Leetcode-02 (linked list question)
- Analysis of USB network card sending and receiving data
- 从 1.5 开始搭建一个微服务框架——日志追踪 traceId
- Unity使用MaskableGraphic画一条带箭头的线
猜你喜欢
[cpk-ra6m4 development board environment construction based on RT thread studio]
Oauth2协议中如何对accessToken进行校验
Laravel php artisan 自动生成Model+Migrate+Controller 命令大全
Analysis of USB network card sending and receiving data
A complete tutorial for getting started with redis: RDB persistence
tensorboard的使用
mos管实现主副电源自动切换电路,并且“零”压降,静态电流20uA
Redis getting started complete tutorial: replication configuration
Centerx: open centernet in the way of socialism with Chinese characteristics
Shangsilicon Valley JVM Chapter 1 class loading subsystem
随机推荐
unrecognized selector sent to instance 0x10b34e810
安装 torch 0.4.1
Jerry's question about DAC output power [chapter]
Lost in the lock world of MySQL
unrecognized selector sent to instance 0x10b34e810
Utilisation de la promesse dans es6
Matlab Error (Matrix dimensions must agree)
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
Oracle connection pool is not used for a long time, and the connection fails
Netperf and network performance measurement
Cocos2d-x box2d physical engine compilation settings
A complete tutorial for getting started with redis: AOF persistence
如何分析粉丝兴趣?
制作(转换)ico图标
Unity uses maskablegraphic to draw a line with an arrow
Jerry's phonebook acquisition [chapter]
cocos3——8.实现初学者指南
树莓派设置静态ip
Introduction to ins/gps integrated navigation type
Use of promise in ES6