Question on schedule jobs

Hi,
i created two varients of the job as shown belo.
1)
DECLARE
  X NUMBER;
BEGIN
  SYS.DBMS_JOB.SUBMIT
    ( job       => X - job name as 'X'
     ,what      => 'DEL_EMPLOYEE_TABLE;' - ITS A STORED PROCEDURE
     ,next_date => to_date('19/05/2009 01:00:00','dd/mm/yyyy hh24:mi:ss')
     ,interval  => 'trunc(sysdate) + 1/24 + 1'
     ,no_parse  => TRUE
  SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
END;
2)
begin
dbms_scheduler.create_job (
job_name => 'DEL_EMPLOYEE_TABLE',
job_type => 'STORED_PROCEDURE',
job_action => 'DEL_EMPLOYEE_TABLE',
number_of_arguments => 0,
start_date => SYSTIMESTAMP,
repeat_interval => 'FREQ=DAILY;BYHOUR=0;BYMINUTE=0;BYSECOND=0',
end_date => NULL,
enabled => TRUE,
comments => 'Delete EMPOYEE old records');
end;
i have the following questions
1) what is the difference between #1 and #2
2) When i queried the DB with following query i could see only
select owner, job_name, state from dba_scheduler_jobs
i could see only
'DEL_EMPLOYEE_TABLE' - job but do not see the #1 job as - X

[email protected] wrote:
1) what is the difference between #1 and #2They use two different schedulers, the old one (DBMS_JOB) and the new one (DBMS_SCHEDULER)
2) When i queried the DB with following query i could see only
select owner, job_name, state from dba_scheduler_jobs
i could see only
'DEL_EMPLOYEE_TABLE' - job but do not see the #1 job as - XYou can find it using:
select * from user_jobsMax
http://oracleitalia.wordpress.com
Edited by: Massimo Ruocchio on Mar 9, 2010 9:37 PM
typos

