The user SYS creates a job by using the following command:
Which two statements are true about the job that was created by the preceding command? (Choose two.)
A. The job is enabled by default after creation
B. The job is automatically dropped after the end date
C. The job executes with the privileges of the user SYS
D. The globalization environment that exists at the time of the job creation prevails at the job runs
本题考点是使用 DBMS_SCHEDULER.CREATE_JOB 创建一个单独调用作业,不使用现有的调度和程序。
其中必须的参数是 job_name,job_type,job_action:
DBMS_SCHEDULER.CREATE_JOB (
job_name IN VARCHAR2,
job_type IN VARCHAR2,
job_action IN VARCHAR2,
number_of_arguments IN PLS_INTEGER DEFAULT 0,
start_date IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
repeat_interval IN VARCHAR2 DEFAULT NULL,
end_date IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
job_class IN VARCHAR2 DEFAULT 'DEFAULT_JOB_CLASS',
enabled IN BOOLEAN DEFAULT FALSE,
auto_drop IN BOOLEAN DEFAULT TRUE,
comments IN VARCHAR2 DEFAULT NULL,
credential_name IN VARCHAR2 DEFAULT NULL,
destination_name IN VARCHAR2 DEFAULT NULL);
job_type 有下列几种类型:
PLSQL_BLOCK:指明 job 是匿名 PL/SQL 块
STORED_PROCEDURE:job 是一个 PL/SQL 或者 JAVA 存储过程或者一个拓展 C 子程序
EXECUTABLE,CHAIN job_action 更加不同的 type 有不同的值,此处是存储过程。 enabled 默认是 false,也就是创建完成后不会自动启动,auto_drop 默认是 true,说明在 job 完成之后会自动的删除。所以 A 错,B 对
由于创建的用户使用的 SYS,所以 job 执行权限是 SYS,C 对。用户创建的 job 属于一个作业类,作业所有者必须有这个作业类的执行权限,才能运行。
D 错误,job 属于数据库内部的调度,不受全局环境的影响。