当前位置:网站首页>[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');
边栏推荐
- 体会设计细节
- Unity使用MaskableGraphic画一条带箭头的线
- [swift] learning notes (I) -- familiar with basic data types, coding styles, tuples, propositions
- 树莓派设置静态ip
- 知识图谱构建全流程
- CVPR 2022 最佳论文候选 | PIP: 6个惯性传感器实现全身动捕和受力估计
- 首届“量子计算+金融科技应用”研讨会在京成功举办
- Cocos2d-x Box2D物理引擎编译设置
- SQL Tuning Advisor一个错误ORA-00600: internal error code, arguments: [kesqsMakeBindValue:obj]
- DOMContentLoaded和window.onload
猜你喜欢
2022 spring recruitment begins, and a collection of 10000 word interview questions will help you
如何分析粉丝兴趣?
Analysis of USB network card sending and receiving data
「小样本深度学习图像识别」最新2022综述
Le tube MOS réalise le circuit de commutation automatique de l'alimentation principale et de l'alimentation auxiliaire, et la chute de tension "zéro", courant statique 20ua
IDEA重启后无法创建Servlet文件的解决方案
从 1.5 开始搭建一个微服务框架——日志追踪 traceId
腾讯云原生数据库TDSQL-C入选信通院《云原生产品目录》
Error: could not find a version that satisfies the requirement xxxxx (from versions: none) solutions
Change your posture to do operation and maintenance! GOPs 2022 Shenzhen station highlights first!
随机推荐
数学归纳与递归
Netperf and network performance measurement
Intelligent static presence detection scheme, 5.8G radar sensing technology, human presence inductive radar application
A complete tutorial for getting started with redis: problem location and optimization
SQL中删除数据
Don't you know the relationship between JSP and servlet?
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
How-PIL-to-Tensor
input_delay
How-PIL-to-Tensor
mos管實現主副電源自動切換電路,並且“零”壓降,靜態電流20uA
CVPR 2022 最佳论文候选 | PIP: 6个惯性传感器实现全身动捕和受力估计
Matlab Error (Matrix dimensions must agree)
mos管实现主副电源自动切换电路,并且“零”压降,静态电流20uA
杰理之在非蓝牙模式下,手机连接蓝牙不要跳回蓝牙模式处理方法【篇】
Codeforces Round #264 (Div. 2) C Gargari and Bishops 【暴力】
变量、流程控制与游标(MySQL)
HDU 4337 King Arthur&#39; S Knights it outputs a Hamiltonian circuit
制作(转换)ico图标
【基于 RT-Thread Studio的CPK-RA6M4 开发板环境搭建】