Generate STATSPACK report automatically

Hi
Version 8174.
I have a job that once per hour taking a snapshot by execution the follwoing command : statspack.snap;
I also would like it to create the file in the filesystem automatically , and save me the errort to execute :
@?/rdbms/admin/spreport.sql
Thanks

Here we go :
1. Some example in the doc :
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/statspac.htm#30085
2. a couple of years ago I wrote some thing about that :
Re: Automating STATSPACk reporting - how?
You can of course improve it
Nicolas.

Similar Messages

  • Generate AWR Report automatically every day

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

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

  • How to generate statspack report

    Hi,
    We have to generate a statspack report. We are accessing the oracle server which is in a remote machine. The platform is windows. But we are not able to generate a report. We have to know whether we have to specify the path of that machine along with the oracle path.
    Currently we give the command to generate report as:
    @d:\oracle\ora92\rdbms\admin\spreport.sql
    Error : Scheme d not supported.
    "d:\oracle\ora92" is the oracle path. Is this syntax coorect?
    It will be verty helpful if u help us in this matter.
    Thanking You,
    Chaitanya.

    SP2-0916 Scheme scheme not supported
    Cause: iSQL*Plus only supports HTTP, HTTPS and FTP.
    Action: Change the scheme to one that is supported.
    How did you call the spreport.sql?
    spreport.sql is designed for SQL*PLUS not iSQL*PLUS
    This script is usually to be run by statspack owner PERFSTAT

  • Generate DB reports for many Schema's automatically.

    Hello,
    I am using ORACLE DB 11g R1 & RHEL 5.
    I have a DB server the MAIN SERVER in which i have many schema's and i have scheduled a crontab job to take a backup of each schema
    on a daily basis. The same backup file (.dmp) is then imported to a BACKUP SERVER machine for the same schema name.
    The bottom line is i am trying to keep a backup server ready with me with the data uptill the last day. So if the
    main server goes down due to some reason the developers can connect to the backup server and continue working.
    Meanwhile i can analyse and bring the main server up again.
    I want an idea buy which i can keep both the server machine ( MAIN & BACKUP ) in the sync of the data and
    i should be able to generate a report automatically every day which schema has been backedup & imported.
    If they have failed then for what reason.
    Please advice me some proper solution. If you have other ideas let me know.
    I want a proper system which will keep the data of MAIN & BACKUP server the same and if the MAIN server goes down
    it should be able to connect to BACKUP server and continue.
    Thanks in advance.

    The same backup file (.dmp) is then imported to a BACKUP SERVER machine for the same schema name.Is it forcibly imported every day ? Why ? Why not import it only when you need to ?
    OTOH, if the export and import processes are automated and self-running you have already resolved your "problem".
    However, is it really a requirement to have an alternate (aka "BACKUP") Development server ? Is it a requirement to have this synchronised with the schema and data of the primary Development server as of the end of the day ? What does your development team lose if it is, say, a few days behind ? Can they not reapply their changes ? How many developers and how many daily changes put together justify the cost of this mechanism ?
    (How about Production ? How is it protected ?)
    Hemant K Chitale

  • SLA Report generate and download automatically

    Hi,
    I u2018m looking for a way to generate  SLA report automatically (in batch) and also download it to a file system or move it to a SAP Portal KM environment.
    Has anybody an idea how I can doit ?
    Regrads
    Robert

    Hi Carsten,
    thank you for your answers.
    you have to configure your button to submit the request "download". so give your
    button the name "download" - you can set the display name like you want - but the >>"internal" name must be "download". Then you can use your condition as described.
    ... and .. the button must not have a target ...Sorry I think I was not clear enough on this. I allready did what you described without success. I thought there was some typo but I could not find one.
    The button name is set to download and the condition is 'Request = Expression 1' in the select list and download in the textarea.
    Unfortunately the process does not execute with this condition whereas it is executed when there is no condition. So I think there has to be some typo I did not recognized so I have to search again.
    just make sure in your link that the :REQUEST is download
    f?p=&APP:ID.:&APP_PAGE_ID.:&SESSION.:download:...
    ("download" is the request parameter)Thank you, that's what I searched.
    Regards
    Markus

  • Automatic statspack report

    hi
    can we sheduled statspack report so system will generate snap at some time and whenever we want the report we can create report using that snap no. ?

    Re: script to generate statspack reports an example of some days ago.
    Nicolas.

  • Snap ids to generate performance report

    Hi,
    I have a basic idea on statspack, and implementing this first time, looking for your help to generate statspack report.
    scenario is this :-
    we have to do a performance testing during bulk loading which happens daily at night for 1 hour.
    i have sheduled a job to generate snaps on every interval of 15 min say :-
    NAME SNAP_ID Date/Time
    oracle 4 13.11.2006:08:45:00
    oracle 1 13.11.2006:08:00:00
    oracle 2 13.11.2006:08:15:00
    oracle 3 13.11.2006:08:30:00
    suppose at 08:00 there is no loading so i am considering this as a baseline snap ,
    so, which snap ids i have to include to generate various performance report (like sp_1_2,sp_1_3,sp_14 etc) .
    Asif

    Snap is a snap. A snapshot of database status at a given point in time. Statspack was designed to help DBA's diagnose the performance problems of a database during a particular interval of time by recording what all went on with the database.
    If you are trying to analyze the database using only one snap, you will never get the correct picture.
    Lets say in your case, you generate the report s_1 only which is before load. How will you diagnose the problem that happened after this snap?

  • Create statspack report using sql*developer

    Hello,
    While connecting with PERFSTAT user I can not create statspack report using SQL*Developer:
    @?/rdbms/admin/awrrpt
    Error starting at line 1 in command:
    @?/rdbms/admin/awrrpt
    Error report:
    Unable to open file: "?/rdbms/admin/awrrpt.sql"
    Actually, my problem or question is that how can PERFSTAT user can generate statspack reports from a Client side. What is the other way a non-dba can see the snapshots histroy and generate report (by using perfstat user ) while joing tables or using views?
    Thanks a lot.
    Best Regards

    Hi,
    for awr reports @?/rdbms/admin/awrrpt (you need EE+Diagnostic Pack) there is a solution.
    Grant execute dbms_workload_repository to <user>;
    Grant select_catalog_role to <user>;
    get all SNAP_IDs
    SELECT   TO_CHAR(s.startup_time,'YYYY.MM.DD HH24:MI:SS') INSTART_FMT,
             di.instance_name INST_NAME,
             di.db_name DB_NAME,
             s.snap_id SNAP_ID,
             TO_CHAR(s.end_interval_time,'YYYY.MM.DD HH24:MI:SS') SNAPDAT,
             s.snap_level LVL
    FROM    dba_hist_snapshot s,
             dba_hist_database_instance di
    WHERE   di.dbid = s.dbid
             AND di.instance_number = s.instance_number
             AND Di.Startup_Time = S.Startup_Time
    ORDER BY snap_id desc;
    Select * From Table(Sys.Dbms_Workload_Repository.Awr_Report_Html(DBID, 1, BEGIN_SNAP_ID, END_SNAP_ID));
    For statspack i don't know a solutuion. I think the best idea is, create a job to make the statspack report on the server side and access it via external tables or mail them forward to you.
    Best regards
    Thomas

  • Interpreting statspack report

    Hi,
    To tune the database i generated statspack report please share me the tips regarding tuning. part of the statspack is given below
    STATSPACK report for
    DB Name         DB Id    Instance     Inst Num Release     OPS Host
    PINDB         3730403337 pindb               1 8.1.7.0.0   NO  suportal01
                    Snap Id     Snap Time      Sessions
    Begin Snap:         21 21-Jul-08 13:08:31      210
       End Snap:         22 21-Jul-08 13:22:24      210
        Elapsed:                  13.88 (mins)
    Cache Sizes
    ~~~~~~~~~~~
               db_block_buffers:     409600          log_buffer:     163840
                  db_block_size:       4096    shared_pool_size: 1310720000
    Load Profile
    ~~~~~~~~~~~~                            Per Second       Per Transaction
                      Redo size:             42,186.94              5,846.24
                  Logical reads:             38,625.42              5,352.68
                  Block changes:                174.36                 24.16
                 Physical reads:             17,187.35              2,381.81
                Physical writes:                173.19                 24.00
                     User calls:                163.64                 22.68
                         Parses:                 26.36                  3.65
                    Hard parses:                  1.23                  0.17
                          Sorts:                 13.91                  1.93
                         Logons:                  0.27                  0.04
                       Executes:                708.32                 98.16
                   Transactions:                  7.22
      % Blocks changed per Read:    0.45    Recursive Call %:   80.91
    Rollback per transaction %:    0.67       Rows per Sort: #######
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Buffer Nowait %:   98.10       Redo NoWait %:   99.97
                Buffer  Hit   %:   55.50    In-memory Sort %:   99.69
                Library Hit   %:   99.62        Soft Parse %:   95.35
             Execute to Parse %:   96.28         Latch Hit %:   99.73
    Parse CPU to Parse Elapsd %:   30.23     % Non-Parse CPU:   99.99
    Shared Pool Statistics        Begin   End
                 Memory Usage %:   83.58   83.11
        % SQL with executions>1:   62.74   63.24
      % Memory for SQL w/exec>1:   37.31   38.34
    STATSPACK report for
    DB Name         DB Id    Instance     Inst Num Release     OPS Host
    PINDB         3730403337 pindb               1 8.1.7.0.0   NO  suportal01
                    Snap Id     Snap Time      Sessions
    Begin Snap:         21 21-Jul-08 13:08:31      210
       End Snap:         22 21-Jul-08 13:22:24      210
        Elapsed:                  13.88 (mins)
    Cache Sizes
    ~~~~~~~~~~~
               db_block_buffers:     409600          log_buffer:     163840
                  db_block_size:       4096    shared_pool_size: 1310720000
    Load Profile
    ~~~~~~~~~~~~                            Per Second       Per Transaction
                      Redo size:             42,186.94              5,846.24
                  Logical reads:             38,625.42              5,352.68
                  Block changes:                174.36                 24.16
                 Physical reads:             17,187.35              2,381.81
                Physical writes:                173.19                 24.00
                     User calls:                163.64                 22.68
                         Parses:                 26.36                  3.65
                    Hard parses:                  1.23                  0.17
                          Sorts:                 13.91                  1.93
                         Logons:                  0.27                  0.04
                       Executes:                708.32                 98.16
                   Transactions:                  7.22
      % Blocks changed per Read:    0.45    Recursive Call %:   80.91
    Rollback per transaction %:    0.67       Rows per Sort: #######
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Buffer Nowait %:   98.10       Redo NoWait %:   99.97
                Buffer  Hit   %:   55.50    In-memory Sort %:   99.69
                Library Hit   %:   99.62        Soft Parse %:   95.35
             Execute to Parse %:   96.28         Latch Hit %:   99.73
    Parse CPU to Parse Elapsd %:   30.23     % Non-Parse CPU:   99.99
    Shared Pool Statistics        Begin   End
                 Memory Usage %:   83.58   83.11
        % SQL with executions>1:   62.74   63.24
      % Memory for SQL w/exec>1:   37.31   38.34
    Buffer Pool Statistics for DB: PINDB  Instance: pindb  Snaps: 21 -22
    -> Pools   D: default pool,  K: keep pool,  R: recycle pool
                                                          Free    Write     Buffer
           Buffer    Consistent    Physical   Physical  Buffer Complete       Busy
    P        Gets          Gets       Reads     Writes   Waits    Waits      Waits
    D  14,233,242             0  14,216,020     39,539       0        0    612,534
    Buffer wait Statistics for DB: PINDB  Instance: pindb  Snaps: 21 -22
    -> ordered by wait time desc, waits desc
                                     Tot Wait    Avg
    Class                    Waits  Time (cs) Time (cs)
    data block             611,175          0         0
    undo header                  2          0         0
    Enqueue activity for DB: PINDB  Instance: pindb  Snaps: 21 -22
    -> ordered by waits desc, gets desc
    Enqueue            Gets      Waits
    TX                7,173          4Thanks
    Prakash
    Message was edited by:
    user612485

    Hi,
    Your Buffer it ratio at that time is 55.50%, close to 85% should be good.>>>can i increase db_block_buffers for this
    Parse CPU to Parse Elapsd %: 30.23, only 30% of your sql statements are shared, you need to change the cursor_sharing to ( force or similar) and the application code as well to potentatially use less literal variables>>>>since it is oracle 8.1.7.0.0. cursor_sharing=force is not available and i discuss with the developers regarding that.suppose if i make cursor_sharing=exact(default) to similar is it impact on execution plan of the queries.
    shared pool Memory Usage %: 83.58 >>>>>>>>>>>>>>shall i increase shared_pool_size
    Regards
    Prakash
    Message was edited by:
    user612485

  • Where to check statspack report destination.

    The statspack reports are being generated with dbms_jobs. Below is a row returned form dba_jobs view.
    63 PERFSTAT PERFSTAT PERFSTAT 11-AUG-06 10:31:25
    11-AUG-06 11:31:25 25969 N
    /*1:Hr*/ sysdate + 1/24
    0 BEGIN statspack.snap; END;
    NLS_LANGUAGE='AMERICAN' NLS_TERRITORY='AMERICA' NLS_CURRENCY='$' NLS_ISO_CURRENCY='AMERICA' NLS_NUMERIC_CHARACTERS='.,' NLS_DATE_FORMAT='DD-MON-RR' NL
    S_DATE_LANGUAGE='AMERICAN' NLS_SORT='BINARY'
    0102000200000000
    Where to check what is the location of statspack report.

    Thanks to all for you inputs. I generated statspack report.
    My intention was to catch a culprit select sql which failed because of ORA - 1555, the alert log did not capture the full sql statement.
    The sql statement goes like this....
    SELECT
    /*+ CHOOSE */ tot3.FULL_HINT_NAME FULL_HINT_NAME,
    tot3.TARGET_TYPE_CODE TARGET_TYPE_CODE,
    tot3.HINT_DETAIL HINT_DETAIL,
    tot3.HINT_STATUS HINT_STATUS,
    tot3.REF_USER_NAME_LIST REF_USER_NAME_LIST,
    tot3.HINT_DESCRIPTION HINT_DESCRIPTION,
    tot3.REF_USER_NAME_LIST_HOVER REF_USER_NAME_LIST_HOVER,
    tot3.REF_PERCENT_COMPLETE REF_PERCENT_COMPLETE,
    tot3.TARGET_HAS_EXCEPTIONS_FLAG TARGET_HAS_EXCEPTIONS_FLAG,
    tot3.TARGET_SUMMARY_CONDITION TARGET_SUMMARY_CONDITION,
    tot3.source_id SOURCE_ID,
    tot3.target_id TARGET_ID,
    tot3.RELATIONSHIP_NAME RELATIONSHIP_NAME,
    tot3.SOURCE_DESCRIPTION SOURCE_DESCRIPTION,
    tot3.IS_USER_PARTICIPANT IS_USER_PARTICIPANT,
    tot3.REF_ID_HOVER REF_ID_HOVER,
    tot3.URL_LINK URL_LINK,
    tot3.ATTACHMENT_LINK ATTACHMENT_LINK,
    tot3.HINT_ID HINT_ID,
    tot3.SOURCE_REQUEST_TYPE SOURCE_REQUEST_TYPE,
    tot3.CREATION_DATE CREATION_DATE
    FROM
    kcrt_req_HINTs_v tot3
    WHERE
    tot3.user_id = :1
    AND
    tot3.source_i
    I could not find that sql in v$sqltext and stats$sqltext, I was expecting this to get captured in statspack report but it did not happen.
    Is it so that the failed sqls will not get recorded in those v$views and hence do not come into statspack report? Or else how can I capture the complete sql statement.

  • Generating AWR reports

    I need to generate many AWR reports everyday with the same time period each time.
    09h00 to 09h15
    11h00 to 11h15
    14h00 to 14h15
    16h00 to 16h15
    Is there a way to generate those reports automatically with parameters?

    783643 wrote:
    I need to generate many AWR reports everyday with the same time period each time.
    09h00 to 09h15
    11h00 to 11h15
    14h00 to 14h15
    16h00 to 16h15
    Is there a way to generate those reports automatically with parameters?
    Rem      If you want to use this script in an non-interactive fashion,
    Rem      see the 'customer-customizable report settings' section in
    Rem      awrrpti.sql

  • Automate statspack report generation.

    Hi All,
    I have a 9i db on HP-UX. It has statspack snapshot scheduled at every 10 mins.
    Is it possible to generate and mail the stats report automatically for a perticular period ? Is there any standard job or Shell script is to be used.
    Thanks in advance,
    Ashutosh

    Ashutosh wrote:
    Hi All,
    I have a 9i db on HP-UX. It has statspack snapshot scheduled at every 10 mins.
    Is it possible to generate and mail the stats report automatically for a perticular period ? Is there any standard job or Shell script is to be used.
    First thing 9i is loong time back got desupported. Please use a supported release at the moment. Second, AFAIK there is no such mechanism available by default to do so. Since you are in 9i and the only scheduling package in that was dbms_job, even writing a custom code to do so would not be a very trivial task.
    Aman....

  • Generating report automatically.....

    I have a reuirement from the users where in they have number of reports generally time bound, say previous week.
    The solution they are looking out is to have these reports are generated automatically and sent via email to a specific group mailbox.
    Can we achieve the above functionality in Business warehouse, if so how.
    Note: I think we need to create a report manually by providing the date range and generating the report and exporting from SAP.
    I am not sure whether there is any procedure of this the same automatically.
    your inputs will be appreciated.

    Hi,
    take a look at the Information Broadcasting. It is possible to destribute content by email.
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/359840dfa5a160e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/eb/0cfa40fe14f523e10000000a155106/frameset.htm
    Regards
    Andreas

  • Generate Reports Automatically From Report Server

    Hi all,
    Can anyone please give me some clues on how to generate reports automatically from report server? e.g. generate daily sales reports on everyday 11:00pm.
    Thank you.

    You can use scheduling feature of reports.
    You need to give in cmd line
    schedule=schedule_param
    Refer in [     Publishing reports to web  - 10G  ] (see link below)
    the command line param - "schedule"
    http://download-uk.oracle.com/docs/html/B10314_01/pbr_cla.htm#641338
    [    All Docs for all versions    ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    ---------------------------------------------------------------------------------

  • How to generate pdf report and automatically save in the folder?

    Hi all,
    I want to ask, how to generate pdf report and automatically save in the folder?
    Actually, if i run pdf report and show to screen. Now do not need to show to the screen but save the pdf file in the folder.
    If anyone know, please share to me.
    Thanks and regards,
    Iwan

    Hi all,
    Thanks for the reply.
    when i run pdf report, and i got this URL to show the pdf report.
    http://190.180.55.73:7778/reports/rwservlet/getjobid3828?server=sitcnrepsvr
    Do any body know where can i get this pdf report that i have run in application server report folder ?
    Thanks and regards,
    Iwan

Maybe you are looking for

  • Adobe Camera Raw (ACR), Jpeg Files and Metadata

    I have been using Adobe Camera Raw (ACR) with my Canon EOS 30D, an 8 MP camera, for a while now. I would make non-destructive changes to the raw file (.CR2) in ACR where the changes would be stored in an adjoining .xmp file. Jpegs of the unedited and

  • Problem using ToolTip_Text on 2 screens

    I am using Forms 6i in my application. When installing on a PC with 2 screens the ToolTip_Text property fails on screen # 2. The text is always displayed on screen # 1. Can anyone help me ? Best Regards kjellG

  • The DEVICES section no longer appears!

    Hello! Happens that there was a time when, if I opened the app on my iphone and had the desktop version running, there would appear a section titled "DEVICES". I thought it was a problem with my (then) current iphone, but now even with a new one, not

  • ABAP Class CL_RSR_WWW_MODIFY_TABLE, Method to concatenate 2 texts

    Hi Experts. I  want to use Web Design API for Tables for a BW WEB report. I should concatenate the texts from 1. and 2. column into 3. colum. I created an ABAP Klass that has CL_RSR_WWW_MODIFY_TABLE as superclass. Which method should I use here ? How

  • GIS integration with mySAP ERP 2004 Jco version?

    Hi guys, Which version of JCO connector will connects the mySAP ERP 2004? while integrating GIS integration with mySAP ERP 2004 . Thanks in advance Regards Rgdasari