Grant execute on DBMS_CRYPTO package (11R1)

I figured out I needed to grant my user access to this SYS package using:
SQL> grant execute on DBMS_CRYPTO to lob_demo;
Grant succeeded.
yet after doing this, I still get this error:
SQL> select DBMS_CRYPTO.HASH(bytes, DBMS_CRYPTO.HASH_SH1) from blobslicer where id=1;
select DBMS_CRYPTO.HASH(bytes, DBMS_CRYPTO.HASH_SH1) from blobslicer where id=1
ERROR at line 1:
ORA-06553: PLS-221: 'HASH_SH1' is not a procedure or is undefined
Yet if I use the numeric constant for DBMS_CRYPTO.HASH_SH1 (3), it works:
SQL> select DBMS_CRYPTO.HASH(bytes, 3) from blobslicer where id=1;
F5A7338EFFEB15A49AFC9545393EF685BB51F931
So what am I missing that prevents me from having access to a constant in the package when I can successfully use one of the function of that same package?
Thanks, --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe, that makes a little bit clearer the difference
between usage of package constants in sql and pl sql...That's what I suspected, thank you for hammering the point home Maxim.
The taken away for me is that package constants are not available to SQL code, only to PL/SQL code. (irrelevant of their type most likely).
I actually tried to grant my user SELECT privileges on the package, because accessing a constant from a package is more akin to SELECT than EXECUTE, but of course one cannot do that.
Thank you both again for the help. --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • GRANT EXECUTE ON SCHEMA.PACKAGE.PROCEDURE TO USER

    Hi,
    GRANT EXECUTE ON SCHEMA.PACKAGE.PROCEDURE TO USER
    returns:
    ORA-00905, do you know why? Can I grant privileges on procedure inside package?
    thanks

    As per my knowledge of oracle, we cannot grant privileges on procedure inside a package.
    <br><br>
    Raj<br>
    <b>www.oraclebrains.com<a>
    <br><font color="#FF0000">POWERED by the people, to the people and for the people WHERE ORACLE IS PASSION.</font></b>
    <br>
    Sorry Leonardo Horikian & Kamal Kishore, I was late and didn't know that you guys have already posted the answer.
    Message was edited by:
    rajs

  • Grant execute on a Package

    I am trying to grant on a package and I am getting this error, what key word is missing.
    1* GRANT EXECUTE ON PACKAGE MDRXML.mx_submit_message_pkg_raj to MDRCENTRAL
    SQL> /
    GRANT EXECUTE ON PACKAGE MDRXML.mx_submit_message_pkg_raj to MDRCENTRAL
    ERROR at line 1:
    ORA-00905: missing keyword
    Will appreciate all the help

    Hi,
    you can try this.
    GRANT EXECUTE ON MDRXML.mx_submit_message_pkg_raj to MDRCENTRAL
    thanks

  • Dbms_crypto package and grants to public

    on 11g RAC installaton we are not getting on default , grants on dbms_crypto to public are set and some time this package is also not installed. what could be the reason ?

    Hi,
    Post here what you're trying to do.
    Oracle Database installs this package in the SYS schema. You can then grant package access to existing users and roles as needed.
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_crypto.htm#i1004143
    $ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.2.0 Production on Wed Aug 24 12:55:59 2011
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning, Automatic Storage Management, OLAP, Data Mining
    and Real Application Testing options
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    SQL> SELECT OWNER,SYNONYM_NAME,TABLE_OWNER FROM DBA_SYNONYMS WHERE TABLE_NAME ='DBMS_CRYPTO';
    OWNER                          SYNONYM_NAME                   TABLE_OWNER
    PUBLIC                         DBMS_CRYPTO                    SYS
    SQL> create user cool identified by cool account unlock;
    User created.
    SQL> grant connect to cool;
    Grant succeeded.
    SQL> grant execute on dbms_crypto to cool;
    Grant succeeded.
    SQL> grant execute on dbms_crypto to public;
    Grant succeeded.Levi Pereira

  • To grant execute on a specific procedure in a package

    is there a way to grant execute on a specific procedure in a package without granting execute to the package itself.

    Case 1: If you have package function,
    ->Then you can create a view on it and give access to specific user.
    Case 2: If you have package procedure
    -> I think, there is no direct method to GRANT part of package.
    -> Make GLOBAL procedure only the one that you want to grant to the user. Now if you grant the package (having few global), user only able to access the GLOBAL's only..
    So how do u implement?
    PACKAGE global_pkg
    Procedure first_global_procedure;
    Procedure second_global_procedure;
    END global_pkg;
    Now You create Package as per user access:
    Package user_1_pkg
    call first_global_procedure;
    END;
    Package user_2_pkg
    call second_global_procedure;
    END;
    Now, you Grant user_1_pkg to USER1 and user_2_pkg to USER2

  • DBMS_CRYPTO package help needed :(

    Hello all,
    I want to use Oracle's DBMS_CRYPTO package for decrypting some data.
    I have one sample program as follows which is not working....the error is shown below.
    SQL> DECLARE
    2 input_string VARCHAR2 (200) := 'Secret Message';
    3 output_string VARCHAR2 (200);
    4 encrypted_raw RAW (2000); -- stores encrypted binary text
    5 decrypted_raw RAW (2000); -- stores decrypted binary text
    6 num_key_bytes NUMBER := 256/8; -- key length 256 bits (32 bytes)
    7 key_bytes_raw RAW (32); -- stores 256-bit encryption key
    8 encryption_type PLS_INTEGER := -- total encryption type
    9 DBMS_CRYPTO.ENCRYPT_AES256
    10 + DBMS_CRYPTO.CHAIN_CBC
    11 + DBMS_CRYPTO.PAD_PKCS5;
    12 BEGIN
    13 DBMS_OUTPUT.PUT_LINE ( 'Original string: ' || input_string);
    14 key_bytes_raw := DBMS_CRYPTO.RANDOMBYTES (num_key_bytes);
    15 encrypted_raw := DBMS_CRYPTO.ENCRYPT
    16 (
    17 src => UTL_I18N.STRING_TO_RAW (input_string, 'AL32UTF8'),
    18 typ => encryption_type,
    19 KEY => key_bytes_raw
    20 );
    21 decrypted_raw := DBMS_CRYPTO.DECRYPT
    22 (
    23 src => encrypted_raw,
    24 typ => encryption_type,
    25 KEY => key_bytes_raw
    26 );
    27 output_string := UTL_I18N.RAW_TO_CHAR (decrypted_raw, 'AL32UTF8');
    28 DBMS_OUTPUT.PUT_LINE ('Decrypted string: ' || output_string);
    29 END;
    30 /
    DBMS_CRYPTO.ENCRYPT_AES256
    ERROR at line 9:
    ORA-06550: line 9, column 2:
    PLS-00201: identifier 'DBMS_CRYPTO' must be declared
    ORA-06550: line 8, column 23:
    PL/SQL: Item ignored
    ORA-06550: line 14, column 21:
    PLS-00201: identifier 'DBMS_CRYPTO' must be declared
    ORA-06550: line 14, column 4:
    PL/SQL: Statement ignored
    ORA-06550: line 15, column 21:
    PLS-00201: identifier 'DBMS_CRYPTO' must be declared
    ORA-06550: line 15, column 4:
    PL/SQL: Statement ignored
    ORA-06550: line 21, column 18:
    PLS-00201: identifier 'DBMS_CRYPTO' must be declared
    ORA-06550: line 21, column 1:
    PL/SQL: Statement ignored
    Oracle version is
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production on linux server.
    can anybody help me how to resolve this problem?
    I mean isnt "DBMS_CRYPTO" Oracle's Standard package?
    pls help.

    Really you should not be using SYSTEM account - you should create your own DBA / Development accounts and use those.
    However, what you are missing is to connect as SYS/SYSDBA and...
    GRANT EXECUTE ON dbms_crypto TO system;

  • "GRANT EXECUTE ANY PROCEDURE TO " does not work in some cases

    Hello,
    I some of my PL/SQL-packages I'm using DBMS-packages.
    Because I don't want to grant access for every single package, I granted EXECUTE ANY PROCEDURE to the user/schema of my packages.
    This did work in several installation.
    But for what reason ever, in one installation DBMS_RANDOM cannot be used (DBMS_RANDOM must be declared). If I explicitly grant execute on this package, it works. When I revoke it and renew the ANY PROCEDURE, it doesn't again.
    What's wrong.
    Version 11.2.0.2 on Win2008R2
    Regards,
    Mynz

    Mynz wrote:
    Hello,
    I some of my PL/SQL-packages I'm using DBMS-packages.
    Because I don't want to grant access for every single package, I granted EXECUTE ANY PROCEDURE to the user/schema of my packages.
    This did work in several installation.
    But for what reason ever, in one installation DBMS_RANDOM cannot be used (DBMS_RANDOM must be declared). If I explicitly grant execute on this package, it works. When I revoke it and renew the ANY PROCEDURE, it doesn't again.
    What's wrong.privilege acquired via ROLE do NOT apply within named PL/SQL procedures/functions

  • Grant execute any function or package

    Hi,
    Does the below command give execute priviliges on functions and packages too ?
    grant execute any procedure to <user>;
    When i give same for fucntion it gives following error,
    SQL> grant execute any function to user2;
    grant execute any function to user2
    ERROR at line 1:
    ORA-00990: missing or invalid privilege
    Thanks.

    EXECUTE ANY PROCEDURE grants permission to all procedures and all functions, whether stand alone or packaged.
    Hopefully, you're well aware of this, but the various ANY privileges, like EXECUTE ANY PROCEDURE, are exceptionally powerful. You want to be very cautious about granting those privileges because they can introduce a number of security holes.
    Justin

  • Grant Execute on package Specification

    How to give grant to package specification to another user?
    The package has only specification and no package body
    in package specification i have defined some constants variables which i need to access from another user?
    Current if i give grant execute from the other user it is shwoing up only blank body......

    Works for me...
    As test_user...
    SQL> create or replace package test_vars is
      2    g_number number := 100;
      3  end;
      4  /
    Package created.
    SQL> grant execute on test_vars to scott;
    Grant succeeded.As scott...
    SQL> create synonym test_vars for test_user.test_vars;
    Synonym created.
    SQL> set serverout on
    SQL> begin
      2    dbms_output.put_line(test_vars.g_number);
      3  end;
      4  /
    100
    PL/SQL procedure successfully completed.
    SQL>

  • Why doesn't the "grant execute any procedure" work?

    Hi to all.
    I want to grant the execute privilege for all SYS schema functions/procedures. To achieve it I do the following:
    SQL> connect sys/*****@orcl
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as SYS
    SQL> create user test identified by test;
    User created
    SQL> grant create session to test;
    Grant succeeded
    SQL> grant execute any procedure to test;
    Grant succeeded
    According to the [http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9013.htm] the "grant execute any procedure" - grants Execute procedures or functions, either standalone or packaged.
    So, the steps seem to be right. Then, I try to connect to the test user and execute any procedure from the SYS schema, for example, dbms_lock.sleep:
    SQL> connect test/test@dizzy/orcl
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as test
    SQL> begin
    2 sys.dbms_lock.sleep(1);
    3 end;
    4 /
    begin
    sys.dbms_lock.sleep(1);
    end;
    ORA-06550: line 3, column 1:
    PLS-00201: identifier 'SYS.DBMS_LOCK' must be declared
    ORA-06550: line 3, column 1:
    PL/SQL: Statement ignored
    So, the execution fails due to insufficient rights. However, the direct grant on the sys.dbms_lock works!
    SQL> connect sys/*****@dizzy/orcl as sysdba
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as SYS
    SQL> grant execute on dbms_lock; to test;
    grant execute on dbms_lock; to test
    ORA-00911: invalid character
    SQL> grant execute on dbms_lock to test;
    Grant succeeded
    SQL> connect test/test@dizzy/orcl
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as test
    SQL> begin
    2 sys.dbms_lock.sleep(1);
    3 end;
    4 /
    PL/SQL procedure successfully completed
    So, to be sure that the grant on any procedure from the definite scheme is given, should I avoid giving the execute any procedure grant?
    P.S. Is there any special tag for code?
    Thanks in advance.

    Sybrand, thank you for the reply.
    You are right. I tried to connect by another user NOT SYS and created the function:
    SQL> create user testic identified by i;
    User created
    SQL> grant create session, execute any procedure to testic;
    Grant succeeded
    SQL> create or replace function get1 return number is
      2  begin
      3  return 1;
      4  end;
      5  /
    Function created
    SQL> connect testic/i@orcl
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as testic
    SQL> select get1 from dual;
    select get1 from dual
    ORA-00904: "GET1": invalid identifier
    SQL> select kaisa_rgali.get1 from dual;
          GET1
             1Thank you for the tag. This's exactly what I asked about.
    Finally, I tried t open the hyperlink http://download.oracle.com/docgs/cd/B10501_01/server.920/a96521/privs.htm but it failed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Hiding the column data. What is the point of DBMS_CRYPTO package?

    DB version:10g R2
    A requirement has come where we need to hide some columns' data from end users.
    Trasparent Data Encryption feature wouldn't do the trick as it encrypts the data only at the storage level not at user level.
    I've seen PL/SQL codes using DBMS_CRYPTO which encrypts and decrypts input strings like the code mentioned in
    Re: Need some hints on using dbms_crypto
    What is point of these PL/SQL codes?
    They can only be used to create functions which will be called in VIEWS. That is the only use of DBMS_CRYPTO package. Right?
    Do you guys have any suggestion in hiding/obfuscating column data? Is creating a view my only option?

    One solution to "hide" data (columns or rows) from end users is simply to create a view.
    The end user will be granted only access to the view and not to the base tables behind the view. The view will only expose those cloumns and rows that the end users is supposed to see.
    Of cause this has nothing to do with encryption. But I don't see anything in your business requirements that needs to use encryption methods.

  • Grant permission to all packages in another schema

    Is there a way I can grant access to all the packages in another user's schema?
    Please guide me.
    Thanks!

    The one way is to use cursor :
    BEGIN
      FOR Rec IN (SELECT object_name, object_type FROM all_objects WHERE owner='SOURCEUSER' AND object_type IN ('PACKAGE')) LOOP
          EXECUTE IMMEDIATE 'GRANT EXECUTE ON SOURCEUSER.'||Rec.object_name||' TO TARGETUSER';
        END IF;
      END LOOP;
    END;Edited by: Radrigez on 13.07.2011 21:38

  • Grant execute

    Hi
    the following command gives error ORA-00905: missing keyword
    i am trying to run the command from xoe schema
    Xadv is another user.
    GRANT EXECUTE
         ON
         PACKAGE
         xoe.xoe_utils_pkg.Get_Status_Desc TO xadv
    thanks in advance
    Mani

    In other words, If you want to expose only this method a "UserA", create a procedure/function that access only this method and grant it to "UserA".
    Otherwise, Once you ganted the package to a "UserA", user has access to all methods and properties declared in the package spec.
    Hope this helps.

  • Error granting EXECUTE on DBMS_JAVA:-4042:ORA-04042: procedure, function,

    Hi .
    I 'm experiencingn the following problem when granting acess to the sys user can any one help please in this issue.I 'm using an oracle 10 g on a solaris system.
    Granting EXECUTE on DBMS_JAVA to SYSTEM WITH GRANT OPTION
    Error granting EXECUTE on DBMS_JAVA:-4042:ORA-04042: procedure, function,
    Thanks.

    You need to execute this with user "sys"
    see my test please:
    oracle@myserver:~> sqlplus "/ as sysdba"
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 17 13:24:28 2010
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    sys@MYSID> grant EXECUTE on DBMS_JAVA to SYSTEM WITH GRANT OPTION;
    Grant succeeded.
    sys@MYSID>as I check ORA-04042: procedure, function, package, or package body does not exist
    I can see that you issue is that you don't have Oracle JVM option installed in your database.
    start database configuration assistant (dbca) choose configure database options operations select your DB SID and install Oracle JVM for your database (find it under Standard database components button)
    HTH, Regards

  • Grant execute on schema.pakage.procedure.........

    i need to grant execute permission to a user on a procedure that is part of a package, i give this command which return error. What should i do
    grant execute on  CORE_BUSINESS.PKG_CORE_BUSINESS_IP.ALTER_TEMP_INSURED_PERSON_DATA to cb_softdata;
    [Error] Execution (3: 53): ORA-00905: missing keyword

    malhi wrote:
    i need to grant execute permission to a user on a procedure that is part of a package, i give this command which return error. What should i do
    grant execute on  CORE_BUSINESS.PKG_CORE_BUSINESS_IP.ALTER_TEMP_INSURED_PERSON_DATA to cb_softdata;
    [Error] Execution (3: 53): ORA-00905: missing keyword
    Hi
    Its not possible to grant at procedure level which exists inside a package.
    Try
    grant execute on  CORE_BUSINESS.PKG_CORE_BUSINESS_IP to  cb_softdata;Regards,
    Achyut
    Edited by: Achyut K on May 9, 2011 3:09 AM
    Nanu Kannadiga
    Edited by: Achyut K on May 9, 2011 3:17 AM

Maybe you are looking for