Sqlplus script to disable alerts and scheduled jobs

Hi
We have a painful task after every clone to manually disable oracle alerts (all 1000 of them from alerts -alerts manager responsibility) and also disable scheduled concurrent jobs (again all 1000 scheduled jobs) manually checking all pending jobs.
its ok to have them in prod but not test.
Is there a sql script which can disable ALL alerts and another sql which stops all scheduled request jobs in concurrent requests screen.
Thanks
aj

A similar query is used as part of the document listed above.
There is a need to change two sets of concurrent requests to prevent execution on a cloned instance.
1) Terminate 'Running' Requests
2) Set Pending jobs to 'On Hold'
1) Set Terminating or Running to Completed/Terminated:
UPDATE fnd_concurrent_requests
SET phase_code = 'C', status_code = 'X'
WHERE status_code ='T'
OR phase_code = 'R';2) Place Pending/(Normal/Standby) to On Hold:
SQL> UPDATE fnd_concurrent_requests
SET hold_flag = 'Y'
WHERE phase_code = 'P'
AND status_code in ('Q','I');

Similar Messages

  • What is released job and scheduled job?

    Hi BW experts,
    Please let me know what is released job and scheduled job?

    Hi
      <b>Released job</b>:The job has been fully defined, including a start condition. Without a start condition, a job cannot be released.
    Only an administrator or a user with appropriate authorizations for background processing can release a job, preventing unauthorized users from running jobs without approval.
    <b>scheduled job:</b> The job which is scheduled for a particular time and that will come into the queue of jobs to which time it is scheduled.
    U can see these jobs in SM37 tcode

  • Disable alert and dialog box in vb script

    Pls. help to disable the alert and dialog box for indesign CS3 in vb script?
    I have try to add the following code to my vb script:
    myIndesign.ScriptPreferences.UserInteractionLevel=1699640946
    (Indesign still display missing Link alert box)
    myIndesign.ScriptPreferences.UserInteractionLevel=idUserInteractionLevels.idNeverInteract
    (Indesign shows need object idUserInteractionLevels)
    myIndesign.ScriptPreferences.UserInteractionLevel=idNeverInteract
    (Indesign shows values should be idUserInteractionLevels enumerator)
    Vb script is running outside Indesign. Script will be automatically stop running when open a missing link document.
    Pls. Help. Thank you!

    Check out this link, it might help.
    http://indesign.objectsdefined.com/adobe/indesign/CS3/clsidUserInteractionLevels.htm

  • Launchd and scheduled jobs

    From what I've read, you can't rely on launchd for scheduled jobs - in my case I want to back up at 3am in the morning - upon it being woken by another application.
    Now that cron is disabled - how can I achieve this scheduled tasks?
    I cannot believe that Apple have released into production a component that simply does not work ( that relies on the machine being on 100% without sleeping etc ).

    Hi Stewart:
    I can't speak to 10.4.3, but in 10.4.2, I just rebuilt my /etc/crontab file the way I wanted it, because cron still is a part of 10.4.2, and my Mac stays on 24x7.
    Looking at the "OEM" version of Tiger's crontab, it appears that what they did was basically make a crontab file full of comment lines, so I guess when cron parsed it, there was nothing there telling cron that it had to launch something.
    So, if you make a bonafide crontab file, I think (in 10.4.3) you'll be okay. If you don't recall the format for the crontab file, or don't have access to an old legacy one from 10.2 or so (I never had 10.3 so don't know whether they used cron or launchd), I can post mine here, if you'd like, that you could use as a model. I'll check back sometime later this week and see if you'd like me to post it here.
    Anyhow, after I made a new crontab file, I had asked on this forum how to disable the launchd daily/weekly/monthly stuff. Although it isn't important to do so, I figured, why run it more often than once daily/weekly/monthly, at what I understood would be random times of day, if the jobs would even be run at all, based on all the reports about undesired behavior caused by reboot, sleep, etc.?
    Some smart person on this forum told me that I could take the three com.apple.periodic-daily/weekly/monthly.plist files and save them off somewhere else other than in /System/Library/LaunchDaemons. So I just tarballed 'em (tar -cvvvzf com.apple.periodic-\*.plist.tgz com.apple.periodic-monthly.plist com.apple.periodic-weekly.plist com.apple.periodic-daily.plist) and left the tarball right there in /System/Library/LaunchDaemons, then deleted the originals. If I ever need 'em again I can just "tar -xvvvzf com.apple.periodic-\*.plist.tgz".
    So as near as I can tell, I don't even have to fuss about whether the daily/weekly/monthly jobs are being launched by launchd, and as near as I can tell, the daily/weekly/monthly jobs are being run daily, weekly, and monthly, as appropriate, and at the desired times of day, by cron and crontab.
    Quicksilver G4   Mac OS X (10.4.2)  
    Quicksilver G4    
    Quicksilver G4    

  • Analytical snapshots and scheduled jobs

    Hello,
    for extended analytical reports we need to make the snapshots of our statistic datas every day.
    There is an option of doing snapshots of the Project in Project Management, but we need to have snapshots of our own BO's or data sources. Is there any possibility to do this?
    In case snapshots can't be done by the system we also would perform it in coding, by creating business objects with required datas and saving them. But we need to do the saving automatically (regularly).
    In Project Management it is also possible to run scheduled snapshots. How can we schedule jobs (it would be enough if we could execute an action which saves our datas at scheduled time)?
    We have found only "Mass Data Run Process" in this context but the MDR's can be done only for the special standard Floorplans, aren't they?
    Best regards,
    Leonid Granatstein.

    Hi,
    currently it is not possible to create snapshots for partner BO content by a standard process.
    Also defining a mass data run object, which you could schedule and where you could implement the snapshot by yourself, is not available for partners yet.  So we have no standard mechanism available to get your task done with the use of the current implementation possibilities.
    The only option I see is that you develop the snapshot activity on your own in ByD studio.
    To trigger the snapshot activity on a regular basis, I only see the option to trigger this from outside. An option would be to define a web service or an XML file upload.
    You could write for example a small program ( by using PHP or .NET) on a PC which runs on a regular basis and which uploads an XML file or calls a web service. This then triggers the snapshot activity you have programmed in ByD Studio.
    I hope this helps.
    Regards,
    Thomas

  • Database shutdown and scheduled jobs

    Hi:
    We are planning to shut down our server for two days, and would like to know following.
    1. We have about 100 jobs scheduled throughout the day. We will shut down the server for two days. What will happen when we restart the server, will same daily scheudle job will execute twice ?
    2. Is there any place in OEM where you select all schedule jobs and suspend all ?
    3. Is there any place in OEM where you select all suspended jobs and resume all ?
    Thanks

    Hi,
    If all your jobs are running from OEM, then simple solution will be to define blackout period for the duration your server will be out, so when the server comes up then jobs will be started except for the jobs to be run during black out period.
    Regards

  • Please help me in creating and scheduling jobs. Its very urgent.

    RDBMS: Oracle 9.2.0.4
    OS: win2k
    OWB Client: 9.2.0.2.8
    OWB Repository: 9.2.0.2.0
    Hi,
    I have created a "process workflow" using OWB and deployed it successfully. Now, I would like to schedule this process. I have installed management server and tried to schedule it but all in vain. I am not able to understand anything. I have read "oracle administrator pdf" and couldnt understand anything. Please dont advise me to read any notes or pdf's because I have tried a lot and was not able to figure out the configuration.
    I have a target database named "TARGET". I would like to schedule the workflow process I have created. I am not able to understand preferred credentials and how to execute the XML script generated by the "process workflow". Please help me coz its very urgent.
    -Aditya

    Why dont you try this? I found it after few tries,
    In the create job dialog box
    under General
    for Override Node Preferred Credentials for entire job
    username and password should be the NT or Unix
    login where your Runtime database Server reside.
    under Parameter
    for Override preferred credentials
    username and password should be of your runtime
    repository user
    Regards,
    Shree

  • Create and Schedule Job - Problem

    hi everyone,
    I'm trying to write an Job which I would like to schedule. Function of this Job is to delete all entries older than 1 Month in the table "tabelle1". As I understand, you can put in job_action the procedure statement.
    BEGIN
    DBMS_SCHEDULER.create_job (
    job_name => 'delete_all_entries',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN DELETE FROM tabelle1 WHERE last_date < (SYSDATE - INTERVAL '1' MONTH) AND (status = 'processed'); END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'FREQ=WEEKLY;BYDAY=SAT;BYHOUR=10;BYMINUTE=00',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    END;
    I get the following error message:
    ORA-06550: Zeile 5, Spalte 118:
    PLS-00103: Encountered the symbol "1" when expecting one of the following:
    ) , * & = - + < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like like2
    like4 likec between || multiset member submultiset
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause: Usually a PL/SQL compilation error.
    *Action:
    What am I doing wrong?.
    Thx in advance!

    Hi,
    If you want to include a single-quote in a string literal, then use 2 single-qutoes in a row, like this:
    'BEGIN DELETE FROM tabelle1 WHERE last_date < (SYSDATE - INTERVAL ''1'' MONTH) AND (status = ''processed''); END;',or use Q-notation:
    Q'{BEGIN DELETE FROM tabelle1 WHERE last_date < (SYSDATE - INTERVAL '1' MONTH) AND (status = 'processed'); END;}',As you posted it, the single-quote right before the 1 indicated that the string literal ended there, and that 1 was outside of the qutoes.
    By the way,
    SYSDATE - INTERVAL '1' MONTH isn't always a valid date (when SYSDATE is October 31, for example).
    Use
    ADD_MONTHS (SYSDATE, -1)instead.
    Edited by: Frank Kulash on Sep 18, 2012 9:41 AM

  • Enabling Recovery and scheduled jobs

    We have a job that is scheduled to run every three hours and we have it set up to enable recovery.  The job has about 10 dataflows in it.  If the job fails and is not corrected should the next run of it in three hours pick up from the point it failed or would it start at the beginning?  It appears to be starting again at the beginning.
    In some cases the job is not actually failing (i.e. no red X) but we get a warning even though the trace log message is "Process terminated because its parent had died.".   There is no error log but the job does stop.  I am wondering if because the system does not see it as an error the next run would just start new vs recovering.

    Arun - We tried the following test.
    A test job has 3 data flows in which  2nd Data Flow does not work as it has authorization issue .
    Scheduled a test job where work flows are normal(No recovery unit set) and execution parameter  ‘Enable Recovery’ was set .  Scheduled the job to repeat every 7 minutes.
    First run as per the Schedule ,failed due to 2nd data flow issue.
    Second run as per the schedule (2nd Data flow was corrected), Recovered, and started from the failed step that is 2nddata flow.
    Third run and Fourth Run as per the Schedule (7 and 14 minutes later) but no dataflows were executed.
    It looks like it uses the recovery information from the 2nd run (which completed the first run successfully) and then ran nothing.  I would have expected that the job would have run from the first dataflow since the prior job had completed succesfully. 
    Any thoughts on how we can set this up in an automated fashion so that if a run is recovered and completes successfully the next run will start from the beginning?

  • Alert Procedure & Schedule Job

    Hi expert,
    Re : Oracle DB 10g (10.1) For Linux
    Our client request get daily alert for Customer Expired . it separate by belong to branch . and also the early remind day need to control by themselves. I don't know how to create procedure & run it daily, everybody can help me. table as below : -
    Below table has been develop by Oracle Forms for user input data.
    CUSTMAS (Customer Master)
    Cust_ID Varchar2
    Belong_to Varchar2
    Cust_Expire Date
    Data :
    A|A_BRANCH|22-6-06
    B|A_BRANCH|16-6-06
    C|B_BRANCH|12-6-06
    ALTMAS (Alert Master)
    ALERT_ID VARCHAR2
    BELONG_TO VARCHAR2
    EARLY_DAY NUMBER(3)
    DATA
    CUSTMAS|A_BRANCH|10
    CUSTMAS|B_BRANCH|6
    ALTMAS will add another Master in future. such as birthday of employee etc..
    I don't know about table design is correct or not ? pls teach me. tks.
    After Run procedure . two files will create in file system.
    formula is : sysdate (6-12-06) = cust_expire - early_day
    Data of A_BRANCH.txt
    B|A_BRANCH|16-6-06
    Data of B_BRANCH.txt
    C|B_BRANCH|12-6-06
    tks a lot
    boris

    Tks for both expert reply.
    i will test it later. but i want to create procedure for result first .
    pls comment . details as below : -
    msalthdr
    ms_alt_id
    ms_alt_branch
    ms_alt_early
    i don't know how to create procedure for loop msalthdr then pass branch,early
    parameter to custhdr_brexp_list & execute it. pls guide me . tks
    mscusthdr
    ms_mas_cd
    ms_mas_enname
    ms_br_no
    ms_br_exp
    CREATE OR REPLACE PROCEDURE custhdr_brexp_list (p_branch varchar2, p_early number) AS
    v_cust_count NUMBER(8);
    v_mascd mscusthdr.ms_mas_cd%type;
    v_masname mscusthdr.ms_mas_enname%type;
    v_brno mscusthdr.ms_br_no%type;
    v_brexp mscusthdr.ms_br_exp%type;
    v_bg_color VARCHAR2(10) := '';
    CURSOR c_cust IS
    SELECT ms_mas_cd,ms_mas_enname,ms_br_no,ms_br_exp
    FROM mscusthdr
    WHERE ms_comp_cd = p_branch and
    ms_br_exp - p_early = sysdate
    ORDER BY ms_mas_enname;
    BEGIN
    SELECT COUNT(*)
    INTO v_cust_count
    FROM mscusthdr
    WHERE ms_comp_cd = p_branch and
    ms_br_exp - p_early = sysdate ;
    owa_util.mime_header('application/ms-excel', FALSE);
    htp.p('Content-Disposition: filename="test.xls"');
    owa_util.http_header_close;
    htp.htmlopen;
    htp.bodyopen;
    htp.header(5, '<font color="RED"> <center> Customer BR. Expire INFO </center></font>');
    htp.tableopen(cattributes=>'border="2",bordercolor="BLACK",width="60%",align="CENTER"');
    htp.tablerowopen(cattributes => 'bgcolor="GREEN"');
    htp.tableheader(cattributes => 'colspan="4", align="CENTER"'
    ,cvalue => '<font face="ARIAL" size="2.5" color="WHITE">'
    || 'Customer. (List Count:' || v_cust_count || ')');
    htp.tablerowclose;
    htp.tablerowopen(cattributes => 'align="LEFT", bgcolor="YELLOW"');
    htp.tableheader(cvalue => '<font face="ARIAL" size="2.25" color="BLUE">' || 'Customer Code.');
    htp.tableheader(cvalue => '<font face="ARIAL" size="2.25" color="BLUE">' || 'Customer Name');
    htp.tableheader(cvalue => '<font face="ARIAL" size="2.25" color="BLUE">' || 'BR No.');
    htp.tableheader(cvalue => '<font face="ARIAL" size="2.25" color="BLUE">' || 'BR Expire Date');
    htp.tablerowclose;
    OPEN c_cust;
    FETCH c_cust
    INTO v_mascd, v_masname, v_brno, v_brexp ;
    WHILE c_cust%FOUND
    LOOP
    IF MOD(v_cust_count, 2) = 0 THEN
    v_bg_color := 'SILVER';
    ELSE
    v_bg_color := 'WHITE';
    END IF;
    htp.tablerowopen(cattributes => 'bgcolor=' || v_bg_color);
    htp.tabledata(cattributes => 'align="LEFT"'
    ,cvalue => '<font face="ARIAL" size="2" color="BLACK">' || v_mascd);
    htp.tabledata(cattributes => 'align="LEFT"'
    ,cvalue => '<font face="ARIAL" size="2" color="BLACK">' || v_masname);
    htp.tabledata(cattributes => 'align="LEFT"'
    ,cvalue => '<font face="ARIAL" size="2" color="BLACK">' || v_brno);
    htp.tabledata(cattributes => 'align="LEFT"'
    ,cvalue => '<font face="ARIAL" size="2" color="BLACK">' || v_brexp);
    htp.tablerowclose;
    v_cust_count := v_cust_count -1;
    FETCH c_cust
    INTO v_mascd, v_masname, v_brno, v_brexp ;
    END LOOP;
    CLOSE c_cust;
    htp.tablerowclose;
    htp.tableclose;
    htp.bodyclose;
    htp.htmlclose;
    EXCEPTION
    WHEN no_data_found THEN
    NULL;
    END;
    SQL> exec custhdr_brexp_list('B',10)
    BEGIN custhdr_brexp_list('B',10); END;
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.OWA_UTIL", line 325
    ORA-06512: at "SYS.HTP", line 1322
    ORA-06512: at "SYS.HTP", line 1397
    ORA-06512: at "SYS.OWA_UTIL", line 375
    ORA-06512: at "XXXX.CUSTHDR_BREXP_LIST", line 23
    ORA-06512: at line 1
    Why error occur ?
    boris

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

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

  • Export scheduler job but chain step and chain rule failed with ORA-24150 ORA-06512 during executed sql script.

    Hi Folks,
    I used expdp utility to export all Oracle scheduler jobs and chains with below method, after that generate sql script by impdp, later on executing sql script encountered some errors.
    Only chain step and chain rule for executing script. Does anyone bright me some light? Thanks!
    My env: Oracle 11g + Oracle Linux 5.5
    My steps as below:
    1. export(expdp) oracle scheduler job(chain)
    2. generate sql script by impdp.
    3. remove orginal scheduler job(chain)
    4. execute sql script
    5. job with no chain well but job with chain failed
    [oracle@linux1 ~]$ expdp scott/tiger directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:\" in \(select \
    > name from sys.obj$ where type\# in \(46,59,66,67,68,69,72,74,79\)\)\"  schemas=scott
    Export: Release 11.2.0.1.0 - Production on Tue Dec 3 17:42:31 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Starting "SCOTT"."SYS_EXPORT_SCHEMA_01":  scott/******** directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:" in (select name from sys.obj$ where type# in (46,59,66,67,68,69,72,74,79))" schemas=scott
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
      /u03/database/usbo/BNR/dump/scott_job.dmp
    Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at 17:42:54
    [oracle@linux1 ~]$ impdp scott/tiger sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Import: Release 11.2.0.1.0 - Production on Tue Dec 3 17:43:04 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Master table "SCOTT"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
    Starting "SCOTT"."SYS_SQL_FILE_FULL_01":  scott/******** sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Job "SCOTT"."SYS_SQL_FILE_FULL_01" successfully completed at 17:43:07
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.
    scott_job.dmp  scott_job.sql 
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.sql
    -- CONNECT SCOTT
    ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
    -- new object type path: SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_1"','1=1',NULL, 'First link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_2"',':"CHAIN_STEP_1".COMPLETED = ''TRUE''',NULL, 'Second link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_3"',':"CHAIN_STEP_2".COMPLETED = ''TRUE''',NULL, 'Third link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_4"',':"CHAIN_STEP_3".COMPLETED = ''TRUE''',NULL, 'End of the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
    END;
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_1"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_1'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for first link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_3"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_3'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for last link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_2"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_2'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for second link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
    , rule_set_name=>'"SCHED_RULESET$1"   '
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_job('"TEST_CHAIN_1_JOB"',
    job_type=>'CHAIN', job_action=>
    'test_chain_1'
    , number_of_arguments=>0,
    start_date=>TO_TIMESTAMP_TZ('03-DEC-2013 05.38.56.718161000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'), repeat_interval=>
    'freq=minutely; interval=2'
    , end_date=>TO_TIMESTAMP_TZ('03-DEC-2013 06.08.56.000000000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'),
    job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_drop=>TRUE,comments=>
    NULL
    COMMIT;
    END;
    [oracle@linux1 ~]$ export ORACLE_SID=usbo
    [oracle@linux1 ~]$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 3 17:44:43 2013
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    sys@USBO> show parameter db_name
    NAME                                 TYPE                              VALUE
    db_name                              string                            usbo
    sys@USBO> conn scott/tiger;
    Connected.
    --remove job and chain.
    scott@USBO> EXEC DBMS_SCHEDULER.drop_job(job_name => 'test_chain_1_job');
    EXEC DBMS_SCHEDULER.drop_chain (chain_name  => 'test_chain_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_2');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_3');
    PL/SQL procedure successfully completed.
    scott@USBO> @/u03/database/usbo/BNR/dump/scott_job.sql
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24150: evaluation context SCOTT.SCHED_EV_CTX$1 does not exist
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_IMP_OBJ", line 40
    ORA-06512: at line 3
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    PL/SQL procedure successfully completed.

    Thanks all of you!
    Hi DK2010,
    I took some test that the data dict(dba_rule_sets/dba_evaluation_contexts) no any data returned after I had removed the job.
    So I tried to create evaluation context and re-executed script(only exception setion.) the first error has gone. For the second still have some issue.
    ---->no any returned
    scott@USBO> select * from dba_rule_sets where rule_set_owner='SCOTT';       
    no rows selected
    scott@USBO> select * from dba_evaluation_contexts WHERE evaluation_context_owner='SCOTT';
    no rows selected
    -->add new EVALUATION CONTEXT
    scott@USBO> exec DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT('SCOTT.SCHED_EV_CTX$1');
    PL/SQL procedure successfully completed.
    --->now it looks fine
    scott@USBO> BEGIN
      2  BEGIN
      3  dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
      4  END;
      5 
      6  COMMIT;
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    --->add new rule set, it prompt aleady exists
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1') 
    BEGIN DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1'); END;
    ERROR at line 1:
    ORA-24153: rule set SCOTT.SCHED_RULESET$1 already exists
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_ADM", line 138
    ORA-06512: at line 1
    -->chain rule still could not find.
    scott@USBO> @job_chain_rules.sql
    no rows selected
    -->rerun
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists 
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    -->drop chain
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1');
    BEGIN dbms_scheduler.drop_chain('TEST_CHAIN_1'); END;
    ERROR at line 1:
    ORA-27479: Cannot drop "SCOTT.TEST_CHAIN_1" because other objects depend on it
    ORA-06512: at "SYS.DBMS_ISCHED", line 1319
    ORA-06512: at "SYS.DBMS_ISCHED", line 1222
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1854
    ORA-06512: at line 1
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist   --->still returned no rule set
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1')
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    Would you like to give me more clue?
    Thanks again.

  • Auto alert mechanism for ATG scheduled job failure and BCC project failure

    Hello all,
    Could you please confirm if there are auto alert mechanisms for ATG scheduled job failure and BCC project failure?
    Waiting for reply.
    Thanks and regards,

    Hi,
    You need to write custom code to get alerts if an ATG Scheduler fails.
    For BCC project deployment monitoring, please refer to the below link in the documentation.
    Oracle ATG Web Commerce - Configure Deployment Event Listeners
    Thanks,
    Gopinath Ramasamy

  • Creating a job and scheduling a job error in OEM

    Hi, Everyone,
    I am trying to create and schedule a job thru OEM. In the the pl/sql block provide i have given my code like this
    begin
    SET SERVEROUTPUT ON;
    SPOOL C:\RFV_PROFILE_REPORT.LOG APPEND;
    SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI:SS') FROM DUAL;
    EXEC PAC_RFV_PROFILE_REPORT.CALL_ALL (200910);
    SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI:SS') FROM DUAL;
    SPOOL OFF;
    end;
    i have created the job and scheduled it but i am getting this error:
    Error # 6550
    Details ORA-06550: line 2, column 5: PL/SQL: ORA-00922: missing or invalid option ORA-06550: line 2, column 1: PL/SQL: SQL Statement ignored ORA-06550: line 3, column 7: PLS-00103: Encountered the symbol "C" when expecting one of the following: := . ( @ % ;
    could anyone pls help as this is very urgent.
    Thanks in advance

    Ah, the problem is you are confusing SQLPlus commands with PL/SQL.
    SET SERVEROUTPUT ON; -- This is a SQLPlus command, not necessary here.
    SPOOL C:\RFV_PROFILE_REPORT.LOG APPEND; -- This is a SQLPlus command, in PL/SQL to write out to a file you will need to call the UTL_FILE package to open a file for writing to. Except that the file you write to will appear on the database server, not your workstation, when the scheduled job runs.
    SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI:SS') FROM DUAL; -- In PL/SQL you need to SELECT columns INTO variables FROM tables. But in fact I guess you want to write the time to file using UTL_FILE again. However, you don't really need to do this, since scheduler will log the start time and run duration itself.
    EXEC PAC_RFV_PROFILE_REPORT.CALL_ALL (200910); -- This is the SQLPlus equivalent of the PL/SQL command:
    BEGIN
    PAC_RFV_PROFILE_REPORT.CALL_ALL (200910);
    END;
    SPOOL OFF; -- This is a SQLPlus command, not necessary here.
    So to summarise, all you really need is:
    BEGIN
    PAC_RFV_PROFILE_REPORT.CALL_ALL (200910);
    END;
    And the scheduled job will log the start time and duration in the database, which you can find here:
    SELECT * FROM USER_SCHEDULER_JOB_RUN_DETAILS

Maybe you are looking for

  • CUE 8.6.1 Language issue

    I am building a new CME/CUE system. It is running CUE 8.6.1 and the only option for languate is English(UK). There used to be more of them. Right now, the gal on the voicemail system has a British Accent. Can that be changed and if so, how?

  • Is splitting Model-UI a must in InDesign CS5?

    Hello, According to the CS5 porting guide and the Programming Guide, it is now mandatory to split the plugin into UI and Model. UI plugin should not have commands, responders, persistent classes, event handlers or service providers. However, one of m

  • Control Key for Quality Management in Procurement

    if we activate Control Key for Quality Management in Procurement in material master then wether we need  also store a control key at the plant level for quality management in procurement. if we want want to maintaine pls tell me how it is pls expalin

  • Business Rule in trigger not working

    Hi, I have business rule that no one below 18 years should be employed in this system. I have created a trigger that alerts me so, but when ever I insert someone either over 10 or below, it fires and deos not insert any record, but if I deleted the t

  • EXIF data is stripped when e-mailing images out of iPhoto '09

    I teach photography classes as well as exchange a lot of photos with friends. Prior to installing iPhoto '09, my e-mailed images contained most of the important exposure info - f/stop, shutter speed, ISO, etc. Being able to discuss my images with fri