当前位置:网站首页>[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');
边栏推荐
- Construction of knowledge map of mall commodities
- Room rate system - login optimization
- 【基于 RT-Thread Studio的CPK-RA6M4 开发板环境搭建】
- MOS transistor realizes the automatic switching circuit of main and auxiliary power supply, with "zero" voltage drop and static current of 20ua
- HDU ACM 4578 Transformation-&gt;段树-间隔的变化
- Make (convert) ICO Icon
- Cocos2d-x box2d physical engine compilation settings
- [cpk-ra6m4 development board environment construction based on RT thread studio]
- Lavel PHP artisan automatically generates a complete set of model+migrate+controller commands
- Redis getting started complete tutorial: replication topology
猜你喜欢
How-PIL-to-Tensor
变量、流程控制与游标(MySQL)
Flutter3.0了,小程序不止于移动应用跨端运行
Redis getting started complete tutorial: replication configuration
QT Bluetooth: qbluetooth DeviceInfo
上个厕所的功夫,就把定时任务的三种调度策略说得明明白白
How-PIL-to-Tensor
Jericho turns on the display icon of the classic Bluetooth hid mobile phone to set the keyboard [chapter]
CVPR 2022 最佳论文候选 | PIP: 6个惯性传感器实现全身动捕和受力估计
centerX: 用中国特色社会主义的方式打开centernet
随机推荐
【达梦数据库】添加自动收集统计信息的任务
腾讯云原生数据库TDSQL-C入选信通院《云原生产品目录》
HDU ACM 4578 Transformation-&gt;段树-间隔的变化
Don't you know the relationship between JSP and servlet?
Cryptography series: detailed explanation of online certificate status protocol OCSP
Redis introduction complete tutorial: replication principle
Cglib agent in agent mode
Cocos2d-x Box2D物理引擎编译设置
杰理之RTC 时钟开发【篇】
Jericho turns on the display icon of the classic Bluetooth hid mobile phone to set the keyboard [chapter]
Redis getting started complete tutorial: common exceptions on the client
Codeforces round 264 (Div. 2) C gargari and Bishop [violence]
密码学系列之:在线证书状态协议OCSP详解
杰理之开启经典蓝牙 HID 手机的显示图标为键盘设置【篇】
A complete tutorial for getting started with redis: RDB persistence
商城商品的知识图谱构建
uniapp的表单验证
centerX: 用中国特色社会主义的方式打开centernet
Centerx: open centernet in the way of socialism with Chinese characteristics
Jerry's RTC clock development [chapter]