DBMS_SCHEDULER.STOP_JOB

Hi,
I have created a external job to execute exe's in unix box. The steps followed are as follows:
    DBMS_SCHEDULER.CREATE_JOB (
                          job_name=>v_job_name,
                          Job_Type => 'EXECUTABLE',
                          Job_Action => exe_name,
                          Enabled=>FALSE,
                          credential_name=>u_name,
                          number_of_arguments=>3);
    DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(v_job_name,1,file_name);
    DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(v_job_name,2,job_name);
    DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(v_job_name,3,job_request_id);
    DBMS_SCHEDULER.RUN_JOB(v_job_name, TRUE);
The job is created and in unix box the exe is invoked successfully,,,
During this particular time when the unix box exe is still running, if I issue
BEGIN
          DBMS_SCHEDULER.STOP_JOB ( job_name=>kill_job_name , force=> true );
END;
The job is not stopped and the below error message is shown...
ORA-27366: job "140225_4202261012171102" is not running
ORA-06512: at "SYS.DBMS_ISCHED", line 199
ORA-06512: at "SYS.DBMS_SCHEDULER", line 557
ORA-06512: at line 2
27366. 00000 -  "job \"%s.%s\" is not running"
*Cause:    An attempt was made to stop a job that was not running.
*Action:   Verify the status of the job. If the job is running but this
           message is still being returned, contact Oracle support.
Also after sometime the unix box exe completes successfully. This is visible in dba_scheduler_job_run_details - SUCCEEDED..
Please provide your valuable inputs.
Regards,
VM

Do you stop the job with the same user as the owner's?
YES - the owner of  the job remains the same.
(You said "DBA_SCHEDULER_RUNNING_JOBS is not showing any entry till the unix box exe completes.")
--> Yes dba_scheduler_jobs has entries available - STATE column value in DISABLED and no entry were available in dba _Scheduler_running_jobs : Also when checked in unix box it is in running status.
  recap of the code and error reported
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
                          job_name=>v_job_name,
                          Job_Type => 'EXECUTABLE',
                          Job_Action => exe_name,
                          Enabled=>FALSE,
                          credential_name=>u_name,
                          number_of_arguments=>3);
    DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(v_job_name,1,file_name);
    DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(v_job_name,2,job_name);
    DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(v_job_name,3,job_request_id);
    DBMS_SCHEDULER.RUN_JOB(v_job_name, TRUE);
END;
BEGIN
          DBMS_SCHEDULER.STOP_JOB ( job_name=>'140226_5002261313171138' , force=> true );
END;
Error report -
ORA-27366: job "140226_5102261421171151" is not running
ORA-06512: at "SYS.DBMS_ISCHED", line 199
ORA-06512: at "SYS.DBMS_SCHEDULER", line 557
ORA-06512: at line 2
27366. 00000 -  "job \"%s.%s\" is not running"
*Cause:    An attempt was made to stop a job that was not running.
*Action:   Verify the status of the job. If the job is running but this
           message is still being returned, contact Oracle support.
Also I have come across one thread which is not exactly same as mine but has something in it
ORA-27366: job is not running.
Has anyone come across this thread.
Your help and suggestion is very much appreciated.