Similar Messages

  • Dbconsole scheduled job question

    I have successfully re-created my dbconsole and repository. I then clicked on the 'Jobs' link and created a SQL Script job to execute once a day.
    My code for this job is as follows:
    set serveroutput on;
    exec system.export_db;
    EXPORT_DB is a procedure which uses the DataPump API to perform a daily export of a few db schemas. I have this job running successfully on a dozen other servers with no issues at all.
    However, on this particular server, I get the following error, and I can't figure out what could possibly be different:
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'SYSTEM.EXPORT_DB' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I can run the same job through SQLPlus, but not through the DBControl. I added the same procedure to the SYS schema, but always the same error.
    Normally, I know that I would need to grant execute permissions on the procedure to the user calling the procedure. But I can't seem to get this to work.
    Any ideas would be much appreciated.
    Thanks,
    Nora

    I found another way to do it.. I instead used the 'Scheduler Jobs' portion of the Dbcontrol, and was able to successfully schedule and run the job there.
    Thanks,
    Nora

  • A collections of questions on scheduling information

    Hello, I am doing some research on QoS management, and I need much scheduling information. So I got some questions.
    1 Based on the oracle scheduler, I want to design my own scheduler(non-preempt). That is, once a job is finished, the scheduler need to schedule new jobs based on some job information. So how can i design such a scheduler? I think it should be a job in the database, but it is neither periodic nor event-based.
    2 Each time my scheduler runs, it probably schedule a same job to run. If the former instance of this job has not completed, the new instance will be skipped. How can I disable the former instance and let the new instance run?
    3 I will configure a periodic job which will collect all of the statistic data at the beginning of each period. How can I read the duration time of each job which has been completed? I know I can read the duration time from ALL_SCHEDULER_JOB_RUN_DETAILS,but the accuracy of the duration time in that view is only second. I need better accuracy. Another problem is, if a job has completed several instances in the last period, how can i differentiate them from each other. Because all of the instance number is 1.
    4 And also, I need to know how much CPU time all of the jobs in the last period have consumed. How can I know the cpu time of each instance of each job?(not only the jobs which have completed but also those jobs which are running.) (because I need add them together and write some algorithm to control it not exceed 80% of the period.)
    I am sorry to put so many troublesome questions together. Hope somebody can give me some guidance. Thanks a lot.

    Hi,
    I'll try to answer some of these questions briefly.
    1 Based on the oracle scheduler, I want to design my
    own scheduler(non-preempt). That is, once a job is
    finished, the scheduler need to schedule new jobs
    based on some job information. So how can i design
    such a scheduler? I think it should be a job in the
    database, but it is neither periodic nor
    event-based.The design of a new Scheduler is not something I can really advise on. Perhaps you could have it based on a master process which is a Scheduler job that runs frequently (once every minute or so).
    2 Each time my scheduler runs, it probably schedule a
    same job to run. If the former instance of this job
    has not completed, the new instance will be skipped.
    How can I disable the former instance and let the new
    instance run? The Scheduler does not allow multiple instances of the same job to run. If you want multiple instances of your action to run you need to create a scheduler program and then you can have multiple jobs pointing to that program. Those jobs can happily run in parallel
    3 I will configure a periodic job which will collect
    all of the statistic data at the beginning of each
    period. How can I read the duration time of each job
    which has been completed? I know I can read the
    duration time from ALL_SCHEDULER_JOB_RUN_DETAILS,but
    the accuracy of the duration time in that view is
    only second. I need better accuracy. Another problem
    is, if a job has completed several instances in the
    last period, how can i differentiate them from each
    other. Because all of the instance number is 1.The jobs will have different requested_start_dates . To gain better accuracy you can use log_date-actual_start_date from the ALL_SCHEDULER_JOB_RUN_DETAILS view.
    4 And also, I need to know how much CPU time all of
    the jobs in the last period have consumed. How can I
    know the cpu time of each instance of each job?(not
    only the jobs which have completed but also those
    jobs which are running.) (because I need add them
    together and write some algorithm to control it not
    exceed 80% of the period.)You can do this by querying both ALL_SCHEDULER_JOB_RUN_DETAILS and ALL_SCHEDULER_RUNNING_JOBS .
    Hope this helps,
    Ravi.

  • How to schedule job?

    Hello All,
    i have a few questions about jobs (scheduling jobs)
    I want to run one procedure at 7:00 A.M and I want to stop this procedure at 12:30 PM on Daily basis.Is it possible with DBMS_JOB? I don't know how to stop running job at specified time.
    I m using Oracle 9i on Linux

    Hi,
    Your best bet is probably to schedule a second job to run at 12:30pm every day and execute the stop. To do the stop you will probably need to figure out the session and terminate the session (google for stopping dbms_job).
    In 10gR2 and up dbms_scheduler (the replacement for dbms_job) can handle this scenario in a much more striahgtforward way (generate an event if the job exceeds a max_run_duration and have the event trigger a second job to snipe the first using a stop_job call).
    -Ravi

  • How to schedule JOB in ORacle

    I have one package and in side that package i have 5 Procedure like
    a;
    b;
    c;
    I would like to run that Package every 2 hrs automatically , Please provide me the solution how to schedule this job ..and i would like to get the errors while executing those Procedures
    thanks
    MAASH

    Hi,
    You cannot run a package, you can only run a procedure in the package.
    In Oracle 10g and up the recommended way to do this is using dbms_scheduler for example to run scott.pkg.a every two hours you would do
    begin
    dbms_scheduler.create_job('myjob',
    job_type=>'plsql_block',
    job_action=>'scott.pkg.a();',
    repeat_interval=>'freq=hourly;interval=2;byminute=0',
    enabled=>true);
    end;
    Errors and successful runs will be logged in all_scheduler_job_run_details.
    For more info see the Scheduler documentation at
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/scheduse.htm (examples)
    http://st-doc.us.oracle.com/11/111/appdev.111/b28419/d_sched.htm (reference documentation)
    There is also a dedicated forum for dbms_scheduler questions here
    Scheduler
    Hope this helps,
    Ravi.

  • 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"*

  • Scheduled Job to gather stats for multiple tables - Oracle 11.2.0.1.0

    Hi,
    My Oracle DB Version is:
    BANNER Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    In our application, we have users uploading files resulting in insert of records into a table. file could contain records ranging from 10000 to 1 million records.
    I have written a procedure to bulk insert these records into this table using limit clause. After the insert, i noticed my queries run slow against these tables if huge files are uploaded simultaneously. After gathering stats, the cost reduces and the queries executed faster.
    We have 2 such tables which grow based on user file uploads. I would like to schedule a job to gather stats during a non peak hour apart from the nightly automated oracle job for these two tables.
    Is there a better way to do this?
    I plan to execute the below procedure as a scheduled job using DBMS_SCHEDULER.
    --Procedure
    create or replace
    PROCEDURE p_manual_gather_table_stats AS
    TYPE ttab
    IS
        TABLE OF VARCHAR2(30) INDEX BY PLS_INTEGER;
        ltab ttab;
    BEGIN
        ltab(1) := 'TAB1';
        ltab(2) := 'TAB2';
        FOR i IN ltab.first .. ltab.last
        LOOP
            dbms_stats.gather_table_stats(ownname => USER, tabname => ltab(i) , estimate_percent => dbms_stats.auto_sample_size,
            method_opt => 'for all indexed columns size auto', degree =>
            dbms_stats.auto_degree ,CASCADE => TRUE );
        END LOOP;
    END p_manual_gather_table_stats;
    --Scheduled Job
    BEGIN
        -- Job defined entirely by the CREATE JOB procedure.
        DBMS_SCHEDULER.create_job ( job_name => 'MANUAL_GATHER_TABLE_STATS',
        job_type => 'PLSQL_BLOCK',
        job_action => 'BEGIN p_manual_gather_table_stats; END;',
        start_date => SYSTIMESTAMP,
        repeat_interval => 'FREQ=DAILY; BYHOUR=12;BYMINUTE=45;BYSECOND=0',
        end_date => NULL,
        enabled => TRUE,
        comments => 'Job to manually gather stats for tables: TAB1,TAB2. Runs at 12:45 Daily.');
    END;Thanks,
    Somiya

    The question was, is there a better way, and you partly answered it.
    Somiya, you have to be sure the queries have appropriate statistics when the queries are being run. In addition, if the queries are being run while data is being loaded, that is going to slow things down regardless, for several possible reasons, such as resource contention, inappropriate statistics, and having to maintain a read consistent view for each query.
    The default collection job decides for each table based on changes it perceives in the data. You probably don't want the default collection job to deal with those tables. You probably do want to do what Dan suggested with the statistics. But it's hard to tell from your description. Is the data volume and distribution volatile? You surely want representative statistics available when each query is started. You may want to use all the plan stability features available to tell the optimizer to do the right thing (see for example http://jonathanlewis.wordpress.com/2011/01/12/fake-baselines/ ). You may want to just give up and use dynamic sampling, I don't know, entire books, blogs and papers have been written on the subject. It's sufficiently advanced technology to appear as magic.

  • How can I locate a Scheduler job?

    Hi there,
    In the alert log, I see the following error :
    ORA-12012: error on auto execute of job 2915
    My question is - how do I find the definition for job 2915?
    And before you say - "that's easy, it's in all_scheduler_jobs", it's
    not in all_scheduler_jobs. The old dbms_job package had a column for
    job number, but the Scheduler doesn't. I've scrutinized the definition for
    all the Scheduler views, but nothing reveals the job number.
    When I look at all the jobs listed in dba_scheduler_jobs, nothing seems
    likely to be this mysterious job 2915.
    Does anyone have any idea how I can locate it?
    Thanks!
    Paul Stuart

    Hi,
    Actually I've been meaning to write this info up as a DBA tip, but never get round to doing it...
    The job number referred to is in fact the Object ID of the Job when dealing with a new Scheduler job and not an original DBMS_JOB job.
    Scheduler jobs are database objects now rather than just 'rows in a table' so have an object ID, visible in dba_objects. But the dba_scheduler jobs view does not display this column!
    See this example, I create a Job that refers to a non existant procedure. The object ID matches that put into the alert log when it fails only a second later:
    SQL> declare
      2    jname varchar2(30) := 'JOB_TEST';
      3    jtype varchar2(16) := 'PLSQL_BLOCK'; -- 'PLSQL_BLOCK', 'STORED_PROCEDURE', 'EXECUTABLE'
      4    jaction varchar2(256) := 'not_a_real_proc;';
      5  begin
      6
      7    dbms_scheduler.create_job (
      8                  job_name        => jname,
      9                  job_type        => jtype,
    10                  job_action      => jaction,
    11                  start_date      => systimestamp,
    12                  enabled         => TRUE,
    13                  auto_drop       => FALSE,
    14                  comments        => 'Test job can be dropped'
    15                  );
    16
    17  end;
    18  /
    PL/SQL procedure successfully completed.
    SQL> select object_id,  object_type,object_name
      2  from dba_objects
      3  where object_name = 'JOB_TEST' and object_type = 'JOB';
    OBJECT_ID OBJECT_TYPE         OBJECT_NAME
         53645 JOB                 JOB_TEST
    SQL> select job, error_date, error_line2 from dba_job_errors;
           JOB ERROR_DATE          ERROR_LINE2
         53646 04/09/2007 22:03:17 PLS-00201: identifier 'NOT_A_REAL_PROC' must be declaredHTH
    Chris

  • Debugging of background scheduled job

    Hi guys,
    Can any one explain me 1 scenario why there is a need to debug background scheduled job..., rather then doing in background we can run the same job/report online and do normal debugging.
    thx in advance,
    Cheers,
    Harish

    Hi ARPAN,
    as long as the job is running, you can enter debuuger from SM50 process overview (program->debug) or SM37 Job Overview (Job->catch active Job).
    And to the initial question: Some messages are configured to be created when saving document (e.g. sales invoice). This will trigger a background process. If something goes wrong with smartform or sapscript form, it will cause an update error. This you may need to debug in background.
    Regards,
    Clemens

  • DPM 2010 Scheduled Jobs Disappear rather than Run

    I have a situation where I have a DPM server that appears to be functioning fine, but none of the scheduled jobs run.  No errors are given, there are no Alerts, and there is nothing in the Event log (Application and System) which indicates a failure. 
    All my Protection Groups show a green tick to indicate that they are fine, but the last successful backup for all of them is Friday the 8th of February.
    If I go to Monitoring and Jobs I see the jobs scheduled, but when the time comes for the job to run, it does not go into the "All jobs in progress", it just merely disappears, like thus:
    And a few minutes later,
    As you can see, the jobs disappear from the queue, and the total number of jobs decreases accordingly.  These jobs do not go into any of the other 3 Statusses (Completed, Failed or In Progress), they just disappear without a trace.
    There is some unallocated space, albeit not much (Used space: 21 155,05 GB Unallocated space: 469,16 GB). If space was an issue I would expect to see errors to indicate this.
    DPM 2010 running version 3.0.8193.0 (hotfix rollup package 6) using remote instance of SQL 2008 which is functioning fine.  I have tried stopping/starting the services, and even rebooted the server twice.  The remote instance of SQL server is using
    a domain account as its service account.  There are no pending Windows updates, i.e. it is fully up-to-date.
    The System Center Data Protection Manager 2010 Troubleshooting Guide (July 2010) does not show how to troubleshoot this particular probelm.
    Does anybody know how to resolve this issue or which logs might help me troubleshoot it?

    OK,
    Did you change the SQL Agent user account ?
    If so, DPM enters the SQL Agent account name into the registry and later we check that account each time the DPM engine launches.  The internal interfaces to DPM are secured using this account so the account name needs to match the account the SQL Agent
    is using. 
    Step 1
    In the registry HKLM\Software\Microsoft\Microsoft Data Protection Manager\Setup alter  both
    SqlAgentAccountName and SchedulerJobOwnerName keys to reflect the SQL Agent user account being used.
    Step 2
    Update DCOM launch and access permissions to match what was granted to the Microsoft$DPM$Acct account.
    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, Mike J. [MSFT]
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Where can I find scheduled Jobs (Reports) in Database?

    Hello anyone,
    i'm nearly new in using Oracle Application Server, so excuse me for asking silly questions,please.
    But where can i find the scheduled jobs (reports) in the database?
    We are using OAS in version 10.1.2.3.0
    Thanks
    Florian

    Hi florian,
    where can i find the scheduled jobs (reports) in the database?
    http://<ip-address>:7778/reports/rwservlet/showjobs?server=<your report server name>
    Then select scheduled jobs from the drop down list
    Note:
    1)7778 is the default port for OAS10g r2..check in your httpd.conf file whether it 7778 or else change it accordingly
    2)you will your get report server name from em console itself ie rep_****
    Regards
    Fabian

  • Cancel the scheduled jobs for process chains - urgent

    Hi,
    How do I cancel the scheduled jobs for process chains which are going to run tonight.
    thanks,
    Radha

    Hello,
    Go into transaction code RSPC and then select the particular process chain by going into the edit mode and in the menu...
    Look for Execution --> Remove from Schedule.
    Let me know if that answered your question.
    Thanks
    Dharma.

  • Bat file for running scheduled jobs

    Hi
    I am not entirely sure whether this is the correct forum to post this question, so apologies if I have posted this question in the wrong place.
    Anyhow, I would like to know how to create two automated bat file scripts that will execute a PL/SQL package that will tell my Oracle 10g R2 database to run a scheduled job. Equally, I need another bat file to tell it to drop the scheduled job.
    I already have a PL/SQL package that creates a schedule job using dbms_scheduler, and I can execute the scheduled job by going into SQL Plus running the execute command against the package. It is this latter bit, the execute part that I want to automate into bat file.
    Can someone show me how to do this?

    I'm in complete agreement with Hans. Oracle has two facilities DBMS_JOB and DBMS_SCHEDULER neither of which benefits in any way be being called by a batch file.
    What is your version number (all of it) and why are you considering this idea?

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

  • Report Queue Manager  - Scheduled Jobs

    Question: How/where does the Queue Manager store info for scheduled jobs?

    It is possible (IN 9iAS) to configure the Reports Server to store all requests in a database table. The Table(s) / View(s) are created by the script rw_server.sql located in $ORACLE_HOME/reports/admin/sql
    To configure this options, create the table and view with the rw_server.sql script, then add these lines in the
    <reports server name>.conf file <jobStatusRepository class="oracle.reports.server.JobRepositoryDB"> <property name="repositoryConn" value="user/password@tnsalias" confidential="yes" encrypted="no"/> </jobStatusRepository> The "value" attribute of the property "repositoryConn" should be a user/password@tnsalias that will be used to connect to the database. The account must have access to the tables created by the script rw_server.sql The combination confidential="yes" and encrypted="no" will provoke the encryption of the value attribute once the Report Server is re-started : After the Reports Server has started you will find: <jobStatusRepository class="oracle.reports.server.JobRepositoryDB"> <property name="repositoryConn" value="ihjFFBFD3jk5Xfrd5HeX5w3dE/E=" confidential="yes" encrypted="yes"/> </jobStatusRepository> Description of the rw_server_queue view columns can be found in the script rw_server.sql itself.
    Thanks,

