Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 28331 invoked from network); 8 Sep 2007 04:00:27 -0500
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by 69.64.49.119 with SMTP; 8 Sep 2007 04:00:27 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 503D873B80D;
 Sat,  8 Sep 2007 04:21:46 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 22016-07; Sat, 8 Sep 2007 04:21:46 -0400 (EDT)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B367B73B787;
 Sat,  8 Sep 2007 04:21:45 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Sat, 08 Sep 2007 03:37:15 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id EC74773BFBA
 for <oracle-l@freelists.org>; Sat,  8 Sep 2007 03:37:14 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 15567-09 for <oracle-l@freelists.org>;
 Sat, 8 Sep 2007 03:37:14 -0400 (EDT)
Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4790073BF41
 for <oracle-l@freelists.org>; Sat,  8 Sep 2007 03:37:14 -0400 (EDT)
Received: by wa-out-1112.google.com with SMTP id k22so904370waf
        for <oracle-l@freelists.org>; Sat, 08 Sep 2007 01:15:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references;
        bh=hIsVwW9aLX8On9Ftq7V7uSvIYAbmQ+64mrHshbBoqjk=;
        b=qIyQfMDqMXP/0Fj97ckLGs5Z2GVP+xXbiHWHVxZ5tEgzpRB+0ssZ8asdbFA9fMHVD7KbA8y1GJ7uJmyWNRf/DHFv4un/ph6HqGJxXJS1CFY9w9cA4RVaxukupsmCm4aFDsJZDsPfGvbs7NHK1K8vE3NWFAg1VwTz7la+Pt07WvU=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references;
        b=Ib5K7iw6w6ldfnWG2+1AMCK4jxCKBedGJ8BD24W6tecVhxXYJrzYh6vof8YQtTsXcgDPV/oK7k2OnyPRAA162lCpe+k/qMl7nfkDlEFIcNcrjLUZgg66bJHx/Aowr65JkjwUgoqIdYVqu7Irj2FFFSVBFouVhSTjoYcfIg2rz8E=
Received: by 10.115.58.1 with SMTP id l1mr1785637wak.1189239354267;
        Sat, 08 Sep 2007 01:15:54 -0700 (PDT)
Received: by 10.114.144.12 with HTTP; Sat, 8 Sep 2007 01:15:54 -0700 (PDT)
Message-ID: <6e9345580709080115y1da2a7dexbc88f7a954c9da4d@mail.gmail.com>
Date: Sat, 8 Sep 2007 10:15:54 +0200
From: "LS Cheng" <exriscer@gmail.com>
To: owensmith99@gmail.com
Subject: Re: How I run a shell script from the scheduler on 10.2.0.2.0 ?
Cc: oracle-l@freelists.org
In-Reply-To: <b447e8230709072301v19b6387dpb99d017d0f96644a@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Part_3943_2113151.1189239354257"
References: <b447e8230709070156kbe4f725y3583a9cf4bf04ee9@mail.gmail.com>
	 <bf46380709071030u66b89b87x8eb3b137e93d1839@mail.gmail.com>
	 <b447e8230709071537r5f7be8e6u53f25bdd2fc784f9@mail.gmail.com>
	 <b447e8230709072301v19b6387dpb99d017d0f96644a@mail.gmail.com>
X-archive-position: 1356
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: exriscer@gmail.com
Precedence: normal
Reply-to: exriscer@gmail.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
------=_Part_3943_2113151.1189239354257
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Befoe modifying did you check the permissions of files you did this?

chown root $ORACLE_HOME/bin/extjob
chmod 4750 $ORACLE_HOME/bin/extjob
chown root $ORACLE_HOME/rdbms/admin/externaljob.ora
chmod 640 $ORACLE_HOME/rdbms/admin/externaljob.ora

because by default those are the permissions, you should not have to do that
manually

thanks

--
LSC

