问题
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:
- the user lacks execute privilege on sys.dbms_lob (although the privilege is granted to PUBLIC by default)
- there is no synonym dbms_lob for sys.dbms_lob in the database (although such public synonym should exist)
- 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