excute privilege on all procedures under a scheme to a role

Hello

I use oracle 10g and Windows server 2003, I have a user named towner.
I need to give a role named kgroup excute privilege on all procedures under this scheme of towner.

Can someone share a query to do this, ty.

Hello
Log in as towner and run this procedure...

Declare
proc_name varchar(200);
sqlstat varchar(500);
cursor c1 is
SELECT object_name  FROM  user_procedures;
begin
open c1;
loop
fetch c1 into proc_name;
sqlstat:='GRANT EXECUTE ON ' ||proc_name||' to kgroup';
Execute immediate sqlstat;
exit when c1%notfound;
end LOOP ;
close c1;
end;

Concerning

UMI

Tags: Database

Similar Questions

  • 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

  • DBMS_METADATA. GET_DDL for all the procedures for a schema

    I'm trying to capture all the DDLS procedure for CUSTOM schema

    I use 11g on Linux.

    I have run this command...
    SELECT dbms_metadata. GET_DDL('PROCEDURE',,'CUSTOM') FROM DUAL;

    And this error occurs:
    ORA-31600: input value invalid NULL for the parameter VALUE in function SET_FILTER
    ORA-06512: at "SYS." Dbms_metadata", line 4018
    ORA-06512: at "SYS." Dbms_metadata", line 5843
    ORA-06512: at line 1


    Thanks in advance.

    user13716252 wrote:
    Now it works but I have only the first row in SQL PLUS...

    Select dbms_metadata. GET_DDL (u.object_type, u.object_name, 'SAPSR3')
    u dba_objects
    where type_objet = 'PROCEDURE '.
    and the owner = "SAPSR3";

    How to bring back the whole procedure?

    SQL > SET LONG 32000

  • not enough privileges to a procedure

    Hello world

    the following code:

    SYNONYM to CREATE or REPLACE oracle_user.table_name FOR table_name

    It works when I run it on the editor of TOAD for Oracle, but it doesn't work when I do it by following a procedure.

    The oracle_user script is:

    CREATE USER oracle_user
    IDENTIFIED BY < password >
    DEFAULT TABLESPACE USERS
    TEMPORARY TEMP TABLESPACE
    DEFAULT PROFILE
    RELEASE OF ACCOUNT;
    -3 system for oracle_user privileges
    GRANT CREATE ANY SYNONYM of oracle_user;
    BECOME a GRANT TO oracle_user USER;
    GRANT CREATE SESSION to oracle_user;
    -1 Tablespace quota for oracle_user
    ALTER USER oracle_user QUOTA UNLIMITED on USERS;
    -1 object of privileges for oracle_user
    GRANT SELECT ON dba_user.table_name TO oracle_user;

    I always use TOAD. Why it works when I run it on the editor and not in a procedure run with TOAD too?

    Thank you very much for your attention and your time

    TOAD, you have all your privileges, granted directly or via a role. You can activate the role and have certain privileges or disable a role and do not have temporaily.
    In the stored procedure, you have only the privileges granted directly.

    Now imagine that Oracle Corp. has decided that starting from version 12 g + your privileges through role will work in the stored procedures. And you disable a role for a user who has a lot of procedures, functions, packages, types. What causes all PL/SQL objects to become invalid and they need to be recompiled. And invalidated all objects in all other schemas that depend on objects. A massive re-compilation may occur after... a simple SET ROLE statement. And before closing, you can issue statements next to ROLE DEFINED. It would not work.

    GRANT CREATE SYNONYM privilege directly to the owner of the stored procedure.

  • READING of the privileges for * all databases *.

    Is it possible to grant READ privileges for the objects in all databases (tables, diagrams, triggers, procedures, views and etc.)

    NATHALIE wrote:
    The longer answer is individual GRANT must be issued for each object.

    Thanks for your response!

    Is it possible to grant privileges to all objects at once?

    The short answer is 'NO '.

    With Oracle, everything is forbidden, except what is explicitly granted.

  • Get the DDL for all tables in a schema;

    Hello

    I tried to get the DDL for all tables under my own diagram "A". Here are the steps I've tried, but in vain I
     1. logged in as a user A 
    2. And the ran query 
              
    SELECT DBMS_METADATA.get_ddl ('TABLE', 'XYZ')
    FROM user_tables
          
    o/p
    (HugecloB)
    
    {code}
    
    Any idea how i can get the DDL for all the tables under my own schema ?
    
    
    Thank you so much!
    
    Edited by: user642297 on Feb 4, 2011 12:05 PM
    
    Edited by: user642297 on Feb 4, 2011 12:05 PM
    
    Edited by: user642297 on Feb 4, 2011 12:05 PM
    
    Edited by: user642297 on Feb 4, 2011 12:07 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Your idea is good, you missed only to use the correct table name:

    SELECT DBMS_METADATA.get_ddl ('TABLE', table_name)
    FROM user_tables;
    

    Concerning

  • PL/SQL procedure in another scheme gives unexpected result call

    I have a SQL Script that does this:
    Conn pnr / < password of user pnr >;
    Set serveroutput on;
    exec vms.disable_all_fk_constraints;
    SELECT the owner, constraint_name, status FROM user_constraints WHERE constraint_type = 'R ';

    and the disable_all_fk_constraints procedure, which is owned by the user 'vms' is defined as:
    create or replace
    procedure disable_all_fk_constraints is
    v_sql VARCHAR2 (4000);
    Start
    dbms_output.put_line ('disable all referential integrity constraints.');
    for rec in (SELECT table_name, constraint_name FROM user_constraints WHERE constraint_type = 'R') loop
    dbms_output.put_line ('Disabling constraint' | rec.constraint_name |) 'from ' | Rec.table_name | '.');
    v_sql: = 'ALTER TABLE ' | Rec.table_name | "DISABLE THE CONSTRAINT ' | Rec.constraint_name;
    execute immediate (v_sql);
    end loop;
    end;

    When I run the script SQL, the call to vms.disable_all_fk_constraints disables the FK forced in the schema "vms", while I wanted to disable the FK constraints in schema "pnr" (the applicant of the procedure). I know I could do this job by copying disable_all_fk_constraints to the 'pnr' schema procedure and calling it as "+ exec disable_all_fk_constraints; +"inside, the SQL script but I want to avoid having to duplicate the PL/SQL procedure in each schema that uses it.

    What can I do?

    Thank you

    Hello

    Create the procedure with AUTHID CURRENT_USER, like this:

    create or replace
    procedure disable_all_fk_constraints
    AUTHID  CURRENT_USER               -- Added
    is
        v_sql VARCHAR2(4000);
    begin
        ...
    

    With AUTHID DEFINE (which is the default), everything that happens inside the stored procedure goes as if the Owers of procedure was done, except that the USER function returns always the name of the actual user.

    Published by: Frank Kulash, January 11, 2011 11:07
    I just see response to Sven. It is true, that it is a very dangerous thing to do.

  • Just download new version, now I can't get rid of tabs. i unchecked all boxes under options. I don't want no legs.

    Since the new update today, I have tabs. I don't want the tabs. I'm getting a sign on top. i unchecked all boxes under the tabs and options. but stay tabs. claiming under aboutfirefox... Yahoo editon ver 1.7, never had that before... can I uninstall the last update or remove tabs? Win7
    Thank you.

    are you talking about 'Always show the tab bar pref', which has been deleted, however, you can go back through an addon.

  • Do a clean install on a Dell Inspiron 1525 with Vista... The Device Manager has a yellow labels on all devices under 'other devices '... Unable to connect to the Net

    I did a clean install on a Dell Inspiron 1525 with Vista Home Premium... I can't connect to Internet... The Device Manager has a yellow labels on all devices under "other devices" that includes network and ethernet controllers... Yet the utility on the Drivers and Utilities CD Dell program says that there is a "Marvel 88E80XX rev A01 10/100 ethernet controller" responsible... HELP :)

    Hello

    Use another computer to download and save the drivers to

    copy them to the flash drive and transfer them like that

    Here is the link to the drivers for your model

    http://support.Dell.com/support/downloads/DriversList.aspx?c=us&l=en&s=Gen&OS=WLH&OSL=en&SystemID=INS_PNT_PM_1525&CATID=-1&impid=-1

    to get help in this matter

    Dell support

    http://support.Dell.com/

    Dell support forums

    http://en.community.Dell.com/support-forums/default.aspx

  • I keep getting these messages that do not allow to use a file. What should I change to have privileges for all functions?

    Original title: administrator Win7

    I have win7 and IE11 running on a HP 8540p.  I'm the only person authorized to use the laptop - I am the administrator.

    I keep getting these messages that do not allow to use a file.  What should I change to have privileges for all functions?

    The second file is not cooperating and was not deleted.

    "Not cooperating" can mean many different things. A real verbatim error message would be more useful. In the case of locked files, it is often possible to remove safe mode.

  • How can I disable administrative privileges on all files in windows 7

    Every time I change laptops, do a reboot of the system or any work on a file, I get locked out my files

    Hi James,

    Thanks for posting your question in the Microsoft Community forums.

    I see from the description of the problem, you want to know how to disable the administrator privileges on all files.

    I imagine the inconvenience that you are experiencing. We are here to help and guide you in the right direction.

    To resolve the issue with deactivation of administrator privileges, I need more information:
    1. what exactly mean you by "I get locked out of my files?
    2. are you logged in as a standard user or administrator?
    3. are you referring to the administrator user ID and quick Email?

    If you are referring to the administrator user ID and quick Email, try the following steps and check if it helps.
    (a) open user account control settings by clicking on Start button.
    (b) then click on Panel.
    (c) in the Search box, type uac, and then click on change User Account Control settings.
    (d) drag the bar of never notify.

    Note: You will not be notified until changes are made to your computer. If logged in as an administrator, programs can make changes to your computer you know on the subject.

    Note: User Account Control (UAC) can help you to prevent your computer from unauthorized changes. It works by asking permission when a task requires administrative rights, such as installing software or changing settings affecting other users. We do not recommend disable user account control. If you turn it off, you must reactivate as soon as possible.

    See the links for more information.

    Let us know the status of the issue after you perform the troubleshooting steps. If you need additional help or information on Windows, I'll be happy to help you. We, at tender Microsoft to excellence.
  • I removed McAfee remove/uninstall in Control Panel, but it still appears in "all programs" under "free trial." How can I remove that?

    I removed McAfee remove/uninstall in Control Panel, but it still appears in "all programs" under "free trial." How can I remove in Windows 7?

    As with many apps AV, you must run the McAfee removal of Development tool

    Thi should remove all traces of your PC McAfee products.

  • After almost 2 years, and all remaining under current contract, Acrobat XI has been removed. Why?

    After almost 2 years, and all remaining under current contract, Acrobat XI has been removed. Why?

    That's great.

  • privileges of all users


    Hello

    on 11.2.0.3,.

    in which table, a DBA can see the privileges of all users?

    Thank you.

    Hello

    You have to query on tables

    dba_sys_privs

    dba_role_privs

    dba_tab_privs

    HTH

  • avoid triggers on all tables in the schema

    I need to put a CREATION TIMESTAMP to the timestamp of the database server (not the timestamp of session) in all tables in a schema to create and update. Is to create a trigger on all the tables in the schema a less time consuming way to do?

    Similarly, I need to set up columns such as CREATE_USER, LAST_UPDATE_USER.

    Thank you in advance.

    You can easily generate the DDL for adding new columns.

    The extent of the filling of the columns, your choice is either to use insertion befire table and triggers to update to fill the columns or the application to provide the necessary information.

    Basic trigger logic would be pretty much the same for all tables, then write a little SQL or PL/SQL to generate the code of the trigger should be simple enough.

    Depending on your application, such as web based with only one Oracle user, you may need to get the real user through dbms_application_info by the logic of the server-based application.

    HTH - Mark D Powell.

    Edited by: Mark D Powell 5 May 2010 07:48

Maybe you are looking for