dbms_scheduler.create_job

Hello
I have a stored procedure in the scheme of mauser.
and grant execute this DS to ERPUSER,
When connect you to oracle in sqlplus with ERPUSER (no mauser) a runtime error see the
Help, please.


Start
dbms_scheduler.create_job
(
job_name = > 'Send_Data_To_HR_Tables ',.
schedule_name = > "EVERY_4_MINS"
job_type = > 'procedure_stockee ',.
job_action = > ' MAUSER. SENDDATATOHRTABLES',.
enabled = > true,
Comments = > 'send my tabales data to HR tables. "
);
end;

"ORA-27481: ' ERPUSER. SEND_DATA_TO_HR_TABLES' has an invalid schedule
"ORA-27476: ' ERPUSER. EVERY_4_MINS' does not exist
ORA-06512: at "SYS." DBMS_ISCHED", line 99
ORA-06512: at "SYS." DBMS_SCHEDULER', line 348
ORA-06512: at line 3 level



Thank you and best regards
allahmorad

Try using schedule_name or repeat_interval settings but not both:

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL>
SQL> show user;
USER is "SCOTT"
SQL>
SQL> create procedure p
  2  as
  3  begin
  4  insert into times values(sysdate);
  5  end;
  6  /

Procedure created.

SQL> show errors
No errors.
SQL>
SQL> begin
  2  dbms_scheduler.create_schedule(
  3  schedule_name => 'every_4_mn',
  4  start_date => systimestamp,
  5  repeat_interval => 'freq=minutely;interval=4');
  6  --
  7  dbms_scheduler.create_job(
  8  job_name => 'savedate',
  9  schedule_name => 'every_4_mn',
 10  job_type => 'stored_procedure',
 11  job_action => 'scott.p',
 12  enabled=>true,
 13  auto_drop=>false);
 14  end;
 15  /

PL/SQL procedure successfully completed.

Wait a while and check:

SQL> select sysdate from dual;

SYSDATE
---------------
05-JUL 19:18:34

SQL> /

SYSDATE
---------------
05-JUL 19:18:57

SQL> select * from times;

C1
---------------
05-JUL 19:19:00
05-JUL 19:15:00

Edited by: P. Forstmann on 5 Jul. 2010 19:19

Tags: Database

