Oracle OCP 1Z0-050(30题)解析

Oracle OCP 1Z0-050(30题)解析

QUESTION 30:

Which three statements are true regarding persistent lightweight jobs? (Choose three.)

A. Persistent lightweight jobs modify several tables in the data dictionary to generate a lot of redo.

B. The user cannot set privileges on persistent lightweight jobs.

C. Persistent lightweight jobs are useful when users need to create a large number of jobs in a short time.

D. Persistent lightweight jobs are useful when users need to create a small number of jobs that run infrequently.

E. The use of a template is mandatory to create persistent lightweight jobs.

Answer: B,C,E

解析:

Lightweight Jobs

Use lightweight jobs when you have many short-duration jobs that run frequently. Under certain circumstances, using lightweight jobs can deliver a small performance gain.

Lightweight jobs have the following characteristics:

  • Unlike regular jobs, they are not schema objects.

  • They have a significant improvement in create and drop time over regular jobs because they do not have the overhead of creating a schema object.

  • They have lower average session creation time than regular jobs.

  • They have a small footprint on disk for job metadata and runtime data.

You designate a lightweight job by setting the job_style job attribute to 'LIGHTWEIGHT'. The other job style is 'REGULAR', which is the default.

Like programs and schedules, regular jobs are schema objects. In releases before Oracle Database 11g Release 1, regular jobs were the only job style supported by the Scheduler.

A regular job offers the maximum flexibility but does entail some overhead when it is created or dropped. The user has fine-grained control of the privileges on the job, and the job can have as its action a program or a stored procedure owned by another user.

If a relatively small number of jobs that run infrequently need to be created, then regular jobs are preferred over lightweight jobs.

A lightweight job must reference a program object (program) to specify a job action. The program must be already enabled when the lightweight job is created, and the program type must be either 'PLSQL_BLOCK' or 'STORED_PROCEDURE'. Because lightweight jobs are not schema objects, you cannot grant privileges on them. A lightweight job inherits privileges from its specified program. Thus, any user who has a certain set of privileges on the program has corresponding privileges on the lightweight job.

 

The following PL/SQL block creates a lightweight job. Lightweight jobs must reference a program, and the program type must be 'PLSQL_BLOCK' or 'STORED_PROCEDURE'. In addition, the program must be already enabled when you create the job.

BEGIN
  DBMS_SCHEDULER.CREATE_JOB (
   job_name         =>  'my_lightweight_job1',
   program_name     =>  'polling_prog_n2',
   repeat_interval  =>  'FREQ=SECONDLY;INTERVAL=10',
   end_date         =>  '30-APR-09 04.00.00 AM Australia/Sydney',
   job_style        => 'LIGHTWEIGHT',
   comments         => 'Job that polls device n2 every 10 seconds');
END;
/

创建和启动一个作业涉及数据字典中一定量的活动。这不可能在短时间(几秒钟)内创建大量作业(可能是数百个)。为了解决这个问题,可以创建持久轻量级作业。轻量级作业是个比标准作业更简单的构造。它必须基于程序,只能有有限的一系列特性:例如:AUTO_DROP总是TURE。可以单独创建轻量级作业,但没有意义。真正的价值是在创建一组作业定义(可能是数百个),并同时提交它们。

• 持久轻量作业在创建/删除时间方面有很大改进,因为它没有创建数据库对象的开销。每个轻量作业都是使用作业模板创建的,并作为程序进行存储。因为持久轻量作业在运行时要向磁盘写入状态信息,所以在执行时应该只有少量改进。

持久轻量作业有多种限制:

- 用户无法设置对这些作业的权限,它们将从父作业模板中继承其权限。

- 必须使用模板,无法创建完全自包含的持久轻量作业。

- 只有一些特定的作业属性是可设置的,如JOB_ARGUMENTS。

如果用户需要在非常短的时间内创建大量作业(每秒10 -100 个作业),并且有一组程序(作业模板)可供使用,则最适合使用轻量作业。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值