On 9/8/07, Owen Smith <owensmith99@gmail.com> wrote:
>
> Oracle People,
>
> Ravi's comments looked promising.
>
> I looked for root.sh
>
> bash sol oracle ~ 23 $
> bash sol oracle ~ 23 $
> bash sol oracle ~ 23 $ cd $ORACLE_BASE
> bash sol oracle ~ 24 $ find . -name root.sh -print
> ./product/10r2/root.sh
> bash sol oracle ~ 25 $
> bash sol oracle ~ 25 $
> bash sol oracle ~ 25 $
> bash sol oracle ~ 25 $
>
> I looked for evidence that it alters permissions of files related to
> external jobs:
>
> bash sol oracle ~ 25 $
> bash sol oracle ~ 25 $
> bash sol oracle ~ 25 $
> bash sol oracle ~ 25 $
> bash sol oracle ~ 25 $
> bash sol oracle ~ 25 $ grep CHOWN ./product/10r2/root.sh
> CHOWN=/bin/chown
>       $CHOWN $ORACLE_OWNER $LBIN/`$ECHO $f | $AWK -F/ '{print $NF}'`
> 2>&1 2>> $LOG
> $CHOWN $ORACLE_OWNER ${ORATAB}
> CHOWN="/usr/bin/chown"
>   CHOWN=/bin/chown
> $CHOWN root $ORACLE_HOME/bin/nmo
> $CHOWN root $ORACLE_HOME/bin/nmb
> $CHOWN root  /var/tmp/.oracle
> $CHOWN root  /tmp/.oracle
> bash sol oracle ~ 26 $
> bash sol oracle ~ 26 $
> bash sol oracle ~ 26 $
>
>
> I did not expect that it would.  I'm diligent about following
> instructions when I install oracle.
>
> Perhaps root.sh was enhanced by a quarterly patch.  I'm on an eval
> license; I have
> no access to support or quarterly patches.
>
> Anyway, I took these steps to follow Ravi's suggestions:
>
> -emctl stop agent
> -emctl stop dbconsole
> -lsnrctl stop
> -SHUTDOWN IMMEDIATE
>
> chown root $ORACLE_HOME/bin/extjob
> chmod 4750 $ORACLE_HOME/bin/extjob
> chown root $ORACLE_HOME/rdbms/admin/externaljob.ora
> chmod 640 $ORACLE_HOME/rdbms/admin/externaljob.ora
>
> -STARTUP
> -lsnrctl start
> -emctl start agent
> -emctl start dbconsole
>
>
> Result?
>
> It worked.
> I can now run shell scripts from the scheduler.
> Also I'm pleased that the scripts run as the user I specify in
> $ORACLE_HOME/rdbms/admin/externaljob.ora
>
> For security reasons I don't want external jobs run as a privileged
> user like oracle or root.
>
> Thanks Ravi!
>
> -Owen
>
>
> On 9/7/07, Owen Smith <owensmith99@gmail.com> wrote:
> > Hello people,
> >
> > I should have added this bit of information:
> >
> > "The script runs fine from oracle's crontab."
> > "The script runs fine from a shell owned by oracle."
> >
> > I'm getting responses telling me to check my env variables and
> permissions
> > which would be helpful to a UNIX novice.
> >
> > I have a feeling that no one is using the scheduler to run RMAN scripts.
> >
> > Tim Hall suggested I take a close look at these files:
> >
> > $ORACLE_HOME/rdbms/admin/externaljob.ora
> > $ORACLE_HOME/bin/extJob
> >
> > Currently I'm setup like this:
> >
> >
> > bash sol root /h/oracle/product/10r2/bin 31 #
> > bash sol root /h/oracle/product/10r2/bin 31 # ll
> > $ORACLE_HOME/rdbms/admin/externaljob.ora
> > -rw-r--r--   1 root     dba           52 Sep  7 15:29
> > /h/oracle/product/10r2/rdbms/admin/externaljob.ora
> > bash sol root /h/oracle/product/10r2/bin 32 #
> > bash sol root /h/oracle/product/10r2/bin 32 # cat
> > $ORACLE_HOME/rdbms/admin/externaljob.ora
> > # externaljob.ora
> > run_user = rman
> > run_group = rman
> >
> > bash sol root /h/oracle/product/10r2/bin 33 #
> > bash sol root /h/oracle/product/10r2/bin 33 #
> >
> >
> > bash sol root /h/oracle/product/10r2/bin 33 #
> > bash sol root /h/oracle/product/10r2/bin 33 # ll $ORACLE_HOME/bin/ext*
> > -rwsr-x---   1 rman     dba        30388 Sep 21  2006
> > /h/oracle/product/10r2/bin/extjob*
> > -rwsr-x---   1 rman     dba        30392 Sep 21  2006
> > /h/oracle/product/10r2/bin/extjobo*
> > -rwsr-x---   1 rman     dba        34468 Sep 21  2006
> > /h/oracle/product/10r2/bin/extproc*
> > -rwxr-xr-x   1 oracle   dba          300 Sep 21  2006
> > /h/oracle/product/10r2/bin/extusrupgrade*
> > bash sol root /h/oracle/product/10r2/bin 34 #
> > bash sol root /h/oracle/product/10r2/bin 34 #
> > bash sol root /h/oracle/product/10r2/bin 34 #
> >
> > On my system, the user 'nobody' has no shell so I cannot use nobody.
> >
> > I created a user named rman:
> >
> >
> > bash sol root /h/oracle/product/10r2/bin 34 #
> > bash sol root /h/oracle/product/10r2/bin 34 #
> > bash sol root /h/oracle/product/10r2/bin 34 # su - rman
> > Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
> > $
> > $ id
> > uid=220(rman) gid=220(rman)
> > $
> > $
> > $ date
> > Fri Sep  7 16:30:03 PDT 2007
> > $
> > $
> >
> > Jared points out that rman needs access to extproc:
> >
> > $ ls -la /h/oracle/product/10r2/bin/extproc
> > -rwsr-x---   1 rman     dba        34468 Sep 21  2006
> > /h/oracle/product/10r2/bin/extproc
> > $
> > $
> >
> >
> > Here is a demo of rman running his script:
> >
> >
> > bash sol root /h/oracle/product/10r2/bin 35 # su - rman
> > Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
> > $
> > $
> > $ ls
> > scripts
> > $
> > $
> > $ scripts/tst.sh
> > $
> > $
> > $ cat scripts/tst.sh
> > #! /bin/sh
> > /usr/bin/date > /tmp/tst.sh.out.txt 2>&1 &
> > exit 0
> >
> > $
> > $
> > $ cat /tmp/tst.sh.out.txt
> > Fri Sep  7 16:31:23 PDT 2007
> > $
> > $ rm /tmp/tst.sh.out.txt
> > $
> >
> >
> > I am focused on this error:
> >
> > ORA-27369: job of type EXECUTABLE failed with exit code: 274662
> >
> > And I am focused on this exit code: 274662
> >
> > What does 274662 mean?
> >
> > If the Scheduler gives me an error like "274662" rather than some
> English,
> > it's obvious to me the Scheduler is a POS and I should not use it.
> >
> > And of course,
> > If I cannot run RMAN from Oracle Scheduler, I'll use cron.
> >
> > -Owen
> >
> >
> >
> > On 9/7/07, Jared Still <jkstill@gmail.com> wrote:
> > > On 9/7/07, Owen Smith <owensmith99@gmail.com> wrote:
> > > >
> > > > I'd like to run a shell script from the Scheduler in my 10g
> database.
> > > > Right now it is a simple shell script.
> > > > Eventually it will wrap RMAN commands to back up my DB.
> > > >
> > > > I wrote a simple pl/sql script to create a job:
> > > >
> > > > -- cr_job10.sql
> > > >
> > > > The scheduler, though, errors out with an error which I see in a
> trace
> > > > file:
> > > >
> > > *** 2007-09-06 17:33:00.175
> > > > ORA-12012: error on auto execute of job 53267
> > > > ORA-27369: job of type EXECUTABLE failed with exit code: 274662
> > >
> > >
> > >
> > > Running external jobs from dbms_scheduler is much like running jobs
> from
> > > cron:
> > > You must explicitly set the environment, as no environment is
> inherited.
> > >
> > > See ML Notes *387451.1 and **389685.1.*
> > >
> > >
> > > --
> > > Jared Still
> > > Certifiable Oracle DBA and Part Time Perl Evangelist
> > >
> >
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

