我想在deadjob时发送sendmsg。所以我需要DBA_JOBS
在程序中选择如何DBA_JOBS
在我尝试此代码的程序中使用:
SELECT COUNT(*)
FROM DBA_JOBS
WHERE JOB in('539','639','679','719','919','1359');
但是这个错误阻止了我的新程序
ORA-00942表或视图不存在
您不需要被授予dba_jobs
使用整个数据库所需的视图。改用user_jobs
视图:
SELECT COUNT(*) as count
FROM USER_JOBS
WHERE JOB in('539','639','679','719','919','1359');
您需要明确授予此视图的读取权限。
oracle@esmd:~> sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Dec 4 08:15:47 2018
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
SQL> grant select on dba_jobs to scott;
Grant succeeded.
SQL>