【效能優化】sqlplus中使用指令碼生成awr報告
sqlplus中使用指令碼生成awr報告
[oracle@ora11g ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Sep 9 07:50:32 2015
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@PROD>@?/rdbms/admin/awrrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
298637399 PROD 1 PROD
Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type:
Type Specified: html
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
------------ -------- ------------ ------------ ------------
* 298637399 1 PROD PROD ora11g.cuug.
com
Using 298637399 for database Id
Using 1 for instance number
Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed. Pressing <return> without
specifying a number lists all completed snapshots.
Enter value for num_days: 2
Listing the last 2 days of Completed Snapshots
Snap
Instance DB Name Snap Id Snap Started Level
------------ ------------ --------- ------------------ -----
PROD PROD 1 08 Sep 2015 15:06 1
2 08 Sep 2015 16:00 1
3 08 Sep 2015 17:12 1
4 08 Sep 2015 18:00 1
5 08 Sep 2015 19:00 1
6 08 Sep 2015 20:00 1
7 08 Sep 2015 21:01 1
8 08 Sep 2015 22:00 1
9 08 Sep 2015 23:00 1
10 09 Sep 2015 00:00 1
11 09 Sep 2015 01:01 1
12 09 Sep 2015 02:00 1
13 09 Sep 2015 03:00 1
14 09 Sep 2015 04:00 1
15 09 Sep 2015 05:00 1
16 09 Sep 2015 06:00 1
17 09 Sep 2015 07:00 1
18 09 Sep 2015 07:44 1
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 5
Begin Snapshot Id specified: 5
Enter value for end_snap: 6
End Snapshot Id specified: 6
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_5_6.html. To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name: 20150908_19_20.html
Using the report name 20150908_19_20.html
手動生成快照命令
SYS@PROD>exec dbms_workload_repository.create_snapshot()
PL/SQL procedure successfully completed.
SYS@PROD>
SYS@PROD>desc dba_hist_snapshot;
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
SNAP_ID NOT NULL NUMBER
DBID NOT NULL NUMBER
INSTANCE_NUMBER NOT NULL NUMBER
STARTUP_TIME NOT NULL TIMESTAMP(3)
BEGIN_INTERVAL_TIME NOT NULL TIMESTAMP(3)
END_INTERVAL_TIME NOT NULL TIMESTAMP(3)
FLUSH_ELAPSED INTERVAL DAY(5) TO SECOND(1)
SNAP_LEVEL NUMBER
ERROR_COUNT NUMBER
SNAP_FLAG NUMBER
SYS@PROD>
SYS@PROD>col BEGIN_INTERVAL_TIME for a35
SYS@PROD>col END_INTERVAL_TIME for a35
SYS@PROD>
SYS@PROD>select snap_id,BEGIN_INTERVAL_TIME,END_INTERVAL_TIME,SNAP_LEVEL from dba_hist_snapshot order by 2;
SNAP_ID BEGIN_INTERVAL_TIME END_INTERVAL_TIME SNAP_LEVEL
---------- ----------------------------------- ----------------------------------- ----------
1 08-SEP-15 02.56.03.000 PM 08-SEP-15 03.06.11.337 PM 1
2 08-SEP-15 03.06.11.337 PM 08-SEP-15 04.00.26.041 PM 1
3 08-SEP-15 05.00.52.000 PM 08-SEP-15 05.12.00.283 PM 1
4 08-SEP-15 05.12.00.283 PM 08-SEP-15 06.00.12.363 PM 1
5 08-SEP-15 06.00.12.363 PM 08-SEP-15 07.00.25.711 PM 1
6 08-SEP-15 07.00.25.711 PM 08-SEP-15 08.00.41.147 PM 1
7 08-SEP-15 08.00.41.147 PM 08-SEP-15 09.01.00.050 PM 1
8 08-SEP-15 09.01.00.050 PM 08-SEP-15 10.00.15.860 PM 1
9 08-SEP-15 10.00.15.860 PM 08-SEP-15 11.00.33.050 PM 1
10 08-SEP-15 11.00.33.050 PM 09-SEP-15 12.00.49.096 AM 1
11 09-SEP-15 12.50.42.000 AM 09-SEP-15 01.01.49.366 AM 1
12 09-SEP-15 01.40.44.000 AM 09-SEP-15 02.00.55.116 AM 1
13 09-SEP-15 02.00.55.116 AM 09-SEP-15 03.00.12.824 AM 1
14 09-SEP-15 03.00.12.824 AM 09-SEP-15 04.00.31.721 AM 1
15 09-SEP-15 04.00.31.721 AM 09-SEP-15 05.00.47.334 AM 1
16 09-SEP-15 05.00.47.334 AM 09-SEP-15 06.00.06.808 AM 1
17 09-SEP-15 06.00.06.808 AM 09-SEP-15 07.00.26.765 AM 1
18 09-SEP-15 07.00.26.765 AM 09-SEP-15 07.44.56.001 AM 1
19 09-SEP-15 07.44.56.001 AM 09-SEP-15 07.58.11.162 AM 1
19 rows selected.
SYS@PROD>
呂星昊
2015.9.10
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29475508/viewspace-1795952/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【AWR】Oracle批量生成awr報告指令碼Oracle指令碼
- 生成awr報告的指令碼指令碼
- 指令碼:定時生成awr報告指令碼
- AWR報告自動生成指令碼指令碼
- 自動生成awr報告指令碼指令碼
- 【AWR】自動生成AWR報告指令碼以及用法指令碼
- awr報告每天自動生成指令碼指令碼
- 轉貼:批量生成awr報告指令碼指令碼
- shell指令碼實現自動生成awr報告指令碼
- 【效能優化】AWR的手工生成優化
- 一個自動生成awr報告的shell指令碼指令碼
- Oracle10g 自動生成AWR報告的指令碼Oracle指令碼
- Oracle10g自動生成AWR分析報告的指令碼Oracle指令碼
- 【效能優化】Oracle 部署 Statspack並生成報告優化Oracle
- Oracle生成awr報告Oracle
- Oracle 生成awr報告Oracle
- oracle效能awr報告Oracle
- 透過shell指令碼定位效能sql和生成報告指令碼SQL
- 通過shell指令碼定位效能sql和生成報告指令碼SQL
- 手工生成AWR分析報告
- 效能優化之達夢AWR使用優化
- 【效能調優】Oracle AWR報告指標全解析Oracle指標
- 通過shell指令碼抓取awr報告中的問題sql指令碼SQL
- 透過shell指令碼抓取awr報告中的問題sql指令碼SQL
- 自動生成AWR HTML報告HTML
- 自動生成ASH報告指令碼指令碼
- 【AWR】Oracle資料庫匯出效能報告幾個指令碼的小說明Oracle資料庫指令碼
- ORACLE AWR效能報告和ASH效能報告的解讀Oracle
- 定時自動生成awr報告
- ORACLE 11G生成AWR報告Oracle
- javascript指令碼的效能優化JavaScript指令碼優化
- 儲存過程批量生成awr指令碼儲存過程指令碼
- Oracle AWR與ASH效能報告深入解析Oracle
- Oracle 11g RAC 如何生成AWR報告?Oracle
- Oracle 11g RAC生成 AWR 報告方法Oracle
- AWR Report 自動生成指令碼 [final]指令碼
- 【效能最佳化】Oracle 部署 Statspack並生成報告Oracle
- 使用shell定製awr指令碼指令碼