STATSPACK output

My database is having peerformance issues and this is the statspack from midnight 21st and 22nsd of March, can someone advice on what needs tunning
Cache Sizes (end)
~~~~~~~~~~~~~~~~~
Buffer Cache: 400M Std Block Size: 8K
Shared Pool Size: 152M Log Buffer: 512K
Load Profile
~~~~~~~~~~~~ Per Second Per Transaction
Redo size: 33,327.98 34,406.40
Logical reads: 10,701.41 11,047.69
Block changes: 123.68 127.68
Physical reads: 9.31 9.61
Physical writes: 11.97 12.35
User calls: 39.26 40.53
Parses: 12.15 12.54
Hard parses: 0.10 0.11
Sorts: 85.00 87.75
Logons: 0.00 0.00
Executes: 30.39 31.38
Transactions: 0.97
% Blocks changed per Read: 1.16 Recursive Call %: 48.11
Rollback per transaction %: 52.01 Rows per Sort: 28.58
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 100.00 Redo NoWait %: 100.00
Buffer Hit %: 99.98 In-memory Sort %: 100.00
Library Hit %: 99.74 Soft Parse %: 99.14
Execute to Parse %: 60.03 Latch Hit %: 100.00
Parse CPU to Parse Elapsd %: 70.40 % Non-Parse CPU: 97.93
Shared Pool Statistics Begin End
Memory Usage %: 94.61 93.62
% SQL with executions>1: 71.90 79.30
% Memory for SQL w/exec>1: 70.91 79.50
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~ % Total
Event Waits Time (s) Ela Time
CPU time 5,204 43.17
log file sync 42,837 1,598 13.26
control file parallel write 29,054 1,392 11.55
db file parallel write 4,838 1,332 11.05
log buffer space 5,733 1,020 8.46
-------------------------------------------------------------

Hi,
can someone advice on what needs tunningFrom what you posted, CPU constitutes 40% of your wait times, yet without seeing the whole report it may be hard to find the root cause.
Sometime, high CPU can be caused by non-reentrant SQL in the library cache or sub-optimal SQL (excessive consistent gets), or any number of other root causes.
From what I see, it's NOT an I/O issue, since we don't see db_file_sequential_reads or db_file_scattered_reads, so it's not likely a data buffer shortage.
I would suggest running your SP report through http://www.statspackanalyzer.com or http://www.oraperf.com and report-back with the output.
Hope this helps. . . .
Donald K. Burleson
http://www.dba-oracle.com

