Database Maintenance 維護DB
you should be able to:
Manage optimizer statistics
Manage the Automatic Workload Repository (AWR) 自動負載知識庫
Use the Automatic Database Diagnostic Monitor (ADDM) 自動數據庫診斷監控
Describe and use the advisory framework
Set alert thresholds 閾值
Use server-generated alerts
Use automated tasks
AWR --(嚴重錯誤)--> ADR 自動診斷知識庫
術語
Automatic Workload Repository (AWR): Infrastructure for data gathering, analysis, and solutions recommendations
AWR Baseline: AWR基線 A set of AWR snapshots for performance comparison
Metric: 度量值 Rate of change in a cumulative statistic
Statistics: 統計信息Data collections providing database and object detail
Optimizer statistics: 優化器統計信息Used by query optimizer
Database statistics: 數據庫統計信息Used for performance
Threshold: 閾值A boundary value againstwhich metric values are compared
Oracle Optimizer Oracle 優化器
依賴於統計信息,找出最優執行計劃:
1、評估表達式和條件
2、使用統計信息
3、決定如何訪問數據
4、多表JOIN連接方式
5、找出最優的路徑
The optimizer:
Evaluates expressions and conditions
Uses object and system statistics
Decides how to access the data
Decides how to join tables
Determines the most efficient path
SQL> SELECT COUNT() FROM hr.employees;
COUNT()
214
SQL> SELECT num_rows FROM dba_tables
2 WHERE owner='HR' AND table_name = 'EMPLOYEES';
NUM_ROWS
107
exec dbms_stats.set_table_prefs('SH','SALES','STALE_PERCENT','13');
AWR: 默認每60分鐘生成快照,默認保留8天,使用MMON進程
建議使用TYPICAL。
select from DBA_OUTSTANDING_ALERTS;
告警消失後告警信息被放入DBA_ALERT_HISTORY;
select from DBA_ALERT_HISTORY;
有狀態告警先進入DBA_OUTSTANDING_ALERT;
無狀態告警直接進入DBA_ALERT_HISTORY;