How to stop a scheduled job using OMB*Plus ?

Hello everyone,
I use a OMB*Plus script to deploy a project in various environments. This includes scheduled jobs.
In this context, I need to stop the schedules of the previous versions to avoid a script crash.
I found the OMBSTOP command thad could do, but I need to retrieve the job ID of the schedule I want to stop. And I don't know how to get the Job ID.
I could get it from a previous launch and save it somewhere, but it wouldn't work if the schedule was manually stopped and restarted. Maybe is there a command that lists the running / scheduled jobs and their IDs? I didn't find it.
Thanks in advance for your help.
Cedric.

Frankly, I cannot see where this is available via pure OMB+, however you could back-door it if if you can figure out how to get these values from the public views (I would guess from the "Scheduling Views" section at http://download-east.oracle.com/docs/cd/B31080_01/doc/owb.102/b28225/toc.htm).
Then you could use my SQL library from OMB+ to get these values and stop the schedules before deploying. you can save this file as omb_sql_library.tcl and then just "source /path/to/omb_sql_library.tcl in your own script to make the functions available in your script.
{code}
package require java
# PVCS Version Information
#/* $Workfile: omb_sql_library.tcl $ $Revision: 1.0 $ */
#/* $Author: $
#/* $Date: 03 Apr 2008 13:43:34 $ */
proc oracleConnect { serverName databaseName portNumber username password } {
# import required classes
java::import java.sql.Connection
java::import java.sql.DriverManager
java::import java.sql.ResultSet
java::import java.sql.SQLWarning
java::import java.sql.Statement
java::import java.sql.CallableStatement
java::import java.sql.ResultSetMetaData
java::import java.sql.DatabaseMetaData
java::import java.sql.Types
java::import oracle.jdbc.OracleDatabaseMetaData
# load database driver .
java::call Class forName oracle.jdbc.OracleDriver
# set the connection url.
append url jdbc:oracle:thin
append url :
append url $username
append url /
append url $password
append url "@"
append url $serverName
append url :
append url $portNumber
append url :
append url $databaseName
set oraConnection [ java::call DriverManager getConnection $url ]
set oraDatabaseMetaData [ $oraConnection getMetaData ]
set oraDatabaseVersion [ $oraDatabaseMetaData getDatabaseProductVersion ]
puts "Connected to: $url"
puts "$oraDatabaseVersion"
return $oraConnection
proc oracleDisconnect { oraConnect } {
$oraConnect close
proc oraJDBCType { oraType } {
#translation of JDBC types as defined in XOPEN interface
set rv "NUMBER"
switch $oraType {
"0" {set rv "NULL"}
"1" {set rv "CHAR"}
"2" {set rv "NUMBER"}
"3" {set rv "DECIMAL"}
"4" {set rv "INTEGER"}
"5" {set rv "SMALLINT"}
"6" {set rv "FLOAT"}
"7" {set rv "REAL"}
"8" {set rv "DOUBLE"}
"12" {set rv "VARCHAR"}
"16" {set rv "BOOLEAN"}
"91" {set rv "DATE"}
"92" {set rv "TIME"}
"93" {set rv "TIMESTAMP"}
default {set rv "OBJECT"}
return $rv
proc oracleQuery { oraConnect oraQuery } {
set oraStatement [ $oraConnect createStatement ]
set oraResults [ $oraStatement executeQuery $oraQuery ]
# The following metadata dump is not required, but will be a helpfull sort of thing
# if ever want to really build an abstraction layer
set oraResultsMetaData [ $oraResults getMetaData ]
set columnCount [ $oraResultsMetaData getColumnCount ]
set i 1
#puts "ResultSet Metadata:"
while { $i <= $columnCount} {
set fname [ $oraResultsMetaData getColumnName $i]
set ftype [oraJDBCType [ $oraResultsMetaData getColumnType $i]]
#puts "Output Field $i Name: $fname Type: $ftype"
incr i
# end of metadata dump
return $oraResults
# SAMPLE CODE to run a quick query and dump the results. #
#set oraConn [ oracleConnect myserver orcl 1555 scott tiger ]
#set oraRs [ oracleQuery $oraConn "select name, count(*) numlines from user_source group by name" ]
#for each row in the result set
#while {[$oraRs next]} {
#grab the field values
# set procName [$oraRs getString name]
# set procCount [$oraRs getInt numlines]
# puts "Program unit $procName comprises $procCount lines"
#$oraRs close
#oracleDisconnect $oraConn
{code}
So you would want to connect to the control center, query for scheduled jobs, stop them, and then continue on with your deployment. I assume that you also need to pause and check that an scheduled job in mid-run has time to exit before moving ahead. You could do a sleep loop querying against system tables looking for active sessions running mappings and waiting until they are all done or something if you really want to bulletproof the process.
Hope this helps,
Mike

Similar Messages

  • How to stop a Scheduler Job in Oracle BI Publisher 10g

    Hello!
    Can someone tell me how can I stop a scheduler job in Oracle BI Publisher 10g?
    I scheduled a bursting job to run a report but is running during two days.
    I would like to stop it.
    Thanks.
    Edited by: SFONS on 19-Jan-2012 07:16

    Unfortunately there is no way to stop a job once it is being executed. Yes as you read, it is not possible once job has started.
    Same thing applies for running queries.
    Once queries are sent to the DB BIP loses control over them. The message you see (if any) "Click Here to Cancel" does not stop any query
    it is just a message.
    I guess you will have to stop/kill the process in your DB
    regards
    Jorge
    p.s If you consider your question answered then please mark my answer as *"Correct"* or *"Helpful"*

  • How to properly create a calendar using OMB*Plus, to schedule a workflow ?

    Hello all,
    I want to schedule a workflow when deploying via OMB*Plus.
    It looks like I have a syntax error, but this happens even with the example given on
    [the OMBCREATE CALENDAR documentation|http://download-uk.oracle.com/docs/cd/B31080_01/doc/owb.102/b28225/omb_4create_1.htm#sthref1427]
    My code is:
    OMBCREATE CALENDAR 'SCH_DELTA_test2' ADD SCHEDULE \
    SET PROPERTIES (REPEAT_EXPRESSION)\
    VALUES ('FREQ=WEEKLY;INTERVAL=1;BYDAY=TUE WED THU FRID SAT;BYHOUR=12;BYMINUTE=0;BYSECOND=0') ]
    If I copy-paste an example from the doc, the last line becomes :
    VALUES ('FREQ=MINUTELY;INTERVAL=20') ]
    The result is:
    OMB00001: Encountered \' at line: 1, column: 95. Was expecting one of: <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <QUOTED_STRING> ...
    The position line: 1, column: 95 is the opening quote of the last line, just before FREQ=
    I can't find any way to get this working. If anyone see something wrong or missing, please advise. Thanks in advance.
    Cedric.

    Hello Oleg,
    I followed your advice, but OMB*Plus doesn't like it, as it seems :
    the code:
    OMBCREATE CALENDAR 'CAl_SCH_DELTA' ADD SCHEDULE 'SCH_DELTA' SET PROPERTIES (REPEAT_EXPRESSION) VALUES ('FREQ=MINUTELY;INTERVAL=20')
    the error:
    OMB00001: Encountered SCH_DELTA at line: 1, column: 49. Was expecting one of: <E
    OF>
    "SET" ...
    Regards
    Cedric.

  • How do we stop the scheduled job ?

    Hi all,
    how do we stop the scheduled job if it is already been  scheduled and running in the background.
    please send your suggestions,
    Rajesh.

    Hi Rajesh
      Each and every job is associated with a Job Number, you need to specify the exact number to extract the correct details.
      Please check table: <b>TBTCO</b> for the same. For more details refer to tables of pattern TBTC*.
    Kind Regards
    Eswar

  • How to schedule jobs using

    Hello Gurus,
    I have a job in SM37 scheduled using the prog. RSBATCH1 with var.&0000000000049. When I go to SE38, give the program name and the var and execute it, there is nothing entered in the 'Jobname' in the user selection screen.
    But when it is executed it runs two(2) Infopackages for that variant.
    I want to remove one of the infopackages. How do I achieve this?
    Where can I get more info on how to schedule jobs using
    RSBATCH1.
    Thanks in advance
    Simmi

    Hi Simmi,
    If the variant is like "var.&0000000000049" in  the job then the program does not ahve any variant.
    To remove the infoapckage for that job goto the infoapckage -> scheduling tab -> Scheduling option -> remove the job from "after job" tab.
    Bye
    Dinesh

  • How to stop the background job "Sap_collector_for_job_statistic"

    Dear All,
    Kindly let me know how to stop the Background job "Sap_collector_for_job_statistic" which is running everyday.
    We want to stop this background job.
    Kindly suggest.
    Regards,
    Mullairaja

    Select the Job using SM37 transaction. In the Menu Choose
    Job ---> Cancel Active Job.
    Before you do this it may be good idea to check the pid using SM50.
    It will be using a Background work process. Check the pid and the status.
    Select the same and in the Menu Choose Process --> Cancel with Core.
    Refresh and check in SM37 for the Active and Cancelled Jobs.

  • How to stop the v3 jobs?

    how to stop the v3 jobs?

    Goto SM37... Give Job Name as LIS. User  *.
    Enable Scheduld, Released and Active Check boxes...execute.
    check job belongs to your Application.
    You cancel the Active Job if you stop the Job.
    or
    You can make Released Job to Scheduled (Menu option Job --< Released --> Scheduled.).
    Hope this helps.
    Nagesh Ganisetti.

  • How to stop a batch job

    Hi Folks,
    Please do let me know how to stop a batch job.
    I am having a batch job which will run a program for every 15 mins in order to update some Z-tables.
    I need to debug and do some investigation. Meanwhile when I am doing this debugging it may take 20-30 mins also. Here this background job scheduling is getting started and the table getting updated and I am not able to do any investigation..
    Can anyone please let me know how can I stop this batch job scheduled every 15 mins taht is make it stop for an hour. So that after my investigation it should keep on running the batch job for every 15 mins.
    Regards
    Mac

    If u schedule this job from SM36 then u can make it active or inactive from there only. From SM36 ..give the name of ur job then press Extended job selection button..then in next screen choose Active tab and there u can check the checkbox "Job on longer active in time interval" and then give ur time.
    Hope this info will help u.
    Regards,
    Joy.

  • HOW TO STOP A SCHEDULING A PROCESS CHAIN IN SAP BPC

    Hello Expert,
    Can Any 1 tell me  how to stop a scheduling of a process chain in sap bpc ??

    Hi Neeraj,
    Your question is not clear.
    If you are asking - How to delete a schedule which runs a process chain/DM package from EPM, then please go to Data Manager -> click View Status arrow -> select view schedule status -> select the schedule, right click and choose delete schedule.
    Neha

  • How can I suspend the job using IPP_CANCEL_JOB of ipp api

    hi, Can anyone help how can I suspend the job using IPPCANCELJOB of ipp api,so that I can cancel my previous job.
    thanks

    As before, you should try http://lists.apple.com/mailman/listinfo/printing.

  • How to call a ODI Job using Command line?

    Hello All,
    Please help me on this..
    How to call an ODI Job using Command line?
    Thanks
    Ravikiran

    Generate a scenario of your package. Then go to <ODI_HOME>/oracledi/agent/bin in command prompt and invoke startscen command .
    startcmd.sh OdiStartScen -SCEN_NAME=scn_load_data -SCEN_VERSION=001 -CONTEXT=GLOBAL -AGENT_CODE=odiSchedAgent001
    Bhabani
    http://dwteam.in

  • Problem using OMB*Plus

    Hello,
    I'm getting this error when trying to connect to design repository via OMB*Plus:
    "OMB01118: Could not connect to repository! PRS-00306: Internal Error: Could not undo reservation for client .
    Please contact Oracle Support with the stack trace and details on how to reproduce it."
    Here's the interesting part:\
    1) I CAN connect to the same repos. from OWB client AND
    2) I can connect to this repository from a different box using OMB*PLus.
    Further, OMB*PLus itself on the box in question is not screwed up, as I can connect to repos. on other boxes!
    What could the problem be?
    Thanks in advance,
    Alex.

    I went further with investigating my scripting problem:
    OMBCONNECT OWBRT92USER/[email protected]:1521:EDW USE REPOSITORY 'OWBRT92' USE MULTIPLE_USER_MODE
    OMB01118: Could not connect to repository! Database connection error!
    So I tried to alter pieces of my connect statement:
    OMBCONNECT OWBRT92USER/[email protected]:1521:wrong USE REPOSITORY 'OWBRT92' USE MULTIPLE_USER_MODE
    API0420: Error message: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNN
    UM=153092608)(ERR=12514)(ERROR_STACK=(ERROR=(CODE=12514)(EMFI=4))))
    API0424: Please check if the the Oracle Service Name is correct.
    Obviously, connect string to database is OK !
    OMBCONNECT OWBRT92USER/[email protected]:1521:EDW USE REPOSITORY 'OWBRT92' USE MULTIPLE_USER_MODE
    API0420: Error message: ORA-01017: invalid username/password; logon denied
    And obviously, repository user is well identified !
    Since I tried using either 'SINGLE_USER_MODE', 'MULTIPLE_USER_MODE' and nothing and it brings the very laconic same OMB01118 message, I guess it has to deal with "use repository clause
    I tried to alter it to see what happens:
    OMBCONNECT OWBRT92USER/[email protected]:1521:EDW USE REPOSITORY 'WRONG' USE MULTIPLE_USER_MODE
    ...but it brings the very same OMB01118 message.
    Now I tried to connect to development repository:
    OMBCONNECT OWBDEV92/[email protected]:1521:EDW USE REPOSITORY 'OWBDEV92' USE MULTIPLE_USER_MODE
    Connected.
    Well, cool, 'means I can connect to devt. repository but I want to deploy to runtime and if I usE:
    OMBDEPLOY SPECIFICATION FROM C:\TEMP\deploytest.xml
    it yields:
    OMB05608: Connection to Runtime Platform has not been made.
    Well, what can I do ?
    Documentation B12187_02_Warehouse Builder Scripting Reference.pdf (chap. 2-12, page 48) mentions a OMBCONNECT_RUNTIME command that does not exist and the example is a strict copy of OMBCONNECT (even the example does not use OMBCONNECT_RUNTIME)
    OMB+> OWMBCONNECT_RUNTIME
    invalid command name "OWMBCONNECT_RUNTIME"
    I'm really stuck.
    Does anyone else connect to a runtime repository to deploy from a xml file ?
    Thanks

  • 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.

  • How to Schedule Job using Database Control for SQLPLUS script?

    Hi All,
    I am using Database version 10.2. I would like to schedule a SQLPLUS script job using Database control (Not using Grid Control!). The following is the script.
    ========================================================
    define OEM_FRIENDLY=1
    define OWB_BACKGROUND=0
    set serveroutput on
    set verify off
    whenever sqlerror exit failure;
    define REPOS_OWNER='&1.'
    define LOCATION_NAME='&2.'
    define TASK_TYPE='&3.'
    define TASK_NAME='&4.'
    define SYSTEM_PARAMS='&5.'
    define CUSTOM_PARAMS='&6.'
    alter session set current_schema = &REPOS_OWNER.;
    set role owb_d_&REPOS_OWNER., owb_o_&REPOS_OWNER.;
    variable exec_return_code number;
    begin
    -- Initialize Return Code
    :exec_return_code := wb_rt_api_exec.RESULT_FAILURE;
    -- Run Task
    :exec_return_code := wb_rt_api_exec.run_task('&LOCATION_NAME.',
    '&TASK_TYPE.',
    '&TASK_NAME.',
    '&CUSTOM_PARAMS.',
    '&SYSTEM_PARAMS.',
    &OEM_FRIENDLY.,
    &OWB_BACKGROUND.);
    end;
    exit :exec_return_code;
    ===========================================================
    Is it possible to schedule SQLPLUS script with 6 different parameters? If yes then how can I schedule for monday to friday or only for Saturday and sundays.
    Please provide brief steps.
    Thanks for your help in advance.
    - Mehul

    Let me explain to you about scheduler.
    You can schedule a pl/sql stored procedure TEST_S as follows...
    Begin
    dbms_scheduler.create_job(
    job_name=>'MY_JOB',
    Job_Type=>'STORED_PROCEDURE',
    job_action=>'TEST_S',
    start_date=>sysdate,
    repeat_interval=>'freq=monthly;BYDAY=MON,TUE,WED,THU,FRI',
    end_date=>null');
    END;
    You can also also execute o/s script like .bat or .sh. For this job type should be EXECUTABLE.
    Example of converting a .sql script in .bat script...
    insert.sql
    insert into dept values(50,'IT','LONDON');
    exit
    insert.bat
    sqlplus scott/tiger @insert.sql
    Executing now...
    C:\Documents and Settings>insert.bat
    C:\Documents and Settings>sqlplus scott/tiger @insert.sql
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Mar 1 08:01:00 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    1 row created.
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - P
    oduction
    With the Partitioning, OLAP and Data Mining options
    C:\Documents and Settings>
    So first read about DBMS_SCHEDULER and do the work in prompt. Then you can go and schedule it even by database control.
    Scheduling by database control...
    http://www.oracle.com/technology/oramag/oracle/04-jul/o44tech_dba.html
    Scheduler
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm#CIHEHDHA
    PS: By default each job you created is disable state. Please enable it by enable procedure of DBMS_SCHEDULER package.

  • Stopping a scheduled job in OWB

    I need to re-deploy a scheduled job and cannot do so because the job is running. How do I stop the job from the OWB control center (or elsewhere)?
    Thanks,
    Dave

    Hi,
    I don't know if there is an easier way but this should work:
    1. run the script list_requests.sql (it should exist inside your owb home at owb\rtp\sql) using the workspace name as parameter
    2. the job should be listed on the EXECUTIONS section
    3. run the script deactivate_execution (same location as list_requests.sql) passing the audit_id and your workspace as parameteres
    Regards,
    Bruno

Maybe you are looking for

  • AIR-LAP1242G-E-K9 do not work with AIR-CT5508-K9 while AIR-LAP1142N-E-K9 do

    Hello, we do have a site where we need to deploy AIR-LAP1142N-E-K9 and AIR-LAP1242G-E-K9 APs. We have two AIR-CT5508-K9 controllers with SW version                  6.0.188.0. AIR-LAP1142N-E-K9s work okay, as expected, we do not have any problems wit

  • Reduce text on 8 1/2 x 11 paper

    I have text on an 8 1/2 x 11 paper which I want to reduce further how do I do it?  Thx

  • What is normalize dialog

    I am still learning the program and have 2 questions: 1. What is normalize dialog? and 2. What does auto smart tone learning mean? I am using Premier Elements 12. Many thanks folks

  • Istore access

    Hi am based in south africa. Can't access any music or movies only applications. Any help?

  • Keeping track of visitors

    Hi- I've recently posted a blog on the imac site. Is there any way to keep track of who views the site? Thanks very much. Joel