<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: statspack report in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995086#M749580</link>
    <description>&lt;!--!*#--&gt;&amp;gt;&amp;gt; After that we manually create the statsreport for various snap id.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Now i want to create a statsreport in a automated way(by creating a script) and will mail to the respective mail id.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I always thought it was a bit of  challenge to automatically create a statspack report, that is without waiting for the prompt to select the begin and end snapshot numbers.&lt;BR /&gt;&lt;BR /&gt;So for my benchmark work I adapted the standard spreport.sql to select specific snaps relative to the end.&lt;BR /&gt;&lt;BR /&gt;You can readily adapt this again to select a specific snap comment or other criteria.&lt;BR /&gt;&lt;BR /&gt;Hope this helps some,&lt;BR /&gt;Hein van den Heuvel (at gmail dot com)&lt;BR /&gt;HvdH Performance Consulting&lt;BR /&gt;&lt;BR /&gt;Rem&lt;BR /&gt;Rem  sphigh.sql, Cloned from spreport.sql by Hein van den Heuvel. Apr 2004&lt;BR /&gt;Rem  set up statspack parameters for high-load phase being 2 snaps away.&lt;BR /&gt;Rem&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;-- Get the current database/instance information - this will be used&lt;BR /&gt;-- later in the report along with bid, eid to lookup snapshots&lt;BR /&gt;&lt;BR /&gt;column snap_id     format 9990 heading 'Snap|Id';&lt;BR /&gt;column begin_snap  heading "Begin Snap"  new_value begin_snap  format 99999;&lt;BR /&gt;column end_snap  heading "End Snap"  new_value end_snap  format 99999;&lt;BR /&gt;column report_name new_value report_name noprint;&lt;BR /&gt;&lt;BR /&gt;column inst_num  heading "Inst Num"  new_value inst_num  format 99999;&lt;BR /&gt;column inst_name heading "Instance"  new_value inst_name format a12;&lt;BR /&gt;column db_name   heading "DB Name"   new_value db_name   format a12;&lt;BR /&gt;column dbid      heading "DB Id"     new_value dbid      format 9999999999 just c;&lt;BR /&gt;&lt;BR /&gt;select d.dbid            dbid&lt;BR /&gt;     , d.name            db_name&lt;BR /&gt;     , i.instance_number inst_num&lt;BR /&gt;     , i.instance_name   inst_name&lt;BR /&gt;     ,  s.snap_id        snap_id&lt;BR /&gt;     , (s.snap_id - 1)   end_snap&lt;BR /&gt;     , (s.snap_id - 2)   begin_snap&lt;BR /&gt;     , 'sph' || to_char(snap_time, 'YYYYMMDDHH24MISS')||&lt;BR /&gt;       '_'||(s.snap_id - 2)||'_'||(s.snap_id - 1) report_name&lt;BR /&gt;  from v$database d,&lt;BR /&gt;       v$instance i,&lt;BR /&gt;       stats$snapshot s&lt;BR /&gt;  where s.snap_id = (select max(snap_id) from stats$snapshot )&lt;BR /&gt;  and  d.dbid = s.dbid&lt;BR /&gt;  and  i.instance_number = s.instance_number;&lt;BR /&gt;&lt;BR /&gt;@/benchmark/sql/sprepins&lt;BR /&gt;--&lt;BR /&gt;-- End of file&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 15 May 2007 15:44:35 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2007-05-15T15:44:35Z</dc:date>
    <item>
      <title>statspack report</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995081#M749574</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;   i want to create the script for statspack report in a automated way..&lt;BR /&gt;&lt;BR /&gt;  The below script is automated snap id creation script&lt;BR /&gt;&lt;BR /&gt;/bin/sh&lt;BR /&gt;ORACLE_SID=DWHDWP&lt;BR /&gt;export ORACLE_SID&lt;BR /&gt;ORACLE_HOME=/u01/app/oracle/product/9.2.0.6&lt;BR /&gt;export ORACLE_HOME&lt;BR /&gt;&lt;BR /&gt;$ORACLE_HOME/bin/sqlplus 'perfstat/perfstat' &amp;lt;&amp;lt; EOF&lt;BR /&gt;&lt;BR /&gt;spool /local/app/ora9i/STATSPACK_RUN/statspack_run.log&lt;BR /&gt;&lt;BR /&gt;execute statspack.snap&lt;BR /&gt;&lt;BR /&gt;spool off&lt;BR /&gt;quit&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;cat /local/app/ora9i/STATSPACK_RUN/statspack_run.log | mailx -s "STATSPACK_RUN" -r NJCSORDBDWHOR01@autodesk.com hcl.dba@autodesk.com&lt;BR /&gt;&lt;BR /&gt;we scheduled it the above script in crontab in various timings. &lt;BR /&gt;&lt;BR /&gt;After that we manually create the statsreport for various snap id.&lt;BR /&gt; &lt;BR /&gt;Now i want to create a statsreport in a automated way(by creating a script) and will mail to the respective mail id.&lt;BR /&gt;&lt;BR /&gt;could u please give ur ideas  to create a script.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Nirmal.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;     &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 May 2007 09:44:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995081#M749574</guid>
      <dc:creator>Nirmalkumar</dc:creator>
      <dc:date>2007-05-07T09:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: statspack report</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995082#M749575</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;What you need to understand generally is:&lt;BR /&gt;&lt;BR /&gt;1) cron has no environment. No ORACLE_SID,no PATH, no nothing. Your script must set everything up for Oracle prior to running any commands.&lt;BR /&gt;&lt;BR /&gt;2) That spooled log may get awfully big so beware of blowing default sendmail message size restrictions which are 2 MB if memory serves.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 07 May 2007 10:40:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995082#M749575</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-05-07T10:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: statspack report</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995083#M749577</link>
      <description>Hi Nirmal,&lt;BR /&gt;&lt;BR /&gt;A few clarifications:&lt;BR /&gt;1. To be able to generate a meaningful Statspack report, you should generated two snapshots within an interval of time. Generally accepted intervals are of 15mins.&lt;BR /&gt;&lt;BR /&gt;You may wish to automate this operation at specific periods of time during the operation hours of your system using the DBMS_JOB or DBMS_SCHEDULER packages.&lt;BR /&gt;&lt;BR /&gt;A sample script on how to do this is supplied in ?/rdbms/admin/spauto.sql, which schedules a snapshot every hour, on the hour.&lt;BR /&gt;&lt;BR /&gt;2. After you have generated the two snapshots, you will have to run the spreport.sql script to produce the Statspack Report.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;SQL&amp;gt;  connect perfstat/perfstat&lt;BR /&gt;SQL&amp;gt;  @?/rdbms/admin/spreport&lt;BR /&gt;&lt;BR /&gt;You will be prompted for:&lt;BR /&gt; 1. The beginning snapshot Id&lt;BR /&gt; 2. The ending snapshot Id&lt;BR /&gt; 3. The name of the report text file to be created&lt;BR /&gt;&lt;BR /&gt;For more information, please refer to Metalink Note 94224.1 - FAQ - STATSPACK COMPLETE REFERENCE&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Tue, 08 May 2007 00:53:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995083#M749577</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-05-08T00:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: statspack report</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995084#M749578</link>
      <description>Hi yogeeraj,&lt;BR /&gt;&lt;BR /&gt;  Thank u for ur reply..&lt;BR /&gt;&lt;BR /&gt;    iam able to get statsreport manually by running spreport.sql script with begin and end snap ids.&lt;BR /&gt;&lt;BR /&gt;   My question is could u please help me out to create a shell script to send a statsreport through mail in automated way.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Nirmal.</description>
      <pubDate>Tue, 08 May 2007 06:45:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995084#M749578</guid>
      <dc:creator>Nirmalkumar</dc:creator>
      <dc:date>2007-05-08T06:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: statspack report</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995085#M749579</link>
      <description>hi nirmal,&lt;BR /&gt;&lt;BR /&gt;unfortunately, i am running oracle10g 10g which automates this via a thing called AWR (automatic workload repository), it just uses the database to hold data.&lt;BR /&gt;&lt;BR /&gt;I have not configured the database for statspack so i cannot really test.&lt;BR /&gt;&lt;BR /&gt;But basically, what you will need to do is:&lt;BR /&gt;1. determine the 2 snap ids&lt;BR /&gt;2. run sqlplus / @script parm1 parm2 parm3....&lt;BR /&gt;3. Email the report file to the desired recipients.&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj&lt;BR /&gt;</description>
      <pubDate>Tue, 08 May 2007 08:43:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995085#M749579</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-05-08T08:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: statspack report</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995086#M749580</link>
      <description>&lt;!--!*#--&gt;&amp;gt;&amp;gt; After that we manually create the statsreport for various snap id.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Now i want to create a statsreport in a automated way(by creating a script) and will mail to the respective mail id.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I always thought it was a bit of  challenge to automatically create a statspack report, that is without waiting for the prompt to select the begin and end snapshot numbers.&lt;BR /&gt;&lt;BR /&gt;So for my benchmark work I adapted the standard spreport.sql to select specific snaps relative to the end.&lt;BR /&gt;&lt;BR /&gt;You can readily adapt this again to select a specific snap comment or other criteria.&lt;BR /&gt;&lt;BR /&gt;Hope this helps some,&lt;BR /&gt;Hein van den Heuvel (at gmail dot com)&lt;BR /&gt;HvdH Performance Consulting&lt;BR /&gt;&lt;BR /&gt;Rem&lt;BR /&gt;Rem  sphigh.sql, Cloned from spreport.sql by Hein van den Heuvel. Apr 2004&lt;BR /&gt;Rem  set up statspack parameters for high-load phase being 2 snaps away.&lt;BR /&gt;Rem&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;-- Get the current database/instance information - this will be used&lt;BR /&gt;-- later in the report along with bid, eid to lookup snapshots&lt;BR /&gt;&lt;BR /&gt;column snap_id     format 9990 heading 'Snap|Id';&lt;BR /&gt;column begin_snap  heading "Begin Snap"  new_value begin_snap  format 99999;&lt;BR /&gt;column end_snap  heading "End Snap"  new_value end_snap  format 99999;&lt;BR /&gt;column report_name new_value report_name noprint;&lt;BR /&gt;&lt;BR /&gt;column inst_num  heading "Inst Num"  new_value inst_num  format 99999;&lt;BR /&gt;column inst_name heading "Instance"  new_value inst_name format a12;&lt;BR /&gt;column db_name   heading "DB Name"   new_value db_name   format a12;&lt;BR /&gt;column dbid      heading "DB Id"     new_value dbid      format 9999999999 just c;&lt;BR /&gt;&lt;BR /&gt;select d.dbid            dbid&lt;BR /&gt;     , d.name            db_name&lt;BR /&gt;     , i.instance_number inst_num&lt;BR /&gt;     , i.instance_name   inst_name&lt;BR /&gt;     ,  s.snap_id        snap_id&lt;BR /&gt;     , (s.snap_id - 1)   end_snap&lt;BR /&gt;     , (s.snap_id - 2)   begin_snap&lt;BR /&gt;     , 'sph' || to_char(snap_time, 'YYYYMMDDHH24MISS')||&lt;BR /&gt;       '_'||(s.snap_id - 2)||'_'||(s.snap_id - 1) report_name&lt;BR /&gt;  from v$database d,&lt;BR /&gt;       v$instance i,&lt;BR /&gt;       stats$snapshot s&lt;BR /&gt;  where s.snap_id = (select max(snap_id) from stats$snapshot )&lt;BR /&gt;  and  d.dbid = s.dbid&lt;BR /&gt;  and  i.instance_number = s.instance_number;&lt;BR /&gt;&lt;BR /&gt;@/benchmark/sql/sprepins&lt;BR /&gt;--&lt;BR /&gt;-- End of file&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 May 2007 15:44:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/statspack-report/m-p/3995086#M749580</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-05-15T15:44:35Z</dc:date>
    </item>
  </channel>
</rss>

