0

我想在deadjob时发送sendmsg。所以我需要DBA_JOBS在程序中选择如何DBA_JOBS在我尝试此代码的程序中使用:

SELECT COUNT(*)
  FROM DBA_JOBS
 WHERE JOB in('539','639','679','719','919','1359');

但是这个错误阻止了我的新程序

ORA-00942表或视图不存在

4

2 回答 2

0

您不需要被授予dba_jobs使用整个数据库所需的视图。改用user_jobs视图:

SELECT COUNT(*) as count
  FROM USER_JOBS
 WHERE JOB in('539','639','679','719','919','1359');
于 2018-12-04T06:51:17.680 回答
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>
于 2018-12-04T05:16:49.783 回答