------=_Part_3943_2113151.1189239354257
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Befoe modifying did you check the permissions of files you did this?<br><br>chown root $ORACLE_HOME/bin/extjob<br>chmod 4750 $ORACLE_HOME/bin/extjob<br>chown root $ORACLE_HOME/rdbms/admin/externaljob.ora<br><div style="direction: ltr;">
chmod 640 $ORACLE_HOME/rdbms/admin/externaljob.ora</div><br>because by default those are the permissions, you should not have to do that manually<br><br>thanks<br><br>--<br>LSC<br><br><div><span class="gmail_quote">On 9/8/07, 
<b class="gmail_sendername">Owen Smith</b> &lt;<a href="mailto:owensmith99@gmail.com">owensmith99@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Oracle People,<br><br>Ravi&#39;s comments looked promising.<br><br>I looked for root.sh<br><br>bash sol oracle ~ 23 $<br>bash sol oracle ~ 23 $<br>bash sol oracle ~ 23 $ cd $ORACLE_BASE<br>bash sol oracle ~ 24 $ find . -name 
root.sh -print<br>./product/10r2/root.sh<br>bash sol oracle ~ 25 $<br>bash sol oracle ~ 25 $<br>bash sol oracle ~ 25 $<br>bash sol oracle ~ 25 $<br><br>I looked for evidence that it alters permissions of files related to<br>
external jobs:<br><br>bash sol oracle ~ 25 $<br>bash sol oracle ~ 25 $<br>bash sol oracle ~ 25 $<br>bash sol oracle ~ 25 $<br>bash sol oracle ~ 25 $<br>bash sol oracle ~ 25 $ grep CHOWN ./product/10r2/root.sh<br>CHOWN=/bin/chown
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$CHOWN $ORACLE_OWNER $LBIN/`$ECHO $f | $AWK -F/ &#39;{print $NF}&#39;`<br>2&gt;&amp;1 2&gt;&gt; $LOG<br>$CHOWN $ORACLE_OWNER ${ORATAB}<br>CHOWN=&quot;/usr/bin/chown&quot;<br>&nbsp;&nbsp;CHOWN=/bin/chown<br>$CHOWN root $ORACLE_HOME/bin/nmo
<br>$CHOWN root $ORACLE_HOME/bin/nmb<br>$CHOWN root&nbsp;&nbsp;/var/tmp/.oracle<br>$CHOWN root&nbsp;&nbsp;/tmp/.oracle<br>bash sol oracle ~ 26 $<br>bash sol oracle ~ 26 $<br>bash sol oracle ~ 26 $<br><br><br>I did not expect that it would.&nbsp;&nbsp;I&#39;m diligent about following
<br>instructions when I install oracle.<br><br>Perhaps root.sh was enhanced by a quarterly patch.&nbsp;&nbsp;I&#39;m on an eval<br>license; I have<br>no access to support or quarterly patches.<br><br>Anyway, I took these steps to follow Ravi&#39;s suggestions:
<br><br>-emctl stop agent<br>-emctl stop dbconsole<br>-lsnrctl stop<br>-SHUTDOWN IMMEDIATE<br><br>chown root $ORACLE_HOME/bin/extjob<br>chmod 4750 $ORACLE_HOME/bin/extjob<br>chown root $ORACLE_HOME/rdbms/admin/externaljob.ora
<br>chmod 640 $ORACLE_HOME/rdbms/admin/externaljob.ora<br><br>-STARTUP<br>-lsnrctl start<br>-emctl start agent<br>-emctl start dbconsole<br><br><br>Result?<br><br>It worked.<br>I can now run shell scripts from the scheduler.
<br>Also I&#39;m pleased that the scripts run as the user I specify in<br>$ORACLE_HOME/rdbms/admin/externaljob.ora<br><br>For security reasons I don&#39;t want external jobs run as a privileged<br>user like oracle or root.
<br><br>Thanks Ravi!<br><br>-Owen<br><br><br>On 9/7/07, Owen Smith &lt;<a href="mailto:owensmith99@gmail.com">owensmith99@gmail.com</a>&gt; wrote:<br>&gt; Hello people,<br>&gt;<br>&gt; I should have added this bit of information:
<br>&gt;<br>&gt; &quot;The script runs fine from oracle&#39;s crontab.&quot;<br>&gt; &quot;The script runs fine from a shell owned by oracle.&quot;<br>&gt;<br>&gt; I&#39;m getting responses telling me to check my env variables and permissions
<br>&gt; which would be helpful to a UNIX novice.<br>&gt;<br>&gt; I have a feeling that no one is using the scheduler to run RMAN scripts.<br>&gt;<br>&gt; Tim Hall suggested I take a close look at these files:<br>&gt;<br>
&gt; $ORACLE_HOME/rdbms/admin/externaljob.ora<br>&gt; $ORACLE_HOME/bin/extJob<br>&gt;<br>&gt; Currently I&#39;m setup like this:<br>&gt;<br>&gt;<br>&gt; bash sol root /h/oracle/product/10r2/bin 31 #<br>&gt; bash sol root /h/oracle/product/10r2/bin 31 # ll
<br>&gt; $ORACLE_HOME/rdbms/admin/externaljob.ora<br>&gt; -rw-r--r--&nbsp;&nbsp; 1 root&nbsp;&nbsp;&nbsp;&nbsp; dba&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 52 Sep&nbsp;&nbsp;7 15:29<br>&gt; /h/oracle/product/10r2/rdbms/admin/externaljob.ora<br>&gt; bash sol root /h/oracle/product/10r2/bin 32 #
<br>&gt; bash sol root /h/oracle/product/10r2/bin 32 # cat<br>&gt; $ORACLE_HOME/rdbms/admin/externaljob.ora<br>&gt; # externaljob.ora<br>&gt; run_user = rman<br>&gt; run_group = rman<br>&gt;<br>&gt; bash sol root /h/oracle/product/10r2/bin 33 #
<br>&gt; bash sol root /h/oracle/product/10r2/bin 33 #<br>&gt;<br>&gt;<br>&gt; bash sol root /h/oracle/product/10r2/bin 33 #<br>&gt; bash sol root /h/oracle/product/10r2/bin 33 # ll $ORACLE_HOME/bin/ext*<br>&gt; -rwsr-x---&nbsp;&nbsp; 1 rman&nbsp;&nbsp;&nbsp;&nbsp; dba&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;30388 Sep 21&nbsp;&nbsp;2006
<br>&gt; /h/oracle/product/10r2/bin/extjob*<br>&gt; -rwsr-x---&nbsp;&nbsp; 1 rman&nbsp;&nbsp;&nbsp;&nbsp; dba&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;30392 Sep 21&nbsp;&nbsp;2006<br>&gt; /h/oracle/product/10r2/bin/extjobo*<br>&gt; -rwsr-x---&nbsp;&nbsp; 1 rman&nbsp;&nbsp;&nbsp;&nbsp; dba&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34468 Sep 21&nbsp;&nbsp;2006<br>&gt; /h/oracle/product/10r2/bin/extproc*
<br>&gt; -rwxr-xr-x&nbsp;&nbsp; 1 oracle&nbsp;&nbsp; dba&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;300 Sep 21&nbsp;&nbsp;2006<br>&gt; /h/oracle/product/10r2/bin/extusrupgrade*<br>&gt; bash sol root /h/oracle/product/10r2/bin 34 #<br>&gt; bash sol root /h/oracle/product/10r2/bin 34 #<br>
&gt; bash sol root /h/oracle/product/10r2/bin 34 #<br>&gt;<br>&gt; On my system, the user &#39;nobody&#39; has no shell so I cannot use nobody.<br>&gt;<br>&gt; I created a user named rman:<br>&gt;<br>&gt;<br>&gt; bash sol root /h/oracle/product/10r2/bin 34 #
<br>&gt; bash sol root /h/oracle/product/10r2/bin 34 #<br>&gt; bash sol root /h/oracle/product/10r2/bin 34 # su - rman<br>&gt; Sun Microsystems Inc.&nbsp;&nbsp; SunOS 5.10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generic January 2005<br>&gt; $<br>&gt; $ id<br>&gt; uid=220(rman) gid=220(rman)
<br>&gt; $<br>&gt; $<br>&gt; $ date<br>&gt; Fri Sep&nbsp;&nbsp;7 16:30:03 PDT 2007<br>&gt; $<br>&gt; $<br>&gt;<br>&gt; Jared points out that rman needs access to extproc:<br>&gt;<br>&gt; $ ls -la /h/oracle/product/10r2/bin/extproc<br>
&gt; -rwsr-x---&nbsp;&nbsp; 1 rman&nbsp;&nbsp;&nbsp;&nbsp; dba&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34468 Sep 21&nbsp;&nbsp;2006<br>&gt; /h/oracle/product/10r2/bin/extproc<br>&gt; $<br>&gt; $<br>&gt;<br>&gt;<br>&gt; Here is a demo of rman running his script:<br>&gt;<br>&gt;<br>&gt; bash sol root /h/oracle/product/10r2/bin 35 # su - rman
<br>&gt; Sun Microsystems Inc.&nbsp;&nbsp; SunOS 5.10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generic January 2005<br>&gt; $<br>&gt; $<br>&gt; $ ls<br>&gt; scripts<br>&gt; $<br>&gt; $<br>&gt; $ scripts/tst.sh<br>&gt; $<br>&gt; $<br>&gt; $ cat scripts/tst.sh<br>&gt; #! /bin/sh
<br>&gt; /usr/bin/date &gt; /tmp/tst.sh.out.txt 2&gt;&amp;1 &amp;<br>&gt; exit 0<br>&gt;<br>&gt; $<br>&gt; $<br>&gt; $ cat /tmp/tst.sh.out.txt<br>&gt; Fri Sep&nbsp;&nbsp;7 16:31:23 PDT 2007<br>&gt; $<br>&gt; $ rm /tmp/tst.sh.out.txt
<br>&gt; $<br>&gt;<br>&gt;<br>&gt; I am focused on this error:<br>&gt;<br>&gt; ORA-27369: job of type EXECUTABLE failed with exit code: 274662<br>&gt;<br>&gt; And I am focused on this exit code: 274662<br>&gt;<br>&gt; What does 274662 mean?
<br>&gt;<br>&gt; If the Scheduler gives me an error like &quot;274662&quot; rather than some English,<br>&gt; it&#39;s obvious to me the Scheduler is a POS and I should not use it.<br>&gt;<br>&gt; And of course,<br>&gt; If I cannot run RMAN from Oracle Scheduler, I&#39;ll use cron.
<br>&gt;<br>&gt; -Owen<br>&gt;<br>&gt;<br>&gt;<br>&gt; On 9/7/07, Jared Still &lt;<a href="mailto:jkstill@gmail.com">jkstill@gmail.com</a>&gt; wrote:<br>&gt; &gt; On 9/7/07, Owen Smith &lt;<a href="mailto:owensmith99@gmail.com">
owensmith99@gmail.com</a>&gt; wrote:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I&#39;d like to run a shell script from the Scheduler in my 10g database.<br>&gt; &gt; &gt; Right now it is a simple shell script.<br>&gt; &gt; &gt; Eventually it will wrap RMAN commands to back up my DB.
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I wrote a simple pl/sql script to create a job:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; -- cr_job10.sql<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; The scheduler, though, errors out with an error which I see in a trace
<br>&gt; &gt; &gt; file:<br>&gt; &gt; &gt;<br>&gt; &gt; *** 2007-09-06 17:33:00.175<br>&gt; &gt; &gt; ORA-12012: error on auto execute of job 53267<br>&gt; &gt; &gt; ORA-27369: job of type EXECUTABLE failed with exit code: 274662
<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Running external jobs from dbms_scheduler is much like running jobs from<br>&gt; &gt; cron:<br>&gt; &gt; You must explicitly set the environment, as no environment is inherited.
<br>&gt; &gt;<br>&gt; &gt; See ML Notes *387451.1 and **389685.1.*<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; --<br>&gt; &gt; Jared Still<br>&gt; &gt; Certifiable Oracle DBA and Part Time Perl Evangelist<br>&gt; &gt;<br>&gt;<br>
--<br><a href="http://www.freelists.org/webpage/oracle-l">http://www.freelists.org/webpage/oracle-l</a><br><br><br></blockquote></div><br>

------=_Part_3943_2113151.1189239354257--
--
http://www.freelists.org/webpage/oracle-l


