In one of our Oracle DB instances, I am unable to modify one row in user_jobs
view (I want to modify the Next_Date
so that the job will be executed at specified time once). I can't do it in as neither the owner nor the sysdba. The error code was 01031 insufficient privileges tips. I know I can do that because I am able to do the same thing in another DB instance. So what kind of privileges I need to alter this view? Thank you!
Asked
Active
Viewed 939 times
0

tete
- 4,859
- 11
- 50
- 81
-
[Use the queries from this answer to query the system privilege views and answer your own question](http://stackoverflow.com/questions/9811670/how-to-show-all-privileges-from-a-user-in-oracle). Best of luck. – Bob Jarvis - Слава Україні Jul 15 '16 at 02:13
-
@BobJarvis , Thank you for your comment. I have little experience as DBA so I am not sure you what view you are referring to. Care to elaborate a bit more? – tete Jul 15 '16 at 02:21
-
The first sentence of my earlier comment is a link to another StackOverflow question which provides information on how to find the answer yourself. – Bob Jarvis - Слава Україні Jul 15 '16 at 02:23
-
If you're trying to run something like `update user_jobs set ...` that will not reliably work. Data dictionary tables cannot be directly modified, at least not safely and reliably. Instead you'll need to use an API, like in DBMS_JOBS or DBMS_SCHEDULER. – Jon Heller Jul 15 '16 at 03:46
-
@JonHeller. Thank you for you comment. Like I mentioned I have little experience as DBA. I just use PL/SQL Developer and run the query `SELECT * FROM USER_JOBS FOR UPDATE` then I'll modify the field in the UI directly. You said it is not safe and not reliable. But I 100% can't modify it. So I am guessing still some flag which forbids me to do it? But in another DB instance I am able to do it? – tete Jul 15 '16 at 09:45
1 Answers
0
Never directly modify tables in the data dictionary. Most of those "tables" are complicated views on undocumented objects. There's no telling what will happen if you modify them.
Instead, use the documented procedure DBMS_JOB.CHANGE to modify job properties. Or even better, avoid those old-fashioned jobs and use the newer DBMS_SCHEDULER package to create and manage jobs.

Jon Heller
- 34,999
- 6
- 74
- 132