Similar Questions

  • Put Repeat_interval in place in dbms_scheduler.create_job

    Gurus,
    I need to set up a job to run 4 times per year (1st of JAN, APR, Jul-OCT to 09:00).
    I tried the following code and received the error of invalid values for repeat_interval. Please help me solve this problem.

    dbms_scheduler.create_job (job_name = > "PROCESS_JOB")
    job_type = > 'procedure_stockee ',.
    job_action = > 'SNAP_PROC ',.
    start_date = > trunc (sysdate) + 9/24.
    repeat_interval = > ' FREQ = MONTHLY; INFECTION IS JAN, APRIL, JULY-OCT.; BYDAY = 1; BYHOUR = 9',
    End_date = > null,
    activated = > false,
    auto_drop = > false,
    Comments = > ' snapshot process);
    --
    Anan

    If you want the 1st day of the month, use BYMONTHDAY = 1 instead of BYDAY = 1

    Kind regards
    Bob

    Take a look at the response of Centinul to {message: id = 9352583} for an example of the use of the DBMS_SCHEDULE. Procedure EVALUATE_CALENDAR_STRING.

    Published by: BobLilly on May 22, 2012 17:08

  • dbms_scheduler.create_job and create_program to run the shell program

    dbms_scheduler.create_job and create_program to run the shell UNIX of PL/SQL program

    I guess that the problem could be a shell program. "send_file_susin.sh", I did run the CFT program which is to transfer files. While I tried to this problem, I heard that I should use dbms_scheduler.create_program and create_job to execute the shell command. Therefore,.

    I've done
    () dbms_scheduler.create_program
    program name = > "SEND_FILE_SUSIN"
    program_type = > "EXECUTABLE."
    program_action = > ' / fsoracle/app/oracle/inst2/if_cft/send_file_susin.sh',
    number_of_arguments = > 0,
    enabled = > TRUE,
    Comments = > 'Test '.
    );
    commit;
    in a package, then I run the package.
    program and job

    DBMS_SCHEDULER exec. () CREATE_JOB
    job_name = > 'run_sh1 ',.
    program name = > "send_file_susin"
    start_date = > sysdate + 1/2880.
    repeat_interval = > null,
    End_date = > null,
    job_class = > 'DEFAULT_JOB_CLASS ',.
    enabled = > true
    )

    When I ran, I would check there program and job send_file_susin in the sched.programs and sched.job classes. The job will run about 30 seconds later.
    After 30 seconds, I saw the work was done, but I couldn't see the log of the CFT program. This means that the file have not been transferred...

    I don't know what is wrong with it... Please, someone that solve?
    Thank you very much in advance.

    Hello

    You don't have to create a program first, put directly in the work should work as well.

    Your pl/sql code is correct, then you should check out a few things with the shell script

    -is set + rx
    -is the first line #! / bin/sh
    -should I use the full path to the executable files for example/usr/bin/ftp
    -It defines the variables

    If that all seems well, consider adding lines of logging to your shell script to debug what goes wrong.

    See this post for more tips

    Guide to the external work on with dbms_scheduler 10g for example scripts, batch files

    Any other questions about the Scheduler, you can use the forum Planner here

    Planner

    Hope this helps,
    Ravi.

  • a problem using dbms_scheduler.create_job. I can't do the work

    I do work to run sh program with 5 arguments, even if I put the time, work does not work...
    Please tell me, why it does not work...-. -;

    I write the source for jobs below...

    exec (dbms_scheduler.create_job)
    job_name = > 'run_sh ',.
    job_type = > 'EXECUTABLE. "
    job_action = > ' /fsoracle/app/oracle/inst2/if_cft/test.sh ZADA/fsoracle/app/oracle/product/rdbms/log/KFG. DD SHRCOM. HR DIRECTOR. A03 KFG. DD SHRCOM. HR DIRECTOR. A03 25 25',
    start_date = > sysdate + 1/1440
    );

    Hello

    You don't have to create a program first, put directly in the work should work as well.

    Your pl/sql code is correct, then you should check out a few things with the shell script

    -is set + rx
    -is the first line #! / bin/sh
    -should I use the full path to the executable files for example/usr/bin/ftp
    -It defines the variables

    If that all seems well, consider adding lines of logging to your shell script to debug what goes wrong.

    See this post for more tips

    Guide to the external work on with dbms_scheduler 10g for example scripts, batch files

    Any other questions about the Scheduler, you can use the forum Planner here

    Planner

    Hope this helps,
    Ravi.

  • Error with dbms_scheduler.create_job

    Hi all

    I am trying to run CREATE_JOB, get the error below.
    I gess I have specified the valid month, but could not solve the problem. What could be the error?
       SQL> BEGIN
      2      dbms_scheduler.create_job(
      3              job_name => 'DEMO_STUDENT_TOT',
      4              job_type => 'PLSQL_BLOCK',
      5              job_action => 'begin student_sum; end; ',
      6              start_date => '7/14/2009 7:40 AM',
      7              repeat_interval => 'FREQ=DAILY',
      8              enabled => TRUE,
      9              comments => 'Demo for job schedule.');
     10  END;
     11  /
    BEGIN
    *
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at line 2
       
    Thank you

    Refer to the documentation: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm#i1000363

    You have:

    start_date => '7/14/2009 7:40 AM',
    

    but the documentation says start_date is a timestamp.

    You must use to_timestamp()...

  • planning using the tasks dbms_scheduler.create_job

    Hi all experts,

    I am really grateful to now take you for your replies, a look at this, I created a job with 'dbms_scheduler.create_job' and blow is the result of the view 'dba_schduler_jobs' why it shows "0" run_count... I went through everything as many links like:

    Answers to "why my jobs are not running?

    and applied and checked all the settings, I use oracle 10.2.0.1.0 on windows server 2003 32-bit
    SQL> BEGIN
         DBMS_SCHEDULER.CREATE_JOB (
             job_name => 'clouser'
            ,job_type => 'PLSQL_BLOCK'
         ,job_action => 'begin package.procedure("po_closure"); end;'
         ,start_date => to_date('17-04-2009 22:00:00', 'dd-mm-yyyy hh24:mi:ss')
         ,repeat_interval => 'FREQ=DAILY;byminute=10'
         ,enabled => TRUE
         ,comments => 'op closure everyday at 11PM'
    );
    END;
    / 
    PL/SQL procedure successfully completed.
     
    SQL> select owner,job_name name,run_count run,start_date
      2  from dba_scheduler_jobs
      3  where owner='FINANCEDEV';
     
    OWNER                          NAME                                  RUN
    ------------------------------ ------------------------------ ----------
    START_DATE
    ---------------------------------------------------------------------------
    FINANCEDEV                     CLOUSER                                 0
    17-APR-09 02.45.10.000000 PM +05:30
     
    FINANCEDEV                     CLOUSER_MAIN                            0
    18-APR-09 10.25.00.000000 AM +05:30
     
    FINANCEDEV                     CLOUSER_MAIN1                           0
    18-APR-09 10.45.00.000000 AM +05:30
     
     
    OWNER                          NAME                                  RUN
    ------------------------------ ------------------------------ ----------
    START_DATE
    ---------------------------------------------------------------------------
    FINANCEDEV                     CLOUSER_MAIN4                           0
    18-APR-09 10.45.00.000000 AM +05:30
     
    FINANCEDEV                     CLOUSER_MAIN5                           0
    18-APR-09 10.43.00.000000 AM +05:30
    the time I planned has already passed and I check it again and again, but no luck, can you please explain why is it so?

    Thanks in advance

    Thanks and greetings
    VD

    Published by: vikrant dixit on April 17, 2009 22:33

    Vikrant,

    You must set your procedure or package that you call job_action and see why it's a failure. Make sure that you can perform your procedure with no problems

    Using the suite perform your procedure and see if it ends correctly and if not solve the problem and use job I posted in my previous post.

    declare
    begin
       input_value varchar2(...) := 'some value';
       schema_name.package_name.procedure_name(input_value);
    end;
    

    Hope helps thie
    Concerning

  • repeat_interval in DBMS_SCHEDULER.create_job - for the 2nd day of each month

    Hi all

    I want to clarify in the repeat_interval the Scheduler for this task must be run on the second of each month at 20:00.
    I've been racking my brains out but nothings coming out.

    Any suggestions?

    You probably want a range like this:

    FREQ=MONTHLY;BYMONTHDAY=2;BYHOUR=20;BYMINUTE=0;BYSECOND=0;
    

    You can use the DBMS_SCHEDULER. EVALUATE_CALENDAR_STRING function to test, as follows:

    SQL > DECLARE
      2  start_date        TIMESTAMP;
      3  return_date_after TIMESTAMP;
      4  next_run_date     TIMESTAMP;
      5  BEGIN
      6  start_date :=
      7    to_timestamp_tz('01-JAN-2003 10:00:00','DD-MON-YYYY HH24:MI:SS');
      8  return_date_after := start_date;
      9  FOR i IN 1..5 LOOP
     10    DBMS_SCHEDULER.EVALUATE_CALENDAR_STRING(
     11      'FREQ=MONTHLY;BYMONTHDAY=2;BYHOUR=20;BYMINUTE=0;BYSECOND=0;',
     12      start_date, return_date_after, next_run_date);
     13  DBMS_OUTPUT.PUT_LINE('next_run_date: ' || next_run_date);
     14  return_date_after := next_run_date;
     15  END LOOP;
     16  END;
     17  /
    next_run_date: 01/02/2003 08:00:00.000000 PM
    next_run_date: 02/02/2003 08:00:00.000000 PM
    next_run_date: 03/02/2003 08:00:00.000000 PM
    next_run_date: 04/02/2003 08:00:00.000000 PM
    next_run_date: 05/02/2003 08:00:00.000000 PM
    
  • Problem with DBMS_SCHEDULER. CREATE_JOB in the package

    Hi all

    I tried the following with DBMS_SCHEDULER example. CREATE_JOB.
    This is just an example, I tried to use the DBMS_SCHEDULER package. Exception block is also not have good standards, because I just want to understand that the package
    create table test_test1 (process_id number  ,name varchar2(22) )
    
    CREATE OR REPLACE PACKAGE PKG_SCHEDULER_TEST
    IS
       PROCEDURE proc_test (v_process_id NUMBER, v_name VARCHAR2);
    
       PROCEDURE DATA_LOAD (v_process_id NUMBER, v_name VARCHAR2);
    END PKG_SCHEDULER_TEST;
    
    
    
    CREATE OR REPLACE PACKAGE BODY PKG_SCHEDULER_TEST
    IS
       PROCEDURE Data_load (v_process_id NUMBER, v_name VARCHAR2)
       IS
       BEGIN
          DBMS_OUTPUT.PUT_LINE ('Data_Load Started ');
    
          INSERT INTO test_test1 (process_id, name)
               VALUES (v_process_id, v_name);
    
          COMMIT;
       EXCEPTION
          WHEN OTHERS
          THEN
             DBMS_OUTPUT.put_line ('sp_Data_load error');
       END;
    
    
       PROCEDURE proc_test (v_process_id NUMBER, v_name VARCHAR2)
       IS
       BEGIN
          DBMS_OUTPUT.PUT_LINE ('PROC_TEST STARTED ');
    
          FOR i IN 1 .. 10
          LOOP
             DBMS_OUTPUT.PUT_LINE ('Inside loop started');
             DBMS_SCHEDULER.CREATE_JOB (
                JOB_NAME          => 'Scheduler' || i,
                JOB_TYPE          => 'PLSQL_BLOCK',
                JOB_ACTION        => 'begin
                                               PKG_SCHEDULER_TEST.DATA_LOAD ('
                                              || v_process_id
                                              || ','
                                              || ''''
                                              || v_name
                                              || '); end;',
                START_DATE        => NULL,
                REPEAT_INTERVAL   => NULL,
                END_DATE          => NULL,
                ENABLED           => TRUE,
                COMMENTS          => ' Comments');
          END LOOP;
    
          DBMS_OUTPUT.PUT_LINE (' Lood ended');
       EXCEPTION
          WHEN OTHERS
          THEN
             DBMS_OUTPUT.put_line (
                'proc_test error' || SQLCODE || ',' || SQLERRM);
       END;
    END PKG_SCHEDULER_TEST;
    The above package was created successfully, but when I tried to run this package the following is the output
    SQL> set serverout on
    SQL> exec PKG_SCHEDULER_TEST.proc_test(1,'A
    PROC_TEST STARTED
    Inside loop started
    Inside loop started
    Inside loop started
    Inside loop started
    Inside loop started
    Inside loop started
    Inside loop started
    Inside loop started
    Inside loop started
    Inside loop started
    Lood ended
    
    PL/SQL procedure successfully completed.
    The question now is after the execution of this package, that the data is not loaded in the TEST_TEST1 table and no statement of output which is located in the Data_load procedure

    Please guide me where I am doing wrong

    Thank you

    Take a close look at your JOB_ACTION

                JOB_ACTION        => 'begin
                                               PKG_SCHEDULER_TEST.DATA_LOAD ('
                                              || v_process_id
                                              || ','
                                              || ''''
                                              || v_name
                                              || '); end;',
    

    It will come out with something like

    begin
    PKG_SCHEDULER_TEST.DATA_LOAD(1,'name); end;
    

    See the problem?

  • Reg: Doubt dbms_scheduler

    Hi Experts,

    I have the script below-

    (a) Proc_2 uses CREATE_JOB to call proc_1. In this case, I don't see the exit for ' *' and ' =' in my console dbms_output. But, the good works of the Insert (insert only once).

    (b) if I Uncomment RUN_JOB, there are 2 INSERTS that passes for the same data, and I can see the outputs ' *' and ' =' in my console output - once printed.

    {package_x}

    PROC_1 {}

    I'm in (slider)

    loop

    dbms_output.put_line('***');

    INSERT INTO table_x values (i.some_value);

    dbms_output.put_line('===');

    end loop;

    commit;

    }

       proc_2 {}

    dbms_scheduler.create_job ('Task1', proc_1);

    -/ / dbms_scheduler.run_job ('job1');

    }

    }

    No idea why this phenomenon occurs? I haven't worked a lot with planners, but assumes that CREATE_JOB is called to step (a).

    Please notify.

    Thank you

    -Nordine

    (on Oracle 10.2.0.1.0)

    No idea why this phenomenon occurs? I haven't worked a lot with planners, but assumes that CREATE_JOB is called to step (a).

    Time to read the manual and then, isn't?

    RUN_JOB performs the work in an interactive way, by default in your current session. That's why you can see DBMS_OUTPUT buffer.

    -Running a task immediately. If use_current_session is TRUE the job is run the

    -the user's current session. If use_current_session is set FALSE labor is running the

    -background by a slave of dedicated work.

    PROCEDURE run_job)

    job_name IN VARCHAR2,

    use_current_session IN DEFAULT BOOLEANTRUE,

    event_message IN SYS. ANYDATA DEFAULT NULL);

    CREATE_JOB (assuming you activate it) will submit JOB1 to be run as a background process.

    If you call RUN_JOB immediately after, JOB1 still exists in the dictionary (assuming once again it is auto-dropable), and runs a second time.

  • WGET and DBMS_SCHEDULER

    Hi all

    I create script shell like below

    =============================================

    (w.sh)

    $ \\Server\share\file_path/wget_file.sh $USERNAME $PASSWORD $FILE_PATH $URL1

    $ \\Server\share\file_path/wget_file.sh $USERNAME $PASSWORD $FILE_PATH $URL2

    $ \\Server\share\file_path/wget_file.sh $USERNAME $PASSWORD $FILE_PATH $URL3

    $ \\Server\share\file_path/wget_file.sh $USERNAME $PASSWORD $FILE_PATH $URL4

    $ \\Server\share\file_path/wget_file.sh $USERNAME $PASSWORD $FILE_PATH $URL5

    $ \\Server\share\file_path/wget_file.sh $USERNAME $PASSWORD $FILE_PATH $URL6

    =============================================

    (wget_file.sh)

    #! / bin/bash

    / usr/sfw/bin/wget - http - user = "$1" - http-passwd = "$2" PEI $3 $ 4

    =============================================

    Those who can run on OS without any error as download about 20 seconds and then I put work by dbms_scheduler as below

    Start

    dbms_scheduler.drop_job ('W');

    dbms_scheduler.create_job (job_name = > 'W', job_type = > 'EXECUTABLE', job_action = > ' / usr/bin/bash ', number_of_arguments = > 1, active = > false, auto_drop = > false);

    dbms_scheduler.set_job_argument_value ('W', 1, argument_value = > ' / tmp/w.sh ');

    dbms_scheduler. Enable ('W');

    end;

    /

    And then run but it was hang and I check the process server who found 2 methods and download only 2 files and not finished.

    So I kill processes by kill - 9 command after that I re - check the file in the path, download all the files completely.

    I tried 2 times and wait more than 5 minutes again same just 2 files in the path and then I kill the process again once the file has been downloaded completely new.

    I tried again 3 times this always the same situation.

    I test with a single command like below

    / usr/sfw/bin/wget - http - user = "$USERNAME" - http-passwd = "$PASSWORD" $FILE_PATH $URL1 Pei

    and it is run by dbms_scheduler.run_job who is running too long and I checked the file in the path that exists, but oracle session did not return anything up and running.

    Do you have an experience like that? and how to solve?

    Thank you

    Hiko

    After add option - O for the wget command and I used the command "more" to get information from the logfile and then changed it to the "cat" command, the problem is gone it is very very weird.

  • 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

  • DBMS_SCHEDULER jobs wait/program end

    Hi all

    I ran into a small limitation on my understanding of DBMS_SCHEDULER.

    I have an executable script that performs a network scan. My goal is to launch this application, wait for them (maybe 5 minutes or 2 hours) for the analysis ends before I return the results.

    Where I am a little confused, is the circulation of works all process when I want to wait for the program complete:

    1 - define a program?

    2 - Apply the arguments?

    3. apply identification information

    4 - set a string?

    Literally, I don't know how to tackle this task. I just want to launch job and wait until it finishes before going to retrieve the file from the server. This is what I have for now, just bits and pieces.

    Mayen simply, I missed something in the docs and I overcomplicate things.

    Thanks in advance to the community for you help.

    Jan S.

    BEGIN
    
      
      
      dbms_scheduler.create_program(
        program_name   => 'network_scan',
        program_type   => 'executable',
        number_of_arguments => 5,
        program_action => 'scan_network.py',
        enabled        =>  FALSE);
      
      dbms_scheduler.define_program_argument('network_scan',1,'x01=1');
      dbms_scheduler.define_program_argument('network_scan',2,'x02=192.168.1.1');
      dbms_scheduler.define_program_argument('network_scan',3,'x03=24');
      dbms_scheduler.define_program_argument('network_scan',4,'x04=D');
      dbms_scheduler.define_program_argument('network_scan',5,'x05=1521-1523,7777');  
    
      vJobName := dbms_scheduler.generate_job_name('NET_SCAN_');
      
      dbms_scheduler.create_job(job_name => vJobName,
                                  job_type => 'EXECUTABLE',
                                  job_action => '/usr/bin/scan_nework.sh',
                                  number_of_arguments => 5,
                                  enabled => FALSE,
                                  auto_drop => FALSE,
                                  comments => 'Network');
    
    dbms_scheduler.set_attribute(vJobName,'credential_name', 'SUCREDENTIALS');
      dbms_scheduler.run_job(vJobName,FALSE);
      
      dbms_scheduler.create_chain (
       chain_name            =>  'net_scan_chain',
       rule_set_name         =>  NULL,
       evaluation_interval   =>  NULL,
       comments              =>  NULL);
      
      dbms_scheduler.define_chain_step('net_scan_chain', 'step1', 'network_scan');
      
      SELECT additional_info, external_log_id
      INTO   l_additional_info, l_external_log_id
      FROM   (SELECT log_id, 
                     additional_info,
                     REGEXP_SUBSTR(additional_info,'job[_0-9]*') AS external_log_id
              FROM   dba_scheduler_job_run_details
              WHERE  job_name = vJobName
              ORDER BY log_id DESC)
      WHERE  ROWNUM = 1;
    
      DBMS_OUTPUT.put_line('ADDITIONAL_INFO: ' || l_additional_info);
      DBMS_OUTPUT.put_line('EXTERNAL_LOG_ID: ' || l_external_log_id);  
      
      
    
        
      -- Wait at least 3 second because its distributed
      dbms_lock.sleep(3);
      SELECT job_name, status, error#, additional_info
      FROM dba_scheduler_job_run_details
      WHERE job_name= vJobName;
       
      
      dbms_lob.createtemporary(l_clob, FALSE);
    
      dbms_scheduler.get_file(
        source_file     => l_external_log_id ||'_stdout',
        credential_name => 'ORACLECREDENTIALS',
        file_contents   => l_clob,
        source_host     => NULL);
    
      DBMS_OUTPUT.put_line('stdout:');
      DBMS_OUTPUT.put_line(l_clob);
    k Scan');
    

    See Tom's last answer in this thread AskTom. It shows how to use the package DBMS_ALERT to notify you.

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:5320945700346034393

  • DBMS_SCHEDULER RUN_JOB successful but nothing happens

    Hi all

    I'm working on a project where I have to create a URL and open it.

    The creation of the URL works fine.

    To open it in a browser, I tried to create one job in the dbms_scheduler:

    Begin

    () Dbms_Scheduler.Create_Job

    Job_Name = > 'IE,'

    Job_Action = > ' / bin/ksh.

    Number_Of_Arguments = > 2,

    activated = > false,

    Job_Type = > 'executable');

    Dbms_Scheduler.Set_Job_Argument_Value ("IE", 1, "#!") ("/ Bin/ksh");

    Dbms_Scheduler.Set_Job_Argument_Value ('IE', 2, 'elinks 'URL' ');

    End;

    It works very well, too.

    But when I want to now the task code succeeds but nothing happens.

    Orders should open a browser with the given URL. If it works fine, an E-mail is sent to a specific address.

    The URL opens the BirtMailer, a tool to send reports as attachments.

    If I run the command on the shell, everything works fine and the e-mail message is sent. But with the Scheduler, nothing happens.

    Any suggestion or advice will be appreciated.

    Thank you all.

    for example:

    #! / bin/bash

    Export HOME =...

    ELinks $*.

  • DBMS_SCHEDULER: cannot find defined jobs

    Hello everyone,

    I'm trying to set up an automatic daily backup on a test server with Oracle 11 g 2.

    First of all, I defined a calendar:

    run DBMS_SCHEDULER. CREATE_SCHEDULE (repeat_interval = > ' FREQ = DAILY;) BYHOUR = 10; BYMINUTE = 30', start_date = > to_timestamp_tz ('2013-03-11 Europe/Berlin ',' YYYY-MM-DD TZR'), schedule_name = > 'FULLBACKUP_DAILY');

    Any fine. That I defined the job step:
    execute DBMS_SCHEDULER.CREATE_JOB(job_name => 'FULLBACKUP_DBTEST2',
                                      job_type => 'EXECUTABLE',
                                      job_action => '<path to script>',
                                      schedule_name => 'FULLBACKUP_DAILY',
                                      job_class => 'DEFAULT_JOB_CLASS',
                                      auto_drop => FALSE,
                                      enabled => TRUE);
    Now, I'm trying to find the Select work with these commands:
    ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT ='dd.mm.yyyy hh24:mi';
    
    SELECT last_start_date, next_run_date, state, job_type, job_action FROM dba_scheduler_jobs WHERE job_name='FULLBACKUP_DBTEST2';
    
    SELECT * FROM DBA_SCHEDULER_JOB_RUN_DETAILS WHERE job_name='FULLBACKUP_DBTEST2';
    But it does not print anything. And I don't know why?

    Here's my RMAN Script, I want to start:
    #!/bin/bash
    
    export ORACLE_SID=dbtest2
    export ORACLE_HOME=/home/oracle/srv/ora/product/11.2.0/dbtest_2
    
    rman target / <<EOI
    
        SET COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
            run {
            allocate channel oem_backup_disk1 type disk ;
            backup incremental level 0 cumulative as COMPRESSED BACKUPSET tag '%TAG' database;
            backup as COMPRESSED BACKUPSET tag '%TAG' archivelog all not backed up delete all input;
            release channel oem_backup_disk1;
            }
    
        quit
    EOI
    He has all the rights (chmod 777 *). When I run the script manually everything is fine and I'm the backup.

    What I did wrong?

    Thanks for the help!

    Kind regards
    David

    Published by: David_Pasternak on 11.03.2013 03:48

    Hi David,

    Work must be enabled using the active parameter below...

    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
                 .
                 .
                 .
     enabled => TRUE);
    END;
    /
    

    Check below for help, looking for stats on the values of columns &

    set line 900
    set pages 900
    col JOB_ACTION for a50
    col REPEAT_INTERVAL for a60
     select OWNER,JOB_NAME,JOB_CREATOR,JOB_ACTION,START_DATE,REPEAT_INTERVAL,RUN_COUNT,LAST_RUN_DURATION,NEXT_RUN_DATE,STATE,ENABLED from DBA_SCHEDULER_JOBS where upper(JOB_NAME) ='FULLBACKUP_DBTEST2';
    select * from DBA_SCHEDULER_JOB_LOG where upper(JOB_NAME) ='FULLBACKUP_DBTEST2' order by 2;
    

    Thank you
    Ajay more
    http://www.moreajays.com

  • DBMS_SCHEDULER logging level oddity - why?

    I am trying to establish with new database 11 g to migrate across our 10 g databases, and I noticed that dbms_scheduler jobs have a logging_level of "RUNS" on 10 g but, despite being created with the same code, on 11 g the logging_level is 'OFF '. I've checked everything I can think of, but I do not understand why the recording level is different on 11g.

    Here is my test scenario:

    < h3 > 10g < / h3 >
    select version
    from   v$instance;
    
    VERSION          
    -----------------
    10.2.0.4.0     
    
    select job_class_name, logging_level
    from   dba_scheduler_job_classes
    where  job_class_name = 'DEFAULT_JOB_CLASS';
    
    JOB_CLASS_NAME                 LOGGING_LEVEL
    ------------------------------ -------------
    DEFAULT_JOB_CLASS              RUNS           
    
    select dbms_scheduler.get_default_value('LOGGING_LEVEL') from dual;
    
    DBMS_SCHEDULER.GET_DEFAULT_VALUE('LOGGING_LEVEL')                               
    --------------------------------------------------------------------------------
    64             
    
    declare
      db_name varchar2(2);
    begin
       dbms_scheduler.create_job( 
        job_name=>'test_job', 
        job_type => 'PLSQL_BLOCK',
        job_action=> 'begin 
      null;
    end; ', 
      start_date => to_timestamp('01/16/2013 12:00:00', 'mm/dd/yyyy hh24:mi:ss'), 
      repeat_interval => 'SYSDATE + 12/24', 
      enabled => true, auto_drop=> false, 
      comments => 'test'
    );
    end;
    /
    
    select job_name, job_type, job_class, logging_level
    from   user_scheduler_jobs
    where  job_name = 'TEST_JOB';
    
    JOB_NAME                       JOB_TYPE         JOB_CLASS                      LOGGING_LEVEL
    ------------------------------ ---------------- ------------------------------ -------------
    TEST_JOB                       PLSQL_BLOCK      DEFAULT_JOB_CLASS              RUNS
    < h3 > 11g < / h3 >
    select version
    from   v$instance;
    
    VERSION          
    -----------------
    11.2.0.3.0  
    
    select job_class_name, logging_level
    from   dba_scheduler_job_classes
    where  job_class_name = 'DEFAULT_JOB_CLASS';
    
    JOB_CLASS_NAME                 LOGGING_LEVEL
    ------------------------------ -------------
    DEFAULT_JOB_CLASS              RUNS        
    
    select dbms_scheduler.get_default_value('LOGGING_LEVEL') from dual;
    
    DBMS_SCHEDULER.GET_DEFAULT_VALUE('LOGGING_LEVEL')                               
    --------------------------------------------------------------------------------
    64           
    
    declare
      db_name varchar2(2);
    begin
       dbms_scheduler.create_job( 
        job_name=>'test_job', 
        job_type => 'PLSQL_BLOCK',
        job_action=> 'begin 
      null;
    end; ', 
      start_date => to_timestamp('01/16/2013 12:00:00', 'mm/dd/yyyy hh24:mi:ss'), 
      repeat_interval => 'SYSDATE + 12/24', 
      enabled => true, auto_drop=> false, 
      comments => 'test'
    );
    end;
    /
    
    select job_name, job_style, job_type, job_class, logging_level
    from   user_scheduler_jobs
    where  job_name = 'TEST_JOB';
    
    JOB_NAME                       JOB_STYLE   JOB_TYPE         JOB_CLASS                      LOGGING_LEVEL
    ------------------------------ ----------- ---------------- ------------------------------ -------------
    TEST_JOB                       REGULAR     PLSQL_BLOCK      DEFAULT_JOB_CLASS              OFF
    Someone at - it ideas as to what could be causing the logging level will be set to OFF on the 11 g database? I know that I can adjust the recording manually via the SET_ATTRIBUTE procedure level, but nothing I have google/read in the documentation explains why the level is not set on WORKS on 11g.

    Am I missing something completely obvious?

    Hi D,

    I think that's probably a bug... When you create a task, oracle is the insertion of the 164400 in the sys.scheduler table $_job. And looking at his decoding, which is

    DECODE (BITAND (j.flags, 32 + 64 + 128 + 256),  32, 'OFF',  64, 'RUNS',  128, 'FAILED RUNS',  256, 'FULL',  NULL)
    

    which gives 32, so that it displays as OFF.

    Based on the track, I think that it does not have the sys.scheduler logging level $_class when inserting new jobs. I suspect that this is a bug.

    Hope everything goes well
    Raj J

Maybe you are looking for

  • Memory RAM upgrade for 9280

    I don't know if someone always checks on this string, but thanks for the tip on the GTX 660!  What a great card! My next questions consider now ram and hard drive upgrades: If I want to add memory, should I get sets to match the four locations?  In o

  • go mini questions please help!

    When I turn on my HP mini computer her talk me to "enter the current password" and after three trys it says "system error fatal vaulted password control failure" with code "CNU9475MH7" Please help me through this form as soon as POSSIBLE. I need the

  • Samsung Digimax S800 digital camera 8.1MP

    I have a new Viao computer and tried to upload photos from my samsung digimax S800 photo device.  The computer does not recognize that there are pictures to download, yet there are no pictures on the camera.  This is the first time I tried to do.  Wh

  • When I try to open an attachment to an e-mail, I get the screen of Microsoft Office 2010. Why?

    I have attempted to open an attachment and had problems.  Then, I received a message through Microsoft Office (I think) who asked how I wanted my attachments open and checked Microsoft Office 2010.  How to change this back and why I can not open atta

  • Where is my icon to taskbar for Volume?

    Silly question, but... in the past, there was an icon in the taskbar on my tablet pc where I could adjust the volume on various things like the Speaker Volume, wave, SW Synth, CD player and Monitor entry and I could put a checkbox in a silent box for