程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> DB2數據庫 >> DB2教程 >> MetricManager

MetricManager

編輯:DB2教程

MetricManager


這部分和awr,ash,addm構成了oracle性能監控的一整套體系。內容涉及很多,下面不能夠全面詳細介紹,希望有拋磚引玉的作用。
[oracle@localhost ~]$ lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Release: 5.5
Codename: Carthage
SQL> select * from v$version where rownum=1;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production


在EM中直觀的看到已經創建的部分度量:

\
簡單創建一個度量,用於警告數據文件6使用情況:

\
SQL> alter database datafile 6 resize 2m;

數據庫已更改。

SQL> alter database datafile 6 autoextend off;

數據庫已更改。

SQL> select bytes/1024/1024 from dba_data_files where tablespace_name="WANG';


BYTES/1024/1024
---------------
2
SQL> create table tt tablespace wang as select * from t;

表已創建。
SQL> select count(*) from tt;

COUNT(*)
----------
1048576
EM中出現了告警信息:

\
我們可以用過查找:
select *from v$metricname(所有度量的名稱)
select * from dba_outstanding_alerts;(突出的告警信息)
select * from dba_alert_histZ喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcnk7o6i45r6v0MXPosD6yrejqTxicj4Kc2VsZWN0ICogZnJvbSB3cmkkX2FsZXJ0X2hpc3Ryb3k7PGJyPgpzZWxlY3QgKiBmcm9tIGRiYV90aHJlc2hvbGRzo6jj0CYjMjA1NDA7o6k8YnI+Cs2ouf22yMG/svrJ+rjmvq/Qxc+itcTKx7rzzKi9+LPMU01PTqOodiRiZ3Byb2Nlc3M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mVyYWxsIHBlcmZvcm1hbmNlLjxicj4KYWxso7qw/MCowct0eXBpY2FstcTM2NDUo6y1q8rH1Pa808HLttTPtc2ztcTQxc+iytW8r7rN1rTQ0LzGu661xNDFz6LK1byvPGJyPgpiYXNpY6O6yOe5+8no1sOzycHLYmFzaWOjrLrctuDQxc+isrvE3MrVvK88YnI+Csjno7o8YnI+CkFXUjxicj4KQURETTxicj4KU0dBxNq05tfUtq+53MDtPGJyPgrX1LavytW8r8r9vt2/4rbUz/PNs7zG0MXPorXEuabE3Dxicj4KLi4uLi4uPGJyPgouLi4uLi48YnI+CtPQ0ru49rrc1ti1xMrTzbx2JHN0YXRpc3RpY3NfbGV2ZWwgOmRpc3BsYXlzCiB0aGUgc3RhdHVzIG9mIHRoZSBzdGF0aXN0aWNzL2Fkdmlzb3JpZXMgIChodHRwOi8vZG9jcy5vcmFjbGUuY29tL2NkL0IxOTMwNl8wMS9zZXJ2ZXIuMTAyL2IxNDIzNy9keW52aWV3c18yMTM1Lmh0bSNSRUZSTjMwMjY0KSAgIDxicj4KztLDx7/J0tTNqLn9diRzdGF0aXN0aWNzX2xldmVswO+1xNDFz6LX97P2yOdwZ2Esc2hhcmVkIHBvb2wgLGJ1ZmZlciBjYWNoZcrWtq+53MDtyrG1xL2o0unH+s/foaM8YnI+CjxpbWcgc3JjPQ=="http://www.2cto.com/uploadfile/Collfiles/20150426/20150426091126482.png" width="700" height="381.551362683" alt="\">
我們以buffer cache advice為例:
select statistics_name,statistics_view_name from v$statistics_level where statistics_name="Buffer Cache Advice';
\
此時我們禁用SGA自動管理:可以修改參數sga_target,設置為0
SQL> show parameter sga;


NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 404M
sga_target big integer 264M

SQL> show parameter sga_target;


NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sga_target big integer 0

此時我們通過EM:
\
baffuer cache分了76mb
上面分配信息可以通過sga動態組件查看:
select * from v$sga_dynamic_components;

\
通過em可以查看buffer cache的大小建議信息:

我們可以根據手動畫出oracle建議的buffer cache大小信息:
select size_for_estimate,ested_pyhsical_read_factor from v$shared_pool_advice
兩列可以裝換成圖標即可( size_for_estimate 橫坐標 ested_pyhsical_read_factor 縱坐標),感興趣可以自己作出。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved