Oracle-Oracle SQL Report (awrsqrpt.sql/awrsqrpi.sql)生成指定SQL的统计报表
生活随笔
收集整理的這篇文章主要介紹了
Oracle-Oracle SQL Report (awrsqrpt.sql/awrsqrpi.sql)生成指定SQL的统计报表
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
概述
我們知道,Oracle提供的腳本均位于下列目錄下
$ORACLE_HOME/rdbms/admin其中,
awrsqrpt.sql用來分析某條指定的SQL語句,通過awrsqrpt.sql腳本,awr能夠生成指定曾經執行過的SQL的執行計劃,當時消耗的資源等情況。
常用的幾個如下:
- awrrpt.sql :生成指定快照區間的統計報表
- awrrpti.sql :生成指定數據庫實例,并且指定快照區間的統計報表
- awrsqlrpt.sql :生成指定快照區間,指定SQL語句(實際指定的是該語句的SQLID)的統計報表
- awrsqrpi.sql :生成指定數據庫實例,指定快照區間的指定SQL語句的統計報表
- awrddrpt.sql :指定兩個不同的時間周期,生成這兩個周期的統計對比報表
- awrddrpi.sql :指定數據庫實例,并指定兩個的不同時間周期,生成這兩個周期的統計對比報表
- addmrpt.sql:數據庫自動診斷監視工具(Automatic Database Diagnostic Monitor :ADDM)
- addmrpti.sql:指定數據庫實例,數據庫自動診斷監視工具(Automatic Database Diagnostic Monitor :ADDM)
調用后臺腳本awrsqrpt.sql獲取
artisandb:[/oracle$]sqlplus /nologSQL*Plus: Release 11.2.0.4.0 Production on Sun Jun 17 17:51:56 2018Copyright (c) 1982, 2013, Oracle. All rights reserved.SQL> connect artisan/artisan2017@PR_CC Connected. SQL> @$ORACLE_HOME/rdbms/admin/awrsqrpt.sqlCurrent Instance ~~~~~~~~~~~~~~~~DB Id DB Name Inst Num Instance ----------- ------------ -------- ------------2143881171 ARTISAN 1 artisanSpecify 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: ------ 輸入report類型,不輸入使用默認html格式Type Specified: htmlInstances in this Workload Repository schema ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~DB Id Inst Num DB Name Instance Host ------------ -------- ------------ ------------ ------------ * 2143881171 1 ARTISAN artisan artisandbUsing 2143881171 for database Id Using 1 for instance numberSpecify 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: 1 ------ 輸入列出快照近幾天的數據Listing the last day's Completed SnapshotsSnap Instance DB Name Snap Id Snap Started Level ------------ ------------ --------- ------------------ ----- artisan ARTISAN 11977 17 Jun 2018 00:00 111978 17 Jun 2018 01:00 111979 17 Jun 2018 02:00 111980 17 Jun 2018 03:00 111981 17 Jun 2018 04:00 111982 17 Jun 2018 05:00 111983 17 Jun 2018 06:00 111984 17 Jun 2018 07:00 111985 17 Jun 2018 08:00 111986 17 Jun 2018 09:00 111987 17 Jun 2018 10:00 111988 17 Jun 2018 11:00 111989 17 Jun 2018 12:00 111990 17 Jun 2018 13:00 111991 17 Jun 2018 14:00 111992 17 Jun 2018 15:01 111993 17 Jun 2018 16:00 111994 17 Jun 2018 17:00 1Specify the Begin and End Snapshot Ids ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Enter value for begin_snap: 11989 ------ 輸入開始的snapId Begin Snapshot Id specified: 11989Enter value for end_snap: 11994 ------ 輸入結束的snapId End Snapshot Id specified: 11994Specify the SQL Id ~~~~~~~~~~~~~~~~~~ Enter value for sql_id: 3r0ccnd9v7q40 ------ 輸入特定的sqlId SQL ID specified: 3r0ccnd9v7q40Specify the Report Name ~~~~~~~~~~~~~~~~~~~~~~~ The default report file name is awrsqlrpt_1_11989_11994.html. To use this name, press <return> to continue, otherwise enter an alternative.Enter value for report_name: ------ 輸入報告名稱,不輸入使用默認名稱Using the report name awrsqlrpt_1_11989_11994.html........ ........ ........ Report written to awrsqlrpt_1_11989_11994.html下載查看
集群中指定特定實例的SQL語句的SQL Report
針對多實例數據庫,使用
@$ORACLE_HOME/rdbms/admin/awrsqrpi.sql總結
以上是生活随笔為你收集整理的Oracle-Oracle SQL Report (awrsqrpt.sql/awrsqrpi.sql)生成指定SQL的统计报表的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 实战SSM_O2O商铺_25【商品类别】
- 下一篇: 实战SSM_O2O商铺_26【商品类别】