<?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 How to place command line statements into a sql script? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232855#M890417</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Oracle 8.1.7.4, HP-UX 11.0&lt;BR /&gt;&lt;BR /&gt;I am a newbie to Oracle so please forgive my&lt;BR /&gt;basic question.&lt;BR /&gt;I have a six lines of svrmgrl statements that I would like to convert into a sql script.&lt;BR /&gt;We want to run this from a cron job.&lt;BR /&gt;&lt;BR /&gt;SVRMGR&amp;gt; connect internal&lt;BR /&gt;Connected.&lt;BR /&gt;SVRMGR&amp;gt; select name,&lt;BR /&gt;     2&amp;gt; trunc(sgasize/(1024*1024))"Allocated (M)",&lt;BR /&gt;     3&amp;gt; trunc(bytes/1024) "Free (K)",&lt;BR /&gt;     4&amp;gt; round(bytes/sgasize*100,2) "% Free"&lt;BR /&gt;     5&amp;gt; from (select sum(bytes) sgasize from sys.v_$sgastat) s,sys.v_$sgastat f&lt;BR /&gt;     6&amp;gt; where f.name = 'free memory';&lt;BR /&gt;&lt;BR /&gt;10 points to any good answer.&lt;BR /&gt;TIA, Gino&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 29 Mar 2004 12:46:49 GMT</pubDate>
    <dc:creator>Gino Castoldi_2</dc:creator>
    <dc:date>2004-03-29T12:46:49Z</dc:date>
    <item>
      <title>How to place command line statements into a sql script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232855#M890417</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Oracle 8.1.7.4, HP-UX 11.0&lt;BR /&gt;&lt;BR /&gt;I am a newbie to Oracle so please forgive my&lt;BR /&gt;basic question.&lt;BR /&gt;I have a six lines of svrmgrl statements that I would like to convert into a sql script.&lt;BR /&gt;We want to run this from a cron job.&lt;BR /&gt;&lt;BR /&gt;SVRMGR&amp;gt; connect internal&lt;BR /&gt;Connected.&lt;BR /&gt;SVRMGR&amp;gt; select name,&lt;BR /&gt;     2&amp;gt; trunc(sgasize/(1024*1024))"Allocated (M)",&lt;BR /&gt;     3&amp;gt; trunc(bytes/1024) "Free (K)",&lt;BR /&gt;     4&amp;gt; round(bytes/sgasize*100,2) "% Free"&lt;BR /&gt;     5&amp;gt; from (select sum(bytes) sgasize from sys.v_$sgastat) s,sys.v_$sgastat f&lt;BR /&gt;     6&amp;gt; where f.name = 'free memory';&lt;BR /&gt;&lt;BR /&gt;10 points to any good answer.&lt;BR /&gt;TIA, Gino&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Mar 2004 12:46:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232855#M890417</guid>
      <dc:creator>Gino Castoldi_2</dc:creator>
      <dc:date>2004-03-29T12:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to place command line statements into a sql script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232856#M890418</link>
      <description>svrmgr &amp;lt;&amp;lt; EOF&lt;BR /&gt;&lt;BR /&gt;connect internal&lt;BR /&gt;trunc(sgasize/(1024*1024))"Allocated (M)",&lt;BR /&gt;trunc(bytes/1024) "Free (K)",&lt;BR /&gt;round(bytes/sgasize*100,2) "% Free"&lt;BR /&gt;from (select sum(bytes) sgasize from sys.v_$sgastat) s,sys.v_$sgastat f&lt;BR /&gt;where f.name = 'free memory';&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;some adjustment may be required.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 29 Mar 2004 12:59:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232856#M890418</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-03-29T12:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to place command line statements into a sql script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232857#M890419</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;If you are doing some sort of monitoring, you may also wish to schedule STATSPACK snaps at reqular intervals. Then run the spreport.sql script to generate the desired reports.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Tue, 30 Mar 2004 03:06:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232857#M890419</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-03-30T03:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to place command line statements into a sql script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232858#M890420</link>
      <description>Inlining the script as SEP suggest is fine.&lt;BR /&gt;&lt;BR /&gt;Yogeeraj is quite correct in observing that if you choose to gather Oracle stats similar to your example then you may want to aim higher and get it all: Statspack.&lt;BR /&gt;Mind you, generating the snaps (automatically) is trivial. Generating the actual reports a little more tricky due to the interactive nature of spreport and the variable snap numbers.&lt;BR /&gt;&lt;BR /&gt;Anyway... my personal prefence in using scripted sql reports is to stick them into a .sql file and feed that to sqlplus. The main advantages I see for this is&lt;BR /&gt;- able to use same script interactively if/when desired&lt;BR /&gt;- easier testing/debugging/expanding of script through interactve sqlplus session&lt;BR /&gt;- easier to change later, leaving job in place just making it execute better code.&lt;BR /&gt;&lt;BR /&gt;So the job you would actually run might be:&lt;BR /&gt;su - oracle -c sqlplus -s "x/y@z" @daily&lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;&lt;BR /&gt;cat daily.sql | sqlplus ....&lt;BR /&gt;&lt;BR /&gt;or sqlplus .... &amp;lt; daily.sql &amp;gt; daily.log&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Mar 2004 12:40:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232858#M890420</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-03-30T12:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to place command line statements into a sql script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232859#M890421</link>
      <description>Hi Gino,&lt;BR /&gt;&lt;BR /&gt;If you wanted to run as a crn job then you just save the above line as a script with the line at the top and bottom as Steven specified.&lt;BR /&gt;&lt;BR /&gt;svrmgrl &amp;lt;&lt;EOF&gt;&lt;BR /&gt;connect internal&lt;BR /&gt;@&lt;/EOF&gt;&lt;BR /&gt;exit&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;And as Yogeeraj mentioned, for monitoring, if you are trying to generate the Statspack &lt;BR /&gt;Performance Report you need to run spreport.sql($OH/rdbms/admin) and choose the Begin and End snapshot ID's, between which the report will be generated. &lt;BR /&gt;&lt;BR /&gt;Note: But, when the script spreport.sql is run, the column SnapId is displayed as &lt;BR /&gt;#####. So change the column formatting options for the snap_id column in the  &lt;BR /&gt;spreport.sql script to a higher value.&lt;BR /&gt;&lt;BR /&gt;Indira A &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Mar 2004 20:35:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232859#M890421</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2004-03-30T20:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to place command line statements into a sql script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232860#M890422</link>
      <description>If you pursue  my answer, don't put a lot of effort into doing a lot of scripts.&lt;BR /&gt;&lt;BR /&gt;Oracle yanked svrmgr with Oracle 9i. You have to use sqlplus and they yanked out sqlplus internal with 9i as well.&lt;BR /&gt;&lt;BR /&gt;Still the technique works just fine.&lt;BR /&gt;&lt;BR /&gt;I for one would not mind seeing an example or elaboration on the second post to this thread.&lt;BR /&gt;&lt;BR /&gt;Good Luck,&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 30 Mar 2004 22:10:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-place-command-line-statements-into-a-sql-script/m-p/3232860#M890422</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-03-30T22:10:09Z</dc:date>
    </item>
  </channel>
</rss>

