<?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: Running an Oracle SQL script fron cron in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908023#M494835</link>
    <description>Hi Tom,&lt;BR /&gt;&lt;BR /&gt;Try 'set head on'.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
    <pubDate>Fri, 22 Dec 2006 07:44:54 GMT</pubDate>
    <dc:creator>spex</dc:creator>
    <dc:date>2006-12-22T07:44:54Z</dc:date>
    <item>
      <title>Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908010#M494814</link>
      <description>How do I execute a Oracle sql script as a cron job.</description>
      <pubDate>Tue, 05 Dec 2006 12:30:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908010#M494814</guid>
      <dc:creator>Tom Grill</dc:creator>
      <dc:date>2006-12-05T12:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908011#M494815</link>
      <description>Here is full example - &lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=947212" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=947212&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
      <pubDate>Tue, 05 Dec 2006 12:34:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908011#M494815</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2006-12-05T12:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908012#M494817</link>
      <description>If you want to run it from oracle's cron, make sure the oracle account is added to the cron.allow and then just add the script to the cron:&lt;BR /&gt;&lt;BR /&gt;# crontab -e&lt;BR /&gt;# 00 00 * * * /script&lt;BR /&gt;# | | | | | |&lt;BR /&gt;# | | | | | script to run&lt;BR /&gt;# | | | | +---------- month&lt;BR /&gt;# | | | +------------ day&lt;BR /&gt;# | | +-------------- day of the week 0-6, 0 = sunday, 1-5 = mon to fri&lt;BR /&gt;# | +----------------- hour of the day 00 to 23&lt;BR /&gt;# +-------------------- minute 00 to 59&lt;BR /&gt;&lt;BR /&gt;If you want to add it to root's crontab, do the following - same syntax as above but the script is different:&lt;BR /&gt;&lt;BR /&gt;# 00 00 * * * su - oracle -c "/script"&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Dec 2006 13:09:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908012#M494817</guid>
      <dc:creator>Coolmar</dc:creator>
      <dc:date>2006-12-05T13:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908013#M494818</link>
      <description>&lt;!--!*#--&gt;Hi Tom,&lt;BR /&gt;&lt;BR /&gt;Here's a basic template for running PL/SQL from within a shell script, which in turn can be scheduled to run via cron:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;export ORACLE_SID=yoursid&lt;BR /&gt;export ORACLE_HOME=/path/to/home&lt;BR /&gt;export ORACLE_BIN=${ORACLE_HOME}/bin&lt;BR /&gt;export ORACLE_TERM=vt220&lt;BR /&gt;export NLS_LANG=AMERICAN_AMERICA.US7ASCII&lt;BR /&gt;export PATH=$PATH:${ORACLE_BIN}&lt;BR /&gt;sqlplus -S "un/pw" &amp;lt;&amp;lt; _EOF_&lt;BR /&gt;  set heading off;&lt;BR /&gt;  select * from v$instance;&lt;BR /&gt;  exit;&lt;BR /&gt;_EOF_&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Place your PL/SQL code between the _EOF_'s, save the resulting shell script, and schedule it to run via 'crontab -e &lt;USER&gt;'.  Make sure &lt;USER&gt; appears in /var/adm/cron/cron.allow.&lt;BR /&gt;&lt;BR /&gt;PCS&lt;/USER&gt;&lt;/USER&gt;</description>
      <pubDate>Tue, 05 Dec 2006 13:37:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908013#M494818</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-12-05T13:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908014#M494820</link>
      <description>Tom,&lt;BR /&gt;&lt;BR /&gt;Simple rule is that you need to define all the veriable and path used to execute your sqlplus statement. So only thing you need to do is define all veriables like ORACLE_HOME, ORACLE_SID and add ORACLE_HOME/bin in path.&lt;BR /&gt;&lt;BR /&gt;Thats it. The script which runs under oracle login will work fine from cron as well with above minor changes.&lt;BR /&gt;&lt;BR /&gt;Samir</description>
      <pubDate>Wed, 06 Dec 2006 00:49:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908014#M494820</guid>
      <dc:creator>Samir Pujara_1</dc:creator>
      <dc:date>2006-12-06T00:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908015#M494822</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;if it is just a sql statement, i would prefer to use DBMS_JOB or DBMS_SCHEDULER (10g)&lt;BR /&gt;&lt;BR /&gt;you are guarantee that the job will be run. Say you had scheduled the job to run at 7:00 am everyday. One day, you have an intervention during which the database downtime that has gone beyond 7:00 am. The database is up again at 7:05am. If scheduled using cron, it never gets run which which dbms_job or dbms_scheduler, the job run as soon as the database is up!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if you need any further assistance, do let us know.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 06 Dec 2006 01:07:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908015#M494822</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-12-06T01:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908016#M494824</link>
      <description>&lt;!--!*#--&gt;hi again,&lt;BR /&gt;&lt;BR /&gt;If you want to use the CRON, one simple example is:&lt;BR /&gt;&lt;BR /&gt;more /home/yogeeraj/testscript.sh&lt;BR /&gt;================================&lt;BR /&gt;#!/bin/sh &lt;BR /&gt;export PATH&lt;BR /&gt;unset USERNAME&lt;BR /&gt;export ORACLE_BASE=/d01/app/oracle&lt;BR /&gt;export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_2&lt;BR /&gt;export ORACLE_SID=mydb&lt;BR /&gt;export PATH=$PATH:$ORACLE_HOME/bin:/usr/X11R6/bin&lt;BR /&gt;umask 022&lt;BR /&gt;#&lt;BR /&gt;sqlplus  /nolog &amp;lt;&amp;lt; EOF&lt;BR /&gt;connect yogeeraj/password&lt;BR /&gt;select sysdate from dual;&lt;BR /&gt;EOF&lt;BR /&gt;#End script: /home/yogeeraj/testscript.sh&lt;BR /&gt;================================&lt;BR /&gt;&lt;BR /&gt;and now in your crontab:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;# min|hour |day  |month|day  |script&lt;BR /&gt;#    |     |of mo|     |of wk|&lt;BR /&gt;#----|-----|-----|-----|-----|--------------------------------------------------&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;&lt;BR /&gt;37 15 * * *  echo "/home/yogeeraj/testscript.sh" | su - oracle10g 1&amp;gt;/home/yogeeraj/logfiles/output-testscript.crn 2&amp;gt;/home/yogeeraj/logfiles/error-testscript.crn   &lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;# END OF TABLE           day0-&amp;gt;Sunday  day6-&amp;gt;Saturday&lt;BR /&gt;#*******************************************************************************&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 06 Dec 2006 01:16:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908016#M494824</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-12-06T01:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908017#M494825</link>
      <description>hi again,&lt;BR /&gt;&lt;BR /&gt;if you want to run a procedure (abc;) or package (you may as well write a plsql block there) using DBMS_JOB:&lt;BR /&gt;&lt;BR /&gt;declare&lt;BR /&gt;   l_job number;&lt;BR /&gt;begin&lt;BR /&gt;   dbms_job.submit( l_job,&lt;BR /&gt;                   'abc;',&lt;BR /&gt;                    trunc(sysdate)+4/24,&lt;BR /&gt;                   'trunc(sysdate)+1+4/24' );&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;will run the job at 4am every day.&lt;BR /&gt;&lt;BR /&gt;make sure to set job_queue_processes and job_queue_interval (init.ora &lt;BR /&gt;parameters).&lt;BR /&gt;&lt;BR /&gt;hope this helps too!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 06 Dec 2006 01:23:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908017#M494825</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-12-06T01:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908018#M494827</link>
      <description>I now have my sql script running as a cron job.  How do I ouput only the results of my query (including the header) and get each record to appear on a single line?</description>
      <pubDate>Tue, 12 Dec 2006 14:09:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908018#M494827</guid>
      <dc:creator>Tom Grill</dc:creator>
      <dc:date>2006-12-12T14:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908019#M494829</link>
      <description>Tom,&lt;BR /&gt;look at the SQL spool command:&lt;BR /&gt;SQL&amp;gt;spool /tmp/a.lis&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;SQL&amp;gt;spool off&lt;BR /&gt;&lt;BR /&gt;See:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=303547" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=303547&lt;/A&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;A href="http://www.experts-exchange.com/Databases/Oracle/Q_21533352.html" target="_blank"&gt;http://www.experts-exchange.com/Databases/Oracle/Q_21533352.html&lt;/A&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;A href="http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a90842/ch7.htm#1005594" target="_blank"&gt;http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a90842/ch7.htm#1005594&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Other things to look at:&lt;BR /&gt;set linesize xxxxx&lt;BR /&gt;set pagesize xxxx&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Dec 2006 03:17:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908019#M494829</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-12-13T03:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908020#M494830</link>
      <description>hi tom,&lt;BR /&gt;&lt;BR /&gt;&amp;gt; How do I ouput only the results of my query (including the header) and get each record to appear on a single line?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The results of your query should be sent to a file which you can use later.&lt;BR /&gt;&lt;BR /&gt;the command that you must include in your script is:&lt;BR /&gt;&lt;BR /&gt;spool &lt;PATH&gt;/&lt;FILENAME&gt;&lt;BR /&gt;...&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;For each record to appear on a single line, you should use the command:&lt;BR /&gt;set linesize &lt;LENGTH of="" line=""&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj&lt;/LENGTH&gt;&lt;/FILENAME&gt;&lt;/PATH&gt;</description>
      <pubDate>Wed, 13 Dec 2006 04:02:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908020#M494830</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-12-13T04:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908021#M494832</link>
      <description>My report spools fine with one exception.  I'd like for the header to be saved.  I did try 'set heading on' but that didn't work.  If I output my select statement without spooling, the header appears.  Any advice?</description>
      <pubDate>Thu, 21 Dec 2006 14:42:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908021#M494832</guid>
      <dc:creator>Tom Grill</dc:creator>
      <dc:date>2006-12-21T14:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908022#M494834</link>
      <description>try to include the line:&lt;BR /&gt;&lt;BR /&gt;set pagesize 1000&lt;BR /&gt;&lt;BR /&gt;other setting that you may wish to look into that i usually use in our scripts are:&lt;BR /&gt;SET ARRAYSIZE 1 &lt;BR /&gt;SET FEEDBACK off &lt;BR /&gt;SET SERVEROUT on &lt;BR /&gt;SET PAGESIZE 66 &lt;BR /&gt;SET NEWPAGE 6 &lt;BR /&gt;SET LINESIZE 75 &lt;BR /&gt;SET PAUSE off &lt;BR /&gt;SET VERIFY off &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Fri, 22 Dec 2006 00:43:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908022#M494834</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-12-22T00:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908023#M494835</link>
      <description>Hi Tom,&lt;BR /&gt;&lt;BR /&gt;Try 'set head on'.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Fri, 22 Dec 2006 07:44:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/3908023#M494835</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-12-22T07:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Running an Oracle SQL script fron cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/6825837#M494837</link>
      <description>&lt;P&gt;Hello Yogeeraj,&lt;/P&gt;&lt;P&gt;I want to schedule a cronjob to compile a package on every day at 7:00 AM with specified user.&lt;/P&gt;&lt;P&gt;Details:&lt;/P&gt;&lt;P&gt;Username : apps&lt;/P&gt;&lt;P&gt;pwd : Deployed#777&lt;/P&gt;&lt;P&gt;ALTER PACKAGE APPS.EQU_BIS_PK COMPILE&lt;/P&gt;&lt;P&gt;Please provide me the cronjob for the above details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Adithya&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 12:50:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/running-an-oracle-sql-script-fron-cron/m-p/6825837#M494837</guid>
      <dc:creator>adithya7</dc:creator>
      <dc:date>2016-01-21T12:50:32Z</dc:date>
    </item>
  </channel>
</rss>

