DBMS LOB.SUBSTR Throwing ORA-00904: Invalid Identifier Error

我的梦境 提交于 2020-01-04 11:03:01

问题


One of our cutomer is running the scripts in oracle sql developer to upgrade his database table structure, procudere & triggers etc. But while running the script, he is getting ORA-00904: Invalid Identifier Error for DBMS_LOB.SUBSTR() and DBMS_LOB.GETLENGTH() in one procedure.

Can somebody tell why is happening so?

There are using Oracle Sql developer Version 3.1.07 Build MAIN-07.42 with Oracle 11g.


回答1:


I imagine 3 possible reasons:

  1. the user lacks execute privilege on sys.dbms_lob (although the privilege is granted to PUBLIC by default)
  2. there is no synonym dbms_lob for sys.dbms_lob in the database (although such public synonym should exist)
  3. the schema, on which the customer works, contains some other package with the same name DBMS_LOB



回答2:


Run this sql with sys to check whether your schema has privilege to execute DBMS_LOB.

select * from dba_tab_privs where table_name='DBMS_LOB';

By default, you should see PUBLIC in the grantees.

If not, you can run sql with sys.

grant execute on sys.DBMS_LOB to public;

or

grant execute on sys.DBMS_LOB to <your_schema_name>


来源:https://stackoverflow.com/questions/10118994/dbms-lob-substr-throwing-ora-00904-invalid-identifier-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!