Regarding AWR Report

Hi,
I have created AWR report .But I can not identify excat problem of the database because it is taking more time to insert data into table.
How to identify this from AWR report?

Database insertion problem in table
Are these threads related? If yes, did you go through the suggestions in that thread?

Similar Messages

  • Error While Generating AWR reports

    Hi All,
    I am new to Oracle 10g. Whenever I try to run the AWR report using awrrpt.sql script I am getting below error messages. I am running this script as SYS user. Please help to generate the AWR reports. Thanks for the help in advance.
    Specify the Report Name
    ~~~~~~~~~~~~~~~~~~~~~~~
    The default report file name is awrrpt_1_22128_22131.html. To use this name,
    press <return> to continue, otherwise enter an alternative.
    Enter value for report_name: awrrpt_test.html
    Using the report name awrrpt_test.html
    select output from table(dbms_workload_repository.awr_report_html( :dbid,
    ERROR at line 1:
    ORA-04063: package body "SYS.DBMS_SWRF_REPORT_INTERNAL" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_SWRF_REPORT_INTERNAL"
    ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 309
    ORA-06512: at line 1
    Regards,
    Nanaiah

    Hi,
    When i tried to compile below packages. It gave 'Warning: Package altered with compilation errors.' message for both.
    DBMS_SWRF_REPORT_INTERNAL
    DBMS_SWRF_INTERNAL
    Again i came back to original position. Now again all 4 objects are in INVALID state. Please advice.
    Regards

  • Need help on Awr Report

    It's hard to present AWR report content here as if i go for copy paste the content alinment and format get changed. Is there any better way to present AWR report in my query.
    Here is my query.
    In a 2 hour AWR reports for a database I can see the below top 5 wait event's
    the database is running on high CPU consumption (there are very less physical reads on database and Logical read is high i suppose ) so I also gather the Segments by Logical Reads. Please provide any suggestion how can i avoid logical reads I/o for the dataabse. If you see at bottom only two segments are responsible for high logical reads.
    Please let me know if more content of AWR report is required.
    Per Second Per Transaction
    Redo size: 12,765.52 2,030.27
    Logical reads: 324,030.64 51,534.93
    Block changes: 71.62 11.39
    Physical reads: 28.26 4.49
    Physical writes: 3.84 0.61
    User calls: 333.61 53.06
    Parses: 157.16 24.99
    Hard parses: 0.17 0.03
    Sorts: 30.07 4.78
    Logons: 1.71 0.27
    Executes: 156.35 24.87
    Transactions: 6.29
    % Blocks changed per Read: 0.02 Recursive Call %: 28.05
    Rollback per transaction %: 16.17 Rows per Sort: 29.99
    Top 5 Timed Events
    Event          Waits          Time(s)     Avg Wait(ms)     % Total Call TimeWait Class
    CPU time                    4,711               88.0
    db file sequential read 190,548          356     2          6.7          User I/O
    gc current block 2-way     172,948          151     1          2.8          Cluster
    gc cr grant 2-way     128,668          67     1          1.2          Cluster
    log file sync          37,920          54     1          1.0          Commit
    Segments by Logical Reads
    Total Logical Reads: 2,342,983,880
    Captured Segments account for 99.8% of Total
    Owner Tablespace Name Object Name Subobject Name Obj. Type Logical Reads %Total
    web_dc DECOINDX D_1F01BC958000013B INDEX 909,141,504 38.80
    web_dc DECODATA DM_RELATION_TYPE_S TABLE 908,104,384 38.76
    web_dc DECOINDX D_1F01BC9580000518 INDEX 165,716,752 7.07
    web_dc DECODATA DM_RELATION_S TABLE 136,235,504 5.81
    web_dc DECOINDX D_1F01BC9580000024 INDEX 62,935,008 2.69
    Regards
    balvindar

    In a 2 hour AWR reports for a database I can see the below top 5 wait event's
    Comment: 2 hour is a too big interval to draw any conclusion. It should be 15-30 mins maximum.
    Apart from that: 88 percent of the wall time is devoted to CPU, so do you have a problem? Not at all!!! Your database is doing pretty nothing.
    the database is running on high CPU consumption (there are very less physical reads on database and Logical read is high i suppose ) so I also gather the Segments by Logical Reads. Please provide any suggestion how can i avoid logical reads I/o for the dataabse. If you see at bottom only two segments are responsible for high logical reads.
    Comment: the database is not running on high CPU consumption. You would need to run an ADDM report to be able to ascertain that. We have no data on the CPU load of the server, nor how much Oracle is contributing to the load.
    You cannot avoid logical read I/O, other than just stopping the application. You can tune them by tuning statements.
    In the future, please wrap the output in   tags (no spaces, lowercase), or I will need new glasses ;)
    Sybrand Bakker
    Senior Oracle DBA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to Understand AWR Report

    Hi
    How to understand AWR report?

    Hi,
    first of all, you need to understand things that this report is about -- like wait events, DB time, CPU time, etc. If you are familiar with these things, the rest is easy.
    There are also some articles about reading AWR reports in my blog, including some examples: http://savvinov.com/awr/
    Best regards,
    Nikolay

  • AWR reports DBMS_ALERT_INFO queries using significant elapsed time

    Hi
    10.1.0.3 / OpenVMS 8.2
    Has anyone encountered AWR reporting significant resource consumption on queries relating to DBMS_ALERT_INFO (via calls to dbms_alert.register)? The buffer busy waits % from AWR is high as well (see AWR snippets below). Oracle are suggesting this is "expected behaviour for the objects owned by
    the SYS user".
    The query takes (on average) 2.3 seconds elapsed, using 1.63 CPU seconds and is responsible for 94% of all Buffer Busy Waits.
    Elapsed CPU Elap per % Total
    Time (s) Time (s) Executions Exec (s) DB Time SQL Id
    10,965 7,746 4,756 2.3 4.7 57w71dgk5qbtx
    Module: DSA103:[CSC_ENV_1.APPLIC.][SPICE.LIB]SPC_PFS1_MA
    SELECT DISTINCT SUBSTR(KGLNAOBJ,11) SID FROM X$KGLOB WHERE KGLHDNSP = 7 AND KGLN
    AOBJ LIKE 'ORA$ALERT$%' AND BITAND(KGLHDFLG,128)!=0 UNION SELECT DISTINCT SID FR
    OM DBMS_ALERT_INFO
    Segments by Buffer Busy Waits DB/Inst: SPICE/ONLINE Snaps: 4930-5026
    Buffer
    Tablespace Subobject Obj. Busy
    Owner Name Object Name Name Type Waits %Total
    SYS SYSTEM DBMS_ALERT_INFO TABLE 130,626 93.76
    Clive

    Christophe Lize wrote:
    Closing this thread even if it's not answered...Sorry, I don't have time to test this myself now, but you shouldn't mark this thread as answered if it is not, because other people might find it and think they find an answer if they have a similar question.
    I suggest you try the following to narrow down things:
    1. Open the RAW trace file and check the cursor numbers of the "direct path reads" - check if you can find any references for those cursor numbers manually. The cursor numbers are those numbers behind the WAIT #<xx>, and you can check if you find any other entry unequal to WAIT #<xx> with the same #<xx>, for example EXEC #<xx> or FETCH #<xx>
    A short primer on how to interpret the raw trace file can also be found in MOS document 39817.1
    2. Run the RAW trace file through alternative free trace file analyzers like SQLDeveloper (yes it can process raw trace files), OraSRP or Christian Antognini's TVD$XTAT. If you have My Oracle Support access you can also try Oracle's own extended Trace Analyzer (TRCA / TRCANLZR). See MOS Note 224270.1
    Check if these tools tell you more about your specific wait event and oddities with the trace file in general.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    Co-author of the "OakTable Expert Oracle Practices" book:
    http://www.apress.com/book/view/1430226684
    http://www.amazon.com/Expert-Oracle-Practices-Database-Administration/dp/1430226684

  • Shell script for Automatic Awr Report

    Hi Good Morning,
    I have a requirement to generate the AWR report daily between (10AM - 06PM , 10AM - 01PM , 01PM - 10PM) . I have the below script for this . But the issue is this script is working only when i run it two times and before running i have to delete snap_list.lst file. Please let me know what is the problem in this script and how to resolve it.
    Script :
    dt=`date +%d%m%Y`
    cd /orabkp/awr_report
    chmod 777 *
    rm -rf snap_list.lst
    touch snap_list.lst
    #rm -rf snap_list.lst
    #rm -rf snap_list.lst
    sqlplus -s " /as sysdba " <<EOF > snap_list.lst
    host sleep 10
    @/oracle/scripts/cron_scripts/rpt1.sql;
    @?/rdbms/admin/awrrpt.sql
    HTML
    1
    `cat snap_list.lst | grep "10:0" | awk '{print $1}'`
    `cat snap_list.lst | grep "13:0" | awk '{print $1}'`
    awrrpt\_$dt\_10AM\-01PM.html
    prompt 2
    @?/rdbms/admin/awrrpt.sql
    HTML
    1
    `cat snap_list.lst | grep "13:0" | awk '{print $1}'`
    `cat snap_list.lst | grep "18:0" | awk '{print $1}'`
    awrrpt\_$dt\_01PM\-06PM.html
    @?/rdbms/admin/awrrpt.sql
    HTML
    1
    `cat snap_list.lst | grep "10:0" | awk '{print $1}'`
    `cat snap_list.lst | grep "18:0" | awk '{print $1}'`
    awrrpt\_$dt\_10AM\-06PM.html
    @?/rdbms/admin/addmrpt.sql
    `cat snap_list.lst | grep "06:0" | awk '{print $1}'`
    `cat snap_list.lst | grep "12:0" | awk '{print $1}'`
    ADDM_REPORT\_$dt\_10AM\-06PM.txt
    EOF
    exit
    cat /oracle/scripts/cron_scripts/rpt1.sql
    host echo 1
    host sleep 10
    @?/rdbms/admin/awrrpt.sql
    HTML
    1
    `cat snap_list.lst | grep "10:0" | awk '{print $1}'`
    `cat snap_list.lst | grep "13:0" | awk '{print $1}'`
    awrrpt\_$dt\_10AM\-01PM.html
    Regards
    Rajasekar

    Hi,
    Modify & Try this script used for rac awr ..
    #!/bin/ksh
    set -x
    ORACLE_SID=DBSID
    ORACLE_HOME=/u01/app/ora11g/product/11.2.0/db_1
    export ORACLE_HOME
    TERM=vt100
    export TERM
    PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/local/bin:/usr/bin/X11:/bin:/sbin:.
    PATH=$ORACLE_HOME/bin:$PATH
    export DT=`date '+%d_%b_%Y_%HH_%MM'`
    export ORACLE_BASE ORACLE_SID ORACLE_HOME PATH DT
    echo $DT
    MAIL="[email protected]"
    CMAIL="[email protected]"
    AWRR="/u01/DBA_Scripts/AWR_REPO"
    sqlplus -s "/ as sysdba"<<EOFSQL
    set head off
    set feed off
    spool /tmp/bsnap.lst
    select max(SNAP_ID)- 3 from dba_hist_snapshot;
    spool off
    spool /tmp/esnap.lst
    select max(SNAP_ID) from dba_hist_snapshot;
    spool off
    spool /tmp/iname.lst
    select instance_name from v\$instance;
    spool off
    spool /tmp/dname.lst
    select database_name from v\$database;
    spool off
    spool /tmp/inum.lst
    select instance_number from v\$instance;
    spool off
    spool /tmp/dbid.lst
    select dbid from v\$database;
    spool off
    EOFSQL
    BSNAP=`cat /tmp/bsnap.lst | tail -1 | awk '{ print $1}'`;export BSNAP
    ESNAP=`cat /tmp/esnap.lst | tail -1 | awk '{ print $1}'`;export ESNAP
    INAME=`cat /tmp/iname.lst | tail -1 | awk '{ print $1}'`;export INAME
    DNAME=`cat /tmp/dname.lst | tail -1 | awk '{ print $1}'`;export DNAME
    INUM=`cat /tmp/inum.lst | tail -1 | awk '{ print $1}'`;export INUM
    DID=`cat /tmp/dbid.lst| tail -1 | awk '{ print $1}'`;export DID
    echo "Begin Snap  : $BSNAP"
    echo "End Snap    : $ESNAP"
    #echo "InstanceName: $INAME"
    echo "DB Name     : $DNAME"
    #echo "InstanceId  : $INUM"
    echo "DB ID       : $DID"
    sqlplus -s "/ as sysdba"<<EOFSQL
          define  inst_num     = $INUM;
          define  num_days     = 12;
          define  inst_name    = 'ALL';
          define  db_name      = '$DNAME';
          define  dbid         = $DID;
          define  begin_snap   = $BSNAP;
          define  end_snap     = $ESNAP;
          define  report_type  = 'html';
          define  report_name  = $AWRR/Awr_report_$DT.html
          @@?/rdbms/admin/awrgrpti
    EOFSQL
    cat /u01/DBA_Scripts/mail_body.txt | mailx -a $AWRR/Awr_report_$DT.html -c $CMAIL -s "DB Report - DB "  $MAILThanks,
    Ajay More
    http://www.moreajays.com

  • Negative Values of Library Cache Hit Ratio in AWR Report

    Hi all,
    We are getting Negative values of Library cache hit ratio in AWR Report of 11g(11.2.0.3) with Solaris[tm] OE (64-bit).
    Please suggest us why it shows negative value.
    Instance Efficiency Percentages (Target 100%)
    Buffer Nowait %: 99.87 Redo NoWait %: 99.99
    Buffer Hit %: 92.17 In-memory Sort %: 100.00
    Library Hit %: -3,321.23 Soft Parse %: 81.95
    Execute to Parse %: 92.88 Latch Hit %: 95.11
    Parse CPU to Parse Elapsd %: 87.25 % Non-Parse CPU: 81.39
    Regards,
    Madhan
    Edited by: user12078989 on Jul 25, 2012 7:40 AM

    Hi Aman,
    DB not restarted during this time.. we don't have production access. we will get awr report automatically from customer daily. also i am getting issue in our local environment v$rowcache view gets values is negative for dc_users and dc_tablespaces parameter may be it's related production issue...

  • Total of %db time column is greater than 100 in AWR report

    Hello,
    I have a query regarding "To 5 timed foreground events" section of AWR report.
    On many occassions I found that the sum of all the values in the %db time column as mentioned above is grater than 100.
    How can percentage be greater than 100?
    Event
    Waits
    Time(s)
    Avg wait (ms)
    % DB time
    Wait Class
    DB CPU
    29,212
    98.18
    latch: shared pool
    2,291
    286
    125
    0.96
    Concurrency
    direct path read
    147,998
    112
    1
    0.38
    User I/O
    library cache: mutex X
    4,831
    92
    19
    0.31
    Concurrency
    log file sync
    36,736
    72
    2
    0.24
    Commit
    In the above case the total comes up to just 100.07 % but I have seen reports where the total goes beyond 120 % -130 %.
    Can you explain why this happens, please?
    Thanks,
    Rushi

    Can someone explain above situation, please?

  • How to find problematic quries using AWR report

    Hi All,
    Somebody please help me how do I analyze the AWR report to find out problematic quires and the relevant recommendation for it.
    It would be highly appreciable
    Kind Regards
    Shankar

    if youre running AWR means you got enterprise edition with the diagnostic licence pack add on. Substantial investment even in a minimal cpu configuration.
    Reason Im asking is your question is opened ended. Sure you can look at the top consuming SQL statement, but that not might be what needs tuning so you want to waste your time trying to fix things that arent broken?
    Have you got a DBA on site?

  • AWR report not getting generated hourly

    Hi
    We have an Oracle EE 11.2.0.1, on which i see that the AWR reports are being generated randomly not every hour , would anyone know if i am missing any config
    My renetention interval specified
    SQL> select SNAP_INTERVAL,RETENTION from DBA_HIST_WR_CONTROL;
    SNAP_INTERVAL RETENTION
    +00000 01:00:00.0 +00007 00:00:00.0
    Snapshot got from the awr report
    Instance DB Name Snap Id Snap Started Level
    EXX001 EXX 30941 27 Dec 2010 01:10 1
    30942 27 Dec 2010 04:22 1
    30943 27 Dec 2010 05:00 1
    30944 27 Dec 2010 06:00 1
    30945 27 Dec 2010 07:00 1
    30946 27 Dec 2010 08:01 1
    30947 28 Dec 2010 01:08 1
    30948 28 Dec 2010 06:25 1
    30949 28 Dec 2010 07:00 1
    30950 28 Dec 2010 08:00 1
    30951 28 Dec 2010 09:00 1
    30952 28 Dec 2010 10:00 1
    30954 29 Dec 2010 08:28 1
    30955 29 Dec 2010 09:00 1
    30956 29 Dec 2010 10:00 1
    30957 29 Dec 2010 11:00 1
    30958 29 Dec 2010 12:00 1
    thank you
    Jonu

    Just saw this in an oracle note regarding the mmon process suspending message (this might be due to our DB's heavy usage)
    ORA-12751 cpu time or run time policy violation [ID 761298.1]
    If the system is so over-loaded that it takes over 15 minutes to gather statistics or other MMON tasks, this error is expected.It is a functionality enhancement in 11g, as it prevents MMON from locking resources those other processes might be waiting for. In 10g , mmon slaves are allowed to run indefinitely.
    This is at database level, as many users are in contention for resources when load is high. This is a new code that will kill the MMON slave if it takes too long to complete so that normal sessions do not have
    to wait for these resources.
    Solution
    If the load on the system is extremely high, this is expected, and error can be ignored.

  • Automatic generation of AWR reports

    Hi,
    How to schedule the automatic JOB to generate the AWR reports hourly basis. ( automatic comparing between 2 snapshots and then generate the text file).
    Thanks in advance.

    Hi,
    If you want the report to be send to your mail through the ORACLE ENTERPRISE MANAGER than you have to write one perl script like below: Adjust statements and addresses as per your requirement.
    The main views are:
    dba_hist_snapshot & dba_hist_thread which are helping us in doing this.
    Hope I answered your question
    autoawr.pl :
    # My perl script for automatically generating awr report
    # By default, report is sent to DBA_EMAIL_LIST_RPT, unless
    # it's overridden by ORA_SP_EMAIL_LIST_RPT
    # 05/26/2006 - Changed snap level from 5 to 6
    # exec statspack.snap(i_snap_level => 6, i_modify_parameter => 'true');
    # NOTES
    # FUTURE ENHANCEMENTS
    # MODIFICATIONS
    # $Log: spreport.pl,v $
    # Revision 1.4 2003/09/02 21:33:14 oracle
    # bugfix (instance_number)
    # Revision 1.3 2003/08/26 19:13:22 oracle
    # add ORA_SP_HACK1
    # Revision 1.2 2003/08/26 18:54:09 oracle
    # mod
    # Revision 1.1 2003/08/26 17:19:58 oracle
    # ic
    # ----------------------- main processing -------------------------------------
    # in case $0 is a full pathname, strip of the directory name
    $progname = $0;
    $progname =~ s/^.*\/// ;
    $progdir=$0;
    $progdir=~ s/\/[^\/]*$// ; if ($progdir eq $0) { $progdir='.'; }
    # set prog to equal progname minus file extension and the "."
    $prog=$progname;
    $prog =~ s/(.*)\..*$/\1/;
    $usage="Usage: $progname <dbname> [<report_begin_datetime in a format of '08/27/07 06:30'> <duration in minutes, at least 60>]\n" ;
    if ( $#ARGV < 0 )
    print $usage;
    exit 1;
    my @arglist=@ARGV;
    $dbname=$ARGV[0];
    shift;
    if ( $#ARGV > -1) {
    $report_user_specified_time="yes";
    # $report_begin_datetime="$ARGV[0] $ARGV[1]";
    $report_begin_date=$ARGV[0];
    $report_begin_time=$ARGV[1];
    $report_begin_datetime="$report_begin_date $report_begin_time";
    $report_duration=$ARGV[2];
    print "Boris: dbg> number of ARGV=$#ARGV, report_begin_datetime=$report_begin_datetime, report_duration=$report_duration\n";
    # print "Boris: dbg> UserSpecifiedTime=$report_user_specified_time\n";
    # ----------- PORTIBILITY: set envdir to the appropriate value
    $envdir=$progdir;
    $ENV{'ENV_FILE'}="$envdir/dba.env";
    $ENV{'APP_NAME'}=$dbname;
    # ----------- End of PORTIBILITY
    # initialize execution environ.
    require("$envdir/ld_env.pl");
    require("$envdir/ora_common.pl");
    $tm_start=`date`; chop $tm_start;
    $tm_stamp=`date "+%Y%m%d"`; chop $tm_stamp;
    $tm_stamp2=`date "+%Y%m%d_%H%M%S"`; chop $tm_stamp2;
    # $ENV{'LD_ENV_DEBUG'}=1;
    my $status=&ld_env;
    # set up log file. If for some reason it's no good, set log file to /dev/null
    $LOG_PREFIX="$ENV{'ORA_ADM_DIR'}/log/${prog}_${dbname}.log";
    $LOGFILE="${LOG_PREFIX}.${tm_stamp}";
    if (open(LOGFILE, ">>$LOGFILE") == 0)
    print "Cannot open log $LOGFILE; discard log info \n";
    open(LOGFILE, ">/dev/null");
    if ( $status != 0 )
    &abort($status, \*LOGFILE, "Failed to load environ: $LD_ENV_ERRMSG\n");
    my $work_dir=$ENV{'DBA_WORK_DIR'};
    if ($work_dir eq '') {
    abort_auto(2, "Env var DBA_WORK_DIR not defined\n");
    } else {
    $status=`mkdir -p $work_dir`;
    if ($status != 0) {
    abort_auto($status, "mkdir -p $work_dir failed\n");
    # ---- main processing
    $RPT_PREFIX1="$ENV{'ORA_ADM_DIR'}/log/awr_ash/awr_${dbname}.rpt";
    $RPTFILE1="${RPT_PREFIX1}.${tm_stamp2}";
    $RPT_PREFIX2="$ENV{'ORA_ADM_DIR'}/log/awr_ash/ash_${dbname}.rpt";
    $RPTFILE2="${RPT_PREFIX2}.${tm_stamp2}";
    #### no need for a special/"perfstat" connection: $ENV{'ORA_CNCT_STR'}=get_env2('ORA_SP_CNCT_STR', 'perfstat/perfstat');
    #### print "dbg> Connecting to the database as: $ENV{'ORA_CNCT_STR'}";
    my $days_minus = get_env2('ORA_SP_DAYS_MINUS', 1);
    ### To avoid "ORA-20200: The instance was shutdown between snapshots x1 and x2", ensure that dba_hist_snapshot.startup_time is the same for min(snap_id) and max(snap_id)
    ### To avoid "ORA-20200: End Snapshot Id y1 must be greater than Begin Snapshot Id y1", take reporting time interval between 5am and 5pm
    if ( $report_user_specified_time eq "yes") {
    $awr_begin_date=$report_begin_date;
    $awr_begin_time=$report_begin_time;
    print "Boris: dbg> awr_begin_date=$awr_begin_date, awr_end_date=$awr_end_date, awr_begin_time=$awr_begin_time, awr_end_time=calculated...\n";
    $fudge=5; # that's 5min
    $sql="
    select t.dbid, t.instance_number, min(s.snap_id), max(s.snap_id)
    from dba_hist_snapshot s, dba_hist_thread t
    where --
    trunc(s.end_interval_time) = trunc(to_date('$awr_begin_date', 'MM/DD/YY'))
    and to_char(s.end_interval_time+5/1440, 'HH24:MI') >= '$awr_begin_time'
    and to_char(s.end_interval_time, 'SSSSS') <= (to_number(substr('$awr_begin_time', 1, 2))*60 + to_number(substr('$awr_begin_time', 4,2)) + $report_duration +$fudge)*60
    and t.instance_number = sys_context('userenv', 'instance')
    and t.instance_number = s.instance_number
    and t.thread# = sys_context('userenv', 'instance')
    and t.snap_id = s.snap_id
    and t.dbid = s.dbid
    group by t.dbid, t.instance_number, s.startup_time
    order by t.dbid, t.instance_number, s.startup_time desc
    else {
    $awr_days_minus=$days_minus;
    $awr_begin_time=4;
    $awr_end_time=16;
    print "Boris: dbg> awr_days_minus=$awr_days_minus, awr_begin_time=$awr_begin_time, awr_end_time=$awr_end_time\n";
    $sql="
    select t.dbid, t.instance_number, min(s.snap_id), max(s.snap_id)
    from dba_hist_snapshot s, dba_hist_thread t
    where trunc(s.begin_interval_time)= trunc(sysdate - $awr_days_minus )
    and to_char(s.begin_interval_time, 'HH24') >= $awr_begin_time
    and to_char(s.begin_interval_time, 'HH24') <= $awr_end_time
    and t.instance_number = sys_context('userenv', 'instance')
    and t.instance_number = s.instance_number
    and t.thread# = sys_context('userenv', 'instance')
    and t.snap_id = s.snap_id
    and t.dbid = s.dbid
    group by t.dbid, t.instance_number, s.startup_time
    order by t.dbid, t.instance_number, s.startup_time desc
    my @output ;
    $status = run_query($sql, \@output);
    if ( $status == 0 )
    my $line = $output[0] ;
    my ($id_dbid, $id_inst_num, $id_min, $id_max) = split(' ', $line);
    print "Boris: dbg> Query output line=$line";
    if ( $id_min eq '' || $id_max eq '' )
    # not stats
    &tee_auto("Error: can't determine min=$id_min and/or max=$id_max snap_id, days_minus=$days_minus, dbid=$id_dbid, inst#=$id_inst_num)\n");
    exit;
    else
    &tee_auto("# generate sprpt for delta between snp_id '$id_min' and '$id_max' (days_minus='$days_minus')\n# f=$RPTFILE1\n");
    if ( $report_user_specified_time eq "yes") {
    $id_ash_begin_datetime="$report_begin_date $report_begin_time";
    $id_ash_duration=$report_duration;
    else {
    $id_ash_begin_datetime=`date --date yesterday "+%D 05:00"`; chop $id_ash_begin_datetime;
    $id_ash_duration=720; #mins: 12 hours (from 5am to 5pm)
    # print "Boris: dbg> id_ash_begin_datetime=$id_ash_begin_datetime, id_ash_duraton=$id_ash_duraton\n";
    $sql = "
    spool $RPTFILE1
    select systimestamp from dual;
    spool off
    run_sql("$sql");
    $sql = "
    define dbid=$id_dbid
    define inst_num=$id_inst_num
    define begin_snap=$id_min
    define end_snap=$id_max
    define report_type='text'
    define report_name=$RPTFILE1
    @?/rdbms/admin/awrrpti
    run_sql("$sql");
    $sql = "
    define dbid=$id_dbid
    define inst_num=$id_inst_num
    define report_type='text'
    define report_name=$RPTFILE2
    define begin_time='$id_ash_begin_datetime'
    -- define default_report_duration='$id_ash_duration'
    define duration=$id_ash_duration
    -- define duration=720
    -- define end_time='$id_ash_date_begin_5pm'
    define slot_width=''
    define target_session_id=''
    define target_sql_id=''
    define target_wait_class=''
    define target_service_hash=''
    define target_module_name=''
    define target_action_name=''
    define target_client_id=''
    define target_plsql_entry=''
    @?/rdbms/admin/ashrpti
    run_sql("$sql");
    ## Concantenate: cat $RPTFILE2 >> $RPTFILE1;
    open ( awr_report, ">>", $RPTFILE1 ) or die "Could not open for writing file $RPTFILE1: $!";
    open ( ash_report, "<", $RPTFILE2 ) or die "Could not open for reading file $RPTFILE2: $!";
    while ( my $line = <ash_report> ) { print awr_report $line; }
    # send report
    my $if_notify = 1;
    if ( $if_notify && -r $RPTFILE1 )
    if ($ENV{'ORA_SP_HACK1'} eq '1') {
    &tee_auto( "# detected ORA_SP_HACK1 -- hack the report a bit...\n");
    # prefix each line of report with '# ' to hack around
    # the problem with Exchange mail server interpreting
    # certain patterns as email attachements...
    my $ed = get_env2('ED', 'ed');
    $cmd="$ed $RPTFILE1 <<eof
    Best regards,
    Rafi
    http://rafioracledba.blogspot.com/

  • How to monitor on disk i/o on healthcheck and awr report on biweekly health

    can you explain how to monitor from disk i/o and awr report from old snap shot to new snap shot
    how to check and analyze .,,,,,,,,,,,,,,,,,,,,,can any one tell few points which we can **regularly maintain for health check**
    thanks in advance
    SQL> SELECT group_number ,disk_number ,mount_status ,total_mb/1024 ,free_mb/1024
    2 ,reads, (bytes_read / (1024*1024*1024)) mb_read ,read_errs ,read_time,writes
    3 ,write_errs ,write_time FROM v$asm_disk;
    GROUP_NUMBER DISK_NUMBER MOUNT_S TOTAL_MB/1024 FREE_MB/1024 READS
    MB_READ READ_ERRS READ_TIME WRITES WRITE_ERRS WRITE_TIME
    2 0 OPENED 199.989258 0 13697147
    402.589765 0 44542.38 4358669 0 8883.86
    2 1 OPENED 199.989258 0 13653653
    405.503195 0 46014.33 4805783 0 11138.13
    2 2 OPENED 199.989258 0 15272350
    415.620874 0 45524.7 4571038 0 9806.01
    GROUP_NUMBER DISK_NUMBER MOUNT_S TOTAL_MB/1024 FREE_MB/1024 READS
    MB_READ READ_ERRS READ_TIME WRITES WRITE_ERRS WRITE_TIME
    2 3 OPENED 199.989258 0 22713630
    533.380945 0 48105.68 4692729 0 9994.31
    2 4 OPENED 199.99707 0 23986390
    547.804756 0 57601.79 5788565 0 11073.44
    1 0 OPENED 199.989258 0 310810
    47.4352741 0 9652.12 1877994 0 3490.5
    GROUP_NUMBER DISK_NUMBER MOUNT_S TOTAL_MB/1024 FREE_MB/1024 READS
    MB_READ READ_ERRS READ_TIME WRITES WRITE_ERRS WRITE_TIME
    1 1 OPENED 199.99707 0 137665
    44.7837362 0 9155.21 751099 0 3092.96
    1 2 OPENED 199.99707 0 139561
    44.7904587 0 9424.26 753116 0 2858.23
    1 3 OPENED 199.99707 0 141139
    44.7718539 0 9506.27 802414 0 2768.22
    9 rows selected.
    can you please tell me how to monitor on disk i/os which is as shown above and
    please tell me AWR report to analyze some basic points for health check
    please give some details for health check of database.
    thanks in advance

    Hi;
    What is DB version?
    Please check below doc:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28275/tdppt_degrade.htm#CACGCJDC
    Also see:
    What is AWR( Automatic workload repository ) and How to generate the AWR report? [ID 748642.1]
    How To Understand AWR Report / Statspack Report [ID 842884.1]
    Regard
    Helios

  • Generate AWR Report automatically every day

    Hi Friends,
    I would like to generate AWR Report automatically every day. How do i do it.
    The Start Time will be 00:00 of Previous day and the end Time will be : 00:00 of current day. The File format is html.
    Currently i am using awrrpt.sql to generate report manually and i would like to achieve it automatically,I am not sure how to pass the values of start and end time (From which table i can get the values)?
    Regards,
    DB

    Hi, DB.
    You may use the below sql script , the sql script generates the AWR report for the duration of 2 days in HTML.
    So you  change
    1) the where condition as per your requirement,
    2) report name in sql script,
    3) and convert it as shell or bat script based on your environment, and schedule it in your OS job scheduler / crontab.
    =-=-=-=-
    connect / as sysdba
    REM set termout off
    variable snap1 number
    variable snap2 number
    COLUMN starthr new_value bhr
    COLUMN endhr new_value ehr
    COLUMN crdate new_value cdt
    begin
    select
      distinct  min(s.snap_id)
    into :snap1
      from dba_hist_snapshot s
    where to_char(trunc(end_interval_time,'HH24'),'HH24') = to_char(trunc(sysdate,'HH24'),'HH24')-2 and trunc(end_interval_time)=trunc(sysdate);
    select
      distinct max(s.snap_id)
    into :snap2
      from dba_hist_snapshot s
    where to_char(trunc(end_interval_time,'HH24'),'HH24') =to_char(trunc(sysdate,'HH24'),'HH24') and trunc(end_interval_time)=trunc(sysdate);
    end;
    COLUMN starthr new_value bhr
    COLUMN endhr new_value ehr
    COLUMN crdate new_value cdt
    select to_char(trunc(sysdate, 'HH24'),'HH24')-2 starthr,
            to_char(trunc(sysdate, 'HH24'),'HH24') endhr,
           to_char(trunc(sysdate),'DD-MON-YYYY') crdate
    from dual;
    define begin_snap=:snap1
    define end_snap=:snap2
    define report_name=/orashare1/reports/awrreport/AWRRPT_PROD_1_${1^^}_${EXDATE}_mor.html
    define  report_type  = 'html';
    @@?/rdbms/admin/awrrpt.sql
    exit

  • Automation of AWR report.

    Hi All,
    I want to automate for awr report generating for every 30 min. For this I am creating a script which is not working properly. Script given below.
    1. Declaring an variable
    2. Giving value to the variable by running sql query
    3. Executing dbms_workload_repository procedure.
    Please help me proper steps.
    SET SERVEROUTPUT ON
    Declare
    DBID_NUM NUMBER;
    INST_NUMBER NUMBER;
    MAX_SNAP_ID NUMBER;
    MIN_SNAP_ID NUMBER;
    DBID_NUM := select DBID into DBID_NUM from dba_hist_snapshot WHERE ROWNUM=1;
    INS_NUMBER := select INSTANCE_NUMBER into INST_NUMBER from dba_hist_snapshot WHERE ROWNUM=1;
    MAX_SNAP_ID := select MAX(SNAP_ID) into MAX_SNAP_ID from dba_hist_snapshot;
    MIN_SNAP_ID =: select MAX(SNAP_ID)-1 into MIN_SNAP_ID from dba_hist_snapshot;
    Begin
    SELECT output FROM TABLE (dbms_workload_repository.awr_report_html(DBID_NUM,INST_NUMBER,MAX_SNAP_ID,MIN_SNAP_ID));
    End;
    /

    Hi,
    I am trying to help, however it's hard because you haven't clarified your end goal. What time period do you need to generate the AWR report for? Generating an AWR report from the entire range of available snap_id's is utterly useless. It's like measuring your average body temperature from the moment of birth up to now.
    How are you planning to generate it -- into a database table, into a file, to terminal output? You didn't mention that and it's impossible to deduce it from your script.
    Most importantly, why do you need to produce all these AWR reports for each 30 mins? Every 30 days, I would understand, but every 30 mins?! Do you realize that if you want to look at some trends, it much easier to do that using AWR views directly, rather than trying to extract data from html codes? And if you want your performance history just in case -- why don't you increase your SYSAUX tablespace and AWR retention, so that you can go back and generate a retrospective AWR report when needed?
    I wrote an anonymous to autogenerate an AWR report for the last snapshot and dump it to the screen, hope this helps:
    declare
      l_dbid number;
      l_inst_id number;
      l_last_snap_id number;
      l_output clob;
    begin
      select dbid into l_dbid from v$database;
      select instance_number into l_inst_id from v$instance;
      select max(snap_id) into l_last_snap_id from dba_hist_snapshot;
      for rec in (select * from table(dbms_workload_repository.awr_report_text(l_dbid,l_inst_id, l_last_snap_id - 1, l_last_snap_id))) loop
         dbms_output.put_line(rec.output);
       end loop;
    end;
    /Best regards,
    Nikolay
    P.S. You have 17 out of 21 questions unresolved. Has the forum been really this unhelpful for you?

  • Fetching parameter value without using AWR report

    Hi,
    I am working on Oracle 10.2.0.2 RAC database.
    I want to get the following values of the database in one particular day.
    maximum LOGICAL READ
    maximum PHYSICAL READ
    BUFFER HIT RATIO
    LIBRARY HIT RATIO
    The purpose is to make a monthly report where these values to be given for 30 days..
    So I donot want to get those data from thirty AWR reports.
    Can you help me?
    Thanks in advance..
    Regards,
    Anjan

    Sorry Aman for late reply..
    Can you please provide me the sql query? I've tried, but cannot do that.
    Rgd,
    Anjan

Maybe you are looking for

  • When converting from docx to pdf, some text boxes are missing. Why?

    I have a large docx file with many text boxes.  The boxes have fill and borders.  When I convert to pdf several text boxes are missing.  The text is there but the box is missing.  How can I prevent this from happening?

  • Mounting external CD-ROM

    I have plug and external scsi cd rom in my machine and i need to mount it but i am unable to found it in /dev. Where do I get it.

  • Integration of SMS with Cisco LMS 3.2

    Hi, Need assistance to confirm if SMS alerts can be integration with LMS 3.2. If yes, could you please walk me though the process. Rgds.....Navinder

  • How to put some iWeb pages onto my Blogger blog?

    I am using iWeb '09, 3.0.3 (501) There are two pages on my website that I would like to put on my personal Blogger blog. The iWeb page has a hyperlink that opens up another page. That first page also has some lightning flashes behind the old haunted

  • JavaHelp search function

    I am experiencing a problem with search function in JavaHelp. The following exception happened when typing in a word to search and hit enter: Exception occurred during event dispatching: java.lang.Error: InvocationTargetException while creating engin