Similar Messages

  • STOPPED JOBS with expdp and dbms_scheduler

    Hello.
    I am working with the 10g release 2 in a RAC enviroment, and i am trying to put an export job at the scheduler.
    To launch the export i have make a shell script, then first exec the export process and after launch a bzip2 command to compress the resultant dmp file.
    The problem is that the export process finish ok, but it don't compress the file, because the scheduler mark the job as STOPPED.
    The log say:
    REASON="Stop job with force called by user: 'SYS'"
    and the expdp S.O process that launch the extjobo stay runing for ever, like if it was waiting for the expdp to exit and it can`t so the script never arrive to the part that compress the file.
    I put the script that i make to export the schema:
    #!/bin/bash
    export ORACLE_HOME=/opt/oracle/product/10.2.0/db
    export PATH=$PATH:$ORACLE_HOME/bin
    export DIRBACK=/ORACLE/BACKUPS/BMR/Dumps
    export dia=`date +%d_%m_%Y_%H_%M_%S`
    export LOG=dump_backup_bmr_$dia.log
    cd $DIRBACK
    $ORACLE_HOME/bin/expdp userid=oracle_backup/orabck@BMR dumpfile="BMR_BMR_$dia.dmp" schemas=BMR directory=Dumps logfile=$LOG
    cd $DIRBACK
    /usr/bin/bzip2 -f --best ./BMR_BMR_$dia.dmp
    cd $DIRBACK
    /bin/mail -s "DUMP BACKUP BMR DIARIO [$dia]" [email protected] < ./dump_backup_bmr_$dia.log
    I have put several cd $DIRBACK to see if it fail because the script don`t find the dmp file.
    Any idea why it STOP after finish the script ?
    PD: sorry for my poor english.
    Regards

    Hi,
    A stop is only done in two cases - if the user calls dbms_scheduler.stop_job or if the database is shutdown while a job is running. Make sure the database is not being shutdown while the job is running or inside of the job.
    If expdp is still running then this suggests that it is hanging. One possibility for that is that expdp is generating a lot of standard error messages and hanging the job (this is a known issue in 10gR2). You can try redirecting standard output and error to files to see if this helps.
    e.g.
    $ORACLE_HOME/bin/expdp > /tmp/output 2> /tmp/errors
    Hope this helps,
    Ravi.

  • Dbms_scheduler - Can't kill job

    Hi,
    I am using version 10.0.2.3 and have defined a chain successfullly. I ran the chain using :-
    exec DBMS_SCHEDULER.RUN_CHAIN (
    chain_name => 'job_manual_load',
    job_name => 'job_immediate_job',
    start_steps => 'step20');
    I want to kill the job but I cannot seem to using :-
    dbms_scheduler.stop_job(job_name=>'job_immediate_job');
    I tried using using the 'force = true' option but still no luck.
    Any help anyone can provide would be useful ?
    Thanks,

    Can you please try the below steps :)
    1. Determine the owner of the job with the query shown below
    SQL> select job, what, log_user, priv_user from dba_jobs where job=<job_number> ;
    2. Connect to the database using SQL*Plus as the owner of the job (value of priv_user from the
    query results obtained in step 1)
    3. Execute the job removal procedure and commit the transaction.
    SQL> exec DBMS_JOB.remove(<job_number>) ;
    SQL> commit;
    Thanks
    Nisanth Santhan

  • Kill DBMS_SCHEDULER jobs

    Hi,
    How to kill a job which gave only job_name and owner. no other details like sid etc.. how to kill this job?
    Regards

    user738145 wrote:
    I tried this, but it's still sunning .
    SQL> exec DBMS_SCHEDULER.stop_JOB (job_name => 'MM.MM_WEEKLY_JOB');
    PL/SQL procedure successfully completed.
    SQL> exec DBMS_SCHEDULER.DROP_JOB (job_name => 'MM.MM_WEEKLY_JOB');
    BEGIN DBMS_SCHEDULER.DROP_JOB (job_name => 'MM.MM_WEEKLY_JOB'); END;
    ERROR at line 1:
    ORA-27478: job "MM.MM_DAILY_JOB" is running
    ORA-06512: at "SYS.DBMS_ISCHED", line 182
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 615
    ORA-06512: at line 1
    Edited by: user738145 on Sep 20, 2011 6:11 PMIf MM_WEEKLY_JOB was doing many, many DML,
    then it may take a while to ROLLBACK all previously made changes

  • How to stop a running job in 10g Scheduler?

    The following is a duplicate post. I posted the following to the general database forum before seeing that otn has a new scheduler forum:
    I am not able to find in the Admin Guide a method to stop a currently running instance of a job in the 10g scheduler.
    In 9i, I run the following script calling DBMS_JOB.broken and DBMS_JOB.remove to shut down currently running jobs:
    DECLARE
    jobid NUMBER;
    CURSOR c1
    IS
    SELECT job
    FROM dba_jobs
    WHERE priv_user = 'ME';
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1
    INTO jobid;
    EXIT WHEN c1%NOTFOUND;
    DBMS_JOB.broken (jobid, TRUE);
    COMMIT;
    DBMS_JOB.remove (jobid);
    COMMIT;
    END LOOP;
    CLOSE c1;
    END;
    How may I create similar code to shut down currently running jobs using DBMS_SCHEDULER in 10g? According to the Admin Guide, disabling jobs with the force option will still allow the job to finish.
    How can I terminate a running job in 10g?

    You can stop a currently running job using the STOP_JOB api.
    STOP_JOB Procedure
    This procedure stops currently running jobs or all jobs in a job class. Any instance of the job will be stopped. After stopping the job, the state of a one-time job will be set to SUCCEEDED whereas the state of a repeating job will be set to SCHEDULED or COMPLETED depending on whether the next run of the job is scheduled.
    Syntax
    DBMS_SCHEDULER.STOP_JOB (
    job_name IN VARCHAR2
    force IN BOOLEAN DEFAULT FALSE);
    Parameters
    Table 83-44 STOP_JOB Procedure Parameters
    Parameter Description
    job_name
    The name of the job or job class. Can be a comma-delimited list. For a job class, the SYS schema should be specified.
    If the name of a job class is specified, the jobs that belong to that job class are stopped. The job class is not affected by this call.
    force
    If force is set to FALSE, the Scheduler tries to gracefully stop the job using an interrupt mechanism. This method gives control back to the slave process, which can update the status of the job in the job queue to stopped. If this fails, an error is returned.
    If force is set to TRUE, the Scheduler will immediately terminate the job slave. Oracle recommends that STOP_JOB with force set to TRUE be used only after a STOP_JOB with force set to FALSE has failed.
    Use of the force option requires the MANAGE SCHEDULER system privilege.
    Setting force to TRUE is not supported for jobs of type executable.
    Usage Notes
    STOP_JOB without the force option requires that you be the owner of the job or have ALTER privileges on that job. You can also stop a job if you have the CREATE ANY JOB or MANAGE SCHEDULER privilege.
    STOP_JOB with the force option requires that have the MANAGE SCHEDULER privilege.

  • Cannot drop job - says it's running, but it's not

    I did a dbms_scheduler.stop_job (which did not raise any error/warnings), and I killed the database session, but my job is still in user_scheudler_running_jobs view (with null session_id, null cpu_used). When I do a user_scheduler.drop_job, i get an error that the job is running. Any ideas how to get rid of this?
    Thanks
    Paul.

    Hi,
    If a job is forcefully stopped it may take a few minutes for it to be marked as no longer running - it should be done when the database cleans up the process.
    If it remains running after a few minutes (and is not a chain job) then you may be running into a bug tracked internally as bug #7258928 for which a fix may be available through support.
    Hope this helps,
    Ravi.

  • Scheduling a job in Oracle

    Hi ,
    how can i schedule a job from Oracle ??
    this is what i declared
    create or replace PROCEDURE myjob
    IS
    v_job number;
    begin
    dbms_job.submit(v_job,
    'PLSQL_program_I_want_to_run;',
    sysdate,
    'sysdate+1/24');
    end;
    ques :
    1. how shld i schedule it to run every 15 minutes ? i saw from somewhere that 1/144 ==> 10 minutes ? i dun quite understand
    if 1/24 equals 1 hr
    then for 15 minutes
    can i do this ((1/60)*15)/24 ??
    2. once i execute this procedure manually , it shld be running as per the next sheduled dates ?
    3. can this procedure somehow be set in such a way that if oracle db is up after being down for some reasons , this procedure can auto kickoff by itself ?
    appreciate ur advise
    tks & rdgs

    Hi,
    If you are using Oracle release 10g or higher you should be using dbms_scheduler instead of dbms_job for several reasons.
    1) Scheduling every 15 minutes is much easier with dbms_scheduler e.g.
    begin
    dbms_scheduler.create_job(
    job_name=>'myjob',
    job_type=>'plsql_block',
    job_action=>'scott.mypackage.myproc(3);',
    repeat_interval=>'freq=hourly;byminute=0,15,30,45;bysecond=0',
    enabled=>true
    2) Now that jobs have real user-specified names, killing them is easier
    exec dbms_scheduler.stop_job('myjob')
    This will run the job at X:00, X:15, X:30, X:45 as long as the database is running (even after restarts) and you can pick any job_name you want.
    This should meet all your requirements. Hope this helps.
    -Ravi

  • Propagation problem in streams 11.1.0.7

    my propagation job: AQ_JOBS_32 is not working any more but it is still running in the oem streams monitor.
    In the DBA_SCHEDULER_RUNNING_JOBS View the SESSION_ID column value is null.
    I can't kill the job any way.
    I have a contradition between procedures:
    SYS.DBMS_SCHEDULER.STOP_JOB
    and
    DBMS_SCHEDULER.DROP_JOB
    the execution of the procedure:
    SYS.DBMS_SCHEDULER.STOP_JOB
    (job_name => 'SYS.AQ_JOB$_32'
    ,force => TRUE);
    RETURN AN ERROR:
    ORA-27366: no se est ejecutando el trabajo "SYS.AQ_JOB$_32"
    ORA-06512: en "SYS.DBMS_ISCHED", lnea 168
    ORA-06512: en "SYS.DBMS_SCHEDULER", lnea 515
    The execution of the procedure:
    DBMS_SCHEDULER.DROP_JOB
    (job_name => 'SYS.AQ_JOB$_32',force => TRUE);
    RETURN AN ERROR :
    ORA-27478: el trabajo "SYS.AQ_JOB$_32" se est ejecutando
    ORA-06512: en "SYS.DBMS_ISCHED", lnea 182
    ORA-06512: en "SYS.DBMS_SCHEDULER", lnea 615
    WHAT TO DO?

    You have posted this to three different group. Please post to one and only one group. Please drop two of the postings. Thank you.

  • Cancelling or removing the scheduled job

    HI,
    I have job running ...i made use of the following SQL statements
      Select * from All_scheduler_jobs;
      select * from USER_SCHEDULER_JOBS;
      select * from user_scheduler_running_jobs;And i see the job is running ...How do i cancel or remove the job ??
    Thank you!!

    Hi,
    calling dbms_scheduler.disable will prevent a job from running again, but it may still be running and may still exist.
    To stop a running job you can use dbms_scheduler.stop_job and top drop a job you can use dbms_scheduler.drop_job.
    To make sure you are dropping the right job, select owner and job_name from all_scheduler_jobs and use 'owner.job_name' instead of just job_name.
    For further scheduler questions, you can use the scheduler forum here.
    Scheduler
    Hope this helps,
    Ravi.

  • Job locked

    Hi,
    I am trying to drop a job but get the following error:
    ORA-27468: "." is locked by another processI try to disable it and get the same error.
    I looked for a blocking session in v$lock but found none.
    Is there anyway to resolve this issue.
    Thanks.

    Solomon,
    Its a scheduler job, its current state is 'SCHEDULED'. If it is running, wouldn't it have a session blocking it in the v$lock view. As I mentioned, I did not find any.
    Anyway, I ran
    exec dbms_scheduler.stop_job() just in case the job was running but got the same error.
    Thanks.

  • How to stop the job which is running infinite time......

    Hi ,
    I created one procedure with the below code. Using dbms_scheduler i created one job and called that program. That job is in sleep mode for long time. How can i stop that job.
    create or replace procedure bpc_test_batch
    is
    begin
    dbms_lock(30000000)
    end;
    Regards,
    Thiru

    Have you tried this already?
    exec dbms_scheduler.stop_job('Your_Job_Name',true);

  • How to stop a refresh job

    Hi,
    on 10g R2 Win 2003,
    I have 10 refresh jobs running since 10 Jan. What is the best way to stop them ?
    In DBMS_JOB package I do not see STOP or KILL option.
    SUBMIT procedure
      Submits a new job to the job queue. 
    REMOVE procedure
      Removes specified job from the job queue. 
    CHANGE procedure
      Alters any of the user-definable parameters associated with a job. 
    WHAT procedure
      Alters the job description for a specified job. 
    NEXT_DATE procedure
      Alters the next execution time for a specified job. 
    INSTANCE procedure
      Assigns a job to be run by a instance. 
    INTERVAL procedure
      Alters the interval between executions for a specified job. 
    BROKEN procedure
      Disables job execution. 
    RUN procedure
      Forces a specified job to run. 
    USER_EXPORT procedure
      Recreates a given job for export. 
    USER_EXPORT procedure
      Recreates a given job for export with instance affinity. 
    Thank you.

    Thanks Helios,
    Stopping Jobs
    You stop one or more running jobs using the STOP_JOB procedure or Enterprise Manager. STOP_JOB accepts a comma-delimited list of jobs and job classes. If a job class is supplied, all running jobs in the job class are stopped. For example, the following statement stops job job1 and all jobs in the job class dw_jobs.
    BEGIN
    DBMS_SCHEDULER.STOP_JOB('job1, sys.dw_jobs');
    END;How to find job1 (is it job name ? ) and can we not write job class ?
    Regards.

  • Trouble removing disabled jobs from oracle scheduler.

    Hi,
    When I run the query :-
    select job_name,job_subname,program_name,enabled,auto_drop,state
    from all_SCHEDULER_JOBS
    where enabled = 'FALSE'
    and state = 'RUNNING'
    I get the following results :-
    job_name     job_subname     program_name     enabled     auto_drop     state
    DAILY_LOAD     STEP30     EQUIP_STATUS_EXECUTE_SCRIPT     FALSE     TRUE     RUNNING
    WEEKLY_CHAIN_IMMEDIATE_JOB     STEP30_1     MONITOR_EXECUTE_SCRIPT     FALSE     TRUE     RUNNING
    There are no entries on the 'ALL_SCHEDULER_RUNNING_CHAINS' table for these jobs.
    How can I remove these jobs that are not disabled but have a state of 'running'.

    Hi DomBrooks,
    When I try :-
    begin
    dbms_scheduler.stop_job(
    'WEEKLY_CHAIN_IMMEDIATE_JOB',
    TRUE
    end;
    I get :-
    ORA-27475: "XXXXX.WEEKLY_CHAIN_IMMEDIATE_JOB" must be a job
    ORA-06512: at "SYS.DBMS_ISCHED", line 164
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 483
    ORA-06512: at line 2
    I get the same when I try :-
    BEGIN
    DBMS_SCHEDULER.DROP_JOB (
    job_name => 'WEEKLY_CHAIN_IMMEDIATE_JOB');
    END;
    When I try :-
    select job, log_user, what from user_jobs;
    I get no rows returned.
    From what I can tell it seems the oracle scheduler does not think the job exist even though it shows up as 'disabled' in the all_scheduler_jobs query.
    I am wondering if a db recycle might fix the problem or if you have any other ideas?
    I really appreciate your help.

  • Activation Job running Forever

    Dear HANA Development Team,
    I created an Analytic view in the SAP HANA Sandbox system and the activation job is running for ever and the view is not getting activated.
    Could you please help me in resolving the issue?
    Thanks,
    Goutham

    i have same problem here. i tried
    sql>DBMS_SCHEDULER.STOP_JOB ('REFRESHFROMMETALINK', TRUE);
    where TRUE is FORCE STOP_JOB, but it doesn't seem to find the job class or job.
    Perhaps the jobs scheduled by OEM are administered somewhere else.
    Can anyone help with this ?
    10.1.0.4 SEO on w32

  • Dbconsole job running forever

    Hi,
    I have a job (refreshfrommetaling) running for almost a month now. The database and the oms have both been down in that time. After the bounce the job still had the status running. So I tried to stop the job and now the status is 'stopping' and it does not look like it's ever going to get stopped.
    How can I get rid of this execution ?
    10.1.0.3 EE on macosX
    regards,
    Ronald
    http://homepage.mac.com/ik_zelf/oracle

    i have same problem here. i tried
    sql>DBMS_SCHEDULER.STOP_JOB ('REFRESHFROMMETALINK', TRUE);
    where TRUE is FORCE STOP_JOB, but it doesn't seem to find the job class or job.
    Perhaps the jobs scheduled by OEM are administered somewhere else.
    Can anyone help with this ?
    10.1.0.4 SEO on w32

Maybe you are looking for

  • Ejecting iPod causes other USB devices to be ejected at the same time.

    When ejecting an iPod Nano 4g from iTunes under Windows Vista, all other USB devices attached to the computer are also ejected at the same time (external hard drives, thumb drives, scanners, etc.). Is there a way to prevent this from happening?

  • Dispute case auto closing

    Hi, I have created a dispute case on customer noted item, when i will reverse the noted item the dispute case is not auto closed, it is still in open status. can any one give me solution for this. Regards, Prakash

  • FM for ORDERS05 Outbound Idoc.

    Hi, I have to post an idoc of basic type ORDERS05 from a custom program. I have populated the fields for control header and the data section of the idoc.I tried using the FM IDOC_OUTPUT_ORDERS to post the idoc,but when I went and checked in WE05,ther

  • IMovie 09 Full Screen mode plays the wrong project.

    I just brought home a new MacBook Pro 15" 2.8 GHz with 4 GB & 500 GB HD, I have existing iMovie 09 projects on an external hard drive. When I click on a project, select for it to play full screen and it plays an entirely different project that's not

  • Question about use Windows Installer SDK

    Hi, I want to Use C# code to read .MSP file and get inside file list. Such as: you can get a hotfix from here https://support.microsoft.com/en-us/kb/3000847 and after extract the exe you can get a .MSP file. And 3 DLL files are including in the .MSP