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.
Similar Messages
-
Grant execute on javaclass is not working
I have successfully compiled a java class in schema two which provides a connection to an OEM data source. I subsequently compiled another java class, also in schema two, that uses the connection in the connection class and loads a temp table. Now, the connection class should really be in a different schema, so I recompiled it in schema one, changed the class name in schema two and then recompiled the one in schema two to essentially remove it from the picture.
When I tested my call specification to the second class, which loads the temporary table, I get an error, as expected because the connection class no longer exists in schema two.
On page 2-15 of the Java Developer's Guide 11g Release 1, it says:
You can provide other users the right to run your class in the following ways:
Using the loadjava -grant option:
Using the following command:
SQL> grant execute on myclass to scott;However, when using the second option (as the user of schema one where I just recompiled it), I get a message that the class does not exist. I have done everything I can think of to confirm that the name I have entered is correct including:
select dbms_java.shortname('long classname') from dual;Is this not really an acceptable way to grant execute privileges on a java source to another schema?
Thanks,
GregoryHi,
you can use quotation mark, because the grant internally transform your javaclass in uppercase.
So :
grant execute on "myclass" to scott ;
will succeed as
grant execute on myclass to scott ;
will not ;o)
regards,
Virgile CREVON
Edited by: user513154 on 12 juil. 2011 04:58 -
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. -
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, --DDMaybe, 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 -
Why can't I grant execute on a directory?
Why can't I grant execute to a directory?
I have carried out the following:
Login as SYS
Prove that the oracle directory exists SELECT * FROM all_directories WHERE directory_name = 'dir_name';
GRANT EXECUTE ON DIRECTORY dir_name TO role_name;
The following documentation at the following address says that I can grant execute:
http://www.morganslibrary.org/reference/directories.html
And yet when I directed the dba to do it and when I query the database to see if He did it it shows me that he did:
GRANTOR GRANTEE TABLE_SCHEMA TABLE_NAME PRIVILEGE GRANTABLE HIERARCHY
SYSTEM role_name SYS dir_name EXECUTE NO NO
SYSTEM role_name SYS dir_name READ NO NO
SYSTEM role_name SYS dir_name WRITE NO NO
3 rows selectedWhen I try it in my xe environment it throws the error:
Error starting at line 1 in command:
GRANT EXECUTE ON DIRECTORY dir_name TO role_name
Error report:
SQL Error: ORA-22928: invalid privilege on directories
22928. 00000 - "invalid privilege on directories"
*Cause: An attempt was made to grant or revoke an invalid privilege on a
directory.
*Action: Only CREATE, DELETE, READ and WRITE privileges can be granted or
revoked on directories. Do not grant or revoke other privileges.What is going on?
BentonBenton wrote:
Why can't I grant execute to a directory?Because you can't, according to the 10g documentation...
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9013.htm#BGEJEBCJ
However in 11g, it can be done...
http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_9013.htm#BGBCIIEG -
Does GRANT CREATE ANY PROCEDURE auto grants EXECUTE on created obj to user?
I have a User ABC which has GRANT CREATE ANY PROCEDURE on schema XYZ. Now, I create a new Function in schema XYZ using my ID ABC named "func123". My question is, would my User ID ABC being creator of func123 be able to EXECUTE it by default ???
Note: ID ABC has not been explicitly given GRANT EXECUTE on this func123 function, neither it has GRANT EXECUTE ANY PROCEDURE on schema XYZ.
Thanks in advance.There is no such thing as 'create any procedure on schema xyz'. When an user has create any procedure, he can create a procedure in any schema, including SYS.
You have an unprotected and unsecured database by granting this powerful privilege to multiple users.
Also when you create a procedure in a different schema, that schema becomes the owner, not the user creating it.
Kindly brush up your basics and (re)read documentation.
Sybrand Bakker
Senior Oracle DBA -
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 -
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 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 stored procedure
I'm trying to allow the "help desk" people to connect via a special database account and execute a procedure to reset or unlock a users's password or account. I've created two stored procedures as user1 and have granted EXECUTE on user1.unlockaccount. Within the procedure I have an IF statement that basically says if the username is IN the following ('SYS','SYSTEM', ect.) then dbms_output.put_line ('not_allowed'). The ELSE is 'execute immediate 'alter user '||pUserName||' identified by '||pPassWord||' account unlock';
Then an exception when others statement to output the 'error: '||sqlerrm
The procedure compiles fine and I can execute it without error as 'user1' but when I GRANT EXECUTE ON USER1.UNLOCKACCOUNT TO USER2 and try to 'execute user1.unlockaccout ('username'); I get insufficient privileges.
I've also switched to SYS and "GRANT EXECUTE ON USER1.UNLOCKACCOUNT TO USER2;" but I still get the same insufficient privs error. If I don't 'set serveroutput on;' I don't see the error message, but it still fails.
Actually, one correction. I'm getting insufficient privs as user1 as well. user1 can unlock a user's account and reset a password outside of the procedure but I'm getting insufficient privs when executing the procedure.
Edited by: wolfeet on Jun 8, 2011 8:49 PMHi,
wolfeet wrote:
Granting ALTER USER directly to the user defeats the whole purpose. I want to allow this user to reset user passwords and unlock user passwords but I don't want the user to be able to reset passwords for dba accounts, sys, system, yada yada. I was hoping I could do this via GRANT EXECUTE on a stored procedure.Solomon said to grant ALTER USER directly to user1, the owner of the procedure, who already has this privilege via a role.
User2, who will run the procedure, needs only EXECUTE privileges on the procedures. User2 will not need the ALTER USER privilege. -
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 keywordmalhi 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 -
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?
thanksAs 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 -
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 helpHi,
you can try this.
GRANT EXECUTE ON MDRXML.mx_submit_message_pkg_raj to MDRCENTRAL
thanks -
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> -
Need grant execute on dbms_rls for VPD
Hi,
I need grant execute on dbms_rls to setup "Virtual Private Database".
How do I go about getting it?
Thank you, Bill
[email protected]Hi Scott and All,
I got the DBA to grant execute to the workspace userid BHRS and run the 2 policies I have for the VPD as BHRS.
begin
dbms_rls.add_policy (
object_schema => 'BHRS',
object_name => 'MR_REQUEST',
policy_name => 'USER_SU_POLICY',
function_schema => 'BHRS',
policy_function => 'GET_SU_USER_ID',
statement_types => 'SELECT, UPDATE',
update_check => TRUE
end;
But, when I went to select * from MR_REQUEST
I got ORA-28112: failed to execute policy function
So I reduced my function down to returning null
create or replace function GET_SU_USER_ID
return varchar2
as
l_retstr varchar2(2000);
l_count integer:=0;
begin
l_retstr := null;
return l_retstr;
end;
Researched a bit and found could look in the USER_DUMP file but the DBA here says the DB doesn't have one because we use the XDB ???
How can I check the policy errors or debug this problem?
Thanks Bill
Maybe you are looking for
-
CLASSPATH not getting picked up for MWA
Hi All, Oracle Database 11g R 11.1.0.7.0 Oracle Applications R 12.1.1 O/S:Linux CLASSPATH not getting picked up for MWA.My classes are lying under $JAVA_TOP/xyz. However my suspicion is that the jvm that deals with MWA is not looking at the classpath
-
Hello, I am running this command "$FND_TOP/patch/115/bin/perl ojspCompile.pl --compile --flush -p 2", and I received a lot of compiltion errors like the following: [11424] !!COMPILATION ERROR(0) eiste/jsp/admin_show_lovrows.jsp: javac: file not found
-
My Mac is an ISO leopard 10.5.8 and it came with iMovie. However, I deleted iMovie two months ago and I wanted to reinstall it. I get this message " The following install step that failed: run preflight script for iWeb. Contact The software manufactu
-
Photoshop CC & Lightroom 5 for £8.78
Yesterday I joined the deal of photoshop CC and lightroom 5 for £8.78. Photoshop CC downloaded just fine however lightroom did not dkwnload at all... I paid for it so I also exlected to recieve a serial number to activate it and some sort of reciet i
-
Uploading and attaching files problem
Dear all, Since a couple of weeks, I can not attach anything to a mail nor upload any image or file on any website (facebook, fileshare etc.). The finder always freezes (no matter if it's Mail, Safari, Chrome or etc.) and I have to start the app aga