Return-Path: <ml-errors@fatcity.com>
Received: from ensim.rackshack.net (root@localhost)
 by orafaq.net (8.11.6/8.11.6) with ESMTP id h8HDHn813441
 for <oracle-l@orafaq.net>; Wed, 17 Sep 2003 08:17:50 -0500
X-ClientAddr: 66.27.56.212
Received: from www3.fatcity.com (rrcs-west-66-27-56-212.biz.rr.com [66.27.56.212])
 by ensim.rackshack.net (8.11.6/8.11.6) with ESMTP id h8HDHn513434
 for <oracle-l@orafaq.net>; Wed, 17 Sep 2003 08:17:49 -0500
Received: (from root@localhost)
 by www3.fatcity.com (8.11.6/8.11.6) id h8HAATi27187
 for oracle-l@orafaq.net; Wed, 17 Sep 2003 03:10:29 -0700
Received: by fatcity.com (05-Jun-2003/v1.0g-b73/bab) via fatcity.com id 005D037E; Wed, 17 Sep 2003 03:09:43 -0800
Message-ID: <F001.005D037E.20030917030943@fatcity.com>
Date: Wed, 17 Sep 2003 03:09:43 -0800
To: Multiple recipients of list ORACLE-L <ORACLE-L@fatcity.com>
X-Comment: Oracle RDBMS Community Forum
X-Sender: Paula_Stankus@doh.state.fl.us
Sender: ml-errors@fatcity.com
Reply-To: ORACLE-L@fatcity.com
Errors-To: ML-ERRORS@fatcity.com
From: Paula_Stankus@doh.state.fl.us
Subject: RE: SQLPLUS with cronjob is giving problem
Organization: Fat City Network Services, San Diego, California
X-ListServer: v1.0g, build 73; ListGuru (c) 1996-2003 Bruce A. Bergman
Precedence: bulk
Mime-Version: 1.0
Content-Type: multipart/alternative;	boundary="----_=_NextPart_001_01C37D03.8FEA4618"
------_=_NextPart_001_01C37D03.8FEA4618
Content-Type: text/plain

 Dear Sami,

As a matter of fact whatever environ. values are set in your .profile are
not in operation through a crontab process.  

To deal with this issue we do something that I have seen others do as well.
We basically create a .profilecron which we call as the first parameter in
our scripts that we want to run in the profile.  We also ensure that this
.profileron will work when we run the scripts interactively.  So let's say
you have a script runsql.ksh You would put immediately after:

!#/bin/ksh
**************************************
* comments
************************************
. /export/home/oracle/.profilecron

Please double-check my syntax for running the korn shell.  This assumes that
you do.  In fact, if you do and do not set that in your scripts you will
have problems with some commands not running correctly.

Good luck.
Paula

-----Original Message-----
To: Multiple recipients of list ORACLE-L
Sent: 9/17/03 3:59 AM

Hello Sami,

Check the environment variables.. such as ORACLE_HOME, LD_LIBRARY_PATH,
and just PATH.. Are they set .. when you execute from CRON ? You will
have them when you execute from unix login.

Hope this helps.

Nikunj



>From: Oracle DBA 
>Reply-To: ORACLE-L@fatcity.com 
>To: Multiple recipients of list ORACLE-L 
>Subject: SQLPLUS with cronjob is giving problem 
>Date: Tue, 16 Sep 2003 06:04:25 -0800 
> 
>Hi List 
> 
> 
>I am trying to automate "Number of Oracle Connections" 
>using cronjob. 
> 
>$ crontab -l 
>0 8 * * * 
>/export/home/oracle/scripts/dba/.Schedulejobs/xyz_conn_monitor.sh 
> > /tmp/xyz_conn_monitor.lst 2>&1 
> 
>$ cat xyz_conn_monitor.sh 
>/u02/app/oracle/product/8.1.7/bin/sqlplus 
>user1/welcome1@xyz 
>@/export/home/oracle/scripts/dba/.Schedulejobs/xyz_conn_monitor.sql 
> 
>$ cat xyz_conn_monitor.lst 
>Message file sp1.msb not found 
>Error 6 initializing SQL*Plus 
> 
>But if run 
>/export/home/oracle/scripts/dba/.Schedulejobs/xyz_conn_monitor.sh 
>in unix $ prompt, it is running fine. 
> 
>Could someone help me to resolve the same? 
> 
> 
>Thanks in advance 
>Sami 
> 
> 
>__________________________________ 
>Do you Yahoo!? 
>Yahoo! SiteBuilder - Free, easy-to-use web site design software 
>http://sitebuilder.yahoo.com 
>-- 
>Please see the official ORACLE-L FAQ: http://www.orafaq.net 
>-- 
>Author: Oracle DBA 
> INET: sami_resume@yahoo.com 
> 
>Fat City Network Services -- 858-538-5051 http://www.fatcity.com 
>San Diego, California -- Mailing list and web hosting services 
>--------------------------------------------------------------------- 
>To REMOVE yourself from this mailing list, send an E-Mail message 
>to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in 
>the message BODY, include a line containing: UNSUB ORACLE-L 
>(or the name of mailing list you want to be removed from). You may 
>also send the HELP command for other information (like subscribing). 

  _____  

 <http://g.msn.com/8HMBENUS/2740??PS=> Fast, faster, fastest: Upgrade to
