statistic_level

本文详细介绍了Oracle数据库中STATISTICS_LEVEL参数的作用、默认值、修改方式以及不同设置对数据库性能和管理的影响,包括对各类系统统计信息的收集情况对比。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

statistic_level
-------------------------------------------------------
Property <wbr><wbr><wbr><wbr><wbr> | <wbr><wbr> Description<br> Parameter type <wbr><wbr> | <wbr><wbr> String<br> Syntax<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> | <wbr><wbr><wbr> STATISTICS_LEVEL = { ALL | TYPICAL | BASIC }<br> Default value<wbr><wbr><wbr><wbr> | <wbr><wbr><wbr> TYPICAL<br> Modifiable<wbr><wbr><wbr><wbr><wbr><wbr><wbr> | <wbr><wbr><wbr> ALTER SESSION, ALTER SYSTEM<br> -----------------------------------------------------------<br><br> STATISTICS_LEVELspecifies the level of collection for database and operating<br> system statistics. The Oracle Database collects these statistics for a variety of purposes,<br> including making self-management decisions.<br> The default setting of TYPICALensures collection of all major statistics required for<br> database self-management functionality and provides best overall performance. The<br> default value should be adequate for most environments.<br> When the STATISTICS_LEVELparameter is set to ALL, additional statistics are added<br> to the set of statistics collected with the TYPICALsetting. The additional statistics are<br> timed OS statistics and plan execution statistics.<br><br> Setting the STATISTICS_LEVELparameter to BASIC disables the collection of many<br> of the important statistics required by Oracle Database features and functionality,<br> including:<br> ■ Automatic Workload Repository (AWR) Snapshots<br> ■ Automatic Database Diagnostic Monitor (ADDM)<br> ■ All server-generated alerts<br> ■ Automatic SGA Memory Management<br> ■ Automatic optimizer statistics collection<br> ■ Object level statistics<br> ■ End to End Application Tracing (V$CLIENT_STATS)<br> ■ Database time distribution statistics (V$SESS_TIME_MODELand V$SYS_TIME_<br> MODEL)<br> ■ Service level statistics<br> ■ Buffer cache advisory<br> ■ MTTR advisory<br> ■ Shared pool sizing advisory<br> ■ Segment level statistics<br> ■ PGA Target advisory<br> ■ Timed statistics<br> ■ Monitoring of statistics<br></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
#!/usr/bin/env python3 import logging import os import outlier import visualize from datetime import datetime from extract_config import get_pandas_sqlinfo, get_pandas_sqlinfo_dynamic_status from config import LOG_DATA_PATH, PP_LOG_DIR, LOG_LEVEL_POSTPROCESSING_PIPELINE def get_changed_firmwares(): changed_firmwares = [] try: automation_runs = get_pandas_sqlinfo_dynamic_status("SELECT * FROM automation_runs ORDER BY run_id DESC LIMIT 1000") automation_runs = automation_runs.sort_values(['run_id', 'firmware']).groupby('firmware').tail(2) df = automation_runs.drop_duplicates(subset=["firmware"]) changed_firmwares = list(df["firmware"]) except: logging.exception("could not fetch last firmwares from db") return changed_firmwares def generate_outlier_and_visualization(current_firmware): logging.info(f"Starting Cyclic Data Generation for {current_firmware}") print(f"Generating Outlier for {current_firmware}") outlier.outliergenerator(current_firmware) print(f"Generating Visualizations for {current_firmware}") visualize.run_visualization("", current_firmware) logging.info(f"performed cyclic generation of outlier and statistic plots for {current_firmware}") print("Finished outlier calculation!") if __name__ == "__main__": now = datetime.now() now_dtstring = now.strftime("%d-%m-%Y-%H-%M-%S") os.makedirs(os.path.join(PP_LOG_DIR, "outlier_logs"), exist_ok=True, mode=0o775) logfile = os.path.join(PP_LOG_DIR, "outlier_logs", f"outlier.log") #For now, only create one logfile. This avoids bloat. Also, with outlier calculation, usually only the most recent call is relevant. #TODO: Write single comprehensive logfile rotation handler for all logfiles! if os.path.exists(logfile): os.remove(logfile) fh = logging.FileHandler(logfile) sh = logging.StreamHandler() logger = logging.basicConfig(level=LOG_LEVEL_POSTPROCESSING_PIPELINE, format='%(asctime)s:%(levelname)s:%(message)s', handlers=[ fh, sh] ) if firmware_override := os.environ.get("OUTLIER_FIRMWARE", None): logging.info(f"Outlier calculation for {firmware_override}") generate_outlier_and_visualization(firmware_override) else: for firmware in get_changed_firmwares(): logging.info(f"Outlier calculation for {firmware}") try: generate_outlier_and_visualization(firmware) except: logging.exception(f"Could not generate outlier for {firmware}")
03-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值