Grant execute on a package in another schema of users
I need the ability to grant enforcement on a package in another schema of users...i.e. User_1 a Package pkg_package1
User_2 should be able to grant execute on user_1.pkg_package1 to other users.
I know you can give any procedure (I think) to user_2 and - it must be able to do.
The problem is - I don't want user_2 can grant execute on any procedure in the database - just a diagram of user_1.
Is there a way to do this?
Hello
FOT individual packages, you can tell
GRANT EXECUTE ON pkg_package1
TO user2
WITH GRANT OPTION;
Alternatively, you can write a procedure in the schema of user_1 which grants privileges and give privileges to EXECUTE user_2 on the procedure.
Tags: Database
Similar Questions
-
Call a package in another schema of a trigger?
Is there a method to call a procedure of a trigger package when the package is in a different schema than the trigger (table)?
Do you need a dblink to run a procedure in a different diagram in the same database?The current scheme should have a privilege on the package execute
example of
HR schema has a package pkg_emp from HR Schema -> Grant execute on pkg_emp to SCOTT Now the table is in SCOTT schema and the table in this schema can all the package using HR.pkg_emp.
Do you need a dblink to run a procedure in a different diagram in the same database?
>No, you need not create the database link
Sanjay
-
You can grant execute on the package to the role?
Is it possible to run on a package for a role? The following excerpt (run as SYS AS SYSDBA) illustrates my problem.
Grant execute on foo_user.foo_package to bar_role works, however, the creation of the trigger based on the grant does not work. If, however, I replace the grant to bar_role with a grant to bar_user the creation of the trigger works very well. Therefore replacementSET SERVEROUTPUT ON SIZE 1000000; CREATE USER foo_user IDENTIFIED BY foo; GRANT CONNECT, UNLIMITED TABLESPACE TO foo_user; CREATE USER bar_user IDENTIFIED BY bar; GRANT CONNECT, UNLIMITED TABLESPACE TO bar_user; CREATE OR REPLACE PACKAGE foo_user.foo_package AS PROCEDURE foo_procedure; END; / CREATE OR REPLACE PACKAGE BODY foo_user.foo_package AS PROCEDURE foo_procedure AS BEGIN DBMS_OUTPUT.PUT_LINE('Ran foo_user.foo_package.foo_procedure'); END foo_procedure; END; / CREATE ROLE bar_role; GRANT bar_role TO bar_user; GRANT EXECUTE ON foo_user.foo_package TO bar_role; CREATE TABLE bar_user.bar_table(bar_column NUMBER); CREATE OR REPLACE TRIGGER bar_user.bar_table_bit BEFORE INSERT ON bar_user.bar_table FOR EACH ROW BEGIN foo_user.foo_package.foo_procedure; END; / INSERT INTO bar_user.bar_table (bar_column) VALUES (1);
withCREATE ROLE bar_role; GRANT bar_role TO bar_user; GRANT EXECUTE ON foo_user.foo_package TO bar_role;
works very well.GRANT EXECUTE ON foo_user.foo_package TO bar_user;
Am I doing something wrong or is not possible to grant enforcement on a package for a role?Hello
Roles do not count inside stored procedures. So that bar_user to foo_user.foo_package of references within a stored procedure, EXECUTE privileges on foo_user.foo_package must be granted directly to the bar_user (or PUBLIC), and not only a role that bar_user has.
-
As sysdba, how I would create a table in another schema of users
Well, I'm a student so I may have some of the words wrong, but I think you understand what I mean.
I am logged in as sysdba, I created a user named scott, and now I want to give the table scott. I want to leave sysdba, as in I don't want to login as scott.ALTER USER SCOTT QUOTA 100M ON USER01;
CHANGE USER
QUOTA UNLIMITED ON -
Grant execute on DBMS_REPUTIL fails
Hello
I just installed Oracle Database 11 g Release 11.2.0.4.0 - 64 bit Production, and I need to run on DBMS_REPUTIL of user for the compatibility of the trigger. I get the error:
SQL > GRANT EXECUTE ON DBMS_REPUTIL to THE PUBLIC;
GRANT EXECUTE ON DBMS_REPUTIL TO THE PUBLIC
*
ERROR on line 1:
ORA-00942: table or view does not exist
SQL > grant execute on DBMS_REPUTIL to webusr
*
ERROR on line 1:
ORA-00942: table or view does not exist
What is the problem with the grant command? Can anyone suggest how to grant execute on this package?
Here is my version of oracle:
SQL > select * from v version $;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11 g Release 11.2.0.4.0 - 64 bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE Production 11.2.0.4.0
AMT for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
Thank you!
USER issuing the GRANT doesn't have a necessary privilege.
SQL > connect scott/tiger
Connected.
SQL > GRANT EXECUTE ON DBMS_REPUTIL TO THE PUBLIC;
GRANT EXECUTE ON DBMS_REPUTIL TO THE PUBLIC
*
ERROR on line 1:
ORA-01031: insufficient privileges
SQL > connect / as sysdba
Connected.
SQL > GRANT EXECUTE ON DBMS_REPUTIL TO THE PUBLIC;
Grant succeeded.
-
Grant permission to another schema package
Dear friends,
I want to give access to another user access to a package in my diagram.
How do I do?
I've seen on this page, but how do refer to the different schema package is?
http://www.techonthenet.com/Oracle/grant_revoke.php
Please guide me.
Thank you.
Nithuser645399 wrote:
Dear friends,I want to give access to another user access to a package in my diagram.
How do I do?
I've seen on this page, but how do refer to the different schema package is?
http://www.techonthenet.com/Oracle/grant_revoke.php
Please guide me.
Thank you.
Nith
Dear nith
Here's the command:grant execute on your_schema.your_package to the_second_user;
Kamran Agayev a.
Oracle ACE
- - - - - - - - - - - - - - - - - - - - -
My video tutorials of Oracle - http://kamranagayev.wordpress.com/oracle-video-tutorials/ -
grant for dbms_metadata.get_ddl on objects in another schema
In Oracle 11 g R2, I use dbms_metadata.get_ddl to get the DDL to another schema, but I got an error:
ORA-31603: object not found 'IS_SNMP_DATA' of type TABLE in the schema "TXV.
that grant is necessary for this package to get from another schema ddl?
I tried with authid current_user (that I found on google), but no result...See the following example:
SQL> create user us_one identified by us1; User created. SQL> grant connect, resource to us_one; Grant succeeded. SQL> create user us_two identified by us2; User created. SQL> grant connect, resource to us_two; Grant succeeded. SQL> conn us_one/us1 Connected. SQL> create table t (id number); Table created. SQL> grant select on t to us_two; Grant succeeded. SQL> conn / as sysdba Connected. SQL> grant execute on dbms_metadata to us_two; Grant succeeded. SQL> conn us_two/us2 Connected. SQL> select dbms_metadata.get_ddl('TABLE','T','US_ONE') from dual; ERROR: ORA-31603: object "T" of type TABLE not found in schema "US_ONE" ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105 ORA-06512: at "SYS.DBMS_METADATA", line 2806 ORA-06512: at "SYS.DBMS_METADATA", line 4333 ORA-06512: at line 1 no rows selected SQL> conn / as sysdba Connected. SQL> grant select_catalog_role to us_two; Grant succeeded. SQL> conn us_two/us2 Connected. SQL> select dbms_metadata.get_ddl('TABLE','T','US_ONE') from dual; DBMS_METADATA.GET_DDL('TABLE','T','US_ONE') -------------------------------------------------------------------------------- CREATE TABLE "US_ONE"."T" ( "ID" NUMBER ) PCTFREE 10 PCTUSED 40 INITRA SQL>
-
How to grant access to a package body to another user in execution
Hello
I have a package body that contains a single procedure and the owner of this APPS package.
I have a requirement to grant access to this procedure which is inside the package to the user 'XXX' so that I can execute this procedure of user XXX in execution.
When I tried under statement then it grant access to the package spec, not to the body. Please let me know how to give access to the package running body?
Grant execute on KEI_TEK_IB_INTF_PKG to XXX.
Thank you!PL, ensure that simultaneous program code is fully eligible package being called (i.e. APPS.) KEI_TEK_IB_INTF_PKG). If the scheme qualifier is omitted, you must create a public synonym (for example to create a public synonym KEI_TEK_IB_INTF_PKG for applications. KEI_TEK_IB_INTF_PKG) for this to work as expected.
HTH
Srini -
grant the select privilege on the table in another schema by role error
Hello
I have a problem with the granting of privileges to another schema
I have A user who has only 1 system priv: connect, which has a private: create session;
I created a role X, which I have the privilege: select on a table to a diagram B customer.
I then conceded this X role to A user.
I can't select * B.customers when im connected to A
identification of information like it that I'm missing?
Thank you
Rgds>
but whenever I put a default role, the other is automatically set to zero-defectsHow did you receive the two default roles?
>
By running the code I posted above as user SYS.Drop your user and start again and use the code I posted.
-
error in grant execute to the public on the package
Hello
I have a package that works with my user but when I try to run on this package that I receive
can you tell me how to run on it to the public?declare v_id number; begin v_id := liste_pkg_lista.liste_lista_func(9); dbms_output.put_line(v_id); end; SQL> / 9 PL/SQL procedure successfully completed. SQL> grant execute on liste_pkg_lista.liste_lista_func to public; grant execute on liste_pkg_lista.liste_lista_func to public * ERROR at line 1: ORA-04042: procedure, function, package, or package body does not exist
Thank youCoco wrote:
Hello
I have a package that works with my user but when I try to run on this package that I receivedeclare v_id number; begin v_id := liste_pkg_lista.liste_lista_func(9); dbms_output.put_line(v_id); end; SQL> / 9 PL/SQL procedure successfully completed. SQL> grant execute on liste_pkg_lista.liste_lista_func to public; grant execute on liste_pkg_lista.liste_lista_func to public * ERROR at line 1: ORA-04042: procedure, function, package, or package body does not exist
can you tell me how to run on it to the public?
Thank you
Grant execute on liste_pkg_lista to public;
-
grant the privilege on the SQL types to another schema
I created two SQL types under the APP_OWNER scheme as follows:
CREATE or REPLACE TYPE t_instr_info as an OBJECT
(NUMBER IMNT_KY)
CREATE or REPLACE TYPE t_tab_instr_info
AS THE t_instr_info TABLE
The privilege on these two types as follows:
Grant execute on t_tab_instr_info to vprods_app2
Grant execute on t_instr_info to vprods_app2
The stored procedures must be developed in the scheme of the APP. In the scheme of the APP, I need to call this type to declare the array as follows:
v_tab_output app_owner.t_tab_instr_info: = app_owner.t_tab_instr_info ();
I get a PLS-00905: object owner.t_tab_instr_info is not valid
I tried giving EVERYTHING instead of run, but the problem persists.
Help, please. As a policy of all objects including tables, types etc. must be app_owner and the app schema privileges
Thank you in advance.One thing I forgot to mention (since you do not explicitly specify how you are granting things) is that you need to issue DIRECT subsidies (as in my example above), you cannot compile the code if you have subsidies via a role (but you can execute anonymous blocks).
This is an example
create user APP_OWNER identified by APP_OWNER default tablespace users temporary tablespace temp; grant connect, resource, create role to APP_OWNER; create user APP_SCHEMA identified by APP_SCHEMA default tablespace users temporary tablespace temp; grant connect, resource to APP_SCHEMA; connect APP_OWNER/APP_OWNER@xe create role for_apps; CREATE OR REPLACE TYPE t_instr_info as OBJECT (IMNT_KY NUMBER); / CREATE OR REPLACE TYPE t_tab_instr_info AS TABLE OF t_instr_info; / grant execute on t_instr_info to for_apps; grant execute on t_tab_instr_info to for_apps; grant for_apps to app_schema; connect APP_SCHEMA/APP_SCHEMA@xe APP_SCHEMA_XE?create or replace procedure test 2 as 3 v_tab_output app_owner.t_tab_instr_info := app_owner.t_tab_instr_info(); 4 begin 5 null; 6 end; 7 / Warning: Procedure created with compilation errors. Elapsed: 00:00:01.17 APP_SCHEMA_XE?show err Errors for PROCEDURE TEST: LINE/COL ERROR -------- ----------------------------------------------------------------- 3/17 PL/SQL: Item ignored 3/17 PLS-00201: identifier 'APP_OWNER.T_TAB_INSTR_INFO' must be declared APP_SCHEMA_XE?declare 2 v_tab_output app_owner.t_tab_instr_info := app_owner.t_tab_instr_info(); 3 begin 4 null; 5 end; 6 / PL/SQL procedure successfully completed. Elapsed: 00:00:01.17
-
Re: "insufficient privileges" error when you run the Java stored procedure in another schema
I get an "insufficient privileges" error when you run the Java stored procedure in another schema, see details below. I don't know what are missing privileges (I already granted the EXECUTE privilege), suggestions? -Thank you.
Define a simple java class and deploy it as a Java stored procedure to test:
Schema: User1
test of the package;
public class HelloWorld {}
public HelloWorld() {
Super();
}
public static String Hello () {}
Return "HELLO";
}
}
CREATE or REPLACE FUNCTION HELLO RETURN VARCHAR2 AUTHID CURRENT_USER AS LANGUAGE JAVA NAME ' test. HelloWorld.hello () return java.lang.String';
Grant execute on USER2 HELLO
Test the Java stored procedure through the PL/SQL function call (in the same schema):
Schema: User1
SET SERVEROUTPUT ON
DECLARE
v_Return VARCHAR2 (200);
BEGIN
v_Return: = User1. HELLO;
DBMS_OUTPUT. Put_line ('v_Return =' | v_Return);
END;
anonymous block filled
v_Return = HELLO
Test the Java stored procedure through the PL/SQL function call in a different pattern:
Schema: USER2
SET SERVEROUTPUT ON
DECLARE
v_Return VARCHAR2 (200);
BEGIN
v_Return: = User1. HELLO;
DBMS_OUTPUT. Put_line ('v_Return =' | v_Return);
END;
Error report-
ORA-01031: insufficient privileges
ORA-06512: at "User1." HELLO', line 1
ORA-06512: at line 4 level
01031 00000 - "insufficient privileges".
* Cause: An attempt was made to change the user name or password
without the privilege appropriate. This error also occurs if
trying to install a database without the need for employment
access privileges.
When Trusted Oracle is configure in DBMS MAC, this error may occur
If the user has been granted the privilege necessary for a higher label
that the connection is active.
* Action: Ask the database to perform the operation or grant administrator
the required privileges.
For users Trusted Oracle get this error, well that granted the
the privilege that is suitable for the top label, ask the database
administrator to grant the privilege to the appropriate label.
You have created the function with AUTHID CURRENT_USER, which means that the function is executed with the rights of the applicant (but not with the rights of the author). This means that the applicant must have grants (directly or through roles) on all used/accessible objects in the service. In your case the user USER2 has not granted with EXECUTE on the class/source Java test. Class HelloWorld, causing the ORA-01031 exception. You create service without AUTHID CURRENT_USER (i.e. with AUTHID DEFINE, which is by default, if you do not have a specific reason to use AUTHID CURRENT_USER) or grant EXECUTE on JAVA test SOURCE. Class HelloWorld to User2.
Dimitar
-
reading of the objects in another schema schema
My requirement is to create a schema and grant privileges to read all objects in another main schema, including the functions and procedures. creating a role and assigning it to the schema will read or select the tables, but she will not allow the user to see the description of a function, or a procedure. can you please tell me what are my options. Thank you.Hello
Yes you can GRANT SELECT privilege to allow access to Tables / views, and GRANT EXECUTE privilege on the procedures in another schema.
You can also CREATE SYNONYM of these Tables in order to hide their location. There is a way to ensure the transparency of the location, otherwise use views or procedures.
These links can give you a few tracks on the transparency of the situation and manage privileges:
http://download.Oracle.com/docs/CD/B28359_01/server.111/b28310/ds_admin006.htm
http://download.Oracle.com/docs/CD/B28359_01/network.111/B28531/authorization.htm#DBSEG004
Hope this helps.
Best regards
Jean Valentine -
access a type of user to another schema (collection)
Hello
In my scheme of production, I created a user type:
I use the TT_my_table collection as a parameter of a procedure type.CREATE TYPE T_my_row OID '4711' IS OBJECT(field1 varchar2(10), field2 number(10)); / CREATE TYPE TT_my_table OID '0815' IS TABLE OF T_my_row; /
Intended to test, I would like to call this procedure from another schema (SQL-developers UT repository). This is why I need 'access' to the collection type of this test pattern.
What are the rights I give to achieve?
Good bye
DPT
Edited by: T.PD the 29.06.2010 10:40Dear T.PD,
I think that under query will work for you;
SQL > GRANT EXECUTE, DEBUG ON TYPE_NAME TO SCHEMA_NAME.
It will be useful,
Ogan
-
composing the package from another package
Hi gurus,
Small question
Thank you!!Say i m in user1 schema. I want to call package from another package in the same schema. So do i need to grant permission to the calling package to call.
Why don't test you it?
create or replace package pack2 is procedure t2; end; Package created. create or replace package body pack2 is procedure t2 is begin dbms_output.put_line('Inside Pack2 And t2'); end; end; Package Body created. create or replace package pack1 is procedure t1; end; Package created. create or replace package body pack1 is procedure t1 is begin pack2.t2; dbms_output.put_line('Inside Pack1 And t1'); end; end; Package Body created. begin pack1.t1; end; Inside Pack2 And t2 Inside Pack1 And t1 Statement processed. 0.11 seconds
Kind regards.
LOULOU
Maybe you are looking for
-
How to capture Web page bookmarks icon?
I just went from Internet Explorer to Firefox and imported all my "Favorites" now "Favorites" successfully anywhere in the browser. However almost none of the icons that are adjacent to Favorites in Internet Explorer have been transferred. See screen
-
How to unlock a mini ipad won't let me slip on after it says Hello
I can't get my ipad mini to unlock, when he says hello and allows you that know to drag you cannot drag
-
Stroke of lightning or USB3.0 external Firewire Mac?
My 2011 MBP works still strong, but the FW and USB 2.0 are not keeping up with the external storage options: I can't see any external SSD FW option for backups of 1 TB, and my needs backup are currently between 2 and 3 TB. Googling suggests no conver
-
Could someone explain the purpose of the translucent bar that appears at the top of the screen, with a + sign and desktop images, when the mouse is moving quickly? Thank you
-
Lenovo Y460: Recently reinstalled windows 7 ultimate and no to activate product key
Hello I have recently reinstalled the Lenovo Y460 with windows recovery disc 7 that came with the laptop, however, I can not find the product key to activate windows, can you please help me how to fix it? Thank you Anthony