我要在死人时发送sendmsg。
所以我需要在程序中DBA_JOBS
选择
我如何在过程中使用DBA_JOBS
我正在尝试此代码:
SELECT COUNT(*)
FROM DBA_JOBS
WHERE JOB in('539','639','679','719','919','1359');
但是这个错误阻止了我的新程序
ORA-00942 表或视图不存在
答案 0 :(得分:0)
您需要明确授予对此视图的读取权限。
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>
答案 1 :(得分:0)
不需要授予使用整个数据库所需的dba_jobs
视图。改用user_jobs
视图:
SELECT COUNT(*) as count
FROM USER_JOBS
WHERE JOB in('539','639','679','719','919','1359');