Cable or DSL today! 
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net --
Author: H elp_me INET: good_dba@hotmail.com Fat City Network Services --
858-538-5051 http://www.fatcity.com San Diego, California -- Mailing
list and web hosting services
--------------------------------------------------------------------- To
REMOVE yourself from this mailing list, send an E-Mail message to:
ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from). You may also send the HELP
command for other information (like subscribing).

------_=_NextPart_001_01C37D03.8FEA4618
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.45">
<TITLE>RE: SQLPLUS with cronjob is giving problem</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>&nbsp;Dear Sami,</FONT>
</P>

<P><FONT SIZE=3D2>As a matter of fact whatever environ. values are set =
in your .profile are not in operation through a crontab process.&nbsp; =
</FONT>
</P>

<P><FONT SIZE=3D2>To deal with this issue we do something that I have =
seen others do as well.&nbsp; We basically create a .profilecron which =
we call as the first parameter in our scripts that we want to run in =
the profile.&nbsp; We also ensure that this .profileron will work when =
we run the scripts interactively.&nbsp; So let's say you have a script =
runsql.ksh You would put immediately after:</FONT></P>

<P><FONT SIZE=3D2>!#/bin/ksh</FONT>
<BR><FONT SIZE=3D2>**************************************</FONT>
<BR><FONT SIZE=3D2>* comments</FONT>
<BR><FONT SIZE=3D2>************************************</FONT>
<BR><FONT SIZE=3D2>. /export/home/oracle/.profilecron</FONT>
</P>

<P><FONT SIZE=3D2>Please double-check my syntax for running the korn =
shell.&nbsp; This assumes that you do.&nbsp; In fact, if you do and do =
not set that in your scripts you will have problems with some commands =
not running correctly.</FONT></P>

<P><FONT SIZE=3D2>Good luck.</FONT>
<BR><FONT SIZE=3D2>Paula</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: H elp_me</FONT>
<BR><FONT SIZE=3D2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=3D2>Sent: 9/17/03 3:59 AM</FONT>
<BR><FONT SIZE=3D2>Subject: Re: SQLPLUS with cronjob is giving =
problem</FONT>
</P>

<P><FONT SIZE=3D2>Hello Sami,</FONT>
</P>

<P><FONT SIZE=3D2>Check the environment variables.. such as =
ORACLE_HOME, LD_LIBRARY_PATH,</FONT>
<BR><FONT SIZE=3D2>and just PATH.. Are they set .. when you execute =
from CRON ? You will</FONT>
<BR><FONT SIZE=3D2>have them when you execute from unix login.</FONT>
</P>

<P><FONT SIZE=3D2>Hope this helps.</FONT>
</P>