Similar Messages

  • How to see values for bind variables in statspack output

    Hi all.
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    PL/SQL Release 9.2.0.4.0 - Production
    CORE 9.2.0.3.0 Production
    TNS for Solaris: Version 9.2.0.4.0 - Production
    NLSRTL Version 9.2.0.4.0 - Production
    Running sprepsql.sql to get full sql and explain plan from hash value...
    SQL comes back with bind variables :1, :2, :3 etc.
    How can I find out what the values are for the bind variables so i can plug them in and run them in test db?
    Thanks for all your help.

    I don't have a trace file...
    I need to know what the values are and if there is anyway to see them from the output of the sprepsql...
    currently looks like:
    select
    r.status,
    NVL(r.required_date, to_date('12/31/3999', 'MM/DD/YYYY')),
    r.calc_qty,
    r.issued_qty,
    r.workorder_type,
    r.workorder_base_id,
    r.workorder_lot_id,
    r.workorder_split_id,
    r.workorder_sub_id,
    r.operation_seq_no,
    r.piece_no,
    r.warehouse_id,
    0,
    wbs_code
    from
    REQUIREMENT r
    where r.part_id = *:1*
    and r.workorder_type = 'W'
    and r.calc_qty > r.issued_qty
    and r.subord_wo_sub_id is null
    AND STATUS IN ('R', 'S','U','H','F')
    AND WAREHOUSE_ID = *:2*
    Thanks for your help.

  • Sga_target_size and sga_max_size

    I noticed our production Oracle Instance sga_target_size configuration might not utilize the host resource very well. The Solaris host has 32G physical memory, it is dedicated host for Oracle Instance, only one instance is running on there, but both SGA_TARGET_SIZE and SGA_MAX_SIZE are configured=2000M which is about 2G.
    I want to increased the SGA_MAX_SIZE and SGA_TARGET_SIZE to 24G so that Oracle can better utilize the memory resource.
    Any advice on this? Anything else I might neglect to check? Thanks in advance!

    Pl post details of OS and database versions.
    >
    I want to increased the SGA_MAX_SIZE and SGA_TARGET_SIZE to 24G so that Oracle can better utilize the memory resource.
    >
    Are there reasons you want to increase SGA ? Are you experiencing any performance issues ? If so, what do AWR / Statspack outputs show ?
    HTH
    Srini

  • Disk bottleneck

    Hello,
    2 weeks ago our my boss told me to check the hardware of our Oracle 8.1.7 database. Cpu and memory looked fairly normal to me.
    Now we have 10 disk in a raid10. Split up our oralog (F:), redolog (G:) and database (E:).
    Created seperate disk for paging.
    But this is what I get.
    PhysicalDisk                _Total 1           G: 3          F:           E:
    ¾ Disk Write Time           6687,393      879.397           789.015           38350.336
    Avg. Disk Bytes/Read           4096.000      0.000      0.000      4096.000
    Avq. Disk Bytes/Transfer           6626.102           6148.129      6148.129      4096.000]
    Avg. Disk Bytes/Write           6857.944      6148.129      6148.129           0.000
    Mij. Disk Queue Ienqth           432.879           8.797           8.523           409.921
    Mij. Disk Read Queue Length      31.635           0.003           0.633           26.417
    Mij. Disk sec/Transfer           1.580           0.071           0.069           17.822
    Disk Reads/sec                22.978           0.000           0.000           22.978
    Disk Transfers/sec           273.741           123.883           123.883           22.978
    Disk WriteBytes/sec      1719718.749      761648.191      761648.191      0.000I hope someone can give me a clue where to look.
    This is not even close to what I'm used to do...
    Ps: have statspack logs and pslist logs...where do I need to look for!
    Thank you in advance!
    Cheers,
    P

    Jay,
    Thank you for your reply. Can I run the sar command in windows?
    I tought this was an Unix command.
    Here is the statspack output.
    Tablespace IO Stats for DB: UNRD Instance: unrd Snaps: 13189 -13190
    ->ordered by IOs (Reads + Writes) desc
    Tablespace
                     Av      Av     Av                    Av        Buffer Av Buf
             Reads Reads/s Rd(ms) Blks/Rd       Writes Writes/s      Waits Wt(ms)
    UNI_INDEXO
             8,948      10   14.3     1.0       17,353       19         13    4.6
    UNI_DATAO
             8,114       9   12.3     1.5       15,391       17        179    0.3
    UNI_ROLLBACK
                 3       0  193.3     1.0       15,664       17        127    0.0
    UNI_TEMP
               967       1    3.0     7.9          767        1      2,699    0.1
    UNI_DATAC
               318       0    5.2     6.6          833        1         29    0.0
    TOOLS
               131       0    9.5     1.0          671        1          0    0.0
    SYSTEM
               334       0    7.4     4.0          321        0      2,699    0.1
    UNI_INDEXC
                82       0   18.3     1.0          278        0         42    0.0
    UNI_BO
               162       0    6.4     3.5           18        0          0    0.0
    File IO Stats for DB: UNRD  Instance: unrd  Snaps: 13189 -13190
    ->ordered by Tablespace, File
    Tablespace               Filename
                     Av      Av     Av                    Av        Buffer Av Buf
             Reads Reads/s Rd(ms) Blks/Rd       Writes Writes/s      Waits Wt(ms)
    SYSTEM                   E:\DATABASE\UNRD\DATA\UNRD_SYS_01.DBF
               334       0    7.4     4.0          321        0      2,699    0.1
    TOOLS                    E:\DATABASE\UNRD\DATA\TOOLS_01.DBF
               131       0    9.5     1.0          671        1          0
    UNI_BO                   E:\DATABASE\UNRD\DATA\UNRD_DATBO_01.DBF
               162       0    6.4     3.5           18        0          0
    UNI_DATAC                E:\DATABASE\UNRD\DATA\UNRD_DATCO_01.DBF
               318       0    5.2     6.6          833        1         29    0.0
    UNI_DATAO                E:\DATABASE\UNRD\DATA\UNRD_DATOP_01.DBF
                53       0   16.0     1.0           36        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_02.DBF
                73       0   11.4     1.0           72        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_03.DBF
                60       0   15.0     1.0          115        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_04.DBF
                59       0   15.9     1.0           54        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_05.DBF
               205       0    9.0     1.0          188        0          1    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_06.DBF
               218       0   11.4     1.0          260        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_07.DBF
               170       0    8.1     1.0          380        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_08.DBF
               101       0   10.2     1.0           79        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_09.DBF
               111       0   11.5     1.0          596        1         20    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_10.DBF
               211       0    7.8     1.0          534        1          7    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_11.DBF
               152       0   12.6     1.0           92        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_12.DBF
               225       0    9.4     1.0          808        1          3    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_13.DBF
               363       0    8.8     3.0          468        1          2    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_14.DBF
               685       1    5.7     2.2          149        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_15.DBF
               648       1    5.6     1.6          420        0          1    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_16.DBF
               428       0    8.6     1.1          375        0         19    2.1
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_17.DBF
               256       0   10.5     1.0          313        0          4    2.5
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_18.DBF
               322       0   10.0     3.2          340        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_19.DBF
               284       0   11.1     3.5          490        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_20.DBF
               240       0   16.1     4.0          772        1          9    0.0
    File IO Stats for DB: UNRD  Instance: unrd  Snaps: 13189 -13190
    ->ordered by Tablespace, File
    Tablespace               Filename
                     Av      Av     Av                    Av        Buffer Av Buf
             Reads Reads/s Rd(ms) Blks/Rd       Writes Writes/s      Waits Wt(ms)
    UNI_DATAO                E:\DATABASE\UNRD\DATA\UNRD_DATOP_21.DBF
               202       0   16.6     1.5          603        1          7    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_22.DBF
               182       0   11.0     1.0          197        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_23.DBF
               265       0   10.8     1.0          255        0          2    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_24.DBF
                82       0   17.2     1.0          268        0          2    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_25.DBF
                87       0   16.6     1.0          623        1         17    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_26.DBF
                90       0   19.4     1.0          341        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_27.DBF
               123       0   14.1     1.0          504        1          9    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_28.DBF
                94       0   16.8     1.0          327        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_29.DBF
                84       0   15.6     1.0          118        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_30.DBF
                63       0   18.4     1.0           49        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_31.DBF
                87       0   17.7     1.0          274        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_32.DBF
                76       0   20.5     1.0          240        0          9    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_33.DBF
                79       0   20.9     1.0          186        0          3    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_34.DBF
               172       0   16.7     1.0          371        0          1    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_35.DBF
                42       0   28.3     1.0          265        0          5    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_36.DBF
                30       0   31.0     1.0           15        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_37.DBF
                44       0   24.8     1.0          387        0          8    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_38.DBF
               121       0   11.2     1.0          833        1         26    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_39.DBF
                60       0   32.0     1.0          337        0         17    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_40.DBF
                92       0   23.8     1.0          174        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_41.DBF
               103       0   19.4     1.0           72        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_42.DBF
               116       0   16.6     1.0          164        0          1    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_43.DBF
               162       0   15.5     1.0          384        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_44.DBF
               172       0   16.1     1.0          780        1          3    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_45.DBF
               130       0   18.5     1.0          265        0          1    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_46.DBF
               152       0   16.4     1.0          219        0          0
    File IO Stats for DB: UNRD  Instance: unrd  Snaps: 13189 -13190
    ->ordered by Tablespace, File
    Tablespace               Filename
                     Av      Av     Av                    Av        Buffer Av Buf
             Reads Reads/s Rd(ms) Blks/Rd       Writes Writes/s      Waits Wt(ms)
    UNI_DATAO                E:\DATABASE\UNRD\DATA\UNRD_DATOP_47.DBF
               114       0   17.3     1.0          331        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_48.DBF
                94       0   21.9     1.0           47        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_49.DBF
                68       0   19.3     1.0          173        0          2    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_DATOP_50.DBF
                64       0   19.7     1.0           48        0          0
    UNI_INDEXC               E:\DATABASE\UNRD\DATA\UNRD_IDXCO_01.DBF
                82       0   18.3     1.0          278        0         42    0.0
    UNI_INDEXO               E:\DATABASE\UNRD\DATA\UNRD_IDXOP_01.DBF
               203       0   17.3     1.0          284        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_02.DBF
               196       0   14.0     1.0          353        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_03.DBF
               301       0   12.2     1.0          695        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_04.DBF
               272       0   14.1     1.0          526        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_05.DBF
               219       0   14.2     1.0          500        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_06.DBF
               244       0   16.8     1.0          327        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_07.DBF
               232       0   12.6     1.0          305        0          1   20.0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_08.DBF
               225       0   15.1     1.0          552        1          1    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_09.DBF
               166       0   18.7     1.0          292        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_10.DBF
               162       0   18.0     1.0          167        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_11.DBF
               226       0   12.5     1.0          250        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_12.DBF
               204       0   17.3     1.0          339        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_13.DBF
               164       0   17.2     1.0          183        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_14.DBF
               181       0   14.3     1.0          194        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_15.DBF
               478       1   15.0     1.0        2,681        3          2    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_16.DBF
               451       0   13.7     1.0        1,180        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_17.DBF
               393       0   13.6     1.0          558        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_18.DBF
               354       0   13.5     1.0          504        1          2   10.0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_19.DBF
               383       0   15.1     1.0        1,006        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_20.DBF
               425       0   15.3     1.0          820        1          0
    File IO Stats for DB: UNRD  Instance: unrd  Snaps: 13189 -13190
    ->ordered by Tablespace, File
    Tablespace               Filename
                     Av      Av     Av                    Av        Buffer Av Buf
             Reads Reads/s Rd(ms) Blks/Rd       Writes Writes/s      Waits Wt(ms)
    UNI_INDEXO               E:\DATABASE\UNRD\DATA\UNRD_IDXOP_21.DBF
               328       0   13.6     1.0          601        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_22.DBF
               371       0   12.4     1.0          443        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_23.DBF
               546       1   11.6     1.0          694        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_24.DBF
               399       0   14.4     1.0          506        1          4    2.5
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_25.DBF
               380       0   12.0     1.0          691        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_26.DBF
               328       0   11.7     1.0          593        1          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_27.DBF
               311       0   15.9     1.0          507        1          2    0.0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_28.DBF
               297       0   18.0     1.0          730        1          1   10.0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_29.DBF
               280       0   14.7     1.0          351        0          0
                             E:\DATABASE\UNRD\DATA\UNRD_IDXOP_30.DBF
               229       0   14.5     1.0          521        1          0
    UNI_ROLLBACK             E:\DATABASE\UNRD\DATA\UNRD_RBS_01.DBF
                 3       0  193.3     1.0       15,664       17        127    0.0
    UNI_TEMP                 E:\DATABASE\UNRD\DATA\UNRD_TMP_01.DBF
               967       1    3.0     7.9          767        1      2,699    0.1I do have a couple of permon running as we speak. And I do get some weird number their aswell.
    My boss won't believe it might be a hardware problem otherwise the company who wrote the software will point at us. You know how it goes..so hopefullu I can figure something out...
    thx again...really!!!
    Message was edited by:
    PeterC

  • Package.......StatsPack...Error..

    Hi.. i m tuning my Oracle Database, for that i need to install Statspack package, when i compiled package... it returned following error.
    Warning: Package Body created with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY STATSPACK:
    LINE/COL ERROR
    2045/3 PLS-00201: identifier 'SYS.DBMS_SHARED_POOL' must be declared
    2045/3 PL/SQL: Statement ignored
    HOw to solve above error..Please check the following Package, and do help me.
    Note: I m connected perfstat user, no as SYS user.
    create or replace package body STATSPACK as
    /* Define package variables.
    Variables prefixed with p_ are package variables.
    p_snap_id integer; /* snapshot id */
    p_instance_number number; /* instance number */
    p_instance_name varchar2(16); /* instance name */
    p_startup_time date; /* instance startup time */
    p_parallel varchar2(3); /* parallel server */
    p_version varchar2(17); /* Oracle release */
    p_dbid number; /* database id */
    p_host_name varchar2(64); /* host instance is on */
    p_name varchar2(9); /* database name */
    p_new_sga integer; /* Instance bounced since last snap? */
    tmp_int integer; /* initialise defaults */
    p_def_snap_level number default 5; /* default snapshot lvl */
    p_def_session_id number default 0; /* default session id */
    p_def_ucomment varchar2(160) default null;
    p_def_pin_statspack varchar2(10) default 'TRUE';
    p_def_last_modified date default SYSDATE;
    /* Below are the default threshold (_th) values for choosing SQL statements
    to store in the stats$sqlsummary table - these statements will typically
    be the statements using the most resources.
    p_def_num_sql number default 50; /* Num. SQL statements */
    p_def_executions_th number default 100; /* Num. executions */
    p_def_parse_calls_th number default 1000; /* Num. parse calls */
    p_def_disk_reads_th number default 1000; /* Num. disk reads */
    p_def_buffer_gets_th number default 10000; /* Num. buf gets */
    p_def_sharable_mem_th number default 1048576; /* Sharable memory */
    p_def_version_count_th number default 20; /* Child Cursors */
    p_def_all_init varchar2(10) default 'FALSE';
    cursor get_instance is
    select instance_number, instance_name
    , startup_time, parallel, version
    , host_name
    from v$instance;
    cursor get_db is
    select dbid, name
    from v$database;
    procedure SNAP
    (i_snap_level in number default null
    ,i_session_id in number default null
    ,i_ucomment in varchar2 default null
    ,i_num_sql in number default null
    ,i_executions_th in number default null
    ,i_parse_calls_th in number default null
    ,i_disk_reads_th in number default null
    ,i_buffer_gets_th in number default null
    ,i_sharable_mem_th in number default null
    ,i_version_count_th in number default null
    ,i_all_init in varchar2 default null
    ,i_pin_statspack in varchar2 default null
    ,i_modify_parameter in varchar2 default 'FALSE'
    is
    /* Takes a snapshot by calling the SNAP function, and discards
    the snapshot id. This is useful when automating taking
    snapshots from dbms_job
    l_snap_id number;
    begin
    l_snap_id := statspack.snap ( i_snap_level, i_session_id, i_ucomment
    , i_num_sql
    , i_executions_th
    , i_parse_calls_th
    , i_disk_reads_th
    , i_buffer_gets_th
    , i_sharable_mem_th
    , i_version_count_th
    , i_all_init
    , i_pin_statspack
    , i_modify_parameter);
    end SNAP;
    procedure MODIFY_STATSPACK_PARAMETER
    ( i_dbid in number default null
    , i_instance_number in number default null
    , i_snap_level in number default null
    , i_session_id in number default null
    , i_ucomment in varchar2 default null
    , i_num_sql in number default null
    , i_executions_th in number default null
    , i_parse_calls_th in number default null
    , i_disk_reads_th in number default null
    , i_buffer_gets_th in number default null
    , i_sharable_mem_th in number default null
    , i_version_count_th in number default null
    , i_all_init in varchar2 default null
    , i_pin_statspack in varchar2 default null
    , i_modify_parameter in varchar2 default 'TRUE'
    is
    /* Calls QAM with the modify flag, and discards the
    output variables
    l_snap_level number;
    l_session_id number;
    l_ucomment varchar2(160);
    l_num_sql number;
    l_executions_th number;
    l_parse_calls_th number;
    l_disk_reads_th number;
    l_buffer_gets_th number;
    l_sharable_mem_th number;
    l_version_count_th number;
    l_all_init varchar2(5);
    l_pin_statspack varchar2(10);
    begin
    statspack.qam_statspack_parameter( i_dbid
    , i_instance_number
    , i_snap_level
    , i_session_id
    , i_ucomment
    , i_num_sql
    , i_executions_th
    , i_parse_calls_th
    , i_disk_reads_th
    , i_buffer_gets_th
    , i_sharable_mem_th
    , i_version_count_th
    , i_all_init
    , i_pin_statspack
    , 'TRUE'
    , l_snap_level
    , l_session_id
    , l_ucomment
    , l_num_sql
    , l_executions_th
    , l_parse_calls_th
    , l_disk_reads_th
    , l_buffer_gets_th
    , l_sharable_mem_th
    , l_version_count_th
    , l_all_init
    , l_pin_statspack);
    /* As we have explicity been requested to change the parameters,
    independently of taking a snapshot, commit
    commit;
    end MODIFY_STATSPACK_PARAMETER;
    procedure QAM_STATSPACK_PARAMETER
    ( i_dbid in number default null
    , i_instance_number in number default null
    , i_snap_level in number default null
    , i_session_id in number default null
    , i_ucomment in varchar2 default null
    , i_num_sql in number default null
    , i_executions_th in number default null
    , i_parse_calls_th in number default null
    , i_disk_reads_th in number default null
    , i_buffer_gets_th in number default null
    , i_sharable_mem_th in number default null
    , i_version_count_th in number default null
    , i_all_init in varchar2 default null
    , i_pin_statspack in varchar2 default null
    , i_modify_parameter in varchar2 default 'FALSE'
    , o_snap_level out number
    , o_session_id out number
    , o_ucomment out varchar2
    , o_num_sql out number
    , o_executions_th out number
    , o_parse_calls_th out number
    , o_disk_reads_th out number
    , o_buffer_gets_th out number
    , o_sharable_mem_th out number
    , o_version_count_th out number
    , o_all_init out varchar2
    , o_pin_statspack out varchar2
    is
    /* Query And Modify statspack parameter procedure, allows query
    and/or user modification of the statistics collection parameters
    for an instance. If there are no pre-existing parameters for
    an instance, insert the Oracle defaults.
    l_instance_number number;
    l_dbid number;
    ui_all_init varchar2(5);
    l_params_exist varchar2(1);
    begin
    if ((i_dbid is null ) or (i_instance_number is null)) then
    l_dbid := p_dbid;
    l_instance_number := p_instance_number;
    else
    l_dbid := i_dbid;
    l_instance_number := i_instance_number;
    end if;
    /* Upper case any input vars which are inserted */
    ui_all_init := upper(i_all_init);
    if ( (i_modify_parameter is null)
    or (upper(i_modify_parameter) = 'FALSE') ) then
    /* Query values, if none exist, insert the defaults tempered
    with variables supplied */
    begin
    select nvl(i_session_id, session_id)
    , nvl(i_snap_level, snap_level)
    , nvl(i_ucomment, ucomment)
    , nvl(i_num_sql, num_sql)
    , nvl(i_executions_th, executions_th)
    , nvl(i_parse_calls_th, parse_calls_th)
    , nvl(i_disk_reads_th, disk_reads_th)
    , nvl(i_buffer_gets_th, buffer_gets_th)
    , nvl(i_sharable_mem_th, sharable_mem_th)
    , nvl(i_version_count_th, version_count_th)
    , nvl(ui_all_init, all_init)
    , nvl(i_pin_statspack, pin_statspack)
    into o_session_id
    , o_snap_level
    , o_ucomment
    , o_num_sql
    , o_executions_th
    , o_parse_calls_th
    , o_disk_reads_th
    , o_buffer_gets_th
    , o_sharable_mem_th
    , o_version_count_th
    , o_all_init
    , o_pin_statspack
    from stats$statspack_parameter
    where instance_number = l_instance_number
    and dbid = l_dbid;
    exception
    when NO_DATA_FOUND then
    insert into stats$statspack_parameter
    ( dbid
    , instance_number
    , session_id
    , snap_level
    , ucomment
    , num_sql
    , executions_th
    , parse_calls_th
    , disk_reads_th
    , buffer_gets_th
    , sharable_mem_th
    , version_count_th
    , all_init
    , pin_statspack
    , last_modified
    values
    ( l_dbid
    , l_instance_number
    , p_def_session_id
    , p_def_snap_level
    , p_def_ucomment
    , p_def_num_sql
    , p_def_executions_th
    , p_def_parse_calls_th
    , p_def_disk_reads_th
    , p_def_buffer_gets_th
    , p_def_sharable_mem_th
    , p_def_version_count_th
    , p_def_all_init
    , p_def_pin_statspack
    , SYSDATE
    returning nvl(i_session_id, p_def_session_id)
    , nvl(i_snap_level, p_def_snap_level)
    , nvl(i_ucomment, p_def_ucomment)
    , nvl(i_num_sql, p_def_num_sql)
    , nvl(i_executions_th, p_def_executions_th)
    , nvl(i_parse_calls_th, p_def_parse_calls_th)
    , nvl(i_disk_reads_th, p_def_disk_reads_th)
    , nvl(i_buffer_gets_th, p_def_buffer_gets_th)
    , nvl(i_sharable_mem_th, p_def_sharable_mem_th)
    , nvl(i_version_count_th, p_def_version_count_th)
    , nvl(ui_all_init, p_def_all_init)
    , nvl(i_pin_statspack, p_def_pin_statspack)
    into o_session_id
    , o_snap_level
    , o_ucomment
    , o_num_sql
    , o_executions_th
    , o_parse_calls_th
    , o_disk_reads_th
    , o_buffer_gets_th
    , o_sharable_mem_th
    , o_version_count_th
    , o_all_init
    , o_pin_statspack;
    end; /* don't modify parameter values */
    elsif upper(i_modify_parameter) = 'TRUE' then
    /* modify values, if none exist, insert the defaults tempered
    with the variables supplied */
    begin
    update stats$statspack_parameter
    set session_id = nvl(i_session_id, session_id)
    , snap_level = nvl(i_snap_level, snap_level)
    , ucomment = nvl(i_ucomment, ucomment)
    , num_sql = nvl(i_num_sql, num_sql)
    , executions_th = nvl(i_executions_th, executions_th)
    , parse_calls_th = nvl(i_parse_calls_th, parse_calls_th)
    , disk_reads_th = nvl(i_disk_reads_th, disk_reads_th)
    , buffer_gets_th = nvl(i_buffer_gets_th, buffer_gets_th)
    , sharable_mem_th = nvl(i_sharable_mem_th, sharable_mem_th)
    , version_count_th = nvl(i_version_count_th, version_count_th)
    , all_init = nvl(ui_all_init, all_init)
    , pin_statspack = nvl(i_pin_statspack, pin_statspack)
    where instance_number = l_instance_number
    and dbid = l_dbid
    returning session_id
    , snap_level
    , ucomment
    , num_sql
    , executions_th
    , parse_calls_th
    , disk_reads_th
    , buffer_gets_th
    , sharable_mem_th
    , version_count_th
    , all_init
    , pin_statspack
    into o_session_id
    , o_snap_level
    , o_ucomment
    , o_num_sql
    , o_executions_th
    , o_parse_calls_th
    , o_disk_reads_th
    , o_buffer_gets_th
    , o_sharable_mem_th
    , o_version_count_th
    , o_all_init
    , o_pin_statspack;
    if SQL%ROWCOUNT = 0 then
    insert into stats$statspack_parameter
    ( dbid
    , instance_number
    , session_id
    , snap_level
    , ucomment
    , num_sql
    , executions_th
    , parse_calls_th
    , disk_reads_th
    , buffer_gets_th
    , sharable_mem_th
    , version_count_th
    , all_init
    , pin_statspack
    , last_modified
    values
    ( l_dbid
    , l_instance_number
    , nvl(i_session_id, p_def_session_id)
    , nvl(i_snap_level, p_def_snap_level)
    , nvl(i_ucomment, p_def_ucomment)
    , nvl(i_num_sql, p_def_num_sql)
    , nvl(i_executions_th, p_def_executions_th)
    , nvl(i_parse_calls_th, p_def_parse_calls_th)
    , nvl(i_disk_reads_th, p_def_disk_reads_th)
    , nvl(i_buffer_gets_th, p_def_buffer_gets_th)
    , nvl(i_sharable_mem_th, p_def_sharable_mem_th)
    , nvl(i_version_count_th, p_def_version_count_th)
    , nvl(ui_all_init, p_def_all_init)
    , nvl(i_pin_statspack, p_def_pin_statspack)
    , SYSDATE
    returning session_id
    , snap_level
    , ucomment
    , num_sql
    , executions_th
    , parse_calls_th
    , disk_reads_th
    , buffer_gets_th
    , sharable_mem_th
    , version_count_th
    , all_init
    , pin_statspack
    into o_session_id
    , o_snap_level
    , o_ucomment
    , o_num_sql
    , o_executions_th
    , o_parse_calls_th
    , o_disk_reads_th
    , o_buffer_gets_th
    , o_sharable_mem_th
    , o_version_count_th
    , o_all_init
    , o_pin_statspack;
    end if;
    end; /* modify values */
    else
    /* error */
    raise_application_error
    (-20100,'QAM_STATSPACK_PARAMETER i_modify_parameter value is invalid');
    end if; /* modify */
    end QAM_STATSPACK_PARAMETER;
    procedure STAT_CHANGES
    /* Returns a set of differences of the values from corresponding pairs
    of rows in STATS$SYSSTAT, STATS$LIBRARYCACHE and STATS$WAITSTAT,
    based on the begin and end (bid, eid) snapshot id's specified.
    This procedure is the only call to STATSPACK made by the statsrep
    report.
    Modified to include multi-db support.
    ( bid IN number
    , eid IN number
    , db_ident IN number
    , inst_num IN number
    , parallel IN varchar2
    , lhtr OUT number, bfwt OUT number
    , tran OUT number, chng OUT number
    , ucal OUT number, urol OUT number
    , rsiz OUT number
    , phyr OUT number, phyrd OUT number
    , phyrdl OUT number
    , phyw OUT number, ucom OUT number
    , prse OUT number, hprse OUT number
    , recr OUT number, gets OUT number
    , rlsr OUT number, rent OUT number
    , srtm OUT number, srtd OUT number
    , srtr OUT number, strn OUT number
    , lhr OUT number, bc OUT varchar2
    , sp OUT varchar2, lb OUT varchar2
    , bs OUT varchar2, twt OUT number
    , logc OUT number, prscpu OUT number
    , tcpu OUT number, exe OUT number
    , prsela OUT number
    , bspm OUT number, espm OUT number
    , bfrm OUT number, efrm OUT number
    , blog OUT number, elog OUT number
    , bocur OUT number, eocur OUT number
    , dmsd OUT number, dmfc OUT number -- begin OPS
    , dfcms OUT number, dfcmr OUT number
    , dmsi OUT number, dmrv OUT number
    , dynal OUT number, dynares OUT number
    , pmrv OUT number, pmpt OUT number
    , npmrv OUT number, npmpt OUT number
    , scma OUT number, scml OUT number
    , pinc OUT number, picrnc OUT number
    , picc OUT number, picrcc OUT number
    , pbc OUT number, pbcrc OUT number
    , pcba OUT number, pccrba OUT number
    , pcrbpi OUT number
    , dynapres OUT number, dynapshl OUT number
    , prcma OUT number, prcml OUT number
    , pwrm OUT number, pfpim OUT number
    , pwnm OUT number
    , dpms OUT number, dnpms OUT number
    , glsg OUT number, glag OUT number
    , glgt OUT number, glsc OUT number
    , glac OUT number, glct OUT number
    , glrl OUT number
    , gcge OUT number, gcgt OUT number
    , gccv OUT number, gcct OUT number
    , gccrrv OUT number, gccrrt OUT number
    , gccurv OUT number, gccurt OUT number
    , gccrsv OUT number
    , gccrbt OUT number, gccrft OUT number
    , gccrst OUT number, gccusv OUT number
    , gccupt OUT number, gccuft OUT number
    , gccust OUT number -- end OPS
    ) is
    bval number;
    eval number;
    l_b_session_id number; /* begin session id */
    l_b_serial# number; /* begin serial# */
    l_e_session_id number; /* end session id */
    l_e_serial# number; /* end serial# */
    function LIBRARYCACHE_HITRATIO RETURN number is
    /* Returns Library cache hit ratio for the begin and end (bid, eid)
    snapshot id's specified
    cursor LH (i_snap_id number) is
    select sum(pins), sum(pinhits)
    from stats$librarycache
    where snap_id = i_snap_id
    and dbid = db_ident
    and instance_number = inst_num;
    bpsum number;
    bhsum number;
    epsum number;
    ehsum number;
    begin
    if not LH%ISOPEN then open LH (bid); end if;
    fetch LH into bpsum, bhsum;
    if LH%NOTFOUND then
    raise_application_error
    (-20100,'Missing start value for stats$librarycache');
    end if; close LH;
    if not LH%ISOPEN then open LH (eid); end if;
    fetch LH into epsum, ehsum;
    if LH%NOTFOUND then
    raise_application_error
    (-20100,'Missing end value for stats$librarycache');
    end if; close LH;
    return (ehsum - bhsum) / (epsum - bpsum);
    end LIBRARYCACHE_HITRATIO;
    function GET_PARAM (i_name varchar2) RETURN varchar2 is
    /* Returns the value for the init.ora parameter for the snapshot
    specified.
    cursor PARAMETER is
    select value
    from stats$parameter
    where snap_id = eid
    and dbid = db_ident
    and instance_number = inst_num
    and name = i_name;
    par_value varchar2(512);
    begin
    if not PARAMETER%ISOPEN then open PARAMETER; end if;
    fetch PARAMETER into par_value;
    if PARAMETER%NOTFOUND then
    raise_application_error
    (-20100,'Missing Init.ora parameter '|| i_name);
    end if; close PARAMETER;
    return par_value;
    end GET_PARAM;
    function GET_SYSSTAT (i_name varchar2, i_beid number) RETURN number is
    /* Returns the value for the System Statistic for the snapshot
    specified.
    cursor SYSSTAT is
    select value
    from stats$sysstat
    where snap_id = i_beid
    and dbid = db_ident
    and instance_number = inst_num
    and name = i_name;
    stat_value varchar2(512);
    begin
    if not SYSSTAT%ISOPEN then open SYSSTAT; end if;
    fetch SYSSTAT into stat_value;
    if SYSSTAT%NOTFOUND then
    raise_application_error
    (-20100,'Missing System Statistic '|| i_name);
    end if; close SYSSTAT;
    return stat_value;
    end GET_SYSSTAT;
    function BUFFER_WAITS RETURN number is
    /* Returns the total number of waits for all buffers in the interval
    specified by the begin and end snapshot id's (bid, eid)
    cursor BW (i_snap_id number) is
    select sum(wait_count)
    from stats$waitstat
    where snap_id = i_snap_id
    and dbid = db_ident
    and instance_number = inst_num;
    bbwsum number; ebwsum number;
    begin
    if not BW%ISOPEN then open BW (bid); end if;
    fetch BW into bbwsum;
    if BW%NOTFOUND then
    raise_application_error
    (-20100,'Missing start value for stats$waitstat');
    end if; close BW;
    if not BW%ISOPEN then open BW (eid); end if;
    fetch BW into ebwsum;
    if BW%NOTFOUND then
    raise_application_error
    (-20100,'Missing end value for stats$waitstat');
    end if; close BW;
    return ebwsum - bbwsum;
    end BUFFER_WAITS;
    function TOTAL_EVENT_TIME RETURN number is
    /* Returns the total amount of time waited for events for
    the interval specified by the begin and end snapshot id's
    (bid, eid) by foreground processes. This excludes idle
    wait events.
    cursor WAITS (i_snap_id number) is
    select sum(time_waited_micro)
    from stats$system_event
    where snap_id = i_snap_id
    and dbid = db_ident
    and instance_number = inst_num
    and event not in (select event from stats$idle_event);
    bwaittime number;
    ewaittime number;
    begin
    if not WAITS%ISOPEN then open WAITS (bid); end if;
    fetch WAITS into bwaittime;
    if WAITS%NOTFOUND then
    raise_application_error
    (-20100,'Missing start value for stats$system_event');
    end if; close WAITS;
    if not WAITS%ISOPEN then open WAITS (eid); end if;
    fetch WAITS into ewaittime;
    if WAITS%NOTFOUND then
    raise_application_error
    (-20100,'Missing end value for stats$system_event');
    end if; close WAITS;
    return ewaittime - bwaittime;
    end TOTAL_EVENT_TIME;
    function LATCH_HITRATIO return NUMBER is
    /* Returns the latch hit ratio specified by the begin and
    end snapshot id's (bid, eid)
    cursor GETS_MISSES (i_snap_id number) is
    select sum(gets), sum(misses)
    from stats$latch
    where snap_id = i_snap_id
    and dbid = db_ident
    and instance_number = inst_num;
    blget number; -- beginning latch gets
    blmis number; -- beginning latch misses
    elget number; -- end latch gets
    elmis number; -- end latch misses
    begin
    if not GETS_MISSES%ISOPEN then open GETS_MISSES (bid); end if;
    fetch GETS_MISSES into blget, blmis;
    if GETS_MISSES%NOTFOUND then
    raise_application_error
    (-20100,'Missing start value for STATS$LATCH gets and misses');
    end if; close GETS_MISSES;
    if not GETS_MISSES%ISOPEN then open GETS_MISSES (eid); end if;
    fetch GETS_MISSES into elget, elmis;
    if GETS_MISSES%NOTFOUND then
    raise_application_error
    (-20100,'Missing end value for STATS$LATCH gets and misses');
    end if; close GETS_MISSES;
    return ( ( elmis - blmis ) / ( elget - blget ) );
    end LATCH_HITRATIO;
    function SGASTAT (i_name varchar2, i_beid number) RETURN number is
    /* Returns the bytes used by i_name in the shared pool
    for the begin or end snapshot (bid, eid) specified
    cursor bytes_used is
    select bytes
    from stats$sgastat
    where snap_id = i_beid
    and dbid = db_ident
    and instance_number = inst_num
    and pool in ('shared pool', 'all pools')
    and name = i_name;
    total_bytes number;
    begin
    if i_name = 'total_shared_pool' then
    select sum(bytes)
    into total_bytes
    from stats$sgastat
    where snap_id = i_beid
    and dbid = db_ident
    and instance_number = inst_num
    and pool in ('shared pool','all pools');
    else
    open bytes_used; fetch bytes_used into total_bytes;
    if bytes_used%notfound then
    raise_application_error
    (-20100,'Missing value for SGASTAT: '||i_name);
    end if;
    close bytes_used;
    end if;
    return total_bytes;
    end SGASTAT;
    function SYSDIF (i_name varchar2) RETURN number is
    /* Returns the difference between statistics for the statistic
    name specified for the interval between the begin and end
    snapshot id's (bid, eid)
    cursor SY (i_snap_id number) is
    select value
    from stats$sysstat
    where snap_id = i_snap_id
    and dbid = db_ident
    and instance_number = inst_num
    and name = i_name;
    begin
    /* Get start value */
    open SY (bid); fetch SY into bval;
    if SY%notfound then
    raise_application_error
    (-20100,'Missing start value for statistic: '||i_name);
    end if; close SY;
    /* Get end value */
    open SY (eid); fetch SY into eval;
    if SY%notfound then
    raise_application_error
    (-20100,'Missing end value for statistic: '||i_name);
    end if; close SY;
    /* Return difference */
    return eval - bval;
    end SYSDIF;
    function SESDIF (st_name varchar2) RETURN number is
    /* Returns the difference between statistics values for the
    statistic name specified for the interval between the begin and end
    snapshot id's (bid, eid), for the session monitored for that
    snapshot
    cursor SE (i_snap_id number) is
    select ses.value
    from stats$sysstat sys
    , stats$sesstat ses
    where sys.snap_id = i_snap_id
    and ses.snap_id = i_snap_id
    and ses.dbid = db_ident
    and sys.dbid = db_ident
    and ses.instance_number = inst_num
    and sys.instance_number = inst_num
    and ses.statistic# = sys.statistic#
    and sys.name = st_name;
    begin
    /* Get start value */
    open SE (bid); fetch SE into bval;
    if SE%notfound then
    eval :=0;
    end if; close SE;
    /* Get end value */
    open SE (eid); fetch SE into eval;
    if SE%notfound then
    eval :=0;
    end if; close SE;
    /* Return difference */
    return eval - bval;
    end SESDIF;
    function DLMDIF (i_name varchar2) RETURN number is
    /* Returns the difference between statistics for the statistic
    name specified for the interval between the begin and end
    snapshot id's (bid, eid)
    cursor DLM (i_snap_id number) is
    select value
    from stats$dlm_misc
    where snap_id = i_snap_id
    and dbid = db_ident
    and instance_number = inst_num
    and name = i_name;
    begin
    /* Get start value */
    open DLM (bid); fetch DLM into bval;
    if DLM%notfound then
    raise_application_error
    (-20100,'Missing start value for statistic: '||i_name);
    end if; close DLM;
    /* Get end value */
    open DLM (eid); fetch DLM into eval;
    if DLM%notfound then
    raise_application_error
    (-20100,'Missing end value for statistic: '||i_name);
    end if; close DLM;
    /* Return difference */
    return eval - bval;
    end DLMDIF;
    begin /* main procedure body of STAT_CHANGES */
    lhtr := LIBRARYCACHE_HITRATIO;
    bfwt := BUFFER_WAITS;
    lhr := LATCH_HITRATIO;
    chng := SYSDIF('db block changes');
    ucal := SYSDIF('user calls');
    urol := SYSDIF('user rollbacks');
    ucom := SYSDIF('user commits');
    tran := ucom + urol;
    rsiz := SYSDIF('redo size');
    phyr := SYSDIF('physical reads');
    phyrd := SYSDIF('physical reads direct');
    phyrdl := SYSDIF('physical reads direct (lob)');
    phyw := SYSDIF('physical writes');
    hprse := SYSDIF('parse count (hard)');
    prse := SYSDIF('parse count (total)');
    gets := SYSDIF('session logical reads');
    recr := SYSDIF('recursive calls');
    rlsr := SYSDIF('redo log space requests');
    rent := SYSDIF('redo entries');
    srtm := SYSDIF('sorts (memory)');
    srtd := SYSDIF('sorts (disk)');
    srtr := SYSDIF('sorts (rows)');
    logc := SYSDIF('logons cumulative');
    prscpu := SYSDIF('parse time cpu');
    prsela := SYSDIF('parse time elapsed');
    tcpu := SYSDIF('CPU used by this session');
    exe := SYSDIF('execute count');
    bs := GET_PARAM('db_block_size');
    bc := GET_PARAM('db_block_buffers') * bs;
    if bc = 0 then
    bc := GET_PARAM('db_cache_size')
    + GET_PARAM('db_keep_cache_size')
    + GET_PARAM('db_recycle_cache_size')
    + GET_PARAM('db_2k_cache_size')
    + GET_PARAM('db_4k_cache_size')
    + GET_PARAM('db_8k_cache_size')
    + GET_PARAM('db_16k_cache_size')
    + GET_PARAM('db_32k_cache_size');
    end if;
    sp := GET_PARAM('shared_pool_size');
    lb := GET_PARAM('log_buffer');
    twt := TOTAL_EVENT_TIME; -- total wait time for all non-idle events
    bspm := SGASTAT('total_shared_pool', bid);
    espm := SGASTAT('total_shared_pool', eid);
    bfrm := SGASTAT('free memory', bid);
    efrm := SGASTAT('free memory', eid);
    blog := GET_SYSSTAT('logons current', bid);
    elog := GET_SYSSTAT('logons current', eid);
    bocur := GET_SYSSTAT('opened cursors current', bid);
    eocur := GET_SYSSTAT('opened cursors current', eid);
    /* Do we want to report on cluster-specific statistics? Check
    in procedure variable "parallel".
    if parallel = 'YES' then
    dmsd := DLMDIF('messages sent directly');
    dmfc := DLMDIF('messages flow controlled');
    dmsi := DLMDIF('messages sent indirectly');
    dmrv := DLMDIF('messages received');
    dfcms := DLMDIF('flow control messages sent');
    dfcmr := DLMDIF('flow control messages received');
    dynal := DLMDIF('dynamically allocated enqueues');
    dynares := DLMDIF('dynamically allocated resources');
    pmrv := DLMDIF('gcs msgs received');
    pmpt := DLMDIF('gcs msgs process time(ms)');
    npmrv := DLMDIF('ges msgs received');
    npmpt := DLMDIF('ges msgs process time(ms)');
    scma := DLMDIF('gcs side channel msgs actual');
    scml := DLMDIF('gcs side channel msgs logical');
    pinc := DLMDIF('gcs immediate (null) converts');
    picrnc := DLMDIF('gcs immediate cr (null) converts');
    picc := DLMDIF('gcs immediate (compatible) converts');
    picrcc := DLMDIF('gcs immediate cr (compatible) converts');
    pbc := DLMDIF('gcs blocked converts');
    pbcrc := DLMDIF('gcs blocked cr converts');
    pcba := DLMDIF('gcs compatible basts');
    pccrba := DLMDIF('gcs compatible cr basts');
    pcrbpi := DLMDIF('gcs cr basts to PIs');
    dynapres := DLMDIF('dynamically allocated gcs resources');
    dynapshl := DLMDIF('dynamically allocated gcs shadows');
    prcma := DLMDIF('gcs recovery claim msgs actual');
    prcml := DLMDIF('gcs recovery claim msgs logical');
    pwrm := DLMDIF('gcs write request msgs');
    pfpim := DLMDIF('gcs flush pi msgs');
    pwnm := DLMDIF('gcs write notification msgs');
    dpms := SYSDIF('gcs messages sent');
    dnpms := SYSDIF('ges messages sent');
    glsg := SYSDIF('global lock sync gets');
    glag := SYSDIF('global lock async gets');
    glgt := SYSDIF('global lock get time');
    glsc := SYSDIF('global lock sync converts');
    glac := SYSDIF('global lock async converts');
    glct := SYSDIF('global lock convert time');
    glrl := SYSDIF('global lock releases');
    gcge := SYSDIF('global cache gets');
    gcgt := SYSDIF('global cache get time');
    gccv := SYSDIF('global cache converts');
    gcct := SYSDIF('global cache convert time');
    gccrrv := SYSDIF('global cache cr blocks received');
    gccrrt := SYSDIF('global cache cr block receive time');
    gccurv := SYSDIF('global cache current blocks received');
    gccurt := SYSDIF('global cache current block receive time');
    gccrsv := SYSDIF('global cache cr blocks served');
    gccrbt := SYSDIF('global cache cr block build time');
    gccrft := SYSDIF('global cache cr block flush time');
    gccrst := SYSDIF('global cache cr block send time');
    gccusv := SYSDIF('global cache current blocks served');
    gccupt := SYSDIF('global cache current block pin time');
    gccuft := SYSDIF('global cache current block flush time');
    gccust := SYSDIF('global cache current block send time');
    end if;
    /* Determine if we want to report on session-specific statistics.
    Check that the session is the same one for both snapshots.
    select session_id
    , serial#
    into l_b_session_id
    , l_b_serial#
    from stats$snapshot
    where snap_id = bid
    and dbid = db_ident
    and instance_number = inst_num;
    select session_id
    , serial#
    into l_e_session_id
    , l_e_serial#
    from stats$snapshot
    where snap_id = eid
    and dbid = db_ident
    and instance_number = inst_num;
    if ( (l_b_session_id = l_e_session_id)
    and (l_b_serial# = l_e_serial#)
    and (l_b_session_id != 0) ) then
    /* we have a valid comparison - it is the
    same session - get number of tx performed
    by this session */
    strn := SESDIF('user rollbacks') + SESDIF('user commits');
    if strn = 0 then
    /* No new transactions */
    strn := 1;
    end if;
    else
    /* No valid comparison can be made */
    strn :=1;
    end if;
    end STAT_CHANGES;
    function SNAP
    (i_snap_level in number default null
    ,i_session_id in number default null
    ,i_ucomment in varchar2 default null
    ,i_num_sql in number default null
    ,i_executions_th in number default null
    ,i_parse_calls_th in number default null
    ,i_disk_reads_th in number default null
    ,i_buffer_gets_th in number default null
    ,i_sharable_mem_th in number default null
    ,i_version_count_th in number default null
    ,i_all_init in varchar2 default null
    ,i_pin_statspack in varchar2 default null
    ,i_modify_parameter in varchar2 default 'FALSE'
    RETURN integer IS
    /* This function performs a snapshot of the v$ views into the
    stats$ tables, and returns the snapshot id.
    If parameters are passed, these are the values used, otherwise
    the values stored in the stats$statspack_parameter table are used.
    l_snap_id integer;
    l_snap_level number;
    l_session_id number;
    l_serial# number;
    l_ucomment varchar2(160);
    l_num_sql number;
    l_executions_th number;
    l_parse_calls_th number;
    l_disk_reads_th number;
    l_buffer_gets_th number;
    l_sharable_mem_th number;
    l_version_count_th number;
    l_all_init varchar2(5);
    l_pin_statspack varchar2(10);
    l_sql_stmt varchar2(3000);
    l_slarti varchar2(20);
    l_threshold number;
    l_total_sql number := 0;
    l_total_sql_mem number := 0;
    l_single_use_sql number := 0;
    l_single_use_sql_mem number := 0;
    l_text_subset varchar2(31);
    l_sharable_mem number;
    l_version_count number;
    l_sorts number;
    l_module varchar2(64);
    l_loaded_versions number;
    l_executions number;
    l_loads number;
    l_invalidations number;
    l_parse_calls number;
    l_disk_reads number;
    l_buffer_gets number;
    l_rows_processed number;
    l_address raw(8);
    l_hash_value number;
    l_version_count number;
    l_max_begin_time date;
    cursor GETSERIAL is
    select serial#
    from v$session
    where sid = l_session_id;
    PROCEDURE snap_sql IS
    begin
    /* Gather summary statistics */
    insert into stats$sql_statistics
    ( snap_id
    , dbid
    , instance_number
    , total_sql
    , total_sql_mem
    , single_use_sql
    , single_use_sql_mem
    select l_snap_id
    , p_dbid
    , p_instance_number
    , count(1)
    , sum(sharable_mem)
    , sum(decode(executions, 1, 1, 0))
    , sum(decode(executions, 1, sharable_mem, 0))
    from stats$v$sqlxs
    where is_obsolete = 'N';
    /* Gather SQL statements which exceed any threshold,
    excluding obsolete parent cursors
    insert into stats$sql_summary
    ( snap_id
    , dbid
    , instance_number
    , text_subset
    , sharable_mem
    , sorts
    , module
    , loaded_versions
    , executions
    , loads
    , invalidations
    , parse_calls
    , disk_reads
    , buffer_gets
    , rows_processed
    , command_type
    , address
    , hash_value
    , version_count
    , cpu_time
    , elapsed_time
    , outline_sid
    , outline_category
    select l_snap_id
    , p_dbid
    , p_instance_number
    , substr(sql_text,1,31)
    , sharable_mem
    , sorts
    , module
    , loaded_versions
    , executions
    , loads
    , invalidations
    , parse_calls
    , disk_reads
    , buffer_gets
    , rows_processed
    , command_type
    , address
    , hash_value
    , version_count
    , cpu_time
    , elapsed_time
    , outline_sid
    , outline_category
    from stats$v$sqlxs
    where is_obsolete = 'N'
    and ( buffer_gets > l_buffer_gets_th
    or disk_reads > l_disk_reads_th
    or parse_calls > l_parse_calls_th
    or executions > l_executions_th
    or sharable_mem > l_sharable_mem_th
    or version_count > l_version_count_th
    /* Insert the SQL Text for hash_values captured in the snapshot
    into stats$sqltext if it's not already there. Identify SQL which
    execeeded the threshold by querying stats$sql_summary for this
    snapid and database instance
    insert into stats$sqltext
    ( hash_value
    , text_subset
    , piece
    , sql_text
    , address
    , command_type
    , last_snap_id
    select st1.hash_value
    , ss.text_subset
    , st1.piece
    , st1.sql_text
    , st1.address
    , st1.command_type
    , ss.snap_id
    from v$sqltext st1
    , stats$sql_summary ss
    where ss.snap_id = l_snap_id
    and ss.dbid = p_dbid
    and ss.instance_number = p_instance_number
    and st1.hash_value = ss.hash_value
    and st1.address = ss.address
    and not exists (select 1
    from stats$sqltext st2
    where st2.hash_value = ss.hash_value
    and st2.text_subset = ss.text_subset
    IF l_snap_level >= 6 THEN
    /* Identify SQL which execeeded the threshold by querying
    stats$sql_summary for this snapid and database instance.
    Capture the plans which were used for the high-load SQL if
    don't already have this data.
    Omit capturing plan usage information for cursors which
    have a zero plan hash value.
    Currently this is captured in a level 6 (or greater)
    snapshot, however this may be integrated into level 5
    snapshot at a later date.
    hl - high load
    insert into stats$sql_plan_usage
    ( hash_value
    , text_subset
    , plan_hash_value
    , cost
    , snap_id
    , address
    , optimizer
    select hl.hash_value
    , hl.text_subset
    , hl.plan_hash_value
    , hl.cost
    , max(hl.snap_id)
    , max(hl.address)
    , max(hl.optimizer)
    from (select /*+ ordered use_nl(sq) index(sq) */
    ss.hash_value
    , ss.text_subset
    , sq.plan_hash_value
    , nvl(sq.optimizer_cost,-9) cost
    , ss.snap_id snap_id
    , ss.address
    , sq.optimizer_mode optimizer
    from stats$sql_summary ss
    , v$sql sq
    where ss.snap_id = l_snap_id
    and ss.dbid = p_dbid
    and ss.instance_number = p_instance_number
    and sq.hash_value = ss.hash_value
    and sq.address = ss.address
    and sq.plan_hash_value > 0
    ) hl
    where not exists (select /*+ no_unnest */
    from stats$sql_plan_usage spu
    where spu.hash_value = hl.hash_value
    and spu.text_subset = hl.text_subset
    and spu.plan_hash_value
    = hl.plan_hash_value
    and spu.cost = hl.cost
    group by hl.hash_value
    , hl.text_subset
    , hl.plan_hash_value
    , hl.cost
    , hl.optimizer;
    /* For all new hash_value, plan_hash_value, cost combinations
    just captured, get the optimizer plans, if we don't already
    have them. Note that the plan (and hence the plan hash value)
    comprises the access path and the join order (and not
    variable factors such as the cardinality).
    insert into stats$sql_plan
    ( plan_hash_value
    , id
    , operation
    , options
    , object_node
    , object#
    , object_owner
    , object_name
    , optimizer
    , parent_id
    , depth
    , position
    , cost
    , cardinality
    , bytes
    , other_tag
    , partition_start
    , partition_stop
    , partition_id
    , other
    , distribution
    , cpu_cost
    , io_cost
    , temp_space
    , snap_id
    select /*+ ordered use_nl(s) use_nl(sp.p) */
    new_plan.plan_hash_value
    , sp.id
    , max(sp.operation)
    , max(sp.options)
    , max(sp.object_node)
    , max(sp.object#)
    , max(sp.object_owner)
    , max(sp.object_name)
    , max(sp.optimizer)
    , max(sp.parent_id)
    , max(sp.depth)
    , max(sp.position)
    , max(sp.cost)
    , max(sp.cardinality)
    , max(sp.bytes)
    , max(sp.other_tag)
    , max(sp.partition_start)
    , max(sp.partition_stop)
    , max(sp.partition_id)
    , max(sp.other)
    , max(sp.distribution)
    , max(sp.cpu_cost)
    , max(sp.io_cost)
    , max(sp.temp_space)
    , max(new_plan.snap_id)
    from (select /*+ index(spu) */
    distinct
    spu.plan_hash_value
    , spu.hash_value
    , spu.address
    , spu.text_subset
    , spu.snap_id
    from stats$sql_plan_usage spu
    where spu.snap_id = l_snap_id
    and not exists (select /*+ nl_aj */ *
    from stats$sql_plan ssp
    where ssp.plan_hash_value
    = spu.plan_hash_value
    ) new_plan
    , v$sql s
    , v$sql_plan sp
    where sp.hash_value = new_plan.hash_value
    and sp.address = new_plan.address
    and s.hash_value = new_plan.hash_value
    and s.address = new_plan.address
    and s.hash_value = sp.hash_value
    and s.address = sp.address
    and s.child_number = sp.child_number
    group by
    new_plan.plan_hash_value
    , sp.id;
    END IF; /* snap level >=6 */
    END snap_sql;
    begin /* Function SNAP */
    /* Get instance parameter defaults from stats$statspack_parameter,
    or use supplied parameters.
    If all parameters are specified, use them, otherwise get values
    from the parameters not specified from stats$statspack_parameter.
    statspack.qam_statspack_parameter
    ( p_dbid
    , p_instance_number
    , i_snap_level, i_session_id, i_ucomment, i_num_sql
    , i_executions_th, i_parse_calls_th
    , i_disk_reads_th, i_buffer_gets_th, i_sharable_mem_th
    , i_version_count_th, i_all_init
    , i_pin_statspack
    , i_modify_parameter
    , l_snap_level, l_session_id, l_ucomment, l_num_sql
    , l_executions_th, l_parse_calls_th
    , l_disk_reads_th, l_buffer_gets_th, l_sharable_mem_th
    , l_version_count_th, l_all_init
    , l_pin_statspack);
    /* Generate a snapshot id */
    select stats$snapshot_id.nextval
    into l_snap_id
    from dual
    where rownum = 1;
    /* Determine the serial# of the session to maintain stats for,
    if this was requested.
    if l_session_id > 0 then
    if not GETSERIAL%ISOPEN then open GETSERIAL; end if;
    fetch GETSERIAL into l_serial#;
    if GETSERIAL%NOTFOUND then
    /* Session has already disappeared - don't gather
    statistics for this session in this snapshot */
    l_session_id := 0;
    l_serial# := 0;
    end if; close GETSERIAL;
    else
    l_serial# := 0;
    end if;
    /* The instance has been restarted since the last snapshot */
    if p_new_sga = 0
    then
    begin
    p_new_sga := 1;
    /* Get the instance startup time, and other characteristics */
    insert into stats$database_instance
    ( dbid
    , instance_number
    , startup_time
    , snap_id
    , parallel
    , version
    , db_name
    , instance_name
    , host_name
    select p_dbid
    , p_instance_number
    , p_startup_time
    , l_snap_id
    , p_parallel
    , p_version
    , p_name
    , p_instance_name
    , p_host_name
    from sys.dual;
    commit;
    end;
    end if; /* new SGA */
    /* Work out the max undo stat time, used for gathering undo stat data */
    select nvl(max(begin_time), to_date('01011900','DDMMYYYY'))
    into l_max_begin_time
    from stats$undostat
    where dbid = p_dbid
    and instance_number = p_instance_number;
    /* Save the snapshot characteristics */
    insert into stats$snapshot
    ( snap_id, dbid, instance_number
    , snap_time, startup_time
    , session_id, snap_level, ucomment
    , executions_th, parse_calls_th, disk_reads_th
    , buffer_gets_th, sharable_mem_th
    , version_count_th, serial#, all_init)
    values
    ( l_snap_id, p_dbid, p_instance_number
    , SYSDATE, p_startup_time
    , l_session_id, l_snap_level, l_ucomment
    , l_executions_th, l_parse_calls_th, l_disk_reads_th
    , l_buffer_gets_th, l_sharable_mem_th
    , l_version_count_th, l_serial#, l_all_init);
    /* Begin gathering statistics */
    insert into stats$filestatxs
    ( snap_id
    , dbid
    , instance_number
    , tsname
    , filename
    , phyrds
    , phywrts
    , singleblkrds
    , readtim
    , writetim
    , singleblkrdtim
    , phyblkrd
    , phyblkwrt
    , wait_count
    , time
    select l_snap_id
    , p_dbid
    , p_instance_number
    , tsname
    , filename
    , phyrds
    , phywrts
    , singleblkrds
    , readtim
    , writetim
    , singleblkrdtim
    , phyblkrd
    , phyblkwrt
    , wait_count
    , time
    from stats$v$filestatxs;
    insert into stats$tempstatxs
    ( snap_id
    , dbid
    , instance_number
    , tsname
    , filename
    , phyrds
    , phywrts
    , singleblkrds
    , readtim
    , writetim
    , singleblkrdtim
    , phyblkrd
    , phyblkwrt
    , wait_count
    , time
    select l_snap_id
    , p_dbid
    , p_instance_number
    , tsname
    , filename
    , phyrds
    , phywrts
    , singleblkrds
    , readtim
    , writetim
    , singleblkrdtim
    , phyblkrd
    , phyblkwrt
    , wait_count
    , time
    from stats$v$tempstatxs;
    insert into stats$librarycache
    ( snap_id
    , dbid
    , instance_number
    , namespace
    , gets
    , gethits
    , pins
    , pinhits
    , reloads
    , invalidations
    , dlm_lock_requests
    , dlm_pin_requests
    , dlm_pin_releases
    , dlm_invalidation_requests
    , dlm_invalidations
    select l_snap_id
    , p_dbid
    , p_instance_number
    , namespace
    , gets
    , gethits
    , pins
    , pinhits
    , reloads
    , invalidations
    , dlm_lock_requests
    , dlm_pin_requests
    , dlm_pin_releases
    , dlm_invalidation_requests
    , dlm_invalidations
    from v$librarycache;
    insert into stats$buffer_pool_statistics
    ( snap_id
    , dbid
    , instance_number
    , id
    , name
    , block_size
    , set_msize
    , cnum_repl
    , cnum_write
    , cnum_set
    , buf_got
    , sum_write
    , sum_scan
    , free_buffer_wait
    , write_complete_wait
    , buffer_busy_wait
    , free_buffer_inspected
    , dirty_buffers_inspected
    , db_block_change
    , db_block_gets
    , consistent_gets
    , physical_reads
    , physical_writes
    select l_snap_id
    , p_dbid
    , p_instance_number
    , id
    , name
    , block_size
    , set_msize
    , cnum_repl
    , cnum_write
    , cnum_set
    , buf_got
    , sum_write
    , sum_scan
    , free_buffer_wait
    , write_complete_wait
    , buffer_busy_wait
    , free_buffer_inspected
    , dirty_buffers_inspected
    , db_block_change
    , db_block_gets
    , consistent_gets
    , physical_reads
    , physical_writes
    from v$buffer_pool_statistics;
    insert into stats$rollstat
    ( snap_id
    , dbid
    , instance_number
    , usn
    , extents
    , rssize
    , writes
    , xacts
    , gets
    , waits
    , optsize
    , hwmsize
    , shrinks
    , wraps
    , extends
    , aveshrink
    , aveactive
    select l_snap_id
    , p_dbid
    , p_instance_number
    , usn
    , extents
    , rssize
    , writes
    , xacts
    , gets
    , waits
    , optsize
    , hwmsize
    , shrinks
    , wraps
    , extends
    , aveshrink
    , aveactive
    from v$rollstat;
    insert into stats$rowcache_summary
    ( snap_id
    , dbid
    , instance_number
    , parameter
    , total_usage
    , usage
    , gets
    , getmisses
    , scans
    , scanmisses
    , scancompletes
    , modifications
    , flushes
    , dlm_requests
    , dlm_conflicts
    , dlm_releases
    select l_snap_id
    , p_dbid
    , p_instance_number
    , parameter
    , sum("COUNT")
    , sum(usage)
    , sum(gets)
    , sum(getmisses)
    , sum(scans)
    , sum(scanmisses)
    , sum(scancompletes)
    , sum(modifications)
    , sum(flushes)
    , sum(dlm_requests)
    , sum(dlm_conflicts)
    , sum(dlm_releases)
    from v$rowcache
    group by l_snap_id, p_dbid, p_instance_number, parameter;
    /* Collect parameters every snapshot, to cater for dynamic
    parameters changable while instance is running
    if l_all_init = 'FALSE' then
    insert into stats$parameter
    ( snap_id
    , dbid
    , instance_number
    , name
    , value
    , isdefault
    , ismodified
    select l_snap_id
    , p_dbid
    , p_instance_number
    , name
    , value
    , isdefault
    , ismodified
    from v$system_parameter;
    else
    insert into stats$parameter
    ( snap_id
    , dbid
    , instance_number
    , name
    , value
    , isdefault
    , ismodified
    select l_snap_id
    , p_dbid
    , p_instance_number
    , i.ksppinm
    , sv.ksppstvl
    , sv.ksppstdf
    , decode(bitand(sv.ksppstvf,7),1,'MODIFIED',4,'SYSTEM_MOD','FALSE')
    from stats$x$ksppi i
    , stats$x$ksppsv sv
    where i.indx = sv.indx;
    end if;
    /* To cater for variable size SGA - insert on each snapshot */
    insert into stats$sga
    ( snap_id
    , dbid
    , instance_number
    , name
    , value
    select l_snap_id
    , p_dbid
    , p_instance_number
    , name
    , value
    from v$sga;
    /* Get current allocation of memory in the SGA */
    insert into stats$sgastat
    ( snap_id
    , dbid
    , instance_number
    , pool
    , name
    , bytes
    select l_snap_id
    , p_dbid
    , p_instance_number
    , pool
    , name
    , bytes
    from v$sgastat;
    insert into stats$system_event
    ( snap_id
    , dbid
    , instance_number
    , event
    , total_waits
    , total_timeouts
    , time_waited_micro
    select l_snap_id
    , p_dbid
    , p_instance_number
    , event
    , total_waits
    , total_timeouts
    , time_waited_micro
    from v$system_event;
    insert into stats$bg_event_summary
    ( snap_id
    , dbid
    , instance_number
    , event
    , total_waits
    , total_timeouts
    , time_waited_micro
    select l_snap_id
    , p_dbid
    , p_instance_number
    , e.event
    , sum(e.total_waits)
    , sum(e.total_timeouts)
    , sum(e.time_waited_micro)
    from v$session_event e
    where e.sid in (select s.sid from v$session s where s.type = 'BACKGROUND')
    group by l_snap_id, p_dbid, p_instance_number, e.event;
    insert into stats$sysstat
    ( snap_id
    , dbid
    , instance_number
    , statistic#
    , name
    , value
    select l_snap_id
    , p_dbid
    , p_instance_number
    , statistic#
    , name
    , value
    from v$sysstat;
    insert into stats$waitstat
    ( snap_id
    , dbid
    , instance_number
    , class
    , wait_count
    , time
    select l_snap_id
    , p_dbid
    , p_instance_number
    , class
    , "COUNT"
    , time
    from v$waitstat;
    insert into stats$enqueue_stat
    ( snap_id
    , dbid
    , instance_number
    , eq_type
    , total_req#
    , total_wait#
    , succ_req#
    , failed_req#
    , cum_wait_time
    select l_snap_id
    , p_dbid
    , p_instance_number
    , eq_type
    , total_req#
    , total_wait#
    , succ_req#
    , failed_req#
    , cum_wait_time
    from v$enqueue_stat
    where total_req# != 0;
    insert into stats$latch
    ( snap_id
    , dbid
    , instance_number
    , name
    , latch#
    , level#
    , gets
    , misses
    , sleeps
    , immediate_gets
    , immediate_misses
    , spin_gets
    , sleep1
    , sleep2
    , sleep3
    , sleep4
    , wait_time
    select l_snap_id
    , p_dbid
    , p_instance_number
    , name
    , latch#
    , level#
    , gets
    , misses
    , sleeps
    , immediate_gets
    , immediate_misses
    , spin_gets
    , sleep1
    , sleep2
    , sleep3
    , sleep4
    , wait_time
    from v$latch;
    insert into stats$latch_misses_summary
    ( snap_id
    , dbid
    , instance_number
    , parent_name
    , where_in_code
    , nwfail_count
    , sleep_count
    , wtr_slp_count
    select l_snap_id
    , p_dbid
    , p_instance_number
    , parent_name
    , "WHERE"
    , sum(nwfail_count)
    , sum(sleep_count)
    , sum(wtr_slp_count)
    from v$latch_misses
    where sleep_count > 0
    group by l_snap_id, p_dbid, p_instance_number
    , parent_name, "WHERE";
    insert into stats$resource_limit
    ( snap_id
    , dbid
    , instance_number
    , resource_name
    , current_utilization
    , max_utilization
    , initial_allocation
    , limit_value
    select l_snap_id
    , p_dbid
    , p_instance_number
    , resource_name
    , current_utilization
    , max_utilization
    , initial_allocation
    , limit_value
    from v$resource_limit
    where limit_value != ' UNLIMITED'
    and max_utilization > 0;
    insert into stats$undostat
    ( begin_time
    , end_time
    , dbid
    , instance_number
    , snap_id
    , undotsn
    , undoblks
    , txncount
    , maxquerylen
    , maxconcurrency
    , unxpstealcnt
    , unxpblkrelcnt
    , unxpblkreucnt
    , expstealcnt
    , expblkrelcnt
    , expblkreucnt
    , ssolderrcnt
    , nospaceerrcnt
    select begin_time
    , end_time
    , p_dbid
    , p_instance_number
    , l_snap_id
    , undotsn
    , undoblks
    , txncount
    , maxquerylen
    , maxconcurrency
    , unxpstealcnt
    , unxpblkrelcnt
    , unxpblkreucnt
    , expstealcnt
    , expblkrelcnt
    , expblkreucnt
    , ssolderrcnt
    , nospaceerrcnt
    from v$undostat
    where begin_time > l_max_begin_time
    and begin_time + (1/(24*6)) <= end_time;
    insert into stats$db_cache_advice
    ( snap_id
    , dbid
    , instance_number
    , id
    , name
    , block_size
    , buffers_for_estimate
    , advice_status
    , size_for_estimate
    , estd_physical_read_factor
    , estd_physical_reads
    select l_snap_id
    , p_dbid
    , p_instance_number
    , id
    , name
    , block_size
    , buffers_for_estimate
    , advice_status
    , size_for_estimate
    , estd_physical_read_factor
    , estd_physical_reads
    from v$db_cache_advice
    where advice_status = 'ON';
    insert into stats$pgastat
    ( snap_id
    , dbid
    , instance_number
    , name
    , value
    select l_snap_id
    , p_dbid
    , p_instance_number
    , name
    , value
    from v$pgastat;
    insert into stats$instance_recovery
    ( snap_id
    , dbid
    , instance_number
    , recovery_estimated_ios
    , actual_redo_blks
    , target_redo_blks
    , log_file_size_redo_blks
    , log_chkpt_timeout_redo_blks
    , log_chkpt_interval_redo_blks
    , fast_start_io_target_redo_blks
    , target_mttr
    , estimated_mttr
    , ckpt_block_writes
    select l_snap_id
    , p_dbid
    , p_instance_number
    , recovery_estimated_ios
    , actual_redo_blks
    , target_redo_blks
    , log_file_size_redo_blks
    , log_chkpt_timeout_redo_blks
    , log_chkpt_interval_redo_blks
    , fast_start_io_target_redo_blks
    , target_mttr
    , estimated_mttr
    , ckpt_block_writes
    from v$instance_recovery;
    if p_parallel = 'YES' then
    insert into stats$dlm_misc
    ( snap_id
    , dbid
    , instance_number
    , statistic#
    , name
    , value
    select l_snap_id
    , p_dbid
    , p_instance_number
    , statistic#
    , name
    , value
    from v$dlm_misc;
    end if; /* parallel */
    /* Begin gathering Extended Statistics */
    IF l_snap_level >= 5 THEN
    snap_sql;
    END IF; /* snap level >=5 */
    IF l_snap_level >= 10 THEN
    insert into stats$latch_children
    ( snap_id
    , dbid
    , instance_number
    , latch#
    , child#
    , gets
    , misses
    , sleeps
    , immediate_gets
    , immediate_misses
    , spin_gets
    , sleep1
    , sleep2
    , sleep3
    , sleep4
    , wait_time
    select l_snap_id
    , p_dbid
    , p_instance_number
    , latch#
    , child#
    , gets
    , misses
    , sleeps
    , immediate_gets
    , immediate_misses
    , spin_gets
    , sleep1
    , sleep2
    , sleep3
    , sleep4
    , wait_time
    from v$latch_children;
    insert into stats$latch_parent
    ( snap_id
    , dbid
    , instance_number
    , latch#
    , level#
    , gets
    , misses
    , sleeps
    , immediate_gets
    , immediate_misses
    , spin_gets
    , sleep1
    , sleep2
    , sleep3
    , sleep4
    , wait_time
    select l_snap_id
    , p_dbid
    , p_instance_number
    , latch#
    , level#
    , gets
    , misses
    , sleeps
    , immediate_gets
    , immediate_misses
    , spin_gets
    , sleep1
    , sleep2
    , sleep3
    , sleep4
    , wait_time
    from v$latch_parent;
    END IF; /* snap level >=10 */
    /* Record level session-granular statistics if a specific session
    has been requested
    if l_session_id > 0
    then
    insert into stats$sesstat
    ( snap_id
    , dbid
    , instance_number
    , statistic#
    , value
    select l_snap_id
    , p_dbid
    , p_instance_number
    , statistic#
    , value
    from v$sesstat
    where sid = l_session_id;
    insert into stats$session_event
    ( snap_id
    , dbid
    , instance_number
    , event
    , total_waits
    , total_timeouts
    , time_waited_micro
    , max_wait
    select l_snap_id
    , p_dbid
    , p_instance_number
    , event
    , total_waits
    , total_timeouts
    , time_waited_micro
    , max_wait
    from v$session_event
    where sid = l_session_id;
    end if;
    commit work;
    RETURN l_snap_id;
    end SNAP; /* Function SNAP */
    begin /* STATSPACK body */
    /* Query the database id, instance_number, database name, instance
    name and startup time for the instance we are working on
    /* Get information about the current instance */
    open get_instance;
    fetch get_instance into
    p_instance_number, p_instance_name
    , p_startup_time, p_parallel, p_version
    , p_host_name;
    close get_instance;
    /* Select the database info for the db connected to */
    open get_db;
    fetch get_db into p_dbid, p_name;
    close get_db;
    /* Keep the package
    sys.dbms_shared_pool.keep('PERFSTAT.STATSPACK', 'P');
    /* Determine if the instance has been restarted since the previous snapshot
    begin
    select 1
    into p_new_sga
    from stats$database_instance
    where startup_time = p_startup_time
    and dbid = p_dbid
    and instance_number = p_instance_number;
    exception
    when NO_DATA_FOUND then
    p_new_sga := 0;
    end;
    end STATSPACK;
    Warning: Package Body created with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY STATSPACK:
    LINE/COL ERROR
    2045/3 PLS-00201: identifier 'SYS.DBMS_SHARED_POOL' must be declared
    2045/3 PL/SQL: Statement ignored

    When i compiled the package, it compiled with following error.
    Warning: Package Body created with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY STATSPACK:
    LINE/COL ERROR
    2045/3 PLS-00201: identifier 'SYS.DBMS_SHARED_POOL' must be declared
    2045/3 PL/SQL: Statement ignored
    SQL>

  • 9I STATSPACK PACKAGE를 이용하여 생성된 성능보고서 분석 예제

    제품 : ORACLE SERVER
    작성날짜 : 2005-01-07
    9I STATSPACK PACKAGE를 이용하여 생성된 성능보고서 분석 예제
    ==========================================
    PURPOSE
    이 문서는 9i 데이타베이스 운영 중 전반적인 System performance
    저하를 경험할 경우 StatsPack Package를 이용하여 성능관련 문제
    분석에 활용하는 방법을 예제를 통해 알아보기로 한다.
    Explanation
    <Bulletin:17118>에는 statspack.snap 프로시져를 수행하여 snapshot을
    생성하는 데 있어 통계정보 수집 방법에 대하여 자세히 소개되어 있다.
    <Bulletin:17119>에는 spreport.sql 수행을 통한 STATSPACK 성능 보고서
    생성 방법과 생성되는 report의 내용을 요약적으로 볼 수 있다.
    이 문서는 STATSPACK utility에 의해 생성되는 이 output(성능보고서)을
    이해하고 진단하는 데 도움을 줄 만한 내용을 알아본다.
    데이타베이스 performance tuning은 아주 광범위한 분야이므로,
    아 자료는 몇 가지 특정 tuning point에 대해서만 촛점을 맞추어 알아본다.
    1. 9i 에서 statspack 수행 시 Summary Information
    STATSPACK report for
    DB Name DB Id Instance Inst Num Release Cluster Host
    ETSPRD7 1415901831 etsprd7a 1 9.2.0.5.0 YES tsonode1
    Snap Id Snap Time Sessions Curs/Sess Comment
    Begin Snap: 71 11-Jun-04 10:02:41 ####### .0
    End Snap: 73 11-Jun-04 12:09:00 ####### .0
    Elapsed: 126.32 (mins)
    ==> 이전의 OPS 항목은 Real Applications Cluster(RAC) 라고 하는 새로운
    용어를 나타내기 위해 Cluster로 대체되었다.
    그리고, Cursors/Session 과 Comment라고 하는 column이 추가되었다.
    2. Oracle 9i Instance Workload Information
    모든 statspack report는 instance efficiency를 결정하는 데 도움이 될
    만한 인스턴스 metric들과 인스턴스의 workload profile을 보여주는 것으로
    시작한다.
    Oracle 9i에서 Std Block size는 인스턴스의 primary block size를 나타낸다.
    1) Instance cache information:
    Cache Sizes (end)
    ~~~~~~~~~~~~~~~~~
    Buffer Cache: 704M Std Block Size: 8K
    Shared Pool Size: 256M Log Buffer: 1,024K
    2) Load profile Information:
    Load profile Information은 Oracle 8i와 9i가 모두 동일하다.
    Load Profile
    ~~~~~~~~~~~~
    Per Second Per Transaction
    Redo size: 351,530.67 7,007.37
    Logical reads: 5,449.81 108.64
    Block changes: 1,042.0 8 20.77
    Physical reads: 37.71 0.75
    Physical writes: 134.68 2.68
    User calls: 1,254.72 25.01
    Parses: 4.92 0.10
    Hard parses: 0.02 0.00
    Sorts: 15.73 0.31
    Logons: -0.01 0.00
    Executes: 473.73 9.44
    Transactions: 50.17
    % Blocks changed per Read: 19.12 Recursive Call %: 4.71
    Rollback per transaction %: 2.24 Rows per Sort: 20.91
    각 항목들의 의미는 다음과 같다.
    Redo size: This is the amount of redo generated during this report.
    Logical Reads: This is calculated as Consistent Gets + DB Block Gets = Logical Reads
    Block changes: The number of blocks modified during the sample interval
    Physical Reads: The number of requests for a block that caused a physical I/O.
    Physical Writes: The number of physical writes issued.
    User Calls: The number of queries generated
    Parses: Total of all parses: both hard and soft
    Hard Parses: Those parses requiring a completely new parse of the
    SQL statement. These consume both latches and shared pool area.
    Soft Parses: Not listed but derived by subtracting the hard parses
    from parses. A soft parse reuses a previous hard parse
    and hence consumes far fewer resources.
    Sorts, Logons, Executes and Transactions are all self explanatory
    3) Instance Efficiency Ratios:
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Buffer Nowait %: 99.99 Redo NoWait %: 100.00
    Buffer Hit %: -45.57 In-memory Sort %: 97.55
    Library Hit %: 99.89 Soft Parse %: 99.72
    Execute to Parse %: -1.75 Latch Hit %: 99.11
    Parse CPU to Parse Elapsd %: 52.66 % Non-Parse CPU: 99.99
    Shared Pool Statistics Begin End
    Memory Usage %: 42.07 43.53
    % SQL with executions>1: 73.79 75.08
    % Memory for SQL w/exec>1: 76.93 77.64
    Example
    1. Parse가 너무 빈번하여 성능에 영향을 주는 예제
    예제1. TARGET 이 100% 인데 다른 항목들은 좋은 편이지만, PARSE 관련
    비율들만 낮은 경향을 보임.
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Buffer Nowait %: 99.93 Redo NoWait %: 99.99
    Buffer Hit %: 97.97 In-memory Sort %: 100.00
    Library Hit %: 93.58 Soft Parse %: 85.59
    Execute to Parse %: 10.21 Latch Hit %: 99.48
    Parse CPU to Parse Elapsd %: 40.07 % Non-Parse CPU: 90.54
    예제2. 한번 PARSE해서 한번만 수행한 SQL이 전체 SQL 의 40% 나 차지하는 경우
    이러한 경우 권장사항은 한번 PARSE하여 여러번 수행하는 것이다.
    Shared Pool Statistics Begin End
    Memory Usage %: 94.13 94.95
    % SQL with executions>1: 40.43 36.56
    % Memory for SQL w/exec>1: 31.67 26.27
    예제3. 다음 정보는 빈번하게 수행되면서, 수행할 때마다 PARSE하는 SQL들이다.
    SQL ordered by Parse Calls for DB:
    % Total
    Parse Calls Executions Parses Hash Value
    191,537 191,538 5.31 2386297721
    Module: OCS00000.exe
    SELECT DOCTNO, CLINIC, DOCTNAME FROM OCSUSER.OCSDOCTOR
    WHERE ROWNUM = 1 -- AND DOCTNO > ' ' --2004/03/02 LEEJUNGHY
    UN -- AND DOCTNO IN (P_DOCTNO,SUBSTR(P_DOCTNO,-5)); A
    ND DOCTNO = TRIM(TO_CHAR(SUBSTR(:b1,GREATEST(LENGTH(:b1)*(-1),-5
    )),'00000'))
    102,871 102,871 2.85 102761273
    Module: OCS00000.exe
    SELECT KORNAME FROM EPMUSER.EPMMASTER WHERE EMPNO IN (:
    b1,SUBSTR(:b1,-5))
    92,454 92,454 2.56 231443659
    Module: NIN00000.exe
    SELECT USERID FROM APMUSER.APMSESSIONID WHERE INSTANC
    ENO = USERENV('INSTANCE') AND SESSIONID = USERENV('S
    ESSIONID')
    예제4. SQL을 shared pool에 할당하는 관련 LATCH 들의 MISS가 보이는 경우
    Latch Activity for DB: DAUMC Instance: DAUMC1 Snaps: 71 -73
    ->"Get Requests", "Pct Get Miss" and "Avg Slps/Miss" are statistics for
    willing-to-wait latch get requests.
    ->"NoWait Requests", "Pct NoWait Miss" are for no-wait latch get requests.
    ->"Pct Misses" for both should be very close to 0.0
    Pct Avg Wait Pct
    Get Get Slps Time NoWait NoWait
    Latch Requests Miss /Miss (s) Requests Miss
    library cache 60,564,808 1.9 0.2 1318 1,431,661 9.8
    library cache pin 28,629,340 0.1 0.1 9 0
    library cache pin alloca 19,120,395 0.1 0.1 5 0
    shared pool 63,075,980 4.0 0.1 578
    예제5. V$librarycache 뷰의 정보 중 SQL AREA의 MISS가 있는 경우
    Library Cache Activity for DB: DAUMC Instance: DAUMC1 Snaps: 71 -73
    ->"Pct Misses" should be very low
    Get Pct Pin Pct Invali-
    Namespace Requests Miss Requests Miss Reloads dations
    SQL AREA 2,766,961 15.6 11,370,919 9.1 87,750 6
    TABLE/PROCEDURE 1,166,084 0.1 3,925,826 0.1 2,081 0
    BODY 45,742 0.0 45,742 0.0 0 0
    TRIGGER 808,617 0.0 808,624 0.0 30 0
    CLUSTER 717 0.0 523 0.0 0 0
    예제6. SHARED POOL USAGE 를 볼 때 2G 중 SQL AREA + LIBRARY CACHE가 대부분 차지
    SGA Memory Summary for DB: DAUMC Instance: DAUMC1 Snaps: 71 -73
    SGA regions Size in Bytes
    Database Buffers 1,509,949,440
    Fixed Size 459,920
    Redo Buffers 679,936
    Variable Size 2,164,260,864
    sum 3,675,350,160
    shared_pool_size = 2013265920
    SGA breakdown difference for DB: DAUMC Instance: DAUMC1 Snaps: 71 -73
    Pool Name Begin value End value % Diff
    shared library cache 465,599,756 467,728,476 0.46
    shared sql area 1,283,939,172 1,300,770,180 1.31
    shared miscellaneous 150,304,904 151,676,316 0.91
    shared free memory 125,065,548 107,550,900 14.00
    너무 빈번한 Parse를 줄이기 위한 권장사항
    - Literal SQL보다는 BIND VARIABLE 사용 권장
    - SOFT PARSE가 85%나 차지하므로 Session_cached_cursors 파라미터 설정 권장
    ( 가령 100 --> 200 )
    이 파라미터에 지정한 갯수는 한 session 동안 open된 상태로 cache에
    유지할 수 있는 cursor의 갯수이다.
    <참고> CURSOR 는 한번 오픈된 다음 여러번 execution 될 수 있다.
    예를 들어 V$SQL 뷰에서 한 SQL 이 몇번 execute 되었는지는
    v$sqlarea.executions 로 확인 가능하다.
    <Note:30804.1> 참조
    2. SQL ACCESS PATH(SQL 수행 패턴)와 I/O에 문제가 있어 성능에 영향을 주는 예제
    SQL 수행 시 full table scan보다 INDEX scan이 항상 더 빠른 것은 아니다.
    예제1. 전체 WAIT TIME 의 대부분(60~70%)이 DB FILE SEQUENTIAL READ,
    즉 one block read (주로 인덱스 사용)일 때이다.
    Top 5 Timed Events
    ~~~~~~~~~~~~~~~~~~ % Total
    Event Waits Time (s) Ela Time
    db file sequential read 3,682,330 87,681 59.32
    CPU time 31,297 21.17
    global cache cr request 4,254,569 11,086 7.50
    enqueue 43,040 3,211 2.17
    latch free 505,497 2,068 1.40
    예제2. Tablespace IO Stats for DB , File IO Stats for DB 등의 DISK IO
    통계정보를 보면 AV Read 속도가 권장이 20ms 이하이나 대부분이
    20ms 이상이고 30ms 인 경우
    Tablespace IO Stats for DB: DAUMC Instance: DAUMC1 Snaps: 71 -73
    ->ordered by IOs (Reads + Writes) desc
    Tablespace Av Av Av Av Buffer Av Buf
    Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)
    OCS_DATA 1,320,724 174 25.0 1.0 34,046 4 90,263 22.5
    AMP_DATA 589,915 78 25.6 1.1 6,487 1 4,994 28.9
    OCS_IDX 282,622 37 26.9 1.0 54,707 7 7,813 25.6
    CP_DATA 204,100 27 18.2 1.1 3,297 0 1,594 17.3
    AMP_IDX 174,413 23 26.4 1.0 16,853 2 5,833 28.9
    File IO Stats for DB: DAUMC Instance: DAUMC1 Snaps: 71 -73
    ->ordered by Tablespace, File
    Tablespace Filename
    Av Av Av Av Buffer Av Buf
    Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)
    AMP_DATA /dev/vx/rdsk/dongadg/daumc_amp_data_30720m
    444,094 59 26.0 1.1 3,311 0 3,716 29.9
    /dev/vx/rdsk/dongadg/daumc_rdat0301_10240m
    74,911 10 24.5 1.1 1,124 0 685 26.5
    /dev/vx/rdsk/dongadg/daumc_rdat0303_10240m
    70,910 9 24.3 1.1 2,052 0 593 25.8
    AMP_IDX /dev/vx/rdsk/dongadg/daumc_amp_idx_30720m
    174,413 23 26.4 1.0 16,853 2 5,833 28.9
    AMS_DATA /dev/vx/rdsk/dongadg/daumc_ams_data_4096m
    11 0 26.4 1.0 0 0 0
    위의 Disk I/O Tuning point를 근거로 튜닝 필요한 SQL 찾기
    예제3. SQL ordered by Gets for DB: DAUMC Instance: DAUMC1 Snaps: 71 -73
    -> End Buffer Gets Threshold: 10000
    -> Note that resources reported for PL/SQL includes the resources used by
    all SQL statements called within the PL/SQL code. As individual SQL
    statements are also reported, it is possible and valid for the summed
    total % to exceed 100
    CPU Elapsd
    Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
    5,029,778 20 251,488.9 2.5 62.87 106.97 1740340670
    Module: NMS00000.exe
    SELECT ns.getdate, ns.gettime, ns.sid, ns.idno, ns.name
    , ns.ward, ns.sex, ns.age, ns.sampcd, we.workcd, MIN(nr
    .testcd) testcd, MIN(nr.testno) testno, MIN(nr.result)
    result, MIN(nr.ROWID) nrROWID, sm.sampnm FROM nmusr.nmsample
    ns, nmusr.nmresult nr, nmusr.nmworkenv we, nmusr.xnmsa
    3,200,846 1,903 1,682.0 1.6 99.29 184.85 2896635021
    Module: OCS00000.exe
    SELECT upslipcode FROM ocsuser.ocsslip WHERE slipcode
    = 'PH11' START WITH slipcode = 'CLIN' CONNECT BY PRIOR slipcod
    e = upslipcode
    예제4. SQL ordered by Reads for DB: DAUMC Instance: DAUMC1 Snaps: 71 -73
    -> End Disk Reads Threshold: 1000
    CPU Elapsd
    Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
    39,256 113 347.4 0.9 33.07 226.06 639735119
    Module: AMI00000.exe
    begin AMPUSER.MAKEADMORDER(:V00001,:V00002,:V00003,:V00004,:V000
    05,:V00006); end;
    38,671 113 342.2 0.9 15.23 167.19 3348585719
    Module: AMI00000.exe
    DELETE FROM AMPUSER.AMPTEMPORDER WHERE ( IDNO = :b4 AND MEDDAT
    E = :b3 AND TYPECODE = :b2) OR TERMID = :b1
    31,358 1 31,358.0 0.8 6.46 88.00 3852126455
    Module: Golden32.exe
    select count(*) FROM cpusr.cpslipuse su -- WHERE su.slipcd = '2
    1' -- AND su.partcd = 'MP' -- AND su.finalflag = 0 -- AND
    SUBSTR(su.labno,1,1) = '1' -- AND LENGTH(su.labno) = 6 --308
    Reference Documents
    <Note:228913.1> Systemwide Tuning using STATSPACK Reports

  • Performance(statspack) related problem

    Anybodyu can suggest me how to improve the database performance as many uiser are complaining that they are getting data very slow........
    i have also used statspack analyzer.......
    STATSPACK report for
    DB Name DB Id Instance Inst Num Release Cluster Host
    NEOSOFT 399087012 neosoft 1 9.2.0.7.0 NO APP
    Snap Id Snap Time Sessions Curs/Sess Comment
    Begin Snap: 1 16-May-08 10:20:15 435 2.2
    End Snap: 3 16-May-08 10:24:12 442 2.2
    Elapsed: 3.95 (mins)
    Cache Sizes (end)
    ~~~~~~~~~~~~~~~~~
    Buffer Cache: 352M Std Block Size: 8K
    Shared Pool Size: 200M Log Buffer: 1,024K
    Load Profile
    ~~~~~~~~~~~~ Per Second Per Transaction
    Redo size: 23,125.82 7,966.31
    Logical reads: 6,050.15 2,084.14
    Block changes: 96.53 33.25
    Physical reads: 1,103.40 380.10
    Physical writes: 16.60 5.72
    User calls: 189.40 65.24
    Parses: 29.92 10.31
    Hard parses: 8.69 2.99
    Sorts: 6.97 2.40
    Logons: 0.11 0.04
    Executes: 29.25 10.08
    Transactions: 2.90
    % Blocks changed per Read: 1.60 Recursive Call %: 31.70
    Rollback per transaction %: 0.29 Rows per Sort: 472.41
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Buffer Nowait %: 100.00 Redo NoWait %: 100.00
    Buffer Hit %: 82.01 In-memory Sort %: 99.21
    Library Hit %: 89.76 Soft Parse %: 70.95
    Execute to Parse %: -2.29 Latch Hit %: 99.95
    Parse CPU to Parse Elapsd %: 100.93 % Non-Parse CPU: 84.62
    Shared Pool Statistics Begin End
    Memory Usage %: 94.72 94.24
    % SQL with executions>1: 39.68 38.62
    % Memory for SQL w/exec>1: 39.34 38.76
    Top 5 Timed Events
    ~~~~~~~~~~~~~~~~~~ % Total
    Event Waits Time (s) Ela Time
    db file scattered read 39,162 38 39.49
    CPU time 28 29.48
    db file sequential read 42,173 28 29.24
    direct path read 1,193 1 .59
    SQL*Net more data to client 31,629 1 .53
    Wait Events for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> s - second
    -> cs - centisecond - 100th of a second
    -> ms - millisecond - 1000th of a second
    -> us - microsecond - 1000000th of a second
    -> ordered by wait time desc, waits desc (idle events last)
    Avg
    Total Wait wait Waits
    Event Waits Timeouts Time (s) (ms) /txn
    db file scattered read 39,162 0 38 1 56.9
    db file sequential read 42,173 0 28 1 61.3
    direct path read 1,193 0 1 0 1.7
    SQL*Net more data to client 31,629 0 1 0 46.0
    log file sync 683 0 0 0 1.0
    control file sequential read 184 0 0 1 0.3
    db file parallel write 61 0 0 1 0.1
    control file parallel write 78 0 0 0 0.1
    log file parallel write 732 0 0 0 1.1
    direct path write 30 0 0 0 0.0
    SQL*Net break/reset to clien 10 0 0 0 0.0
    LGWR wait for redo copy 3 0 0 0 0.0
    SQL*Net message from client 44,675 0 577 13 64.9
    virtual circuit status 47,524 4 145 3 69.1
    SQL*Net message to client 44,674 0 0 0 64.9
    SQL*Net more data from clien 260 0 0 0 0.4
    Background Wait Events for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> ordered by wait time desc, waits desc (idle events last)
    Avg
    Total Wait wait Waits
    Event Waits Timeouts Time (s) (ms) /txn
    control file sequential read 80 0 0 2 0.1
    db file parallel write 61 0 0 1 0.1
    control file parallel write 78 0 0 0 0.1
    log file parallel write 732 0 0 0 1.1
    LGWR wait for redo copy 3 0 0 0 0.0
    rdbms ipc message 993 242 2,054 2069 1.4
    pmon timer 79 79 234 2962 0.1
    smon timer 13 0 228 17520 0.0
    SQL ordered by Gets for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Buffer Gets Threshold: 10000
    -> Note that resources reported for PL/SQL includes the resources used by
    all SQL statements called within the PL/SQL code. As individual SQL
    statements are also reported, it is possible and valid for the summed
    total % to exceed 100
    CPU Elapsd
    Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
    92,160 36 2,560.0 6.4 0.41 0.37 1007205397
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    75,042 33 2,274.0 5.2 0.23 0.29 3052506495
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    68,310 27 2,530.0 4.8 0.27 0.27 2037438344
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    48,617 31 1,568.3 3.4 0.16 0.22 1186386010
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    45,060 20 2,253.0 3.1 0.17 0.18 3400961035
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    42,976 17 2,528.0 3.0 0.14 0.17 3744553745
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    36,114 78 463.0 2.5 0.13 0.11 4262998487
    Module: In Patient 2.1.152.exe
    SQL ordered by Gets for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Buffer Gets Threshold: 10000
    -> Note that resources reported for PL/SQL includes the resources used by
    all SQL statements called within the PL/SQL code. As individual SQL
    statements are also reported, it is possible and valid for the summed
    total % to exceed 100
    CPU Elapsd
    Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'DOCTORVISIT' escape '
    25,102 11 2,282.0 1.8 0.06 0.10 812077776
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    24,984 36 694.0 1.7 0.09 0.07 3956499023
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'INVENTORY' escape '\' and ac.table_name like 'DMEDMAST' esca
    23,213 1 23,213.0 1.6 1.59 2.83 2435229694
    Module: SQL*Plus
    BEGIN statspack.snap(i_snap_level=>7); END;
    22,930 10 2,293.0 1.6 0.14 0.09 3466778893
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    22,680 10 2,268.0 1.6 0.08 0.09 3786189544
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    20,340 9 2,260.0 1.4 0.13 0.08 3649693145
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    SQL ordered by Gets for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Buffer Gets Threshold: 10000
    -> Note that resources reported for PL/SQL includes the resources used by
    all SQL statements called within the PL/SQL code. As individual SQL
    statements are also reported, it is possible and valid for the summed
    total % to exceed 100
    CPU Elapsd
    Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
    19,460 42 463.3 1.4 0.09 0.06 3858576624
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    SQL ordered by Reads for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Disk Reads Threshold: 1000
    CPU Elapsd
    Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
    8,084 4 2,021.0 3.1 0.14 1.08 4198744706
    Module: Out Patient 2.1.41.exe
    Select Max(BillNo) as Bno From PatientsRegistration Where regdt
    = to_date('01/04/2008','dd/mm/yyyy') and regdt <= to_date('31/03/2009','dd/mm/yyyy')
    7,302 1 7,302.0 2.8 0.13 0.51 2116660478
    Module: In Patient 2.1.157.exe
    select discount,discamount from billpharmacy where patientid='PA
    T09212'
    7,302 1 7,302.0 2.8 0.06 0.41 3612969128
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PA
    T09037'
    7,302 1 7,302.0 2.8 0.19 0.51 3981413559
    Module: In Patient 2.1.152.exe
    sELECT * FROM BillPharmacy WHERE BillPharmacy.pATIENtid= 'PAT090
    37' order by to_number((issueno))
    7,300 1 7,300.0 2.8 0.14 0.69 136284863
    Module: In Patient 2.1.152.exe
    delete from billpharmacy where patientid='PAT09037'
    7,299 1 7,299.0 2.8 0.20 0.77 2137420337
    Module: In Patient 2.1.152.exe
    delete from billpharmacy where patientid='PAT09154'
    7,298 1 7,298.0 2.8 0.13 0.43 1007690124
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PA
    T08301'
    7,298 1 7,298.0 2.8 0.13 0.58 3087447381
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PA
    T09154'
    7,061 1 7,061.0 2.7 0.13 0.97 2993688253
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PA
    T09146'
    7,058 1 7,058.0 2.7 0.39 0.76 1202603169
    Module: In Patient 2.1.152.exe
    SELECT BILLHDR.BILLNO, BILLHDR.BILLDT, BILLHDR.BALANCE, BILLHDR.
    TOTAL, BILLHDR.NETAMOUNT,IPINFO.type as orgtype, BILLHDR.PREVAD
    V , IPInfo.IpNO, IPInfo.REGDT,IPInfo.REGTM, IPInfo.Name, IPInfo.
    ADDRESS1,IPINFO.relativenm ,Rooms.roomno , Beds.BEDNO, ROOMTYPES
    , decode(IPINFO.sex,1,'Male','Female')sex,IPINFO.AGE ||' '||dec
    6,640 1 6,640.0 2.5 0.13 1.06 796742944
    Module: In Patient 2.1.152.exe
    SQL ordered by Reads for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Disk Reads Threshold: 1000
    CPU Elapsd
    Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
    select discount,discamount from billpharmacy where patientid='PA
    T09123'
    4,617 4 1,154.3 1.8 0.19 0.94 2042905630
    Module: Out Patient 2.1.41.exe
    SELECT NVL(Max(MoneyReciept.mrBillNo),0) AS MaxOfBillNob FROM Mo
    neyReciept where generalopd = 0
    4,496 3 1,498.7 1.7 0.06 0.57 2718453880
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208970TS000002' order by trackdate,tracktime
    4,494 3 1,498.0 1.7 0.13 0.74 3290276624
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R207032T0000351' order by trackdate,tracktime
    4,451 3 1,483.7 1.7 0.20 0.99 768943678
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208613TS000002' order by trackdate,tracktime
    4,091 4 1,022.8 1.6 0.19 1.62 266509601
    Module: In Patient 2.1.152.exe
    SELECT IPInfo.IPNo ,IPInfo.name,doctorvisit.date_r ,unithdr.drna
    me , doctorvisit.visitid FROM Doctorvisit , IPInfo,unithdr wher
    e Doctorvisit.Patid = IPInfo.PatID and Doctorvisit.doctorid=unit
    hdr.unitid and doctorvisit.date_r >=to_date('06/05/2008','fmdd/m
    m/yyyy') order by IPInfo.IPNo
    3,933 5 786.6 1.5 0.14 1.29 2546712787
    Module: Diagnotech 2.2.49.exe
    Select max(BillNo) as Bno From MoneyReciept where rcdt >= to_dat
    e('01/04/2008','dd/mm/yyyy') and rcdt <= to_date('31/03/2009','d
    d/mm/yyyy')
    3,439 3 1,146.3 1.3 0.25 1.89 2816864569
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R207242T0000104' order by trackdate,tracktime
    3,129 2 1,564.5 1.2 0.06 0.88 1803349496
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208962TS000002' order by trackdate,tracktime
    3,065 4 766.3 1.2 0.17 1.30 54282346
    Module: In Patient 2.1.157.exe
    Select * from track where tablenm = 'FRMDOCTORVISIT' and primkey
    id = 'VI048354' order by trackdate,tracktime
    2,834 3 944.7 1.1 0.17 1.57 165470279
    Module: Diagnotech 2.2.49.exe
    SQL ordered by Reads for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Disk Reads Threshold: 1000
    CPU Elapsd
    Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208926TS000002' order by trackdate,tracktime
    2,769 3 923.0 1.1 0.13 1.28 3812904405
    Module: Diagnotech 2.2.49.exe
    Select * from track where tablenm = 'FRMREPORTING' and primkeyid
    = 'R208892TS000002' order by trackdate,tracktime
    2,730 3 910.0 1.0 0.19 1.21 680462328
    Module: In Patient 2.1.157.exe
    select * from DoctorVisit where Date_r >= to_date('06/05/2008','
    dd/mm/yyyy') and Date_r <= to_date('16/05/2008','dd/mm/yyyy')
    2,526 2 1,263.0 1.0 0.58 1.14 4043595143
    Module: SQL*Plus
    INSERT INTO STATS$SQL_SUMMARY ( SNAP_ID , DBID , INSTANCE_NUMBER
    , TEXT_SUBSET , SHARABLE_MEM , SORTS , MODULE , LOADED_VERSIONS
    , FETCHES , EXECUTIONS , LOADS , INVALIDATIONS , PARSE_CALLS ,
    DISK_READS , BUFFER_GETS , ROWS_PROCESSED , COMMAND_TYPE , ADDRE
    SS , HASH_VALUE , VERSION_COUNT , CPU_TIME , ELAPSED_TIME , OUTL
    2,484 1 2,484.0 0.9 0.19 0.91 33028691
    Module: Diagnotech 2.2.49.exe
    select * from requisitions where upper(reqno) = '180800'
    2,483 1 2,483.0 0.9 0.13 0.93 2943168498
    Module: Diagnotech 2.2.49.exe
    Update Requisitions Set Collected = 0 Where TRIM(ReqID) ='R20987
    8'
    2,482 1 2,482.0 0.9 0.11 0.74 2336722822
    Module: Diagnotech 2.2.49.exe
    Update Requisitions Set Collected = 0 Where TRIM(ReqID) ='R20987
    7'
    2,480 1 2,480.0 0.9 0.06 0.67 650704065
    Module: In Patient 2.1.152.exe
    select sum(can.returnamt) refamt from diagnotech.cancellationhd
    r can,diagnotech.requisitions req where can.reqid = req.reqid an
    SQL ordered by Executions for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Executions Threshold: 100
    CPU per Elap per
    Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value
    283 283 1.0 0.00 0.00 1283498366
    Module: Diagnotech 2.2.49.exe
    Select to_char(sysdate,'fmdd/mm/yyyy HH24:mi:ss am') as abc from
    OPTIONS
    238 76 0.3 0.00 0.00 4274598960
    select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, tim
    estamp#, sample_size, minimum, maximum, distcnt, lowval, hival,
    density, col#, spare1, spare2, avgcln from hist_head$ where obj#
    =:1 and intcol#=:2
    126 126 1.0 0.00 0.00 2168100061
    Module: Diagnotech 2.2.49.exe
    select * from departments where deptid = 'DEP00004'
    114 0 0.0 0.00 0.00 4073347083
    select grantor#, grantee#, privilege#, sequence#, nvl(option$,0)
    from objauth$ where obj#=:1 and col#=:2
    112 112 1.0 0.00 0.00 3687727603
    insert into col$(obj#,name,intcol#,segcol#,type#,length,precisio
    n#,scale,null$,offset,fixedstorage,segcollength,deflength,defaul
    t$,col#,property,charsetid,charsetform,spare1,spare2,spare3)valu
    es(:1,:2,:3,:4,:5,:6,decode(:7,0,null,:7),decode(:5,2,decode(:8,
    -127/*MAXSB1MINAL*/,null,:8),178,:8,179,:8,180,:8,181,:8,182,:8,
    99 99 1.0 0.00 0.00 3468666020
    select text from view$ where rowid=:1
    84 84 1.0 0.00 0.00 2997854589
    insert into access$(d_obj#,order#,columns,types) values (:1,:2,:
    3,:4)
    84 84 1.0 0.00 0.00 3951809012
    insert into dependency$(d_obj#,d_timestamp,order#,p_obj#,p_times
    tamp,d_owner#, property)values (:1,:2,:3,:4,:5,:6, :7)
    78 0 0.0 0.00 0.00 3867936055
    Module: Out Patient 2.1.41.exe
    commit
    78 78 1.0 0.00 0.00 4262998487
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'DOCTORVISIT' escape '
    44 44 1.0 0.00 0.00 3216099004
    Module: Diagnotech 2.2.49.exe
    select * from options
    42 42 1.0 0.00 0.00 3858576624
    SQL ordered by Executions for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Executions Threshold: 100
    CPU per Elap per
    Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'IPINFO' escape '\'
    36 540 15.0 0.01 0.01 1007205397
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    36 36 1.0 0.00 0.00 3956499023
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'INVENTORY' escape '\' and ac.table_name like 'DMEDMAST' esca
    34 34 1.0 0.00 0.00 857250417
    Module: Diagnotech 2.2.46.exe
    select * from departments where deptid = 'DEP00031'
    33 43,442 1,316.4 0.04 0.05 502973950
    Module: Pharmacy 2.0.174.exe
    SELECT substr(UPPER(MedMast.MedNm),1,50) MedNm , MedSubCat.MSCOD
    E ,MEDMAST.POTENCY ,substr(genericnm,1,50) genericnm, sum(dmeddt
    ls.currqty) stock, MedMast.medid FROM MedMast , MedSubCat,dmedd
    tls where UPPER(MEDMAST.MEDNM) LIKE '%%' and medmast.medid = d
    meddtls.medid and MEDMAST.SubCatID = MedSubCat.MSCatID and dmed
    33 132 4.0 0.01 0.01 3052506495
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    31 124 4.0 0.01 0.01 1186386010
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    31 31 1.0 0.00 0.00 3993731530
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    SQL ordered by Executions for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Executions Threshold: 100
    CPU per Elap per
    Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'OTS1' escape '\' and ac.table_name like 'DOCTORINFO' escape
    28 28 1.0 0.00 0.00 737183288
    Module: Diagnotech 2.2.49.exe
    Select * From CReqno
    27 0 0.0 0.00 0.00 246231567
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    SQL ordered by Parse Calls for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Parse Calls Threshold: 1000
    % Total
    Parse Calls Executions Parses Hash Value
    283 283 3.99 1283498366
    Module: Diagnotech 2.2.49.exe
    Select to_char(sysdate,'fmdd/mm/yyyy HH24:mi:ss am') as abc from
    OPTIONS
    126 126 1.78 2168100061
    Module: Diagnotech 2.2.49.exe
    select * from departments where deptid = 'DEP00004'
    99 99 1.40 3468666020
    select text from view$ where rowid=:1
    78 78 1.10 3867936055
    Module: Out Patient 2.1.41.exe
    commit
    78 78 1.10 4262998487
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'DOCTORVISIT' escape '
    44 44 0.62 3216099004
    Module: Diagnotech 2.2.49.exe
    select * from options
    42 42 0.59 3858576624
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'IP' escape '\' and ac.table_name like 'IPINFO' escape '\'
    36 36 0.51 1007205397
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    36 36 0.51 3956499023
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'INVENTORY' escape '\' and ac.table_name like 'DMEDMAST' esca
    34 34 0.48 857250417
    Module: Diagnotech 2.2.46.exe
    SQL ordered by Parse Calls for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Parse Calls Threshold: 1000
    % Total
    Parse Calls Executions Parses Hash Value
    select * from departments where deptid = 'DEP00031'
    33 33 0.47 502973950
    Module: Pharmacy 2.0.174.exe
    SELECT substr(UPPER(MedMast.MedNm),1,50) MedNm , MedSubCat.MSCOD
    E ,MEDMAST.POTENCY ,substr(genericnm,1,50) genericnm, sum(dmeddt
    ls.currqty) stock, MedMast.medid FROM MedMast , MedSubCat,dmedd
    tls where UPPER(MEDMAST.MEDNM) LIKE '%%' and medmast.medid = d
    meddtls.medid and MEDMAST.SubCatID = MedSubCat.MSCatID and dmed
    33 33 0.47 3052506495
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    31 31 0.44 1186386010
    Module: In Patient 2.1.152.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    31 31 0.44 3993731530
    Module: In Patient 2.1.152.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'OTS1' escape '\' and ac.table_name like 'DOCTORINFO' escape
    30 15 0.42 3067006941
    delete from dependency$ where d_obj#=:1
    28 28 0.39 737183288
    Module: Diagnotech 2.2.49.exe
    Select * From CReqno
    27 27 0.38 246231567
    Module: Pharmacy 2.0.174.exe
    select to_char(null), ac.owner, ac.table_name, acc.column_name,
    acc.position, ac.constraint_name from all_constraints ac, all_co
    ns_columns acc where ac.owner=acc.owner and ac.constraint_type=
    'P' and ac.constraint_name=acc.constraint_name and ac.owner lik
    e 'INVENTORY' escape '\' and ac.table_name like 'DISSUEDTLSP' e
    27 27 0.38 445844524
    Module: In Patient 2.1.152.exe
    select nvl(tarrifflg,0) as tf from sourcehdr where sourceid = ''
    SQL ordered by Parse Calls for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Parse Calls Threshold: 1000
    % Total
    Parse Calls Executions Parses Hash Value
    27 27 0.38 2037438344
    Module: Pharmacy 2.0.174.exe
    select null, i.owner, i.table_name, decode (i.uniqueness,'UNIQUE
    ',0,1), null, i.index_name, 3, c.column_position, c.column_name,
    'A', i.distinct_keys, i.leaf_blocks, null from all_indexes i, a
    ll_ind_columns c where i.owner = c.index_owner and i.index_name
    = c.index_name and i.table_owner = c.table_owner and i.table_nam
    22 22 0.31 3073477137
    select u.name,o.name, t.update$, t.insert$, t.delete$, t.enabled
    from obj$ o,user$ u,trigger$ t where t.baseobject=:1 and t.ob
    j#=o.obj# and o.owner#=u.user# order by o.obj#
    Instance Activity Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    Statistic Total per Second per Trans
    CPU used by this session 2,821 11.9 4.1
    CPU used when call started 2,826 11.9 4.1
    CR blocks created 15 0.1 0.0
    DBWR buffers scanned 5,873 24.8 8.5
    DBWR checkpoint buffers written 167 0.7 0.2
    DBWR checkpoints 0 0.0 0.0
    DBWR free buffers found 5,653 23.9 8.2
    DBWR lru scans 17 0.1 0.0
    DBWR make free requests 17 0.1 0.0
    DBWR summed scan depth 5,873 24.8 8.5
    DBWR transaction table writes 1 0.0 0.0
    DBWR undo block writes 228 1.0 0.3
    SQL*Net roundtrips to/from client 89,026 375.6 129.4
    active txn count during cleanout 156 0.7 0.2
    background checkpoints completed 0 0.0 0.0
    background checkpoints started 0 0.0 0.0
    background timeouts 243 1.0 0.4
    branch node splits 0 0.0 0.0
    buffer is not pinned count 1,225,066 5,169.1 1,780.6
    buffer is pinned count 1,069,472 4,512.5 1,554.5
    bytes received via SQL*Net from c 4,334,045 18,287.1 6,299.5
    bytes sent via SQL*Net to client 79,310,906 334,645.2 115,277.5
    calls to get snapshot scn: kcmgss 14,976 63.2 21.8
    calls to kcmgas 942 4.0 1.4
    calls to kcmgcs 166 0.7 0.2
    change write time 19 0.1 0.0
    cleanout - number of ktugct calls 182 0.8 0.3
    cleanouts and rollbacks - consist 5 0.0 0.0
    cleanouts only - consistent read 18 0.1 0.0
    cluster key scan block gets 206,010 869.2 299.4
    cluster key scans 81,803 345.2 118.9
    commit cleanout failures: block l 0 0.0 0.0
    commit cleanout failures: callbac 11 0.1 0.0
    commit cleanout failures: cannot 0 0.0 0.0
    commit cleanouts 2,731 11.5 4.0
    commit cleanouts successfully com 2,720 11.5 4.0
    commit txn count during cleanout 87 0.4 0.1
    consistent changes 15 0.1 0.0
    consistent gets 1,412,564 5,960.2 2,053.2
    consistent gets - examination 572,440 2,415.4 832.0
    cursor authentications 531 2.2 0.8
    data blocks consistent reads - un 15 0.1 0.0
    db block changes 22,877 96.5 33.3
    db block gets 21,323 90.0 31.0
    deferred (CURRENT) block cleanout 1,548 6.5 2.3
    dirty buffers inspected 19 0.1 0.0
    enqueue conversions 52 0.2 0.1
    enqueue releases 4,639 19.6 6.7
    enqueue requests 4,640 19.6 6.7
    enqueue timeouts 0 0.0 0.0
    enqueue waits 0 0.0 0.0
    execute count 6,932 29.3 10.1
    free buffer inspected 19 0.1 0.0
    free buffer requested 258,870 1,092.3 376.3
    hot buffers moved to head of LRU 2,520 10.6 3.7
    immediate (CR) block cleanout app 23 0.1 0.0
    Instance Activity Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    Statistic Total per Second per Trans
    immediate (CURRENT) block cleanou 502 2.1 0.7
    index fast full scans (full) 163 0.7 0.2
    index fetch by key 380,673 1,606.2 553.3
    index scans kdiixs1 86,708 365.9 126.0
    leaf node 90-10 splits 22 0.1 0.0
    leaf node splits 64 0.3 0.1
    logons cumulative 25 0.1 0.0
    messages received 806 3.4 1.2
    messages sent 806 3.4 1.2
    no buffer to keep pinned count 0 0.0 0.0
    no work - consistent read gets 779,017 3,287.0 1,132.3
    opened cursors cumulative 7,669 32.4 11.2
    parse count (failures) 2 0.0 0.0
    parse count (hard) 2,060 8.7 3.0
    parse count (total) 7,091 29.9 10.3
    parse time cpu 434 1.8 0.6
    parse time elapsed 430 1.8 0.6
    physical reads 261,506 1,103.4 380.1
    physical reads direct 3,529 14.9 5.1
    physical writes 3,935 16.6 5.7
    physical writes direct 3,529 14.9 5.1
    physical writes non checkpoint 3,839 16.2 5.6
    pinned buffers inspected 0 0.0 0.0
    prefetched blocks 175,966 742.5 255.8
    prefetched blocks aged out before 0 0.0 0.0
    process last non-idle time 270 1.1 0.4
    recovery blocks read 0 0.0 0.0
    recursive calls 20,832 87.9 30.3
    recursive cpu usage 296 1.3 0.4
    redo blocks written 11,309 47.7 16.4
    redo buffer allocation retries 0 0.0 0.0
    redo entries 12,097 51.0 17.6
    redo log space requests 0 0.0 0.0
    redo log space wait time 0 0.0 0.0
    redo ordering marks 1 0.0 0.0
    redo size 5,480,820 23,125.8 7,966.3
    redo synch time 30 0.1 0.0
    redo synch writes 689 2.9 1.0
    redo wastage 160,348 676.6 233.1
    redo write time 29 0.1 0.0
    redo writer latching time 0 0.0 0.0
    redo writes 732 3.1 1.1
    rollback changes - undo records a 2 0.0 0.0
    rollbacks only - consistent read 10 0.0 0.0
    rows fetched via callback 235,269 992.7 342.0
    session connect time 0 0.0 0.0
    session logical reads 1,433,886 6,050.2 2,084.1
    session pga memory 45,074,044 190,185.8 65,514.6
    session pga memory max 49,946,024 210,742.7 72,596.0
    session uga memory max 3,455,708 14,581.1 5,022.8
    shared hash latch upgrades - no w 54,598 230.4 79.4
    shared hash latch upgrades - wait 0 0.0 0.0
    sorts (disk) 13 0.1 0.0
    sorts (memory) 1,639 6.9 2.4
    sorts (rows) 780,425 3,292.9 1,134.3
    summed dirty queue length 239 1.0 0.4
    Instance Activity Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    Statistic Total per Second per Trans
    switch current to new buffer 172 0.7 0.3
    table fetch by rowid 612,799 2,585.7 890.7
    table fetch continued row 626 2.6 0.9
    table scan blocks gotten 459,367 1,938.3 667.7
    table scan rows gotten 18,523,828 78,159.6 26,924.2
    table scans (long tables) 128 0.5 0.2
    table scans (short tables) 1,655 7.0 2.4
    transaction rollbacks 1 0.0 0.0
    transaction tables consistent rea 0 0.0 0.0
    transaction tables consistent rea 0 0.0 0.0
    user calls 44,888 189.4 65.2
    user commits 686 2.9 1.0
    user rollbacks 2 0.0 0.0
    workarea executions - multipass 0 0.0 0.0
    workarea executions - onepass 24 0.1 0.0
    workarea executions - optimal 2,433 10.3 3.5
    write clones created in foregroun 0 0.0 0.0
    Tablespace IO Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->ordered by IOs (Reads + Writes) desc
    Tablespace
    Av Av Av Av Buffer Av Buf
    Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)
    DIAGNOTECH
    61,945 261 0.7 1.9 64 0 0 0.0
    IP
    10,753 45 1.2 9.5 23 0 0 0.0
    SYSTEM
    5,668 24 1.2 3.2 22 0 0 0.0
    OTS1
    2,456 10 1.5 7.8 19 0 0 0.0
    TEMP
    1,429 6 0.6 2.5 739 3 0 0.0
    INVENTORY
    478 2 3.5 1.3 49 0 0 0.0
    UNDOTBS1
    0 0 0.0 229 1 0 0.0
    INDX
    15 0 2.0 1.0 0 0 0 0.0
    PAYROLL
    1 0 20.0 4.0 0 0 0 0.0
    File IO Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->ordered by Tablespace, File
    Tablespace Filename
    Av Av Av Av Buffer Av Buf
    Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)
    DIAGNOTECH F:\ORACLE\ORADATA\NEOSOFT\DIAGNOTECH1.ORA
    61,945 261 0.7 1.9 64 0 0
    INDX F:\ORACLE\ORADATA\NEOSOFT\INDX01.DBF
    15 0 2.0 1.0 0 0 0
    INVENTORY F:\ORACLE\ORADATA\NEOSOFT\INVENTORY1.ORA
    478 2 3.5 1.3 49 0 0
    IP F:\ORACLE\ORADATA\NEOSOFT\IP1.ORA
    10,753 45 1.2 9.5 23 0 0
    OTS1 F:\ORACLE\ORADATA\NEOSOFT\OTS11.ORA
    2,456 10 1.5 7.8 19 0 0
    PAYROLL F:\ORACLE\ORADATA\NEOSOFT\PAYROLL1.ORA
    1 0 20.0 4.0 0 0 0
    SYSTEM F:\ORACLE\ORADATA\NEOSOFT\SYSTEM01.DBF
    5,668 24 1.2 3.2 22 0 0
    TEMP F:\ORACLE\ORADATA\NEOSOFT\TEMP01.DBF
    1,429 6 0.6 2.5 739 3 0
    UNDOTBS1 F:\ORACLE\ORADATA\NEOSOFT\UNDOTBS01.DBF
    0 0 229 1 0
    Buffer Pool Statistics for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> Standard block size Pools D: default, K: keep, R: recycle
    -> Default Pools for other block sizes: 2k, 4k, 8k, 16k, 32k
    Free Write Buffer
    Number of Cache Buffer Physical Physical Buffer Complete Busy
    P Buffers Hit % Gets Reads Writes Waits Waits Waits
    D 44,044 82.0 1,432,475 257,328 406 0 0 0
    Instance Recovery Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> B: Begin snapshot, E: End snapshot
    Targt Estd Log File Log Ckpt Log Ckpt
    MTTR MTTR Recovery Actual Target Size Timeout Interval
    (s) (s) Estd IOs Redo Blks Redo Blks Redo Blks Redo Blks Redo Blks
    B 87 19 3628 65684 64450 184320 64450
    E 87 20 4063 69805 69805 184320 69805
    Buffer Pool Advisory for DB: NEOSOFT Instance: neosoft End Snap: 3
    -> Only rows with estimated physical reads >0 are displayed
    -> ordered by Block Size, Buffers For Estimate (default block size first)
    Size for Size Buffers for Est Physical Estimated
    P Estimate (M) Factr Estimate Read Factor Physical Reads
    D 32 .1 4,004 67.25 19,260,129,810
    D 64 .2 8,008 42.95 12,300,910,895
    D 96 .3 12,012 32.00 9,165,118,680
    D 128 .4 16,016 25.62 7,338,010,607
    D 160 .5 20,020 17.54 5,022,366,182
    D 192 .5 24,024 11.74 3,361,228,965
    D 224 .6 28,028 7.05 2,020,169,694
    D 256 .7 32,032 3.94 1,127,930,012
    D 288 .8 36,036 2.32 663,835,521
    D 320 .9 40,040 1.44 413,674,540
    D 352 1.0 44,044 1.00 286,377,525
    D 384 1.1 48,048 0.75 215,831,108
    D 416 1.2 52,052 0.60 171,670,371
    D 448 1.3 56,056 0.51 145,708,247
    D 480 1.4 60,060 0.45 128,439,943
    D 512 1.5 64,064 0.40 114,053,332
    D 544 1.5 68,068 0.37 104,584,674
    D 576 1.6 72,072 0.34 96,792,591
    D 608 1.7 76,076 0.32 92,596,531
    D 640 1.8 80,080 0.31 89,929,979
    PGA Aggr Target Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> B: Begin snap E: End snap (rows dentified with B or E contain data
    which is absolute i.e. not diffed over the interval)
    -> PGA cache hit % - percentage of W/A (WorkArea) data processed only in-memory
    -> Auto PGA Target - actual workarea memory target
    -> W/A PGA Used - amount of memory used for all Workareas (manual + auto)
    -> %PGA W/A Mem - percentage of PGA memory allocated to workareas
    -> %Auto W/A Mem - percentage of workarea memory controlled by Auto Mem Mgmt
    -> %Man W/A Mem - percentage of workarea memory under manual control
    PGA Cache Hit % W/A MB Processed Extra W/A MB Read/Written
    88.2 213 29
    %PGA %Auto %Man
    PGA Aggr Auto PGA PGA Mem W/A PGA W/A W/A W/A Global Mem
    Target(M) Target(M) Alloc(M) Used(M) Mem Mem Mem Bound(K)
    B 24 7 24.4 0.4 1.6 .0 100.0 1,228
    E 24 8 23.8 0.0 .0 .0 .0 1,228
    PGA Aggr Target Histogram for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> Optimal Executions are purely in-memory operations
    Low High
    Optimal Optimal Total Execs Optimal Execs 1-Pass Execs M-Pass Execs
    8K 16K 2,000 2,000 0 0
    16K 32K 55 55 0 0
    32K 64K 28 28 0 0
    64K 128K 50 50 0 0
    128K 256K 110 110 0 0
    256K 512K 26 26 0 0
    512K 1024K 176 158 18 0
    1M 2M 8 4 4 0
    4M 8M 2 0 2 0
    PGA Memory Advisory for DB: NEOSOFT Instance: neosoft End Snap: 3
    -> When using Auto Memory Mgmt, minimally choose a pga_aggregate_target value
    where Estd PGA Overalloc Count is 0
    Estd Extra Estd PGA Estd PGA
    PGA Target Size W/A MB W/A MB Read/ Cache Overalloc
    Est (MB) Factr Processed Written to Disk Hit % Count
    12 0.5 417.1 207.2 67.0 1
    18 0.8 417.1 89.3 82.0 0
    24 1.0 417.1 46.4 90.0 0
    29 1.2 417.1 46.4 90.0 0
    34 1.4 417.1 46.4 90.0 0
    38 1.6 417.1 13.2 97.0 0
    43 1.8 417.1 11.1 97.0 0
    48 2.0 417.1 11.1 97.0 0
    72 3.0 417.1 11.1 97.0 0
    96 4.0 417.1 11.1 97.0 0
    144 6.0 417.1 0.0 100.0 0
    192 8.0 417.1 0.0 100.0 0
    Rollback Segment Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->A high value for "Pct Waits" suggests more rollback segments may be required
    ->RBS stats may not be accurate between begin and end snaps when using Auto Undo
    managment, as RBS may be dynamically created and dropped as needed
    Trans Table Pct Undo Bytes
    RBS No Gets Waits Written Wraps Shrinks Extends
    0 15.0 0.00 0 0 0 0
    1 412.0 0.00 831,990 1 0 1
    2 48.0 0.00 61,500 0 0 0
    3 87.0 0.00 132,404 0 0 0
    4 79.0 0.00 66,626 0 0 0
    5 71.0 0.00 91,284 0 0 0
    6 40.0 0.00 15,474 0 0 0
    7 660.0 0.00 547,536 1 0 1
    8 168.0 0.00 21,762 0 0 0
    9 86.0 0.00 10,108 0 0 0
    10 295.0 0.00 156,468 0 0 0
    Rollback Segment Storage for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->Optimal Size should be larger than Avg Active
    RBS No Segment Size Avg Active Optimal Size Maximum Size
    0 385,024 0 385,024
    1 9,625,600 806,999 16,900,096
    2 5,365,760 711,094 8,511,488
    3 5,365,760 664,381 9,560,064
    4 5,365,760 763,735 8,511,488
    5 5,365,760 672,648 9,625,600
    6 5,365,760 677,906 9,560,064
    7 6,414,336 647,093 8,511,488
    8 5,365,760 628,652 10,608,640
    9 5,365,760 769,325 9,560,064
    10 5,365,760 622,015 9,560,064
    Undo Segment Summary for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> Undo segment block stats:
    -> uS - unexpired Stolen, uR - unexpired Released, uU - unexpired reUsed
    -> eS - expired Stolen, eR - expired Released, eU - expired reUsed
    Undo Undo Num Max Qry Max Tx Snapshot Out of uS/uR/uU/
    TS# Blocks Trans Len (s) Concurcy Too Old Space eS/eR/eU
    1 695 1,032,965 12 1 0 0 0/0/0/0/0/0
    Undo Segment Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> ordered by Time desc
    Undo Num Max Qry Max Tx Snap Out of uS/uR/uU/
    End Time Blocks Trans Len (s) Concy Too Old Space eS/eR/eU
    16-May 10:22 695 ######## 12 1 0 0 0/0/0/0/0/0
    Latch Activity for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->"Get Requests", "Pct Get Miss" and "Avg Slps/Miss" are statistics for
    willing-to-wait latch get requests
    ->"NoWait Requests", "Pct NoWait Miss" are for no-wait latch get requests
    ->"Pct Misses" for both should be very close to 0.0
    Pct Avg Wait Pct
    Get Get Slps Time NoWait NoWait
    Latch Requests Miss /Miss (s) Requests Miss
    Consistent RBA 732 0.0 0 0
    FAL request queue 1 0.0 0 0
    FIB s.o chain latch 12 0.0 0 0
    FOB s.o list latch 27 0.0 0 0
    SQL memory manager latch 2 0.0 0 79 0.0
    SQL memory manager worka 7,245 0.0 0 0
    active checkpoint queue 169 0.0 0 0
    archive control 10 0.0 0 0
    archive process latch 7 0.0 0 0
    cache buffer handles 12,078 0.0 0 0
    cache buffers chains 2,602,999 0.0 0.0 0 506,781 0.0
    cache buffers lru chain 858 0.0 0 615,593 0.0
    channel handle pool latc 37 0.0 0 0
    channel operations paren 265 0.0 0 0
    checkpoint queue latch 30,545 0.0 0 893 0.0
    child cursor hash table 16,079 0.0 0 0
    dml lock allocation 2,674 0.0 0 0
    dummy allocation 43 0.0 0 0
    enqueue hash chains 9,313 0.0 0 0
    enqueues 9,405 0.0 0 0
    event group latch 5 0.0 0 0
    hash table column usage 0 0 55,565 0.0
    hash table modification 1 0.0 0 0
    kmcptab latch 78 0.0 0 0
    kmcpvec latch 0 0 78 0.0
    ktm global data 13 0.0 0 0
    lgwr LWN SCN 742 0.0 0 0
    library cache 193,957 0.0 0.0 0 6,959 0.4
    library cache load lock 110 0.0 0 0
    library cache pin 63,420 0.0 0 0
    library cache pin alloca 43,208 0.0 0 0
    list of block allocation 49 0.0 0 0
    loader state object free 34 0.0 0 0
    message pool operations 26 0.0 0 0
    messages 2,866 0.0 0 0
    mostly latch-free SCN 742 0.0 0 0
    multiblock read objects 164,572 0.0 0.0 0 0
    ncodef allocation latch 3 0.0 0 0
    object stats modificatio 1,669 0.0 0 0
    post/wait queue 1,029 0.0 0 683 0.0
    process allocation 11 0.0 0 5 0.0
    process group creation 11 0.0 0 0
    redo allocation 13,617 0.0 0.0 0 0
    redo copy 0 0 12,145 0.0
    redo writing 2,533 0.0 0 0
    row cache enqueue latch 215,027 0.0 0.0 0 0
    row cache objects 218,418 0.0 0.0 0 472 0.0
    sequence cache 99 0.0 0 0
    session allocation 8,683 0.0 0 0
    session idle bit 94,091 0.0 0 0
    Latch Activity for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->"Get Requests", "Pct Get Miss" and "Avg Slps/Miss" are statistics for
    willing-to-wait latch get requests
    ->"NoWait Requests", "Pct NoWait Miss" are for no-wait latch get requests
    ->"Pct Misses" for both should be very close to 0.0
    Pct Avg Wait Pct
    Get Get Slps Time NoWait NoWait
    Latch Requests Miss /Miss (s) Requests Miss
    session switching 3 0.0 0 0
    session timer 80 0.0 0 0
    shared pool 160,825 0.0 0.0 0 0
    sim partition latch 0 0 35 0.0
    simulator hash latch 63,337 0.0 0 0
    simulator lru latch 4,437 0.0 0 16,447 0.0
    sort extent pool 129 0.0 0 0
    transaction allocation 47 0.0 0 0
    transaction branch alloc 3 0.0 0 0
    undo global data 3,091 0.0 0 0
    user lock 114 0.0 0 0
    virtual circuit buffers 540,157 0.4 0.0 0 0
    virtual circuit queues 256,196 0.0 0.0 0 0
    virtual circuits 89,002 0.0 0 0
    Top 5 Logical Reads per Segment for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Segment Logical Reads Threshold: 10000
    Subobject Obj. Logical
    Owner Tablespace Object Name Name Type Reads %Total
    DIAGNOTECH DIAGNOTECH REQUISITIONS TABLE 162,064 11.66
    SYS SYSTEM I_OBJ1 INDEX 115,328 8.30
    SYS SYSTEM OBJ$ TABLE 113,328 8.15
    SYS SYSTEM I_IND1 INDEX 109,584 7.88
    IP IP BILLPHARMACY TABLE 89,328 6.43
    Top 5 Physical Reads per Segment for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Segment Physical Reads Threshold: 1000
    Subobject Obj. Physical
    Owner Tablespace Object Name Name Type Reads %Total
    IP IP BILLPHARMACY TABLE 86,212 34.43
    DIAGNOTECH DIAGNOTECH REQUISITIONS TABLE 79,487 31.74
    DIAGNOTECH DIAGNOTECH TRACK TABLE 33,193 13.25
    IP SYSTEM TRACK TABLE 17,926 7.16
    OTS1 OTS1 MONEYRECIEPT TABLE 10,036 4.01
    Top 5 Row Lock Waits per Segment for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    -> End Segment Row Lock Waits Threshold: 100
    Row
    Subobject Obj. Lock
    Owner Tablespace Object Name Name Type Waits %Total
    IP IP BILLID4064 INDEX 1 100.00
    Dictionary Cache Stats for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->"Pct Misses" should be very low (< 2% in most cases)
    ->"Cache Usage" is the number of cache entries being used
    ->"Pct SGA" is the ratio of usage to allocated size for that cache
    Get Pct Scan Pct Mod Final
    Cache Requests Miss Reqs Miss Reqs Usage
    dc_histogram_defs 22,135 1.1 0 0 3,348
    dc_object_ids 26,251 0.0 0 0 625
    dc_objects 4,895 0.1 0 15 960
    dc_profiles 21 0.0 0 0 1
    dc_rollback_segments 273 0.0 0 0 12
    dc_segments 11,239 0.1 0 0 604
    dc_sequences 3 33.3 0 3 6
    dc_tablespaces 19,449 0.0 0 0 5
    dc_user_grants 2,814 0.0 0 0 17
    dc_usernames 886 0.0 0 0 15
    dc_users 22,542 0.0 0 0 20
    Library Cache Activity for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    ->"Pct Misses" should be very low
    Get Pct Pin Pct Invali-
    Namespace Requests Miss Requests Miss Reloads dations
    BODY 445 0.0 445 0.0 0 0
    CLUSTER 397 0.0 121 0.0 0 0
    SQL AREA 7,041 28.0 24,030 16.9 55 23
    TABLE/PROCEDURE 8,324 0.0 15,082 0.6 18 0
    TRIGGER 953 0.0 953 0.0 0 0
    Shared Pool Advisory for DB: NEOSOFT Instance: neosoft End Snap: 3
    -> Note there is often a 1:Many correlation between a single logical object
    in the Library Cache, and the physical number of memory objects associated
    with it. Therefore comparing the number of Lib Cache objects (e.g. in
    v$librarycache), with the number of Lib Cache Memory Objects is invalid
    Estd
    Shared Pool SP Estd Estd Estd Lib LC Time
    Size for Size Lib Cache Lib Cache Cache Time Saved Estd Lib Cache
    Estim (M) Factr Size (M) Mem Obj Saved (s) Factr Mem Obj Hits
    104 .5 97 21,986 47,321 1.0 22,910,514
    128 .6 120 27,657 47,381 1.0 22,988,994
    152 .8 143 32,965 47,422 1.0 23,048,924
    176 .9 166 38,101 47,451 1.0 23,094,145
    200 1.0 189 42,541 47,474 1.0 23,126,910
    224 1.1 212 47,258 47,492 1.0 23,155,651
    248 1.2 235 52,101 47,508 1.0 23,180,673
    272 1.4 258 56,800 47,521 1.0 23,202,200
    296 1.5 283 61,512 47,532 1.0 23,220,564
    320 1.6 306 65,892 47,540 1.0 23,235,720
    344 1.7 329 70,532 47,547 1.0 23,246,826
    368 1.8 352 75,208 47,553 1.0 23,257,346
    392 2.0 375 81,494 47,559 1.0 23,268,801
    416 2.1 411 88,685 47,565 1.0 23,279,344
    SGA Memory Summary for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    SGA regions Size in Bytes
    Database Buffers 369,098,752
    Fixed Size 455,784
    Redo Buffers 1,191,936
    Variable Size 436,207,616
    sum 806,954,088
    SGA breakdown difference for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    Pool Name Begin value End value % Diff
    java free memory 83,886,080 83,886,080 0.00
    large free memory 63,891,136 64,350,992 0.72
    large session heap 19,994,944 19,535,088 -2.30
    shared 1M buffer 2,098,176 2,098,176 0.00
    shared Checkpoint queue 1,129,216 1,129,216 0.00
    shared DML lock 1,028,764 1,028,764 0.00
    shared FileOpenBlock 6,564,072 6,564,072 0.00
    shared KGK heap 3,756 3,756 0.00
    shared KGLS heap 2,584,540 2,431,584 -5.92
    shared KQR M PO 2,844,672 2,768,896 -2.66
    shared KQR S PO 249,880 250,652 0.31
    shared KQR S SO 7,936 7,936 0.00
    shared KSXR pending messages que 841,036 841,036 0.00
    shared KSXR receive buffers 1,033,000 1,033,000 0.00
    shared MTTR advisory 59,288 59,288 0.00
    shared PL/SQL DIANA 3,179,412 3,015,708 -5.15
    shared PL/SQL MPCODE 388,924 241,096 -38.01
    shared PLS non-lib hp 3,688 3,688 0.00
    shared VIRTUAL CIRCUITS 2,564,620 2,564,620 0.00
    shared db_handles 1,080,000 1,080,000 0.00
    shared dictionary cache 2,137,216 2,137,216 0.00
    shared enqueue 1,676,824 1,676,824 0.00
    shared event statistics per sess 18,675,020 18,675,020 0.00
    shared fixed allocation callback 388 388 0.00
    shared free memory 14,167,016 15,470,156 9.20
    shared joxs heap init 4,220 4,220 0.00
    shared ktlbk state objects 778,960 778,960 0.00
    shared library cache 43,962,768 43,051,344 -2.07
    shared message pool freequeue 665,792 665,792 0.00
    shared miscellaneous 41,742,904 42,080,748 0.81
    shared parameters 3,224 9,272 187.59
    shared processes 1,500,000 1,500,000 0.00
    shared sessions 3,998,480 3,998,480 0.00
    shared sim memory hea 195,212 195,212 0.00
    shared sql area 111,345,832 111,177,960 -0.15
    shared table definiti 16,576 15,240 -8.06
    shared transaction 1,852,092 1,852,092 0.00
    shared trigger defini 26,236 24,148 -7.96
    shared trigger inform 592 592 0.00
    shared trigger source 304 304 0.00
    buffer_cache 369,098,752 369,098,752 0.00
    fixed_sga 455,784 455,784 0.00
    log_buffer 1,180,672 1,180,672 0.00
    init.ora Parameters for DB: NEOSOFT Instance: neosoft Snaps: 1 -3
    End value
    Parameter Name Begin value (if different)
    background_dump_dest F:\oracle\admin\neosoft\bdump
    compatible 9.2.0.0.0
    control_files F:\oracle\oradata\neosoft\control
    core_dump_dest F:\oracle\admin\neosoft\cdump
    db_block_size 8192
    db_cache_size 369098752
    db_domain
    db_file_multiblock_read_count 16
    db_name neosoft
    dispatchers (PROTOCOL=TCP)
    fast_start_mttr_target 300
    hash_join_enabled TRUE
    instance_name neosoft
    java_pool_size 83886080
    large_pool_size 83886080
    open_cursors 300
    pga_aggregate_target 25165824
    processes 1500
    query_rewrite_enabled FALSE
    remote_login_passwordfile EXCLUSIVE
    shared_pool_size 209715200
    sort_area_size 524288
    star_transformation_enabled FALSE
    timed_statistics TRUE
    undo_management AUTO
    undo_retention 10800
    undo_tablespace UNDOTBS1
    user_dump_dest F:\oracle\admin\neosoft\udump
    End of Report

    How did you calculated all these ratios............I looked through the formatted output of the Statspack report, specifically the setion "SQL ordered by reads for DB" and found these SQL statements which are performing a large number of physical reads. Most of the SQL statements have similar WHERE clauses, except for the constants to the right of the = :
    Physical Reads  Executions  Reads per Exec %Total Time (s)  Time (s) Hash Value
              8,084            4        2,021.0    3.1     0.14      1.08 4198744706
    Module: Out Patient 2.1.41.exe
    Select Max(BillNo) as Bno From PatientsRegistration Where regdt
    = to_date('01/04/2008','dd/mm/yyyy') and regdt <= to_date('31/03/2009','dd/mm/yyyy')
              7,302            1        7,302.0    2.8     0.13      0.51 2116660478
    Module: In Patient 2.1.157.exe
    select discount,discamount from billpharmacy where patientid='PAT09212'
              7,302            1        7,302.0    2.8     0.06      0.41 3612969128
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PAT09037'
              7,302            1        7,302.0    2.8     0.19      0.51 3981413559
    Module: In Patient 2.1.152.exe
    sELECT * FROM BillPharmacy WHERE BillPharmacy.pATIENtid= 'PAT09037' order by to_number((issueno))
              7,300            1        7,300.0    2.8     0.14      0.69  136284863
    Module: In Patient 2.1.152.exe
    delete from billpharmacy where patientid='PAT09037'
              7,299            1        7,299.0    2.8     0.20      0.77 2137420337
    Module: In Patient 2.1.152.exe
    delete from billpharmacy where patientid='PAT09154'
              7,298            1        7,298.0    2.8     0.13      0.43 1007690124
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PAT08301'
              7,298            1        7,298.0    2.8     0.13      0.58 3087447381
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PAT09154'
              7,061            1        7,061.0    2.7     0.13      0.97 2993688253
    Module: In Patient 2.1.152.exe
    select discount,discamount from billpharmacy where patientid='PAT09146'
    and on what basis you one should have to find out
    which query causing the problem....
    i also wanted to learn how to read the
    statspack.........I personally do not like Statspack reports, but there are several very good sources for understanding Statspack reports:
    http://jonathanlewis.wordpress.com/2006/11/29/analysing-statspack-pt1/
    http://jonathanlewis.wordpress.com/statspack-examples/
    Metalink Note:232443.1 (How to Identify Resource Intensive SQL for Tuning)
    Metalink Note:390374.1 (Oracle Performance Diagnostic Guide (OPDG))
    Metalink Note:228913.1 (Systemwide Tuning using STATSPACK Reports)
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • Running statspack report remotely from a client?

    Hi!
    To get a statspack report I run @spreport.sql from an SQL*Plus session on the database server.
    Having to go to the DB server for that sometimes is a chore and I would prefer to get a report from any client, or even from within SQL Developer.
    Is there an easy way to achive this or is there a tool for that?
    Obviously, the spreport.sql might differ from Oracle DB version to version, so I would either need to have a series of these reports scripts on the client and the select the right one or I would need to have some mechanisum (stored proc?) that gets to rdbms/admin on the server, executed the spreport.sql script there, read the output and return that from to the client.
    Is there an easier way or anyone knows of a package that will do that?
    Thanks,
    Marcus

    Marcus,
    I don't think that I did get your question. Sorry but do you mean to say that you want a report from the client terminal , running locally over teh client only? That's what I got from this line,
    Having to go to the DB server for that sometimes is a chore and I would prefer to get a report from any client, or even from within SQL Developer. Or do you want the report to be available from the server side to the client's local machine?
    If you want the report to be given to you on the client side only, I am not sure that there is any way possibly there. What's the issue in fetching the report from the server though ? If one can connect to db as a valid db and o/s user, he can fetch the data as well. But its just a thought. I don't use any of the tools much so I guess, I shall just join you and see what others have to say about it.
    Aman....

  • Execution time difference between Statspack and DBM_Monitor trace

    Hi Everyone,
    We noticed that output of query execution time is quite differ between statspack and session tracing (DBMS_MONITOR) report. The query execution time in Statspack was 1402 sec and in session trace file was 312.25 Sec. FYI database version is 11.2.0.3 which is installed on platform OL 5.8
    Both of the following reports (Staspack/tracing) was executed on same system and at the same time. Could you suggest why execution time is differ in staspack and session tracing?
    Staspack execution time :-
    Elapsed Elap per CPU Old
    Time (s) Executions Exec (s) %Total Time (s) Physical Reads Hash Value
    1402.50 1 1402.50 9.1 53.92 256,142 3247794574
    select * from ( select * from ( select resourcecontentslocati
    on,isprotocolname,ismimecontenttype,indexedmetatext,objectid,met
    atext,valueaddxml,resourcetype,resourceviewedtime,iscmaresultid,
    resourcelastviewedbyuser,issequencenumber,nvl(length(contents),0
    Session tracing time:-
    call count cpu elapsed disk query current rows
    Parse 1 10.58 256.44 43364 153091 0 0
    Execute 1 0.01 0.08 0 0 0 0
    Fetch 143 2.09 55.72 25440 32978 0 1000
    total 145 12.69 312.25 68804 186069 0 1000
    Thanks
    Rajdeep

    Hi,
    First of all, please read the [url https://wikis.oracle.com/display/Forums/Forums+FAQ]FAQ page and find out how to use the code tags to format your output properly so that it's readable.
    I don't want to work out the stats formatting but I'd guess that if you ran the query first time and the data was not cached, it would be slower than the 2nd query when it was cached. The stats should confirm this so please format them so we can see it properly.
    Rob

  • Statspack with explain plan.

    The goal is to obtain the overall system statistics and explain plans for the entire system.
    1. The only tool that I can think of is "StatsPack".
    2. With AWR there are 2 issues:-
    a. It is not free
    b. It does not give Explain plan output.
    3. We can use 10046 / 10053 Trace's however it wont give you as comphrehensive an output as statspack, you would also have to enable trace for each individual application while its running, grab the trace file, look at the report.
    4. We can also use outlines to store the explain plan this was primarily for Oracle version 10g.
    5. The last option we have is sql managed baselines. This is good , however it does not tell me conclusively how my system was executing a sql lets say 10 days back. It wont accept the new sql unless we promote it. Still there is no guarantee that the underlying sql plan will not change.
    So far statspack with level 6 appears to be the only solution.

    Personally I'd spend the money and get AWR.
    The problem with StatsPack is that when you run it, after an issue, it is too late to capture anything of value. With AWR snapshots are taken as often as you wish, 24 hours a day, and then when someone tells you there was a problem at 4:15 in the morning ... you have something to work with.

  • Statspack report not coming properly

    version 10.2.0.4
    Edited by: user12052260 on May 22, 2010 10:14 PM

    sorry for the format
    Hi All,
    version 10.2.0.4
    os hp-ux 11.11
    i have created new perfstat user and trying to generate report with spreport.sql but am not getting full report like below
    18:16:00 SQL> @$ORACLE_HOME/rdbms/admin/spreport.sql
    Current Instance
    ~~~~~~~~~~~~~~~~
       DB Id    DB Name      Inst Num Instance
    1418078253 WGMUGPRO            1 wgmugpro
    Elapsed: 00:00:00.01
    Instances in this Statspack schema
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       DB Id    Inst Num DB Name      Instance     Host
    1418078253        1 WGMUGPRO     wgmugpro     snstr04
    Using 1418078253 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.
    Listing all Completed Snapshots
                                                           Snap
    Instance     DB Name        Snap Id   Snap Started    Level Comment
    wgmugpro     WGMUGPRO             1 22 May 2010 15:47     5
                                      2 22 May 2010 15:48     5
                                      3 22 May 2010 15:50     5
                                      4 22 May 2010 16:20     5
                                      5 22 May 2010 16:25     5
                                      6 22 May 2010 18:10     5
                                      7 22 May 2010 18:11     5
                                      8 22 May 2010 18:15     5
    Specify the Begin and End Snapshot Ids
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Enter value for begin_snap: 7
    Begin Snapshot Id specified: 7
    Enter value for end_snap: 8
    End   Snapshot Id specified: 8then output is coming as below
    STATSPACK report for
    Database                            DB Id
    Instance                         Inst Num
    Startup Time                     Release
    RAC
    ~~~~~~~~                         -----------
                                      1418078253 wgmugpro            1
    22-May-10 18:00 10.2.0.4.0  NO
    Host  Name:   snstr04          Num CPUs:    2
    Phys Memory (MB):    4,058
    ~~~~
    Snapshot       Snap Id     Snap Time      Sessions Curs/Sess Comment
    ~~~~~~~~    ---------- ------------------ -------- --------- -------------------
    Begin Snap:          6 22-May-10 18:10:07       21       2.8
      End Snap:          7 22-May-10 18:11:01       21       2.7
       Elapsed:                0.90 (mins)
    Cache Sizes                       Begin        End
    ~~~~~~~~~~~                  ---------- ----------
                   Buffer Cache:       720M             Std Block Size:         8K
               Shared Pool Size:       224M
         Log Buffer:                    14,139K
    Load Profile                            Per Second       Per Transaction
    ~~~~~~~~~~~~                       ---------------       ---------------
                      Redo size:              9,926.22            536,016.00
                  Logical reads:                 87.11              4,704.00
                  Block changes:                 16.28                879.00
                 Physical reads:                  5.52                298.00
                Physical writes:                  0.09                  5.00
                     User calls:                  0.61                 33.00
                         Parses:                 16.30                880.00
                    Hard parses:                  2.13                115.00
                          Sorts:                 11.57                625.00
                         Logons:                  0.02                  1.00
                       Executes:                 25.24              1,363.00
                   Transactions:                  0.02
      % Blocks changed per Read:   18.69    Recursive Call %:                99.81
    Rollback per transaction %:    0.00       Rows per Sort:                33.03
    Instance Efficiency Percentages
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Buffer Nowait %:  100.00       Redo NoWait %:  100.00
                Buffer  Hit   %:   93.66    In-memory Sort %:  100.00
                Library Hit   %:   75.91        Soft Parse %:   86.93
             Execute to Parse %:   35.44         Latch Hit %:  100.00
    Parse CPU to Parse Elapsd %:   77.78     % Non-Parse CPU:   72.00what may be the reason.
    Thanks in advance..

  • Statspack ?? please correct if anything wrong

    Dear all,
    executed the spcreate.sql
    log in as perfstat
    SQL>variable jobno number;
    SQL>variable instno number;
    SQL>begin
    select instance_number into :instno from v$instance;
    dbms_job.submit(:jobno, 'statspack.snap;', trunc(sysdate+1/48,'HH'), 'trunc(SYSDATE+1/48,''HH'')', TRUE, :instno);
    commit;
    end;
    To get the report :
    spreport
    begin snap_id 100
    end_snap ID 112
    file name : sp_100_112
    Are the above steps correct. Where is the statspack file saved.
    I see the output on the screen but cannot find the file.
    Regards
    SL

    Please see this,
    Re: statspack report to a file
    Adith

  • Elapsed Time in Statspack report

    There is a java process that made updates to 1 millon rows in the oracle database table. A commit was issued after each update statement in the code. There were 10 java threads(processes) involved in updating the 1 million rows and the total time took 3 hours and 40 minutes. However, in the statspack report pulled for that time period, it indicates that the total elapsed time was 4 hours and 3 minutes. What may be the cause for this difference ?

    Thanks to all. I was also reading the same site. ALso what does these mean in case of session details.
    memory sorts, table scans, physical reads, logical reads, cursors.
    In some of the sessions I have these figures. What can I figure out from this.
    (giving the output in vertical way)
    ID 105
    Status - INACTIVE
    Machine- ebank_prd
    User Name - EVENT
    Elapsed Time- 16,237
    CPU Used     -645
    Memory Sorts-25
    Table Scans - 7866
    Physical Reads -134
    Logical Reads- 115249
    Commits     7981
    Cursor 104     
    Buffer Cache Hit Ratio 100
    Another one :
    26,INACTIVE,ebank_prd,CAIORA, 239,105, 31,093, 9,636, 67,032, 56,334 45,543, 860     0     8     100
    Here the epalsed time is 239,105,
    cpu used is 31,093
    memory sorts is 9,636
    table scans is 67,032
    physical read 56,334
    logical reads 45,543,860
    The figures are so high
    I performance is slow and what shall I do next to find out whats wrong by looking at the values.
    Waiting for your answer.
    Thanks again
    SL

  • Help interpreting  v$rowcache_parent output

    Hi,
    what saddr = 00 means in that output :
    SQL> select count(*) , saddr from v$rowcache_parent group by saddr order by 1 desc;
      COUNT(*) SADDR
        413532 00
             2 00000001DF739E88DB is RAC 10.2.0.3 .
    Regards.
    Greg

    user10388717 wrote:
    Jonathan,
    to make a long story short on my 4 node RAC 10.2.0.3 there was:
    ORA-00603: ORACLE server session terminated by fatal error
    ORA-00604: error occurred at recursive SQL level 1
    ORA-04031: unable to allocate 4120 bytes of shared memory ("shared pool","select name,online$,contents...","Typecheck","kgghteInit")
    ORA-00604: error occurred at recursive SQL level 1
    ORA-04031: unable to allocate 4120 bytes of shared memory ("shared pool","select name,online$,contents...","Typecheck","kgghteInit")
    in trace I've found huge utlization in 'KQR L PO ' (dont know what that means, probably row cache related)
    Memory Utilization of Subpool 2
    ================================
    Allocation Name          Size
    "free memory              "    96364088
    "KQR L PO                 "   866133600
    The number of items you have in the rowcache is quite large - are you making a lot of use of partitioned tables ?
    It might be quite interesting to see the results of querying
    select cache_name, count(*) from v$rowcache_parent group by cache_name;
    select subcache_name, count(*) from v$rowcache_subordiate group by subcache_name;But the bottom line on this is that you should report ORA-00600 / ORA_0060N to Oracle support.
    In this case I think they'll tell you that you need to have a larger shared pool (given the ORA-04031). But it's possible that they will suggest you set a hidden parameter to reduce the number of subpools to 1; or adjust the shared pool reserved to allow all this stuff to get into it and avoid fragmentation issues.
    The release of 500MB is not a surprise - it's the type of thing that can happen just before the ORA-04031: Oracle kicks out a batch of objects to see if that will free up enough contiguous space to allow for your 4K allocation, then another batch - and so on until (a) it succeeds, or (b) it has to give up with a 4031. As this happens your application may stall for a few seconds as the shared pool goes through a massive latch storm (and it may stall again as a flood of "hard parsing" takes place to replace all the stuff that's been kicked out).
    Does your application do a lot of truncating, or permanent or global temporary tables, or lots of create/exchange partition/drop - if you're using partitioned tables ? This can have a catastrophic effect on the shared pool in RAC. It shouldn't introduce a huge growth in the rowcache - but maybe you've found a related memory leak.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)
    +"Science is more than a body of knowledge; it is a way of thinking"+
    +Carl Sagan+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • STATSPACK vs AWR

    Hello All,
    I am using Oracle 11g R2
    I am new to the STATSPACK, and I have few questions:
    Is it only a command line tool ? or it can be accessed through Oracle Enterprise Manager.
    Can you provide me the details of how to generate reports? snapshots ? in STATSPACK
    Regards,

    NB wrote:
    Hello All,
    I am using Oracle 11g R2
    I am new to the STATSPACK, and I have few questions:
    Is it only a command line tool ? or it can be accessed through Oracle Enterprise Manager.
    Can you provide me the details of how to generate reports? snapshots ? in STATSPACK
    Regards,You dont need to take statspack reports anymore in 11gR2 use AWR instead. AWR has its advance functionality and includes almost everything to know whats running in instance.
    Yes you can generate AWR report from OEM too.
    from sql prompt you can run like
    SQL>@?/rdbms/admin/awrrpt.sql
    (specify begin snaphot time and end snapshot time)
    you can have HTML or Text file as output.
    And these will be created on you current OS path. hope this help.

Maybe you are looking for

  • Problems adding native extensions from linked resources in Flash Builder 4.7

    While adding native extensions (.ane files) from linked source folder in a Actionscript Mobile Project on Flash Builder 4.7, a java.lang.NullPointerException is thrown. Below is the stacktrace. Any help would be appreciated. Also, what is the link/si

  • How to remove options in context menu of the task in UWL.

    Hi, How to remove options or customize the context menu of the task in UWL. I have 4 options(Edit,Remove,Forward,Resubmit) is appearing in the context menu. My requirement is to delete Forward option form the menu list and only 3 options should appea

  • Ver 7.0.1 wont support frames.

    I upgraded to ver. 7.0.1 and on certain sites its blank and when I right click view page source, it tells me that the browser doesn't support frames. Here's a copy and paste. <noframes><h2>Your browser does not support frames. We recommend upgrading

  • Package sun.jdbc.rowset does not exist

    Hi, I am tryng to use a CachedRowSet in a JSP page. I got rowset.jar from sun and I put it in my classpath. When I try to import sun.jdbc.rowset I have the message "package sun.jdbc.rowset does not exist". Please, could someone help me? Tanks, Celso

  • Updation agent information in table

    Hi , I have created one custom module pool program which is used for request for resource. Now in that i create new entries with request no , date (i.e sydatum) , person responsible (for creating request) all this values are stored in the custom tabl