Troubled to get scheduler job to run?

Hi all friends:
I'm having trouble getting any scheduler jobs (here, troubled job name is CUSTMASTER_CHANGES_01) to actually run.
when
sql>select job_name,state,enabled,retry_count,failure_count,run_count,restartable,start_date,repeat_interval,job_class
from all_scheduler_jobs;
JOB_NAME STATE ENABL RETRY_COUNT FAILURE_COUNT RUN_COUNT RESTA START_DATE REPEAT_INTERVAL JOB_CLASS
CUSTMASTER_CHANGES_01 SCHEDULED TRUE 0 0 0 FALSE 14-JAN-08 09.46.14.6 FREQ=SECONDLY;I SCANNER_JO
72965 AM AMERICA/NEW NTERVAL=5 B_CLASS
_YORK
for job 'CUSTMASTER_CHANGES_01'
we can see RUN_COUNT 0 and restartable false.
I upped slave processes to 5. dbms_scheduler.run_job('CUSTMASTER_CHANGES_01') works, but it's still not executing on the schedule
when run as sysdba
SQL> exec dbms_scheduler.run_job('CUSTMASTER_CHANGES_01');
ERROR at line 1:
ORA-27475: "SYS.CUSTMASTER_CHANGES_01" must be a job
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1
to resolve that,
we found
When you create your job by using dbsm_scheduler, it has a parameter called ‘auto_drop’, is by default, =’true’, like, auto_drop => TRUE
see below;
dbms_scheduler.create_job(
job_name IN VARCHAR2,
job_type IN VARCHAR2,
job_action IN VARCHAR2,
number_of_arguments IN PLS_INTEGER DEFAULT 0,
start_date IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
repeat_interval IN VARCHAR2 DEFAULT NULL,
end_date IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
job_class IN VARCHAR2 DEFAULT 'DEFAULT_JOB_CLASS',
enabled IN BOOLEAN DEFAULT FALSE,
auto_drop IN BOOLEAN DEFAULT TRUE,
comments IN VARCHAR2 DEFAULT NULL);
The job you manually run once and then it drops itself when you test.
so I am specifiying auto_drop to be false, but it is showing it has true as the attribute.
DBMS_SCHEDULER.CREATE_JOB(
job_name => scanner.scanner_name,
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN IF EEG_SCAN.GET_RUNNING_JOBS_COUNT('
||''''||UPPER(scanner.scanner_name)||''''
||') < 2 THEN '||scanner.scanner_proc_name||'; END IF; END;',
repeat_interval => 'FREQ=SECONDLY;INTERVAL=5',
job_class => c_job_class_name,
auto_drop => FALSE,
enabled => true
scheduler job is still not working as expected.....?
Can you help me for this??
thanks a lot in advance.
Message was edited by:
jerrygreat
Message was edited by:
jerrygreat

Hi,
There are a few other limits you could check .
Make sure that you have not exceeded the maximum number of sessions or the maximum number of processes or the maximum number of scheduler jobs
select * from dba_scheduler_global_attribute;
and
select name,value from v$parameter where name like '%process%';
select name,value from v$parameter where name like '%session%';
Also check how many jobs are currently running
select count(*) from dba_scheduler_running_jobs;
select count(*) from dba_jobs_running ;
select count(*) from v$session ;
One of these limits may need to be increased.
The run_job succeeds because it runs in the current session by default, if you use use_current_session=>false, does it still work ?
Also auto_drop only drops the job when it has completed e.g. past its end_date or exceeded its max_runs.
Finally note that there is a dedicated forum for dbms_scheduler located here
Scheduler
Hope this helps,
Ravi.

Similar Messages

  • Having trouble getting a job to run using job scheduler

    I am using Oracle 11g. I run a sql script that schedules a job:
    exec sys.dbms_scheduler.create_job( job_name => '"SYSTEM"."UCR"', job_type => 'EXECUTABLE', job_action => 'D:\UserCountReport\bin\ucr.bat', repeat_interval => 'FREQ=HOURLY;BYHOUR=3;BYMINUTE=0;BYSECOND=0',start_date => to_timestamp_tz('2011-07-21 US/Eastern', 'YYYY-MM-DD TZR'), job_class => 'DEFAULT_JOB_CLASS', auto_drop => FALSE,enabled => FALSE);
    exec sys.dbms_scheduler.set_attribute( name => '"SYSTEM"."UCR"',  attribute => 'job_weight',  value => 1);
    exec sys.dbms_scheduler.enable( '"SYSTEM"."UCR"' );
    commit;
    exit;When I am connected to the database, I run these commands:
    SQL> SELECT JOB_NAME, STATE, job_action, repeat_interval FROM DBA_SCHEDULER_JOBS
    where job_name='UCR';
    JOB_NAME
    STATE
    JOB_ACTION
    REPEAT_INTERVAL
    UCR
    SCHEDULED
    C:\UserCountReport\bin\ucr.bat
    FREQ=HOURLY;BYHOUR=9;BYMINUTE=0;BYSECOND=0
    SQL> SELECT JOB_NAME, status FROM DBA_SCHEDULER_JOB_LOG where job_name = 'UCR';
    JOB_NAME
    STATUS
    UCR
    SUCCEEDED
    UCR
    SUCCEEDED
    UCR
    SUCCEEDEDHowever, I don't get any signs that the job has run even though Oracle says all the runs have succeeded. The batch file that the job is supposed to execute creates a file and writes stuff to it. However, the file is not written. When I run the batch file from command prompt, it executes correctly.
    I have tried following instructions here:
    Answers to "Why are my jobs not running?"
    However, all three of these commands return errors:
    SQL> select value from v$parameter where name='job_queue_processes';
    select value from v$parameter where name='job_queue_processes'
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> select count(*) from dba_scheduler_running_jobs;
    select count(*) from dba_scheduler_running_jobs
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> select count(*) from dba_jobs_running;
    select count(*) from dba_jobs_running
    ERROR at line 1:
    ORA-00942: table or view does not existI've tried various other commands from that list and I get errors as well.
    I'm not quite sure where to go from here to troubleshoot this problem. Any help would be appreciated. Thanks.
    Edited by: 874375 on Jul 22, 2011 9:14 AM
    Edited by: 874375 on Jul 22, 2011 9:18 AM

    So I changed my script to this:
    exec sys.dbms_scheduler.create_job( job_name => '"SYSTEM"."UCR"', job_type => 'EXECUTABLE', job_action => '%windir%\system32\cmd.exe /C D:\UserCountReport\bin\ucr.bat', ....I now have this:
    SQL> SELECT JOB_NAME, status FROM DBA_SCHEDULER_JOB_LOG where job_name='BOXTONE_
    MONTHLY_UCR';
    JOB_NAME
    STATUS
    BOXTONE_MONTHLY_UCR
    FAILED
    BOXTONE_MONTHLY_UCR
    SUCCEEDED
    BOXTONE_MONTHLY_UCR
    SUCCEEDED
    JOB_NAME
    STATUS
    BOXTONE_MONTHLY_UCR
    SUCCEEDEDIs there a place with log files that will tell me why the job failed? If so where are the log files located?

  • DPM 2012 R2 Upgrade - Scheduled jobs not running

    Hi,
    We're having an issue after upgrading to DPM 2012 R2 where the scheduled jobs are not running.
    We're running Server 2012 R2 with SQL Server 2008 R2 SP2.
    Looking at SQL jobs, if we run the job step we get an error.
    Message
    [136] Job 18822c3e-8fe 7-47a2-bb6e-0feccecc2952 reported: The process could not be created for step 1 of job 0xA746B176EAD99943A14A57DAF684829F (reason: %1 is not a valid Win32 application)
    However, if we place quotes around the triggerjob.exe path in the SQL default job step:
    "C:\Program Files\Microsoft System Center 2012 R2\DPM\DPM\bin\TriggerJob.exe" 9b30d213-b836-4b9e-97c2-db03c3eb39d7 18822c3e-8fe7-47a2-bb6e-0feccecc2952 server.domainname.com
    It is successful. 
    We've already uninstalled DPM 2012 R2 and re-installed, restored the database and run dpmsync -sync with the same result. We've checked the DCOM Config Launch and Activation Permissions for Microsoft System Center 2012 R2 Data Protection Manager Service
    and has full access.
    Has anyone else had this issue and been able to resolve it?
    Any help would be greatly appreciated.

    Hi,
    The below blog may assist with troubleshooting your issue.
    http://blogs.technet.com/b/dpm/archive/2014/10/08/how-to-troubleshoot-scheduled-backup-job-failures-in-dpm-2012.aspx
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually
    answer your question. This can be beneficial to other community members reading the thread. Regards, Dwayne Jackson II. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights."

  • HELP: scheduled jobs no run---searched a lot but still cannot resolve

    As for this problem, I have searched a lot by google, but I still cannot resolve it.
    I am using 11g on Linux.
    I delete all of jobs in my database.Then I configured a very simple periodic job as follows:
    begin
    DBMS_SCHEDULER.create_job (job_name => 'test2',
    program_name => 'test_program',
    repeat_interval => 'freq=secondly; INTERVAL= 4',
    auto_drop => FALSE);
    dbms_scheduler.set_attribute(name => 'test2',
    attribute => 'max_runs',
    VALUE => 100);
    dbms_scheduler.enable('test2');
    end;
    The program which the job is associated with is as follows:
    create or replace PROCEDURE TEST AS
    BEGIN
    INSERT INTO print_tab VALUES('come on');
    commit;
    END TEST;
    However the table is always empty and the job never runs, and the state shows "SCHEDULED".
    The facts are as follows:
    1. My database worked very fine until yesterday. This problem occurs suddenly.
    2. I also tried to reboot the system, but it did not work.
    3. I can manually run the job by DBMS_SCHEDULER.RUN_JOB('test2', TRUE);
    4 The process of CJQ, J0 are both running;
    5. the value of "job_queue_processess" is 10000, and also i changed it to other values, it did not work;
    6. the value of "MAX_JOB_SLAVE_PROCESSES" is 999.
    I really do not understand the reason. Who could you give me some guidance. If you need more diagnostic, please tell me how to get them. Great thanks.
    Message was edited by:
    KingMing

    There are many logs in      /u01/app/oracle/diag/rdbms/orcl/orcl/alert, which I checked from the manager console. Could you please help me take a look? Thanks
    r 22, 2008 8:16:47 PM EDT     UNKNOWN     16     
         Thread 1 advanced to log sequence 3114
    Apr 22, 2008 8:16:47 PM EDT     UNKNOWN     16     
         Current log# 3 seq# 3114 mem# 0: /u01/app/oracle/oradata/orcl/redo03.log
    Apr 22, 2008 8:16:46 PM EDT     UNKNOWN     16     
         Thread 1 cannot allocate new log, sequence 3114
    Apr 22, 2008 8:16:46 PM EDT     UNKNOWN     16     
         Private strand flush not complete
    Apr 22, 2008 8:16:46 PM EDT     UNKNOWN     16     
         Current log# 2 seq# 3113 mem# 0: /u01/app/oracle/oradata/orcl/redo02.log
    Apr 22, 2008 8:00:46 PM EDT     UNKNOWN     16     
         Thread 1 advanced to log sequence 3113
    Apr 22, 2008 8:00:46 PM EDT     UNKNOWN     16     
         Current log# 2 seq# 3113 mem# 0: /u01/app/oracle/oradata/orcl/redo02.log
    Apr 22, 2008 1:25:35 PM EDT     UNKNOWN     16     
         Thread 1 advanced to log sequence 3112
    Apr 22, 2008 1:25:35 PM EDT     UNKNOWN     16     
         Current log# 1 seq# 3112 mem# 0: /u01/app/oracle/oradata/orcl/redo01.log
    Apr 22, 2008 4:39:32 AM EDT     UNKNOWN     16     
         Thread 1 advanced to log sequence 3111
    Apr 22, 2008 4:39:32 AM EDT     UNKNOWN     16     
         Current log# 3 seq# 3111 mem# 0: /u01/app/oracle/oradata/orcl/redo03.log
    Apr 21, 2008 9:15:42 PM EDT     UNKNOWN     16     
         Thread 1 advanced to log sequence 3110
    Apr 21, 2008 9:15:42 PM EDT     UNKNOWN     16     
         Current log# 2 seq# 3110 mem# 0: /u01/app/oracle/oradata/orcl/redo02.log
    Apr 21, 2008 8:15:54 PM EDT     UNKNOWN     16     
         Thread 1 advanced to log sequence 3109
    Apr 21, 2008 8:15:54 PM EDT     UNKNOWN     16     
         Current log# 1 seq# 3109 mem# 0: /u01/app/oracle/oradata/orcl/redo01.log
    Apr 21, 2008 8:15:54 PM EDT     UNKNOWN     16     
         Thread 1 cannot allocate new log, sequence 3109
    Apr 21, 2008 8:15:54 PM EDT     UNKNOWN     16     
         Private strand flush not complete
    Apr 21, 2008 8:15:54 PM EDT     UNKNOWN     16     
         Current log# 3 seq# 3108 mem# 0: /u01/app/oracle/oradata/orcl/redo03.log
    Apr 21, 2008 3:19:00 PM EDT     NOTIFICATION     16     
         process start     ksbrdp:3527:3697353022     CJQ0 started with pid=39, OS id=8880
    Apr 21, 2008 3:19:00 PM EDT     NOTIFICATION     16     
         process start     ksbs1p_real:2133:2371767696     Starting background process CJQ0
    Apr 21, 2008 3:15:48 PM EDT     NOTIFICATION     16     
         admin_ddl     opiexe:2995:2802784106     Completed: ALTER DATABASE OPEN
    Apr 21, 2008 3:15:46 PM EDT     UNKNOWN     16     
         db_recovery_file_dest_size of 2048 MB is 0.00% used. This is a
    Apr 21, 2008 3:15:46 PM EDT     UNKNOWN     16     
         user-specified limit on the amount of space that will be used by this
    Apr 21, 2008 3:15:46 PM EDT     UNKNOWN     16     
         database for recovery-related files, and does not reflect the amount of
    Apr 21, 2008 3:15:46 PM EDT     UNKNOWN     16     
         space available in the underlying filesystem or ASM diskgroup.

  • Scheduler Jobs that run between certain times?

    Is there an easy way to query which dbms_scheduler jobs run between any given times?
    If I look at repeat_interval in user_scheduler_jobs, for example, I've got things like "FREQ=DAILY; BYHOUR=14,16,18,20,8,10,12; BYMINUTE=30" and "FREQ=HOURLY; INTERVAL=2;" and "FREQ=DAILY;", and it's not therefore clear to me how I could write a query that would find which jobs run between (say) 17:00 and 19:00.
    Is there a function, or a neat bit of sql, that will 'explode' the repeat interval (presumably, in the case of the last two examples above, with reference to the start_date) into standardized times which I could then query? Or is there some other way of doing it?

    There are no schedules used here. The repeat interval is specified for all jobs at the time of creating the job.
    Besides, that wouldn't address the issue, even so. Even if schedules are in use, they declare their repeat interval in the form "freq=daily;byhour=3,4,5,6;byminute=0;bysecond=0", stored in a text field. Exactly the same, in fact, as the repeat_interval column in the user_scheduler_jobs column.
    So how do you derive from that the knowledge that the job can run some time between 2 and 8AM?
    I want to list all jobs which might start between those two times, but I do not know syntactically or logically how it is possible to query either user_scheduler_jobs or all_scheduler_schedules to select all rows where repeat_interval "is somehow covered by the time range 2 to 8".
    Thanks for replying, though.

  • Schedule job to run daily at specific times

    Hello,
    Not sure if this is the correct forum to post my question. If not, please advise which forum to use.
    How can I setup a background job which runs daily day, but only runs between a specific time?
    Our request is to have a job to run daily between 0700 - 1700 - then end and restarts again at 0700 the next day. How can we do this?
    Kind regards

    Check this
    https://forums.sdn.sap.com/search.jspa?threadID=&q=backgroundANDjobANDschedule&objID=f50&dateRange=all&numResults=15
    PS Please make a search this forum before posting

  • Scheduled Job not running properly

    Hello Friends,
    I have a webservice that sends the mail to 24 or above users at a single go . This functionality I need to schedule . So I designed the job for same purpose , now the problem is that the webservice is running absolutely fine but once the job is scheduled and run , the mails are not send . I tried to send a single mail also with the help of scheduler API and was succefull in doing that but If the webservice needs to send more than one mail , this does not happen through the Scheduler API
    I also had encountered problem while runnign the webservice earlier. I was getting the Read timed out error during execution of webservice For its solution I increased the time out period of the webservice  mannually ( from the left panel , the time out period can be increased in WebService Navigator ) and the problem got solved , this you cant do once you have scheduled the job so one of the reson may this time out expiration also .
    So can any one help me out with the way to increase the time out period for the webservice not mannually rather in a more stabel and permanent way
    Edited by: Smriti_techno on May 5, 2009 8:50 AM

    hi
    refer this link for example of scheduler api
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90a95132-8785-2b10-bda5-90d82a76431e
    let me know am i correct or not
    bvr

  • Schedule Job to run every 15 minutes from 5 AM to 10 PM

    Hello,
    I am interested to have a job running from 5:00 AM to 10:00 PM every day, every 15 minutes
    Is it possible with Oracle 10g DBMS_scheduler?
    Thanks

    Hi,
    You can check this form here :http://www.oracle-base.com/articles/10g/scheduler-10g.php
    Hope this help

  • Schedule jobs not running

    the user execute the abap job and execute in background, but it is not running. He execute many times, but still sit in schedule state, do you know why? there is no error in SM21, will it be authority issues? how to check? thanks

    It looks like it is an authorization issue. Ask them to do that again and immediately in another session, run SU54. This will show all the authorization checks that the user went through and tells you if it failed.
    Alternatively, they can just go to SM37 and try to release it. If it comes back with a message, you will know.
    Srinivas

  • Schedule Job to run every day at 01:00:00 i.e. mid-night 01:00 AM

    Dear Gurus,
    I want to create a job that will run every day at 01:00:00 i.e. mid-night 01:00 AM.
    and the above job will be started from 2-Jul-2010 01:00:00
    I have created below code.
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB(
    JOB_NAME => 'Smry_Dly_Trial'
    ,JOB_TYPE => 'PLSQL_BLOCK'
    ,JOB_ACTION => 'BEGIN Periodic.Execute_Smry_Job(''HOURLY''); END;'
    ,START_DATE => to_date('2-Jul-2010 01:00:00','DD-Mon-YYYY HH24:MI:SS')
    ,REPEAT_INTERVAL => 'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI,SAT,SUN; BYHOUR=1;'
    ,ENABLED => TRUE
    ,COMMENTS => 'Generates Call Summary Daily');
    END;
    Could any one suggest me is it fine or any change needed.
    Regards
    Sanjeev

    Seems fine.
    You could also use trunc(to_date('01-jul-2010'))+1+1/24 for your start date.
    Regards,
    Amol

  • I scheduled job to run at 10:00am, why it ran at 4:00am?

    I created a program like this:
    dbms_scheduler.create_program
    (program_name=> 'PROG_ST_IFS_LOAD1',
    program_type=> 'executable',
    program_action=> '/export/db25/mis/bin/shell/st_ifsload_job1',
    enabled=>true,
    comments=>'Procedure'
    I created a job like this:
    dbms_scheduler.create_job
    (job_name => 'ST_IFSLOAD_JOB1',
    program_name=> 'PROG_ST_IFS_LOAD1',
    schedule_name=>'SCH_ST_IFS_LOAD1',
    enabled=>true,
    auto_drop=>false,
    comments=>'Job to remind file');
    I set the date and time to run the job on a date each month, the date will be in variable v_remind_date, it could be 21, 22 or any date depends on the business needs. At the 1st of each month, I reset the attribute of the job like this:
    v_date := v_remind_date||'/'||to_char(sysdate,'mm/yyyy')||' 10:00';
    -- change start time
    DBMS_SCHEDULER.SET_ATTRIBUTE(
    name => 'SCH_ST_IFS_LOAD1',
    attribute => 'start_date',
    value => to_date(v_date,'dd/mm/yyyy hh24:mi')
    Why my job ran at 4:00am this morning, I want it to run at 10:00am?
    Please help! thanks a lot!

    See if dbms_scheduler is running in the right time zone:
    select dbms_scheduler.stime from dual;
    Then try:
    v_date := v_remind_date||'/'||to_char(dbms_scheduler.stime,'mm/yyyy')||' 10:00';
    If dbms_scheduler.stime output is wrong use dbms_scheduler.set_scheduler_attribute('default_timezone', 'PST8PDT')
    for example to change it.

  • Scheduling job to run every 2 weeks in oracle 10g

    Can anyone tell me how I can schedule a job to every 2 weeks start first monday of a month? An example would be great.
    My email address is [email protected]
    Regards
    Manish

    Hi,
    "2 weeks start first monday of a month" sounds like the 1st, third and possibly the fifth Monday of the month.
    So you can try
    repeat_interval=>'FREQ=MONTHLY;BYDAY=MO;BYSETPOS=1,3,5'
    You can use the following to test this expression
    create or replace procedure print_dates
    cal_string in varchar2,
    start_date in timestamp with time zone,
    nr_of_dates in pls_integer
    is
    date_after timestamp with time zone := start_date - interval '1' second;
    next_execution_date timestamp with time zone;
    begin
    for i in 1 .. nr_of_dates
    loop
    dbms_scheduler.evaluate_calendar_string
    (cal_string, start_date, date_after, next_execution_date);
    dbms_output.put_line(to_char(next_execution_date,
    'DY DD-MON-YYYY (DDD-IW) HH24:MI:SS TZH:TZM TZR'));
    date_after := next_execution_date;
    end loop;
    end;
    exec print_dates('FREQ=MONTHLY;BYDAY=MO;BYSETPOS=1,3,5',sysdate,12);
    MON 18-JUN-2007 (169-25) 01:54:37 +00:00 +00:00
    MON 02-JUL-2007 (183-27) 01:54:37 +00:00 +00:00
    MON 16-JUL-2007 (197-29) 01:54:37 +00:00 +00:00
    MON 30-JUL-2007 (211-31) 01:54:37 +00:00 +00:00
    MON 06-AUG-2007 (218-32) 01:54:37 +00:00 +00:00
    MON 20-AUG-2007 (232-34) 01:54:37 +00:00 +00:00
    MON 03-SEP-2007 (246-36) 01:54:37 +00:00 +00:00
    MON 17-SEP-2007 (260-38) 01:54:37 +00:00 +00:00
    MON 01-OCT-2007 (274-40) 01:54:37 +00:00 +00:00
    MON 15-OCT-2007 (288-42) 01:54:37 +00:00 +00:00
    MON 29-OCT-2007 (302-44) 01:54:37 +00:00 +00:00
    MON 05-NOV-2007 (309-45) 01:54:37 +00:00 +00:00
    PL/SQL procedure successfully completed.
    Hope this helps,
    Ravi.
    PS There is a forum dedicated to dbms_scheduler here
    Scheduler

  • Cannot get scheduled task to run

    Hi Folks,
    Googled lots for this but cant find the answer. Sorry to have to post.
    When i browse to the file it works fine, but wont execute from cfadmin. Can anyone help?
    I've checked permissions and they seem to be ok.
    Any help much appreciated.
    Thankyou

    Start by checking the Output to file checkbox. Then indicate a text file to write to.
    Schedule the task for some point in the next five minutes.
    Wait for the time to pass
    Read the text file that was created.
    Oftentimes it will reveal that an error occured, and say what type of error.
    As for permissions, are you checking the persmissions in your web server (IIS???) or in your Windows folder?
    You need to go to the web server interface, and make sure the file in question is allowed to be run by whatever account is used to start the ColdFusion service, since THAT is the user as far as the execution of this file is concerned.

  • Scheduling job to run  every 45 minutes

    Hi, i have to execute a batch evert 45 minutes, everyday except friday.
    i gave the below but its executing evey hourly i.e 60 min not 45 min, can some1 plz help
    BEGIN
    DBMS_SCHEDULER.create_job (
    job_name => 'JOB',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN JOB; END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,SAT,SUN;BYHOUR=9,10,11,12,13,14,15,16,17,18,19,20,21; BYMINUTE=45;',
    end_date => NULL,
    enabled => TRUE,
    comments => 'TO test proc');
    END;
    /

    BEGIN
    DBMS_SCHEDULER.create_job (
    job_name => 'JOB',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN JOB; END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=45;BYDAY=MON,TUE,WED,THU,SAT,SUN',
    end_date => NULL,
    enabled => TRUE,
    comments => 'TO test proc');
    END;
    /

  • Problem with variable in scheduled job

    I'm trying to get the following scheduled job to run:
    switch(config)# scheduler job name backup_job
    switch(config-job)# cli var name timestamp $(TIMESTAMP) ; copy running-config bootflash:/$(SWITCHNAME)-cfg.$(timestamp) ; copy bootflash:/$(SWITCHNAME)-cfg.$(timestamp) tftp://1.2.3.4/
    switch(config-job)# exit
    switch(config)# scheduler schedule name backup_timetable
    switch(config-schedule)# job name backup_job
    switch(config-schedule)# time daily 1:23
    switch(config-schedule)# exit
    switch(config)# exit
    This job is taken directly from multiple Cisco MDS and Nexus documents. From what I can tell, the purpose of this job is to save the running configuration to a file on bootflash with date & time in the file name and then to copy the file from bootflash to tftp server.
    I can create the job and schedule successfully:
    switch(config)#show scheduler job name backup_job
    Job Name: backup_job
    cli var name timestamp $(TIMESTAMP)
    copy running-config bootflash:/$(SWITCHNAME)-cfg.$(timestamp)
    copy bootflash:/$(SWITCHNAME)-cfg.$(timestamp) tftp://1.2.3.4
    ==============================================================================
    switch(config)#show scheduler schedule name backup_timetable
    Schedule Name       : backup_timetable
    User Name           : admin
    Schedule Type       : Run every day at 10 Hrs 48 Mins
    Last Execution Time : Tue Mar  6 10:48:00 2012
    Last Completion Time: Tue Mar  6 10:48:00 2012
    Execution count     : 1
         Job Name            Last Execution Status
    backup_job                        Success (0)
    ==============================================================================
    The scheduled job runs successfully but the files that are created have the variable $(TIMESTAMP) in the file name instead of the actual date and time e.g. switch-cfg.$(TIMESTAMP)
    The logfile contains the following:
    Schedule Name  : backup_timetable                  User Name : admin
    Completion time: Tue Mar  6 10:59:26 2012
    --------------------------------- Job Output ---------------------------------
    `cli var name timestamp $(TIMESTAMP)`
    `copy running-config bootflash:/PEN-9509-2-cfg.$(TIMESTAMP) `
    Copy complete, now saving to disk (please wait)...
    `copy bootflash:/PEN-9509-2-cfg.$(TIMESTAMP) tftp://1.2.3.4 `
    Trying to connect to tftp server......
    Connection to server Established. Copying Started.....
    It looks to me that the $(timestamp) variable is being created successfully and is being replaced with the $(TIMESTAMP) variable but this is not being replaced with the actual date and time.
    The thing I don't get is that this looks to me that we're trying to nest variables and the same Cisco documents from which I get this configuration also state that nested variables are not allowed.
    I have tried this on different hardware - MDS9500, MDS9100, Nexus 5000, Nexus 7000 and different software - SAN-OS 3.3, NX-OS 4.1, NX-OS 5.2 but cannot get it to work. I have also tried to put the commands in a script and run with the run-script command but it still does not work.
    There is probably another method to achieve what this configuration is trying to achieve (and I would like to know if there is) but I want to know if this particular configuration will work.
    Can anyone tell me if they have got this working or can see what I'm doing wrong or can try running this in a lab please?

    I managed to get this resolved with a bit of a workaround. If I put the copy commands in a script and pass the variable to the run-script command as part of the scheduled job then it works ok. Trying to create the variable within the script (or as a separate scheduled job command) still doesn’t work.
    So, creating a script file (script) as follows:
    copy running-config bootflash:/$(SWITCHNAME)-cfg.$(timestamp)
    copy bootflash:/$(SWITCHNAME)-cfg.$(timestamp) tftp://1.2.3.4
    and creating a scheduled job with the following command:
    run-script bootflash:script timestamp=”$(TIMESTAMP)”
    achieves the desired result.

Maybe you are looking for

  • Error "codepage could not be determined for the receiver-system"

    Hi, we use the idoc-adapter to send message from mySAP ERP to PI. All worked fine. So, this morning I have changed the datatype of the messageId from "char" to "int" in mySAP ERP in the customizing menue (install param). So, no message received in SA

  • Problem in Transaction Variant - hide screen

    Hi All, Iam creating a transaction variant for the tcode IE02. There are 4 tabs in which i need the first tab( say A ) to be hidden completely so that the second tab      ( say B)gets displayed as the first tab. I have hidden the tab  A and the field

  • Font is italicized, but only in web browsers

    Hi everyone, I have a strange problem.  I've started work with a new inherited workstation, and my font is italicized, but only in web browsers.  And I *think* only on text that has default styling.  E.g., forms, textareas, Google search results, and

  • My subscription was cancelled although I paid for ...

    I renewed my monthly subscription, and just after doing that, instead of receiving an automatic message confirming the payment, this is the message I received: Your subscription has been successfully cancelled We are sorry to hear that you will no lo

  • Song capacity for iPhone

    I have ran a search for this question but nothing came up. How many songs can you load onto the device? I have a library that is over 2,000 songs, and was interested in purchasing an iPhone this summer. Thanks in advance.