This discussion is archived
1 2 3 4 5 Previous Next 70 Replies Latest reply: May 28, 2013 3:48 AM by VinodrajJayaraman Go to original post RSS
  • 45. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    736688 Newbie
    Currently Being Moderated
    Owner is inst1 that is dbms, permission is 755.

    Thanks for your reply :)
  • 46. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    RnR Pro
    Currently Being Moderated
    Hi,

    As mentioned in the note above, on 10.2.0.2 and higher

    bin/extjob file must be owned by root:oraclegroup but must be setuid i.e. 4750 (-rwsr-x---)

    You might be able to fix the permissions by rerunning root.sh or you can set the permissions manually.

    Hope this helps,
    Ravi.
  • 47. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    736688 Newbie
    Currently Being Moderated
    Yeah, you're right.

    I just succeed to execute the script ^^

    For somebody who may have a problem with this,
    check out the permission and owner of files, extjob, extjobo and externaljob.ora

    Thanks, Ravi :)
    Thank you so much :)
  • 48. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch fi
    664396 Newbie
    Currently Being Moderated
    Hi, Yes I've seen this problem before with a regular scheduler job, it's not necessarily the external nature that could do it.

    I think that it means that a copy of the thing it has in ram does map to an object type it can stuff it into...anymore...

    The key phrase on gleaning like a swami on fixing this is .... ( ...anymore...)

    I have seen it when rebuilding it or changing object privileges and when an object existed somewhere, then you rebulit it's specification and it got a new internal object id. Any copies of that type that may be in flight inside a job will throw that error when they try to go marshal that object back out of the structure it's in.

    For example, if you have a object type say "mymessage_t" and an instance of this type exists in an advance queue.
    Next you wantonly rebuild the type specification whlie objects are still ready for deq. Then you get that when you try to dequeue the old instance(s) of the object type. Yes, that also means that the system is forced us to clear that queue out before updating any type specs, even if the type spec is structure compatible to the old type, since it ends up with a totally new object id.
  • 49. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    736688 Newbie
    Currently Being Moderated
    I made job to execute a shell script.

    exec dbms_scheduler.create_job (
    job_name => 'run_sh',
    job_type=>'EXECUTABLE',
    job_action=> '/fsoracle/app/oracle/inst2/if_cft/send_file_susin.sh',
    start_date=>sysdate + 1/5760,
    enabled => TRUE
    );

    send_file_susin.sh
    #!/bin/ksh
    set -v
    . /fsutil/ndm/axway/profile

    /fsutil/ndm/axway/Synchrony/Transfer_CFT/bin/CFTUTIL << EOJ
    CONFIG TYPE=COM,MEDIACOM=TCPIP,FNAME=$CFTTCP

    SEND PART=ZADA,IDF=1363X1364,
    FNAME='/fsoracle/app/oracle/product/rdbms/log/KFG.DD.SHRCOM.HRD.A03',
    NFNAME=KFG.DD.SHRCOM.HRD.A03,
    FLRECL=25,NLRECL=25
    SWAITCAT SELECT='IDTU=="%_CAT_IDTU%"'
    EOJ

    This script is well executed in terminal mode, but it threwed error, when I executed the shell script, send_file_susin.sh.

    I changed owners and chmods of some specific files, and t.sh was well executed.
    t.sh
    #!bin/ksh

    /usr/bin/mkdir /tmp/test

    I don't know what's wrong with the script, send_file_susin.sh.

    Does any know about this? Please, tell me the solution.

    Thanks in advance,
    Jinbae Kim.



    RnR


    Posts: 1,014
    Registered: 12/11/01
    Re: execve: Exec format error to execute shell script
    Posted: Nov 30, 2009 6:58 PM in response to: user8753257 Helpful
    Reply

    Hi,

    What error does it throw ? If you are using 11g you should consider using a credential for running external jobs.

    -Ravi


    You mentioned like that.
    I'm using 10g. and the error was ORA-27369: ....................... : Unknown error STANDARD_ERROR="execve: Exec format error"

    I tried to execute not using shell script, but it wasn't able to be executable because of the length of command lines.

    what can I do that?
  • 50. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    RnR Pro
    Currently Being Moderated
    Hi,

    Typically this is because some environment variable is not set.

    You can use env to see what environment variables are set.

    You should redirect the stdout and stderr to files to debug what is going on e.g.

    echo hi >/tmp/log.out 2>/tmp/log.err

    Hope this helps,
    Ravi.
  • 51. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    736688 Newbie
    Currently Being Moderated
    Hey Ravi,

    Thanks always for your reply :)
    Oh, merry christmas~ today is eve, haha

    Anyways, I didn't solve the problem and changed the program, but I've still had problems.

    I got 2 questions today.

    First, As you mentioned, I can't use redirection on the externaljob. Is there anyway to do that? The reason is that I can run the shell script well on the kshell by admin account, but I can't do that using nobody account because it's a virtual account. So, I'd like to check standard output message.

    Second, I'm not sure about this right now. NDM program I'm using is not support for virtual accounts like nobody. If it's true, I have to change the way, external job, I'm doing. Is there anyway to change that account, nobody?

    Hope to solve this problem...
    Thanks again in advance.

    Bye~
    Jinbae Kim
  • 52. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    RnR Pro
    Currently Being Moderated
    Hi,

    Hope you had a good holiday season !
    First, As you mentioned, I can't use redirection on the externaljob. Is there anyway to do that? The reason is that I can run the shell script well on the kshell by admin account, but I can't do that using nobody account because it's a virtual account. So, I'd like to check standard output message.
    The best way of doing this is to create a second script which runs your script and redirects the output and then use the scheduler to call the second script. The scheduler does not support script redirection directly.
    Second, I'm not sure about this right now. NDM program I'm using is not support for virtual accounts like nobody. If it's true, I have to change the way, external job, I'm doing. Is there anyway to change that account, nobody?
    You should review the part of the parent post about "what user does my job run as" you can change the user that the job runs as in one of several ways

    - using a credential on 11gR1 and up
    - editing the externaljob.ora file (in 10.2.0.2 and up)
    - changing the ownership of extjob (ONLY on 10.2.0.1 and below)

    Hope this helps,
    Ravi.
  • 53. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    user702895 Newbie
    Currently Being Moderated
    Customer is running on 11.2.

    When running a job that was created by SYS, it fails with error 274670.

    SQL> exec dbms_scheduler.run_job('RUN_Shell');
    BEGIN dbms_scheduler.run_job('RUN_Shell'); END;

    *
    ERROR at line 1:
    ORA-27369: job of type EXECUTABLE failed with exit code: 274670
    ORA-06512: at "SYS.DBMS_ISCHED", line 185
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
    ORA-06512: at line 1

    Everything is setup as specified. All permissions and ownership are correct. It works fine for non-sys users.

    The manual (and this thread) state that jobs running as SYS without credentials the job should run as the oracle user. Customer refuses to use credentials and states that he wants it to work as documented. We tried changing the permissions on extjobo to 4750 but that didn't change anything. I'm not sure what else to try.

    Thanks.
  • 54. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    RnR Pro
    Currently Being Moderated
    Hi,

    This error indicates that an unsupported configuration change was made. In particular, the permissions on extjobo have been changed so that it runs setuid.

    extjobo should be owned by oracle/oinstall and must not be setuid (chmod to 750 should work).

    Fixing this should remove the error.

    Hope this helps,
    Ravi.
  • 55. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    user702895 Newbie
    Currently Being Moderated
    It was owned by oracle/oinstall with permission 750 and it didn't work. We tried 4750 with oracle/oinstall and that didn't work either.
  • 56. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    RnR Pro
    Currently Being Moderated
    Hi,

    For a job owned by SYS, extjobo should be owned by the OS user that oracle runs as and should not be setuid or setgid .

    Once this is done if there is an error, the error number and message should be different.

    If you are seeing a different error number or message, you can post it here so we can take a look.

    Thanks,
    Ravi.
  • 57. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    user702895 Newbie
    Currently Being Moderated
    oracle@su79tb11:/cs/oracle/product/11.2/bin/ [DZHDPH12] chown oracle:oinstall extjobo
    oracle@su79tb11:/cs/oracle/product/11.2/bin/ [DZHDPH12] chmod 750 extjobo

    oracle@su79tb11:/cs/oracle/product/11.2/bin/ [DZHDPH12] ls -lrt ext*
    -rwxr-x--x 1 oracle oinstall 15368 Jan 19 17:47 extproc
    -rwxr-x--- 1 oracle oinstall 1227760 Jan 19 17:48 extjobo
    -rwxr-x--- 1 oracle oinstall 300 Jan 19 17:48 extusrupgrade
    -rwxr-xr-x 1 oracle oinstall 1227768 Jan 19 17:48 extjoboO
    -rwxr-xr-x 1 oracle oinstall 1227760 Jan 19 17:48 extjobO
    -rwxr-x--- 1 oracle oinstall 0 Jan 19 17:48 extprocO
    -rwsr-x--- 1 root oinstall 1227760 Jan 19 18:09 extjob

    oracle@su79tb11:/cs/oracle/product/11.2/bin/ [DZHDPH12] sqlplus / as sysdba

    SQL*Plus: Release 11.2.0.1.0 Production on Wed Apr 28 18:50:55 2010

    Copyright (c) 1982, 2009, Oracle. All rights reserved.


    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options

    SQL> exec DBMS_SCHEDULER.drop_job (job_name => 'RUN_Shell');

    PL/SQL procedure successfully completed.

    SQL> BEGIN
    DBMS_SCHEDULER.create_job (
    2 3 job_name => 'RUN_Shell',
    4 job_type => 'EXECUTABLE',
    5 job_action => '/cs/oracle/data/emiliano/EXT_SHELL_Call/shell_test.sh',
    enabled => TRUE,
    6 7 start_date => SYSTIMESTAMP,
    8 repeat_interval => 'freq=hourly; byminute=0',
    9 end_date => NULL,
    10 comments => 'Run external shell program.');
    11 END;
    12 /

    PL/SQL procedure successfully completed.

    SQL> exec dbms_scheduler.run_job('RUN_Shell');
    BEGIN dbms_scheduler.run_job('RUN_Shell'); END;

    *
    ERROR at line 1:
    ORA-27369: job of type EXECUTABLE failed with exit code: 274670
    ORA-06512: at "SYS.DBMS_ISCHED", line 185
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
    ORA-06512: at line 1
    SQL>
  • 58. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    RnR Pro
    Currently Being Moderated
    Hi,

    Thanks for this clear error report. It looks like there may be a bug when run_job in the foreground is used on a SYS job and the OS user is not logged in as the oracle user.

    Can you confirm that the job runs properly in the background (run_job with use_current_session=>false and then check scheduler_job_run_Details view)) and that the job also runs properly (in the foreground) when you are logged into the OS as the oracle user ?

    If these both run without errors then this particular case looks like it might be an oracle bug and you probably have to resolve it through support.

    Thanks,
    Ravi.
  • 59. Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
    user702895 Newbie
    Currently Being Moderated
    The job executes correctly from the OS when logged in as the oracle user. The job also seems to run when use_current_session=false. However, the job does not run successfully. Run details says it failed.

    SQL> exec dbms_scheduler.run_job('RUN_Shell', FALSE);

    PL/SQL procedure successfully completed.

    And the query to DBA_SCHEDULER_JOB_RUN_DETAILS shows status as failed

    select LOG_ID,LOG_DATE,OWNER,JOB_NAME,STATUS from DBA_SCHEDULER_JOB_RUN_DETAILS where JOB_NAME='RUN_SHELL' and OWNER='SYS' order by LOG_DATE

    3040 30.04.10 17:23:15.674837 +02:00 SYS RUN_SHELL FAILED