When executing a permissions script an Oracle database agent the following error occurs
ERROR at line 1:
ORA-20001: ORA-04021: timeout occurred while waiting to lock object ,sql:
grant select on gv_$instance to FOGLIGHT_AGENT
ORA-06512: at "SYS.EXECUTE_IMMEDIATE", line 34
ORA-06512: at line 191
Use the following to look for the source of the locking:
Once the sid has been determined the process locking the object can be killed.
RESOLUTION 2Contact Oracle Support to clarify why the select privilege cannot be granted to gv_$instance.
As a workaround the following code may be successful in granting the privilege:
DECLARE vcmd varchar2(4000); BEGIN vcmd :=' grant select on gv_$instance to FOGLIGHT'; sys.execute_immediate(vcmd,-02030); END; /
© ALL RIGHTS RESERVED. Feedback 使用条款 隐私