Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • Goldengate Tutorial Oracle
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • Import and export statements Oracle
  • Btee and Bitmap Plans in Oracle 9i and higher Oracle
  • switchlogfile.sh Linux/Unix
  • How to start CRS manually Oracle
  • How to Modify the statistics collection by MMON for AWR repository Oracle
  • Oracle Material from OTN Oracle
  • restarting network in linux Linux/Unix
  • move_arch_files.ksh Linux/Unix
  • VIvek Encryption Package and Its Usage Oracle
  • Formatter Explain plan Output 1 Oracle
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • Find average Row Length and other table size calculation. metalink notes Oracle

DBMS_JOB all example

Posted on 21-Jan-2009 By Admin No Comments on DBMS_JOB all example

Job Execution Interval:

‘SYSDATE + 7’ Exactly seven days from the last execution

‘SYSDATE + 1/48’ Every half hour

‘NEXT_DAY(TRUNC(SYSDATE), ”MONDAY”) + 15/24’ Every Monday at 3PM

‘NEXT_DAY(ADD_MONTHS(TRUNC(SYSDATE, ”Q”), 3), ”THURSDAY”)’ First Thursday of each quarter

Remobe the job:

BEGIN

DBMS_JOB.REMOVE(14144);

END;

/

Change the job:

In this example, job number 14144 is altered to execute every three days:

BEGIN

DBMS_JOB.CHANGE(14144, NULL, NULL, ‘SYSDATE + 3’);

END;

/

If you specify NULL for WHAT, NEXT_DATE, or INTERVAL when you call the procedure DBMS_JOB.CHANGE, the current value remains unchanged.

What is the job:

BEGIN

DBMS_JOB.WHAT(14144,

‘DBMS_DDL.ANALYZE_OBJECT(”TABLE”,

”HR”, ”DEPARTMENTS”,

”ESTIMATE”, NULL, 50);’);

END;

/

NEXT_DATE:

You can alter the next execution time for a job by calling the DBMS_JOB.NEXT_DATE procedure, as shown in the following example:

BEGIN

DBMS_JOB.NEXT_DATE(14144, SYSDATE + 4);

END;

/

INTERVAL:

The following example illustrates changing the execution interval for a job by calling the DBMS_JOB.INTERVAL procedure:

BEGIN

DBMS_JOB.INTERVAL(14144, ‘NULL’);

END;

/

Broken Jobs:

A job is labeled as either broken or not broken. Oracle does not attempt to run broken jobs. However, you can force a broken job to run by calling the procedure DBMS_JOB.RUN

You have marked the job as broken, using the procedure DBMS_JOB.BROKEN:

BEGIN

DBMS_JOB.BROKEN(14144, TRUE);

END;

/

BEGIN

DBMS_JOB.BROKEN(14144, FALSE, NEXT_DAY(SYSDATE, ‘MONDAY’));

END;

/

BEGIN

DBMS_JOB.RUN(14144);

END;

/

SELECT JOB, NEXT_DATE, NEXT_SEC, FAILURES, BROKEN

FROM DBA_JOBS;

JOB NEXT_DATE NEXT_SEC FAILURES B

——- ——— ——– ——– –

9125 01-JUN-01 00:00:00 4 N

14144 24-OCT-01 16:35:35 0 N

9127 01-JUN-01 00:00:00 16 Y

SELECT SID, r.JOB, LOG_USER, r.THIS_DATE, r.THIS_SEC

FROM DBA_JOBS_RUNNING r, DBA_JOBS j

WHERE r.JOB = j.JOB;

SID JOB LOG_USER THIS_DATE THIS_SEC

—– ———- ————- ——— ——–

12 14144 HR 24-OCT-94 17:21:24

25 8536 QS 24-OCT-94 16:45:12

Oracle, SQL scripts

Post navigation

Previous Post: dbms_job.submit example
Next Post: All Hints for Oracle Databases

Related Posts

  • Is It Recommended To Apply Patch Bundles When PSU Is Available? -ID 743554.1 Oracle
  • New Latest Param.sql for finding all hidden parameters also Oracle
  • ORA-01220 Oracle
  • Find sort details from Db find_sort.sql Oracle
  • Rman Notes -1 Oracle
  • normal maintenance for exp-imp and renaming table Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Very Good Oralce Internal Tuning Book Oracle
  • move_arch_files.ksh Linux/Unix
  • To find all disk io ( EMC as well as local) Linux/Unix
  • process id based files and processes Linux/Unix
  • mutex in Oracle 10.2.0.2 or Oracle 10g Oracle
  • Another export with Query Oracle
  • SQL_PROFILE – I explaination Oracle
  • tblwopk.sql /* Find Tables Without PK */ Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme