Permission for ORACLE to call dbms _ packages during storage

Source: Internet
Author: User

ORACLE encountered a problem with the permission to call the dbms _ package during the storage process: ETL @ RACTEST> begin 2 DBMS_LOCK.sleep (1); 3 end; 4/PL/SQL procedure successfully completed. www.2cto.com but ETL @ RACTEST> create or replace procedure etl. pliutest 2 authid current_user 3 AS 4 BEGIN 5 DBMS_LOCK.sleep (1); 6 END; 7/www.2cto.com Warning: Procedure created with compilation errors. elapsed: 00:00:00. 07ETL @ RACTEST> ETL @ RACTEST> show errorsErrors for PR Ocedure etl. PLIUTEST: LINE/col error -------- submit 5/2 PL/SQL: Statement ignored5/2 PLS-00201: identifier 'dbms _ lock' must be declared the same package, it can be executed in anonymous blocks of the same user, but it does not have the permission to execute in the stored procedure, when pkg starting with DBMS _ is used in pl/SQL, You need to execute grant execute on dbms_xxxx to xxx to grant the permission. In addition, the system user is not authorized to log on to the system by using sys or plsql/as dba. After authorization, you can see: SYSTEM @ RACTEST> select grantee, owner, table_name, grantor, privilege from dba_tab_privs where table_name like 'dbms _ lock '; grantee owner TABLE_NAME grantor privilege quota ---------- specified SYS DBMS_LOCK sys executedmsys DBMS_LOCK SYS specified SYS DBMS_LOCK sys executemdsys sys DBMS_LOCK SYS E XECUTEOLAPSYS DBMS_LOCK sys executesysman sys DBMS_LOCK sys executeetl sys DBMS_LOCK sys execute 8 rows selected. then run: SYSTEM @ RACTEST> create or replace procedure etl again. pliutest 2 authid current_user 3 AS 4 BEGIN 5 DBMS_LOCK.sleep (1); 6 END; 7/Procedure created. OK!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.