DBMS_JOB 与 DBMS_SCHEDULER

发布于 2024-10-01 12:50:41 字数 41 浏览 6 评论 0原文

DBMS_JOB 和 DBMS_SCHEDULER 之间有什么区别?

What is the difference between DBMS_JOB and DBMS_SCHEDULER ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

捂风挽笑 2024-10-08 12:50:42

来自其他论坛:

虽然 dbms_job 仍然存在于 10g 和 11g 中,但 Oracle 建议在 10g 及更高版本中使用 dbms_scheduler。 dbms_job 中没有添加任何新功能,您可能很快就会遇到它的限制。

dbms_scheduler 比 dbms_job 更健壮、功能更齐全,并且包含 dbms_job 没有的以下功能:

  • 记录作业运行(作业历史记录)
  • 简单但强大的调度语法(类似于 cron 语法,但比 cron 语法更强大)
  • 在外部运行作业操作系统上的数据库
  • 不同类别作业之间的资源管理
  • 使用作业参数,包括将对象传递到存储过程
  • 基于权限的作业安全模型
  • 作业命名和
  • 存储的作业中的注释,可重用的计划

10g 第 1 版之后的版本中的功能包括:

  • 作业单元(10gR2 及更高版本)之间的依赖关系
  • 基于财务日历和会计季度(10gR2 及更高版本)的调度 基于
  • 的作业,在收到事件时运行(10gR2 及更高版本)
  • 在远程计算机上运行作业(11gR1 及更高版本)
  • 事件 有关感兴趣的作业事件(10gR2 及更高版本)的邮件通知
  • 根据文件到达启动作业(10gR2 及更高版本)

From other forums:

Although dbms_job still exists in 10g and 11g, Oracle recommends the use of dbms_scheduler in releases 10g and up. No new features are being added to dbms_job and you will likely quickly run into its limitations.

dbms_scheduler is more robust and fully-featured than dbms_job and includes the following features that dbms_job does not have :

  • logging of job runs (job history)
  • simple but powerful scheduling syntax (similar to but more powerful than cron syntax)
  • running of jobs outside of the database on the operating system
  • resource management between different classes of jobs
  • use of job arguments including passing of objects into stored procedures
  • privilege-based security model for jobs
  • naming of jobs and comments in jobs
  • stored, reusable schedules

Features in releases after 10g Release 1 include :

  • dependencies between job units (10gR2 and up)
  • scheduling based on financial calendars and fiscal quarters (10gR2 and up)
  • event based jobs which run when an event is received (10gR2 and up)
  • running of jobs on remote machines (11gR1 and up)
  • e-mail notifications on job events of interest (10gR2 and up)
  • starting a job based on arrival of a file (10gR2 and up)
蘸点软妹酱 2024-10-08 12:50:42

需要注意的一个区别是,与 DBMS_JOB 不同,DBMS_SCHEDULER 执行提交,这使得它不适合某些用途。对于比较简单的需求来说也比较麻烦。虽然 DBMS_JOB 将不再得到增强,但它不太可能被取消支持,因为肯定有数千个系统正在使用它并依赖于它的工作方式,包括不执行调用它的事务的隐式提交。

请参阅此“询问 Tom”主题 了解更多。

One difference to be aware of is that unlike DBMS_JOB, DBMS_SCHEDULER performs a commit, which makes it unsuitable for some uses. It is also rather cumbersome for simpler requirements. While DBMS_JOB will no longer be enhanced, it is unlikely to ever be desupported, as there must be thousands of systems that are using it and rely on the way it works, including not performing an implicit commit of the transaction from which it was called.

See this Ask Tom thread for more.

夏夜暖风 2024-10-08 12:50:42

接下来列出的是 DBMS_SCHEDULER 相对于 cron 的一些优点:

• 可以使一个作业的执行依赖于另一个作业的完成

• 强大的资源平衡和灵活的调度功能

• 可以基于数据库事件

• 无论操作系统如何,DBMS_SCHEDULER 语法的工作方式都是相同的

• 可以使用数据字典运行状态报告

• 如果在集群环境中工作,无需担心为集群中的每个节点同步多个 cron 表

接下来列出的是使用 cron 的一些优点:

• 易于使用、简单、经过验证且真实。

• 几乎在所有 Linux/Unix 机器上都可用。在大多数情况下,无论 Linux/Unix 平台如何,运行几乎相同(是的,存在细微差别)

。独立于数据库运行,无论数据库供应商或数据库版本如何,其工作方式都是相同的

• 无论数据库是否可用,都可以工作

Listed next are some of the benefits that DBMS_SCHEDULER has over cron:

• Can make the execution of a job dependent on the completion of another job

• Robust resource balancing and flexible scheduling features

• Can run jobs based on a database event

• DBMS_SCHEDULER syntax works the same regardless of the operating system

• Can run status reports using the data dictionary

• If working in clustered environment, no need to worry about synchronizing multiple cron tables for each node in the cluster

Listed next are some of the advantages of using cron:

• Easy to use, simple, tried and true

• Almost universally available on all Linux/Unix boxes; for the most part, runs nearly identically regardless of the Linux/Unix platform (yes, there are minor differences)

• Database agnostic; operates independently of the database and works the same regardless of the database vendor or database version

• Works whether the database is available or not

旧情别恋 2024-10-08 12:50:42

我知道这是一个旧线程,但这似乎相关。

升级到 Oracle Database 19c 后,旧 DBMS_JOB 接口下的作业将会发生转换。不用担心——放松!

会发生什么?这对您在 DBA_JOBS 中的工作意味着什么?

首先,您无法在调度程序的控制下阻止或跳过迁移。但也没有理由这样做。

During the 19c upgrade for each job in DBMS_JOB a corresponding entry will be created with DBMS_SCHEDULER
The old DBMS_JOB interface still works. But using it will always create a corresponding entry in the scheduler
The check in preupgrade.jar is only checking for inconsistencies or any issues

这意味着:您仍然可以使用 DBMS_JOB,但实际上我们正在使用 DBMS_SCHEDULER。内部程序已更改。您的调用将以相同的方式工作,但 DBMS_JOB 现在是 DBMS_SCHEDULER 的旧接口。

请参阅:DBMS_JOB – 行为更改升级期间的 Oracle 19c

I know this is an old thread, but this seems relevant.

With the upgrade to Oracle Database 19c there will be a conversion of jobs under the hood of the old DBMS_JOB interface. No worries – relax!

What happens? And what does that mean for your jobs in DBA_JOBS?

First of all, you can’t prevent or skip the migration under the scheduler’s control. But there is also no reason to do so.

During the 19c upgrade for each job in DBMS_JOB a corresponding entry will be created with DBMS_SCHEDULER
The old DBMS_JOB interface still works. But using it will always create a corresponding entry in the scheduler
The check in preupgrade.jar is only checking for inconsistencies or any issues

What this means is: You can still use DBMS_JOB but under the cover we are using DBMS_SCHEDULER. The internal procedures have been changed. Your calls will work the same way, but DBMS_JOB is now a legacy interface to the DBMS_SCHEDULER.

See: DBMS_JOB – Behavior Change in Oracle 19c during upgrade

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文