2 Replies Latest reply: Nov 14, 2012 7:58 AM by Veeresh.S RSS

    DBMS scheduler 2

    846231
      Hi all,

      I run this command c/o Veeresh, but I got error:
      C:\Documents and Settings\admin>sqlplus / as sysdba
      
      SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 14 21:37:39 2012
      
      Copyright (c) 1982, 2010, Oracle.  All rights reserved.
      
      
      Connected to:
      Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
      With the Partitioning, OLAP, Data Mining and Real Application Testing options
      
      SQL> BEGIN
        2  SYS.DBMS_SCHEDULER.CREATE_JOB(
        3  job_name => 'refresh_link',
        4  job_type => 'EXECUTABLE',
        5  job_action => 'C:\WINDOWS\system32\cmd.exe',
        6  start_date => SYSTIMESTAMP,
        7  repeat_interval => 'freq=daily; byhour=0; byminute=0; bysecond=0',
        8  number_of_arguments => 2,
        9  end_date => NULL,
       10  enabled => TRUE,
       11  comments => 'refresh db links');
       12  SYS.DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(
       13  job_name => 'refresh_link', argument_position => 1, argument_value => '/c')
      ;
       14  SYS.DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(
       15  job_name => 'refresh_link', argument_position => 2, argument_value => '"d:\
      batch\main_prg1x.bat"');
       16  END;
       17  /
      BEGIN
      *
      ERROR at line 1:
      ORA-27457: argument 1 of job "SYS.REFRESH_LINK" has no value
      ORA-06512: at "SYS.DBMS_ISCHED", line 124
      ORA-06512: at "SYS.DBMS_SCHEDULER", line 271
      ORA-06512: at line 2
      
      
      SQL> l
        1  BEGIN
        2  SYS.DBMS_SCHEDULER.CREATE_JOB(
        3  job_name => 'refresh_link',
        4  job_type => 'EXECUTABLE',
        5  job_action => 'C:\WINDOWS\system32\cmd.exe',
        6  start_date => SYSTIMESTAMP,
        7  repeat_interval => 'freq=daily; byhour=0; byminute=0; bysecond=0',
        8  number_of_arguments => 2,
        9  end_date => NULL,
       10  enabled => TRUE,
       11  comments => 'refresh db links');
       12  SYS.DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(
       13  job_name => 'refresh_link', argument_position => 1, argument_value => '/c')
      ;
       14  SYS.DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(
       15  job_name => 'refresh_link', argument_position => 2, argument_value => '"d:\
      batch\main_prg1x.bat"');
       16* END;
      SQL>
      Help please..........

      Thanks,
      Kinz
        • 1. Re: DBMS scheduler 2
          Osama_Mustafa
          Error:     ORA-27457 (ORA-27457)
          Text:     argument %s of job %s.%s has no value
          ---------------------------------------------------------------------------
          Cause:No value was provided for the job argument with the specified position.
          Action:Provide a value for the job argument using any of the set_job_xxxx_value() routines. Or, when using a named program,
               specify a default value for the corresponding argument of the
               program.


          Read
          http://www.oracle-base.com/articles/10g/scheduler-10g.php
          • 2. Re: DBMS scheduler 2
            Veeresh.S
            remove the 1st argument,let us think of it later

            on 8th line replace number_of_arguments value 2 to *1*
            and
            remove 12th and 13th line
            and
            on 15th line
            replace argument_position value 2 to *1*

            and try running it and see what it throws