DBMS_SCHEDULER and Script Shell on 10.2.0.1

Hi all

My env, Oracle 10.2.0.1 and OS is Solaris.

My script can run on the operating system that is a work without error that contain create file, delete the file, call sqlplus, function to get the value of database and return to the variables of the BONE.

Shell script to the code as below

-------------------------------------------------------------------------------------------------------------------------------------

get_val () {}

sqlplus-s/nolog < < EOF

Conn test/test

set the position

Set feedback off

set pages 0

SELECT SUBSTR (SYS_CONNECT_BY_PATH (Z, ' '), 2) z

FROM (SELECT NAMEDQUERY, ROW_NUMBER () ON the rn (ORDER OF Z),

COUNT (*) NTC)

X

WHERE Z LIKE "% FULL")

WHERE rn = NTC

START WITH rn = 1

Rn = rn + 1 PRIOR CONNECTION.

EXPRESSIONS OF FOLKLORE

}

VX = $(get_val)

If [${#vx} - gt 0]; then

for x in $vx

do

RM-f $CURRDIR / $xfile.txt 2 >/dev/null

fact

FI

-------------------------------------------------------------------------------------------------------------------------------------

When it is executed by dbms_scheduler showing below error

ORA-27369: jobs of type EXECUTABLE failed with exit code: no such file or directory

STANDARD_ERROR="/home/Oracle/script/test.sh: error of syntax on line 26: ' vx = $' unexpected

How to fix above error?  (owner of $CURRDIR / $xfile.txt is oracle user)

One last question, how to force dbms_scheduler that use user oracle (OS) to run the shell script?, as I know, the default user is null and Oracle 10.2.0.2 later version which have external.job.ora to define but 10.2.0.1 has not.

Thank you in advance,

Hiko

I changed the planner of the storyline of the game as below

dbms_scheduler.create_job (job_name => 'TEST', job_type => 'EXÉCUTABLE', job_action => ' / usr/bin/bash ', number_of_arguments-online 1);

dbms_scheduler.set_job_argument_value('TEST',1,argument_value,'/home/Oracle/test.sh');

It's the job. This is the finding of fact

1. change the permissions of $ORACLE_HOME/bin/extjob to 4750 (- rwsr - x) -

2. change the owner of $ORACLE_HOME/bin/extjob to oracle: dba

3. use "/ usr/bin/bash ' instead of ' / usr/bin/sh".

But I found the error on the process of downloading the files I use wget to download the source in shell script file and run by dbms_scheduler as shown above.

My problem, the first file can download normally and until the end of the process but second file has to hang.

You have an idea or a solution to prove and solve it?

Thank you

Hiko

Tags: Database

Similar Questions

  • Unble to call the dbms_scheduler perl script

    Hi all

    I had written a Korn shell script that calls 2 pl/sql procedures. This shell script has been called since the DBMS_SCHEDULER and it worked fine. But later asked me to change it to perl, as we had to move to windows-based computer. The perl script ran fine from the command prompt but when I tried this scheduler, the task failed with ' ORA-27369: jobs of type EXECUTABLE failed with exit code: no such file or directory " error." When debugging, I realized if I commented associate DB command work went very well. I tried, including the path to all libraries (see entries in green), but it fails. I joined to share of my below perl script. Help, please

    Appreciate any help or suggestions.

    Thanks in advance

    #! / usr/bin/perl
    Use DBI;

    use strict;

    $ENV {'ORACLE_HOME'} = ' / product/app/11.2.0/db_1';
    $ENV {'ORACLE_SID'} = 'XXX ';
    $ENV {"LIB_PATH'} = ' $ORACLE_HOME/lib ';
    $ENV {'PATH'} = "$ORACLE_HOME/bin: $ORACLE_HOME/OPatch: / usr/bin: / etc: / usr/sbin: / usr/ucb: $HOME/bin: / usr/bin / X 11: / sbin: /usr/opt/perl5_64/lib/site_perl/5.18.2/aix- "
    thread-multi-64all:. $LIB_PATH
    $ENV {'LD_LIBRARY_PATH'} = ' $GG_HOME: $LIB_PATH: / usr/opt/perl5_64/lib/site_perl/5.18.2/aix-thread-multi-64all';

    #my ($inst, $user, $pass) = @ARGV;
    My $inst = "XXX";
    my $user = "aaa";
    my $pass = "aaa";

    # Then do not check each call DBI we define RaiseError.
    # See the DBI docs, if you are not familiar with RaiseError.
    # AutoCommit is currently encouraged and may be required at a later date.
    print ($user, $pass, $inst, "\n");
    My $dbh = DBI-> connect (' dbi:Oracle: $inst ', $user, $pass,)
    ({Mode AutoCommit = > 0, RaiseError = > 1, PrintError = > 0})
    or die "could not connect: $DBI::errstr";

    Exit 0;


    Hello

    Have you checked the files mentioned in the error? Looks like some files are missing or you don't have permission to access. In order to check these.

  • I'm doing a Shell call Firefox in the directory C:\Program Files (x 86) of \Mozilla FireFox\ and LabView shell call gives an error.

    I'm doing a Shell call Firefox in the directory C:\Program Files (x 86) of \Mozilla FireFox\ and LabView shell call gives an error. I can go to the BACK shell and make the fine call, but Labview Shell gives several errors. Anyone know how to get around the problem of directory with the name of the Program Files (x 86) directory with space and the (x 86) BACK doesn't seem to like?

    You must use quotation marks.

  • get the program freezes and non-compliant messages and scripts.

    I use a windows 7 starter pack and I keep program freezes and unfounded messages and scripts, how do I fix these errors?

    I use Norton Antivirus and Malwarebytes Anti-malware, but I still cannot sort them

    Press Ctrl-Shift-Escape and look under the tab process to try to identify what program consumes CPU.

    However, I see that your RAM is low - so make sure that you disable that much 'Autostart' possible programs in MSCONFIG.  It is normal to have a large number of files and programs, but you want to limit how much is actually trying to run at the same time.

  • Library, templates and scripting elements disappear from the active panel

    In Dreamweaver CC 2014, I try to use a library item. When inserted into a page, the application hangs for 30 to 60, then crashes. At the reopening of the app, the active panel display more library items, and templates icons or scripts.

    This site has been migrated from previous versions of Dreamweaver, and templates and library items across an entire site. Just by clicking on the library item in the code blocks the application of DW.

    Any solution?

    Hi dakotakid,

    What is expected. The three elements of library models and scripts are disabled mode live view. You can continue to use code view.

    Thank you!

    Kusha

  • DreamWeaver - has access to the customer server languages and scripts?

    DreamWeaver - has access to the customer server languages and scripts?

    Thanks to anyone who responds to this in advance.

    If the access you want to say, "can I write a JavaScript or PHP with Dreamweaver code?  Yes.

    If you mean something else, please provide details.

    Nancy O.

  • What is the experience of Migration of PMS Data and Scripts of data Migration

    Hi just what is preparation of PMS and Scripts of data Migration Data Migration experience
    Why do we use these in HRMS (EBS)

    PL provide a link to where you got these terms of.

    'PMS Data Migration experience' is not a term EBS - most likely a seller or third expression/tool/software.

    "Data migration" in HRMS (other EBS modules) generally refers to the process of transferring data from a legacy system to the EBS during the process of going live with EBS.

    HTH
    Srini

  • Help filter the HTML and script tags.

    I have my first php site runs fully almost ready to go live, except that I have not allowed for filtering of tags HTML and scripts from my forms, form fields, and the URL.

    User input has been validated to match my criteria, values are escaped before the entry of the database.

    I'm usually plans to use preg_match against different regex filter HTML and script tags and some of my forms that already have in place when you post (all the php) but for the rest of the filtering, I have some queries, concerns and questions about php filter_var for sanitation.

    First of all:

    My free text fields need work.

    I need to allow users to be able to type a description of the use of General punctuation.

    Would this work: (not sure if the regular expression is correct and if it isn't the best way to address filtering)

    If isset Post textfield

    allow only letters, numbers, General Liposuction and 265 character limit

    $check = ' / ^ [a-zA-Z0 - 9\s.-,] {$1-265} / '.

    {If (preg_match (& check, {$_GET ['textfield']}))}

    allow

    } else {...

    Or is there a better way to do it with filter_var, this would allow users to type what they needed and just remove whatever it is a threat, such as:

    If isset Post textfield

    $var = $_POST ["textfield"]

    (filter_var ($var, FILTER_SANITIZE_STRING);)

    then check match my criteria

    If ok enter the database

    Second:

    On the URL where the variables are passed is - that enough to filter variables using one of the methods above, this would actually use only a verification of the figures or letters of my variables (no punctuation). Or still is there a better way to do it with the filter_var: OR am I misunderstanding the filter_var function, it seems too easy is it really get rid all the bad things.

    {if (isset($_GET['var1']))}

    (filter_var ($var1, FILTER_SANITIZE_URL));

    }

    then continue with the code

    Finally again to about the url, even though the variables are not passed when a page is loaded must I verify that the url is just the url? And how can I do this? Using filter_var?

    As always, any help is very appreciated.

    Thank you in advance.

    Given that the information comes from the berries of $_GET and $_POST, use filter_input().

    If you control $_POST ["textfield"]:

    $sanitized = filter_input(INPUT_POST, 'textfield', FILTER_SANITIZE_STRING);
    

    $sanitized contains the string stripped of all tags.

    If you are var1 through the table control $_GET:

    $clean_var1 = filter_input(INPUT_GET, 'var1', FILTER_SANITIZE_STRING);
    
  • Script Shell settings which crosses DBMS_SCHEDULER as executable

    Hello

    I use Oracle 10.2.0.1 on Solaris.

    I have a shell script to run through DBMS_SCHEDULER.

    DBMS_SCHEDULER. () CREATE_PROGRAM
    program name = > "PROGRAM_NAME,"
    program_type = > "EXECUTABLE."
    program_action = > ' / home/oracle/test.sh',
    enabled = > TRUE,
    Comments = > 'Test Shell Script '.
    );

    But how to define the settings for the shell script?

    Lets say if I run promt Unix shell script, I will enter as below:

    /Home/Oracle/test.sh DITCHES aed5 XYZ

    How to set it in the DBMS_SCHEDULER.define_program_argument?

    Thank you
    Shail

    When you create the program, you set the number of parameters it accepts:

    DBMS_SCHEDULER.CREATE_PROGRAM (
    program_name => 'PROGRAM_NAME',
    program_type => 'EXECUTABLE',
    program_action => '/home/oracle/test.sh',
    enabled => TRUE,
    comments => 'Test Shell Script',
    number_of_arguments     => 3
    );
    

    Then, you set your arguments to work and set default values. This step is optional - but if you do not then you will need to set the values using the set_job_argument_value:

    -sets the first argument

    DBMS_SCHEDULER.DEFINE_PROGRAM_ARGUMENT(
       program_name   => 'PROGRAM_NAME',
       argument_position   => 1,
       argument_name           => 'arg1',
       argument_type           'CHAR',
       default_value          => 'PITS',
    );
    

    You can set the coressponding to aid argument:

    DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE (
       job_name => 'JOB1',
       argument_position  => 1,
       argument_value => 'PITS');
    

    or by using the name of the argument defined using the define_program argument

    DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE (
       job_name => 'JOB1',
       argument_name  => 'arg1',
       argument_value => 'PITS');
    

    where JOB1 is a job for the program program name created by using the dbms_scheduler.create_job procedure

    See material: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm for more details...

  • Dbms_Scheduler and executable script

    Hello

    I have a scenario. I was running a shell script (which in turn runs an oracle procedure) every 30 minutes and put it in cron. Now, that was before, when the procedure used to take less than 30 minutes.

    Now, one day, intermittently, it takes MORE than 30 minutes. Thus, the second round of the procedure not obey the limits set for the program.

    I want to have is to have a SINGLE instance of the shell script (it emails after the procedure), running at a given time. So if the cron lights and he sees that there is already one instance of the script running, and this should not run now.

    The way I wanted to do it is like this:

    (i). dbms_scheduler to run the executable file and somehow (I need help here) stopping at the next run to the don't fire unless there is a already running.

    or

    (II) use dbms_scheduler to run the actual procedure and somehow allowing that ONE perform the procedure at some point (in this scenario, I must take care of the Oracle email itself rather than from unix).

    or

    (III) there is an alternative where I was using autonomous transaction to update a table that runs the program and then NOT run the same procedure when it is already running. But, since it is an in-house solution and Oracle might have something to do this already, I would use the Oracle one.

    Thank you.

    Hello

    In fact i) is done for you automatically. If you schedule a task to run periodically and the last execution runs during the next start date, then dbms_scheduler automatically skip the next run and move on to the next. dbms_scheduler has never two instances of the same task running at the same time.

    If you do not need no additional concurrency control. If you do not need concurrency control, dbms_lock provides a simple way to protect access to a resource (e.g. If only a session must Access a table at the same time).

    Finally if you just need e-mail sent when a job fails, you can use a utility provided by Oracle on the Planner home page

    http://www.Oracle.com/technology/products/database/Scheduler/index.html

    Locate the notification of work under Scheduler utilities package that will make it very easy to send e-mail when your job will fail.

    If you have any other questions, feel free to ask!

    -Nice

  • How to call the script shell of the Hyperion Workspace

    Hi all

    I have to call a shell script of the Hyperion workspace. After searching on Google, I came to know that its possible using generic employment applications.

    So I created a generic job application in the workspace to help below in detail.

    Job name: set_run_shell

    Server: Name of the Server workspace

    Order tempate: $PROGRAM $PARAMS

    executable: Cygwin executable path (like hyperion installed in windows server 2008, I had to install Cygwin to make the unix-like environment)

    Just write simple shellscript that the ECHO command displays "Hello World."

    Imported this shell script and above assigned jobs for it but no luck, when I run this job I never see output or less error. It showing the message running for a long time until get session expires.

    Can someone help me to run a shell script.

    Thank you

    Aravind

    The executable file must be %WINDIR%\System32\cmd.exe cmd.exe

    You will also need to create a batch file that comes from this sh.exe and imports that work. Try and let me know.

    Concerning

    Celvin Kattookaran

  • How to call commands in script shell written in Applescript in Adobe extended Script or JSX

    The appeal of commands below:

    shell script "curl-L o" and shell script '-i sed ' "equivalent commands in JSX.

    Thank you

    Try to post your questions in the specific forum.

    https://forums.Adobe.com/welcome

  • Execution of Script Shell UNIX in ODI in Windows 7

    Nice day

    I'm new on ODI and I searched the forum a way to run a UNIX Shell Script in ODI, installed in the Windows 7 operating system and I could not find.

    Is it possible to run a UNIX Shell Script in ODI, if my OS is Windows 7?

    You must run the UNIX Shell Script to unix/linux and batch file in windows.
    Thank you.

  • Make the script shell on command 'srvctn '.

    Hi all

    Hello.

    I want to make the Shell Script on srvctn command,
    research work is not state of the node.
    I'm using the 11g environment.

    For example by using the command "srvctl start database-d."
    showing as follows.


    *******************************************
    example of order <>

    $ srvctl status database-d RAC
    RAC1 instance is not running on the node collabn1
    RAC2 instance is running on the node collabn2
    *******************************************


    As described below, I want to exit
    the is not running on the node list.

    *******************************************
    example of <>output

    collabn1
    collabn3
    collabn5
    *******************************************

    Could you please tell any person or to the statement above, out of shell script?

    I'm grad to send the response.

    Thank you and best regards.

    Hello

    you could do something like the following:

    #!/bin/sh
    
    srvctl status database -d RAC | grep 'not running' | sed -e 's/^.* node //'
    

    and this will give output like that in your example.

    Since you could easily expand your script to actually pronounce on the nodes does not.

    HtH
    Johan

    Published by: Johan Nilsson on December 20, 2011 02:57

  • Call a script shell to an OWB mapping or process flow

    Hello

    is it possible to call a shell script for a mapping owb or process flow and how can I do this?

    Greetings

    Check this box: -.

    http://blogs.Oracle.com/warehousebuilder/2010/05/how_to_use_user_defined_activity_in_owb_process_flow.html

    See you soon
    Katia

Maybe you are looking for