Maybe you are looking for

  • Function Module (ENQUEUE_ES_PROG) not working in Background

    I scheduled a job which runs every 15 mins in the the background to fetch data from an external system,depending on the data volume ,the program can sometimes run for over 15 minutes.To avoid data conflict I used a function module ENQUEUE_ES_PROG on

  • Adobe Media Encoder CS4 converting mp4 to FLV

    Hi, First up why is there no forum for Adobe Media Encoder CS4? My issue is whith converting MP4 to flv. The video is added to the que. Problem is no video picture is shown, during the convert process. When I go into setting and move the play head al

  • ICloud Control Panel 2.0 instalation error on Win 7 x64bit

    just tried by Apple Software Update and manually as recommended and got that error is it because it's 32bit version of installer ? i have microsoft visual c++ 2008 as well as 2005 and 2010 installed for x86 and x64 so...

  • Scrollpane location

    Hi, ive got the following problem. I use a JPanel to put a number of JTextFields in it. This number is not determined before. So sometimes the Panel gets to big to fit on a Screen. I decided to put it into a jscrollpane. But now if got the problem if

  • Help! Not able to Print TIF files

    I recently pasted 4 photos into a 19x13 canvass. The file was originally a 1.2 GB file, which would not print, so I then reduced the size to approximately 700MB. I go to FILE then select PRINT and nothing happens. Is there a setting I messed up somew