关于过程CREATE_JOB_CLASS Procedure

文档地址:http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_sched.htm#i1011092

 

CREATE_JOB_CLASS Procedure

 

This procedure creates a job class. Job classes are created inthe SYS schema.

Syntax

DBMS_SCHEDULER.CREATE_JOB_CLASS (
   job_class_name            IN VARCHAR2,
   resource_consumer_group   IN VARCHAR2 DEFAULT NULL,
   service                   IN VARCHAR2 DEFAULT NULL,
   logging_level             IN PLS_INTEGER
                                DEFAULT DBMS_SCHEDULER.LOGGING_RUNS,
   log_history               IN PLS_INTEGER DEFAULT NULL,
   comments                  IN VARCHAR2 DEFAULT NULL);

Parameters

Table 93-12 CREATE_JOB_CLASS ProcedureParameters

ParameterDescription

job_class_name

The name of the class being created. A schema other thanSYS cannot be specified.

This attribute specifies the name of the job class and uniquelyidentifies the job class. The name has to be unique in the SQLnamespace. For example, a job class cannot have the same name as atable in a schema.

resource_consumer_group

This attribute specifies the resource consumer group this classis associated with. A resource consumer group is a set ofsynchronous or asynchronous sessions that are grouped togetherbased on their processing needs. A job class has a many-to-onerelationship with a resource consumer group. The resource consumergroup that the job class associates with will determine theresources that will be allocated to the job class.

If the resource consumer group that a job class is associatedwith is dropped, the job class will then be associated with thedefault resource consumer group.

If no resource consumer group is specified, the job class isassociated with the default resource consumer group.

If the specified resource consumer group does not exist whencreating the job class, an error occurs.

If resource_consumer_group is specified, you cannotspecify a service (it must be NULL). Also, if aservice is specified, resource_consumer_group must beNULL.

service

This attribute specifies the database service that the jobs inthis class will have affinity to. In a RAC environment, this meansthat the jobs in this class will only run on those databaseinstances that are assigned to the specific service.

If a service is specified, resource_consumer_groupmust be NULL. Note that a service can be mapped to aresource consumer group, so you can also control resourcesallocated to jobs by specifying a service. SeeDBMS_RESOURCE_MANAGER.SET_CONSUMER_GROUP_MAPPINGfor details.

If no service is specified, the job class will belong to thedefault service, which means it will have no service affinity andany one of the database instances within the cluster might run thejob. If the service that a job class belongs to is dropped, the jobclass will then belong to the default service.

If the specified service does not exist when creating the jobclass, then an error occurs.

logging_level

This attribute specifies how much information is logged. Thethree possible options are:

  • DBMS_SCHEDULER.LOGGING_OFF

    No logging will be performed for any jobs in this class.

  • DBMS_SCHEDULER.LOGGING_RUNS

    The Scheduler will write detailed information to the joblog for all runs of each job in this class. This is thedefault.

  • DBMS_SCHEDULER.LOGGING_FULL

    In addition to recording every run of a job, the Scheduler willrecord all operations performed on all jobs in this class. In otherwords, every time a job is created, enabled, disabled, altered, andso on will be recorded in the log.

log_history

This enables you to control the amount of logging the Schedulerperforms. To prevent the job log and the window log from growingindiscriminately, the Scheduler has an attribute that specifies howmuch history (in days) to keep. Once a day, the Scheduler willautomatically purge all log entries from both the job log as wellas the window log that are older than the specified history. Thedefault is 30 days.

You can change the default by using theSET_SCHEDULER_ATTRIBUTE procedure. For example, tochange it to 90 days, issue the following statement:

DBMS_SCHEDULER.SET_SCHEDULER_ATTRIBUTE('log_history','90');

The range of valid values is 1 through 999.

comments

This attribute is for an optional comment about the job class.By default, this attribute is NULL.


Usage Notes

For users to create jobs that belong to a job class, the jobowner must have EXECUTE privileges on the job class.Therefore, after the job class has been created,EXECUTE privileges must be granted on the job class sothat users create jobs belonging to that class. You can also grantthe EXECUTE privilege to a role.

Creating a job class requires the MANAGESCHEDULER system privilege.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值