oracle自動工作負載庫(AWR):采集與性能相關的統計數據,並從統計的數據中導出性能量度,以跟蹤數據庫潛在的問題。
如何生成oracle數據庫的自動負載庫報告。
手工生成一份oracle數據庫的快照:
SQL>execute dbms_workload_repository.create_snapshot();
oracle自動負載庫的sql腳本一般位於$ORACLE_HOME/rdbms/admin目錄下,文件名為awrrpt.sql,如下圖所示:
執行oracle自動工作負載庫的sql腳本:
SQL>@?/rdbms/admin/awrrpt.sql
其中“@”表示在oracle的命令窗口中執行SQL腳本,而“?”表示$ORACLE_HOME目錄。
根據提示輸入自動負載庫的類型,默認是html格式,可以輸入txt格式。
選擇要分析哪天的數據庫性能,如果輸入1,將會列出當天的數據庫快照和對應的時間點,如果輸入2,將會列出最近兩天的數據庫快照和對應的時間點,以此類推。咱們這里輸入2,如下圖:
選擇一個開始和一個結束的快照號,這兩個快照號的時間段內數據庫不能重啟過。
按提示進行操作,生成報告后輸入:exit退出數據庫。
SQL>exit
使用ftp工具將linux下的報告傳到windows下打開。
oracle數據庫自動負載報告如下:
WORKLOAD REPOSITORY report for
| DB Name |
DB Id |
Instance |
Inst num |
Startup Time |
Release |
RAC |
| ORCL |
1384228360 |
orcl |
1 |
17-Sep-14 11:09 |
11.2.0.1.0 |
NO |
| Host Name |
Platform |
CPUs |
Cores |
Sockets |
Memory (GB) |
| localhost.localdomain |
Linux IA (32-bit) |
2 |
2 |
1 |
1.98 |
| Snap Id |
Snap Time |
Sessions |
Cursors/Session |
|
| Begin Snap: |
13 |
17-Sep-14 12:00:57 |
27 |
1.6 |
| End Snap: |
14 |
17-Sep-14 13:00:23 |
29 |
1.3 |
| Elapsed: |
59.43 (mins) |
|||
| DB Time: |
1.22 (mins) |
Report Summary
Cache Sizes
| Begin |
End |
|||
| Buffer Cache: |
324M |
324M |
Std Block Size: |
8K |
| Shared Pool Size: |
144M |
144M |
Log Buffer: |
5,012K |
Load Profile
| Per Second |
Per Transaction |
Per Exec |
Per Call |
|
| DB Time(s): |
0.0 |
0.2 |
0.01 |
0.07 |
| DB CPU(s): |
0.0 |
0.0 |
0.00 |
0.01 |
| Redo size: |
737.2 |
7,917.8 |
||
| Logical reads: |
22.2 |
237.9 |
||
| Block changes: |
2.8 |
30.2 |
||
| Physical reads: |
0.2 |
2.5 |
||
| Physical writes: |
0.2 |
2.6 |
||
| User calls: |
0.3 |
3.3 |
||
| Parses: |
2.1 |
22.3 |
||
| Hard parses: |
0.0 |
0.4 |
||
| W/A MB processed: |
0.0 |
0.2 |
||
| Logons: |
0.1 |
0.6 |
||
| Executes: |
3.6 |
38.5 |
||
| Rollbacks: |
0.0 |
0.0 |
||
| Transactions: |
0.1 |
Instance Efficiency Percentages (Target 100%)
| Buffer Nowait %: |
99.99 |
Redo NoWait %: |
100.00 |
| Buffer Hit %: |
98.95 |
In-memory Sort %: |
100.00 |
| Library Hit %: |
96.22 |
Soft Parse %: |
98.22 |
| Execute to Parse %: |
42.02 |
Latch Hit %: |
99.99 |
| Parse CPU to Parse Elapsd %: |
100.95 |
% Non-Parse CPU: |
92.74 |
Shared Pool Statistics
| Begin |
End |
|
| Memory Usage %: |
73.00 |
79.85 |
| % SQL with executions>1: |
56.93 |
82.26 |
| % Memory for SQL w/exec>1: |
51.68 |
71.33 |
Top 5 Timed Foreground Events
| Event |
Waits |
Time(s) |
Avg wait (ms) |
% DB time |
Wait Class |
| DB CPU |
15 |
19.90 |
|||
| log file sync |
67 |
2 |
23 |
2.09 |
Commit |
| db file sequential read |
28 |
0 |
2 |
0.09 |
User I/O |
| switch logfile command |
1 |
0 |
38 |
0.05 |
Administrative |
| asynch descriptor resize |
7,534 |
0 |
0 |
0.03 |
Other |
Host CPU (CPUs: 2 Cores: 2 Sockets: 1)
| Load Average Begin |
Load Average End |
%User |
%System |
%WIO |
%Idle |
| 0.05 |
0.00 |
0.3 |
0.2 |
0.6 |
95.2 |
Instance CPU
| %Total CPU |
%Busy CPU |
%DB time waiting for CPU (Resource Manager) |
| 0.3 |
7.3 |
0.0 |
Memory Statistics
| Begin |
End |
|
| Host Mem (MB): |
2,026.8 |
2,026.8 |
| SGA use (MB): |
484.0 |
484.0 |
| PGA use (MB): |
49.4 |
53.8 |
| % Host Mem used for SGA+PGA: |
26.32 |
26.53 |
oracle數據庫的自動診斷工具(ADDM)
oracle數據庫自動診斷報告腳本一般位於$ORACLE_HOME/rdbms/admin/目錄下,文件名為addmrpt.sql
如何生成一個oracle數據庫自動診斷報告:
SQL>@?/rdbms/admin/addmrpt.sql
按要求一步一步執行即可,最后通過ftp工具將報告傳到windows下進行查看。
oracle自動診斷文檔內容如下:
ADDM Report for Task 'TASK_53'
------------------------------
Analysis Period
---------------
AWR snapshot range from 13 to 14.
Time period starts at 17-SEP-14 12.00.58 PM
Time period ends at 17-SEP-14 01.00.24 PM
Analysis Target
---------------
Database 'ORCL' with DB ID 1384228360.
Database version 11.2.0.1.0.
ADDM performed an analysis of instance orcl, numbered 1 and hosted at
localhost.localdomain.
Activity During the Analysis Period
-----------------------------------
Total database time was 73 seconds.
The average number of active sessions was .02.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are no findings to report.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Additional Information
----------------------
Miscellaneous Information
-------------------------
There was no significant database activity to run the ADDM.
注意:報告的具體說明,詳見書。