<P><FONT SIZE=3D2>Nikunj</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>&gt;From: Oracle DBA </FONT>
<BR><FONT SIZE=3D2>&gt;Reply-To: ORACLE-L@fatcity.com </FONT>
<BR><FONT SIZE=3D2>&gt;To: Multiple recipients of list ORACLE-L </FONT>
<BR><FONT SIZE=3D2>&gt;Subject: SQLPLUS with cronjob is giving problem =
</FONT>
<BR><FONT SIZE=3D2>&gt;Date: Tue, 16 Sep 2003 06:04:25 -0800 </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;Hi List </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;I am trying to automate &quot;Number of Oracle =
Connections&quot; </FONT>
<BR><FONT SIZE=3D2>&gt;using cronjob. </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;$ crontab -l </FONT>
<BR><FONT SIZE=3D2>&gt;0 8 * * * </FONT>
<BR><FONT =
SIZE=3D2>&gt;/export/home/oracle/scripts/dba/.Schedulejobs/xyz_conn_moni=
tor.sh </FONT>
<BR><FONT SIZE=3D2>&gt; &gt; /tmp/xyz_conn_monitor.lst 2&gt;&amp;1 =
</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;$ cat xyz_conn_monitor.sh </FONT>
<BR><FONT SIZE=3D2>&gt;/u02/app/oracle/product/8.1.7/bin/sqlplus =
</FONT>
<BR><FONT SIZE=3D2>&gt;user1/welcome1@xyz </FONT>
<BR><FONT =
SIZE=3D2>&gt;@/export/home/oracle/scripts/dba/.Schedulejobs/xyz_conn_mon=
itor.sql </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;$ cat xyz_conn_monitor.lst </FONT>
<BR><FONT SIZE=3D2>&gt;Message file sp1.msb not found </FONT>
<BR><FONT SIZE=3D2>&gt;Error 6 initializing SQL*Plus </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;But if run </FONT>
<BR><FONT =
SIZE=3D2>&gt;/export/home/oracle/scripts/dba/.Schedulejobs/xyz_conn_moni=
tor.sh </FONT>
<BR><FONT SIZE=3D2>&gt;in unix $ prompt, it is running fine. </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;Could someone help me to resolve the same? =
</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;Thanks in advance </FONT>
<BR><FONT SIZE=3D2>&gt;Sami </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;__________________________________ </FONT>
<BR><FONT SIZE=3D2>&gt;Do you Yahoo!? </FONT>
<BR><FONT SIZE=3D2>&gt;Yahoo! SiteBuilder - Free, easy-to-use web site =
design software </FONT>
<BR><FONT SIZE=3D2>&gt;<A HREF=3D"http://sitebuilder.yahoo.com" =
TARGET=3D"_blank">http://sitebuilder.yahoo.com</A> </FONT>
<BR><FONT SIZE=3D2>&gt;-- </FONT>
<BR><FONT SIZE=3D2>&gt;Please see the official ORACLE-L FAQ: <A =
HREF=3D"http://www.orafaq.net" =
TARGET=3D"_blank">http://www.orafaq.net</A> </FONT>
<BR><FONT SIZE=3D2>&gt;-- </FONT>
<BR><FONT SIZE=3D2>&gt;Author: Oracle DBA </FONT>
<BR><FONT SIZE=3D2>&gt; INET: sami_resume@yahoo.com </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;Fat City Network Services -- 858-538-5051 <A =
HREF=3D"http://www.fatcity.com" =
TARGET=3D"_blank">http://www.fatcity.com</A> </FONT>
<BR><FONT SIZE=3D2>&gt;San Diego, California -- Mailing list and web =
hosting services </FONT>
<BR><FONT =
SIZE=3D2>&gt;-----------------------------------------------------------=
---------- </FONT>
<BR><FONT SIZE=3D2>&gt;To REMOVE yourself from this mailing list, send =
an E-Mail message </FONT>
<BR><FONT SIZE=3D2>&gt;to: ListGuru@fatcity.com (note EXACT spelling of =
'ListGuru') and in </FONT>
<BR><FONT SIZE=3D2>&gt;the message BODY, include a line containing: =
UNSUB ORACLE-L </FONT>
<BR><FONT SIZE=3D2>&gt;(or the name of mailing list you want to be =
removed from). You may </FONT>
<BR><FONT SIZE=3D2>&gt;also send the HELP command for other information =
(like subscribing). </FONT>
</P>

<P><FONT SIZE=3D2>&nbsp; _____&nbsp; </FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&lt;<A =
HREF=3D"http://g.msn.com/8HMBENUS/2740??PS=3D" =
TARGET=3D"_blank">http://g.msn.com/8HMBENUS/2740??PS=3D</A>&gt; Fast, =
faster, fastest: Upgrade to</FONT>
<BR><FONT SIZE=3D2>Cable or DSL today! </FONT>
<BR><FONT SIZE=3D2>-- Please see the official ORACLE-L FAQ: <A =
HREF=3D"http://www.orafaq.net" =
TARGET=3D"_blank">http://www.orafaq.net</A> --</FONT>
<BR><FONT SIZE=3D2>Author: H elp_me INET: good_dba@hotmail.com Fat City =
Network Services --</FONT>
<BR><FONT SIZE=3D2>858-538-5051 <A HREF=3D"http://www.fatcity.com" =
TARGET=3D"_blank">http://www.fatcity.com</A> San Diego, California -- =
Mailing</FONT>
<BR><FONT SIZE=3D2>list and web hosting services</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------=
------ To</FONT>
<BR><FONT SIZE=3D2>REMOVE yourself from this mailing list, send an =
E-Mail message to:</FONT>
<BR><FONT SIZE=3D2>ListGuru@fatcity.com (note EXACT spelling of =
'ListGuru') and in the</FONT>
<BR><FONT SIZE=3D2>message BODY, include a line containing: UNSUB =
ORACLE-L (or the name of</FONT>
<BR><FONT SIZE=3D2>mailing list you want to be removed from). You may =
also send the HELP</FONT>
<BR><FONT SIZE=3D2>command for other information (like =
subscribing).</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C37D03.8FEA4618--
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: Paula_Stankus@doh.state.fl.us

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

