Grants on dba_dependencies table

Version:oracle 10g
tool: sqldeveloper
Hi Experts,
I have created a procedure in scott schema by using the cursor from the table DBA_DEPENDENCIES and DBA_OBJECTS,
but its giving the error table does not exists,
I have asked our dba to provide the read access to this table ,
and after providing the read access I could be able to select from the editor but again could not use in the procedure.
Again its giving table or view does not exists.
Please help me to come out of this.
Note: I don't want to use all_dependencies since its not giving all data which I require.
Thanks in advance.....

What was the exact grant that the DBA issued?  If you're still getting an ORA-00942 error, that's a pretty convincing argument that the DBA did not, in fact, grant the owner of the procedure direct SELECT access on DBA_DEPENDENCIES.
Was the DBA attempting to give the grant on just that object?  Or did he grant the owner the SELECT ANY DICTIONARY privilege?
Can you cut and paste from a SQL*Plus session that shows that
1) the direct grant to the owner of the procedure is in place
and
2) the procedure that selects from DBA_DEPENDENCIES does not compile
Justin

Similar Messages

  • Dynamic SQL and GRANT CREATE ANY TABLE

    hi gurus,
    i have a dynamic SQL in a procedure where a table will be created from an existing table without data.
    strSQL:='create table ' || strTemp || ' as select * from ' || strArc || ' where 1=2';
    execute immediate strSQL;
    without GRANT CREATE ANY TABLE for the user, *"ORA-01031: insufficient privileges"* error during execution.
    Is there a way to tackle this issue without providing GRANT CREATE ANY TABLE privilige?
    many thanks,
    Charles

    ravikumar.sv wrote:
    The problem is not because of dynamic sql...It probably has something to do with dynamic SQL or, more accurately, dynamic SQL within a stored procedure.
    From a SQL*Plus command prompt, you can create a table if your account has the CREATE TABLE privilege either granted directly to it or granted to a role that has been granted to your account. Most people probably have the CREATE TABLE privilege through a role (hopefully a custom "developer role" that has whatever privileges you grant to users that will own objects but potentially through the default RESOURCE role). That is not sufficient to create tables dynamically via a definer's rights stored procedure. Only privileges that are granted directly to the user, not those granted via a role, are visible in that case.
    I expect that the DBAs are granting the CREATE ANY TABLE privilege directly to the account in question rather than through whatever role(s) are being used which is why that appears to solve the problem.
    Justin

  • Grant select on table to user

    IN A SCHEMA TEST1 THERE ARE 200 PLUS TABLES AND VIEWS.NOW I WANT TO GRANT SELECT ON TABLES AND VIEWS TO TEST2 USER.HOW CAN I GRANT SELECT ON THOSE TABLES AND VIEWS IN BULK INSTED OF GRANTING INDIVIDUALLY.
    Any idea?
    Thankx...
    Sorry for suing cap.letters....

    That works providing the grantee doesn't want to be able to build stored procedures or (more likely) views on the granted tables...
    SQL> conn u1/u1
    Connected.
    SQL> create role select_u1
      2  /
    Role created.
    SQL> grant select on t1 to select_u1
      2  /
    Grant succeeded.
    SQL> grant select_u1 to u3
      2  /
    Grant succeeded.
    SQL> conn u3/u3
    Connected.
    SQL> select * from u1.t1
      2  /
          COL1
             1
    SQL> create view my_view as
      2  select * from u1.t1
      3  /
    select * from u1.t1
    ERROR at line 2:
    ORA-01031: insufficient privileges
    SQL> As it happens, we know from the OP's other thread that they want a read only user, so perhaps the role will suffice. But they still need to grant selects on 200 objects to the role, so the automation will still come in handy :)
    Cheers, APC

  • Set Grant Permission to table in Access Database

    Hello All,
    How to set grant permission in Access 2003 Database. I am using Microsoft ACE OLEDB 12.0 Connection String, Using System.Data.OleDb Component and want to set Grant DELETE, INSERT, PROCEDURE, SELECT, UPDATE ON MSysObjects TO Admin
    Best Regard
    Xan To

    Hello Kevin And Paul
    I have tried what you all say, but I get an error like this
    this my code:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim Builder As New OleDb.OleDbConnectionStringBuilder
    Try
    With Builder
    .Provider = "Microsoft.ACE.OLEDB.12.0"
    .DataSource = "C:\Users\Xan To\Desktop\Test.mdb"
    End With
    'Using cn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Xan To\Desktop\Test.mdb; Jet OLEDB:System Database=system.mdw;")
    Using cn As New OleDb.OleDbConnection
    With cn
    .ConnectionString = Builder.ConnectionString
    End With
    Using cmd As New OleDb.OleDbCommand
    With cmd
    .Connection = cn
    .CommandText = "GRANT SELECT ON TABLE MSysObjects TO Admin"
    End With
    cn.Open()
    cmd.ExecuteNonQuery()
    End Using
    End Using
    Catch ex As Exception
    MessageBox.Show(ex.ToString)
    End Try
    End Sub

  • See the grants on a table

    Hi,
    how to see who has select grant on a table ?
    thank you.

    Note that you may also need to query ROLE_TAB_PRIVS to see what roles have SELECT access. And USER_ROLE_PRIVS to see the users that have been granted those roles. And ROLE_ROLE_PRIVS to see what roles have been granted those roles (and then follow the chain however many levels it goes to see what users eventually get the privileges).
    This is also ignoring users that may have privileges like SELECT ANY TABLE granted to them (or to a role they've been granted).
    Justin

  • Insufficient privileges/can not grant to create tables

    I have just created database..
    Connected as SYS I tried to Create user/schema as following:
    CREATE USER "xsales" PROFILE "DEFAULT" IDENTIFIED BY "*******" ACCOUNT UNLOCK
    GRANT "CONNECT" TO "ABDO"
    Trying to create tables I recieved:
    Failed to commit: ORA-01950: no privileges on tablespace 'USERS'
    Then I tried to grant CREATE ANY TABLES to the user xsales to enable it to
    run the script of create tables,but I recieved
    ORA-01917: user or role 'abdo' does not exist
    although I connected with xsales succefully
    Can anyone help?

    the user name is correct .....
    I ran the following script succefully:
    CREATE USER xsales PROFILE "DEFAULT" IDENTIFIED BY "********" ACCOUNT UNLOCK;
    GRANT "CONNECT" TO xsales;
    GRANT ALTER ANY CLUSTER TO XSALES;
    GRANT ALTER ANY DIMENSION TO XSALES;
    GRANT ALTER ANY INDEX TO XSALES;
    GRANT ALTER ANY INDEXTYPE TO XSALES;
    GRANT ALTER ANY MATERIALIZED VIEW TO XSALES;
    GRANT ALTER ANY PROCEDURE TO XSALES;
    GRANT ALTER ANY TABLE TO XSALES;
    GRANT ALTER TABLESPACE TO XSALES;
    GRANT ALTER USER TO XSALES;
    GRANT ANALYZE ANY DICTIONARY TO XSALES;
    GRANT CREATE ANY CLUSTER TO XSALES;
    GRANT CREATE ANY DIMENSION TO XSALES;
    GRANT CREATE ANY INDEX TO XSALES;
    GRANT CREATE ANY INDEXTYPE TO XSALES;
    GRANT CREATE ANY MATERIALIZED VIEW TO XSALES;
    GRANT CREATE ANY PROCEDURE TO XSALES;
    GRANT CREATE ANY TABLE TO XSALES;
    GRANT CREATE ANY VIEW TO XSALES;
    GRANT CREATE CLUSTER TO XSALES;
    GRANT CREATE DATABASE LINK TO XSALES;
    GRANT CREATE DIMENSION TO XSALES;
    GRANT CREATE INDEXTYPE TO XSALES;
    GRANT CREATE MATERIALIZED VIEW TO XSALES;
    GRANT CREATE PROCEDURE TO XSALES;
    GRANT CREATE PUBLIC DATABASE LINK TO XSALES;
    GRANT CREATE TABLE TO XSALES;
    GRANT CREATE TABLESPACE TO XSALES;
    GRANT CREATE USER TO XSALES;
    GRANT CREATE VIEW TO XSALES;
    GRANT DELETE ANY TABLE TO XSALES;
    GRANT DROP ANY CLUSTER TO XSALES;
    GRANT DROP ANY DIMENSION TO XSALES;
    GRANT DROP ANY INDEX TO XSALES;
    GRANT DROP ANY INDEXTYPE TO XSALES;
    GRANT DROP ANY MATERIALIZED VIEW TO XSALES;
    GRANT DROP ANY PROCEDURE TO XSALES;
    GRANT DROP ANY TABLE TO XSALES;
    GRANT DROP ANY VIEW TO XSALES;
    GRANT DROP PUBLIC DATABASE LINK TO XSALES;
    GRANT DROP TABLESPACE TO XSALES;
    GRANT DROP USER TO XSALES;
    GRANT EXECUTE ANY INDEXTYPE TO XSALES;
    GRANT EXECUTE ANY PROCEDURE TO XSALES;
    GRANT EXPORT FULL DATABASE TO XSALES;
    GRANT GLOBAL QUERY REWRITE TO XSALES;
    GRANT GRANT ANY OBJECT PRIVILEGE TO XSALES;
    GRANT GRANT ANY PRIVILEGE TO XSALES;
    GRANT IMPORT FULL DATABASE TO XSALES;
    GRANT INSERT ANY TABLE TO XSALES;
    GRANT LOCK ANY TABLE TO XSALES;
    GRANT MANAGE SCHEDULER TO XSALES;
    GRANT MANAGE TABLESPACE TO XSALES;
    GRANT QUERY REWRITE TO XSALES;
    GRANT SELECT ANY DICTIONARY TO XSALES;
    GRANT SELECT ANY TABLE TO XSALES;
    GRANT SELECT ANY TRANSACTION TO XSALES;
    GRANT SYSDBA TO XSALES;
    GRANT CREATE SESSION TO XSALES;
    GRANT UPDATE ANY TABLE TO XSALES;
    Then I logged as XSALES to try to CREATE TABLES, still I got:
    SQL> CONN XSALES/**********@ORACLE
    Connected.
    SQL> CREATE TABLE PROD(ID number(6));
    CREATE TABLE PROD(ID number(6))
    ERROR at line 1:
    ORA-01950: no privileges on tablespace 'USERS'
    How I can solve that?

  • Select Grant on local Table to the Remote Oracle User

    How Can we Give a SELECT Grant on a Specific Table to the Remote Oracle User.

    IIRC, the remote user accesses local objects via a schema on the local database. That suggests you need to grant SELECT on the local table to the local schema that the remote user connects by.

  • Grant on a table but don't see the TRIGGER

    I created a new user on 10.2.0.4 windows
    I granted select and update on a couple of table of another user on the database.
    My new user can see the table and data but not the triggers on those table?
    What is the previlege to see those triggers?

    OWNER = GDEM
    new user :
    CREATE USER SOAGDEM
    IDENTIFIED BY VALUES 'C36DE993D2216E8A'
    DEFAULT TABLESPACE USERS
    TEMPORARY TABLESPACE TEMP
    PROFILE DEFAULT
    ACCOUNT UNLOCK;
    -- 2 Roles for SOAGDEM
    GRANT CONNECT TO SOAGDEM;
    GRANT RESOURCE TO SOAGDEM;
    ALTER USER SOAGDEM DEFAULT ROLE ALL;
    -- 1 Tablespace Quota for SOAGDEM
    ALTER USER SOAGDEM QUOTA UNLIMITED ON USERS;
    -- 719 Object Privileges for SOAGDEM
    GRANT INSERT, SELECT ON GDEM.ABONNEMENT TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ACTION_CONCERTEE TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ACTIVITE_RECH TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ADMIS_REVUE TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ADREESSES_T4 TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ADRESSE_CORRIGEE TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ADR_PERSONNE_REL1_T4A TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.AGENT_LIAISON TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.AIDE_STAGE TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.AIDE_STAGE_DETAIL TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.AIDE_STAGE_DETAIL_07062005 TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.AIDE_STAGE_07062005 TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ALAIN_BUDGET TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ALAIN_EXCEL TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ALAIN_T4 TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.ALLOC_BUDGET TO SOAGDEM;
    GRANT INSERT, SELECT ON GDEM.APPROBATION_DEM TO SOAGDEM;

  • Grant privileges on tables in other tablespace

    Hi,
    If my DB instance has 2 tablespaces which belong to different users, say tablespace 1 belongs to user A and tablespace 2 belongs to user B. And I want user A to have the access/modify privileges on the tables in tablespace 2, how ?
    Do I first need to GRANT alter, manage user B.tablespace 2 TO user A then GRANT all tablespace 2.tables to user A ?
    Or ALTER USER user A QUOTA UNLIMITED ON  user N.tablespace 2 then GRANT all tablespace 2.tables to user A ?
    Or I can just GRANT all tablespace 2.tables to user A , i.e. I do not need to grant tablespace privileges , just grant table priviledge ?

    thought it would be simple to grant the access, anyways one should have system privilege to do that.
    Else, as Karthick specified, we have to loop through the list of tables and grant access.
    BEGIN
      FOR i IN (SELECT * FROM user_tables)
      LOOP
        EXECUTE IMMEDIATE 'GRANT SELECT,INSERT,UPDATE,DELETE ON ' || i.table_name || ' TO USERA';
      END LOOP;
    END;Regards,
    Prazy

  • Grant to all tables on my schema

    I am fairly new to Oracle and I need to grant "select, update, insert on all mytalbes to roleone, then grant that role to all my users.
    well, I have about 50 tables and 20 users.
    So far the most automated way I have come up with is:
    grant select, update, insert on table1 to role1;
    then I after that, I do:
    grant role1 to userone;
    I am sure there is a way to do this in some sort of procedure. I dont have DBA privs. I own all of the tables on my schema and those are the ones that I need to grant the privs to users.
    would you guys show me how to do this?
    thanks a bunch!

    You have to grant the privileges on each table to the role and then grant the role to each user, so you need 70 GRANT statements. You can write some dynamic SQL to generate the grants, though
    DECLARE
      sqlStmt VARCHAR2(4000);
    BEGIN
      FOR x IN (SELECT * FROM user_tables)
      LOOP
        sqlStmt := 'GRANT SELECT, UPDATE, INSERT ON ' || x.table_name || ' TO role1';
        EXECUTE IMMEDIATE sqlStmt;
      END LOOP;
    END;
    DECLARE
      sqlStmt VARCHAR2(4000);
    BEGIN
      FOR x IN (SELECT * FROM dba_users)
      LOOP
        sqlStmt := 'GRANT role1 TO ' || x.username;
        EXECUTE IMMEDIATE sqlStmt;
      END LOOP;
    END;Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Making new user & granting select any table privilages

    I want to make a new user account who have only select all tables privilages, i am trying this but it not working, please make correction...
    SQL> create user aaa identified aaabbbccc;
    SQL> grant connect, select any table to aaa;
    But its not working.......Plz forward the right commands...

    When you create new user, it has PUBLIC role privilegesPeter, what do you mean exactly ? The following is an extract from 10.2 documentation :
    When you create a user with the CREATE USER statement, the user's privilege domain is empty. To log on to Oracle Database, a user must have the CREATE SESSION system privilege. Therefore, after creating a user, you should grant the user at least the CREATE SESSION system privilege.

  • Granting SELECT on Tables

    Friends
    What'd be the simplest way to give an user access to SELECT a table but excluding from it one specific column?
    Tks!

    Hello KeenOnOracle
    Yes.
    And it is recommended that you do not use the star-operator for creating views.
    Because it is possible to create a view with this "CREATE VIEW view_name AS SELECT * FROM table_name;" -> But it is only in special cases recommended... (Architecture-View)
    But because you have to exclude a column so in your case it is no problem. You have to list up your columns in the create command so if you change the structure of the table you have to change your view definition too.

  • Find the roles granted on tables in oracle 10g

    Hi,
    I need to find what roles granted to what tables in a schema. I try to query dba_tab_privs but this will give what roles granted to tables, but i want to find what tables are missing these roles in a schema?
    any help is appreciated.
    Thanks...

    789287 wrote:
    i have another scenario where i have 2 different schemas such as TEST_A ans TEST_B. here TEST_B. at TEST_B user have 2 roles B_query and b_update and granted these roles to TEST_B user.
    TEST_A need to access the TEST_B objects, when i grant the A_QUERY, A_UPDATE to TEST_A user. then i login as TEST_A user to access the TEST_B objects gets an eror object doesn't exist.
    i dont want to grant privileges directly on to the TEST_B objects to TEST_A user. is there anyway i can accomplish this through the role?
    i thought it would appropriate to ask the question here rather opening a thread.
    Thanks...consider to actually post the actual SQL & complete error response from Oracle.
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • How to GRANT SELECT on all the tables in 1 go?

    Hi
    I have many tables (close to 200) in my Schema. I want to grant SELECT ON ALL TABLES to another user. How do I achieve this in one go?
    Thanking you in advance,
    ...

    Although Justin has given a wonderful answer. You might also review the following threads;
    Grant select on a schema
    Re: Grant select on a schema
    grant select on
    grant select  on
    grant select on tables
    Re: grant select on tables
    Adith

  • GRANT SELECT to TEMP(by procedure)..... ALL tables and views of OWNER....

    hi ,
    I want to privelege only Grant SELECT ALL tables,views....
    I have written A procedure.....given below....
    CREATE OR REPLACE PROCEDURE GRANT_SELECT_ALL_PROC
    IS
    l_obj VARCHAR2(60);
    l_obj_type VARCHAR2(60);
    CURSOR Cur_Obj IS
    SELECT OBJECT_NAME,OBJECT_TYPE
    FROM USER_OBJECTS
    WHERE USER ='OWNER';
    BEGIN
    For i in Cur_Obj Loop
    l_obj := i.OBJECT_NAME;
    l_obj_type := i.OBJECT_TYPE;
    IF l_obj_type IN ('TABLE','VIEW')
    THEN
    EXECUTE IMMEDIATE 'GRANT SELECT ON' || l_obj ||'TO TEMP’;
    ELSIF l_obj_type IN('FUNCTION','PROCEDURE','PACKAGE') THEN
    EXECUTE IMMEDIATE 'GRANT EXECUTE ON'|| l_obj ||'TO TEMP’;
    END IF;
    END LOOP;
    END GRANT_SELECT_ALL_PROC;
    procedure is working fine.....
    OWNER there are some table and views......
    But After creation of User name TEMp....
    When I m giving GRANT SELECT to TEMP(by procedure)..... ALL tables and views of OWNER....
    when I coonecte to TEMP...
    Not getting table,view List...
    not even data of table or Views.....
    can anybdy help me.......advance thanx ...
    sanjay

    hi ,
    I want to privelege only Grant SELECT ALL
    tables,views....
    have written A procedure.....given below....
    CREATE OR REPLACE PROCEDURE GRANT_SELECT_ALL_PROC
    IS
    l_obj VARCHAR2(60);
    l_obj_type VARCHAR2(60);
    CURSOR Cur_Obj IS
    SELECT OBJECT_NAME,OBJECT_TYPE
    FROM USER_OBJECTS
    WHERE USER ='OWNER';
    BEGIN
    For i in Cur_Obj Loop
    l_obj := i.OBJECT_NAME;
    l_obj_type := i.OBJECT_TYPE;
    IF l_obj_type IN ('TABLE','VIEW')
    THEN
    EXECUTE IMMEDIATE 'GRANT SELECT ON' || l_obj ||'TO
    TEMP’;
    ELSIF l_obj_type IN('FUNCTION','PROCEDURE','PACKAGE')
    THEN
    EXECUTE IMMEDIATE 'GRANT EXECUTE ON'|| l_obj ||'TO
    TEMP’;
    END IF;
    END LOOP;
    END GRANT_SELECT_ALL_PROC;
    procedure is working fine.....
    OWNER there are some table and views......
    But After creation of User name TEMp....
    When I m giving GRANT SELECT to TEMP(by
    procedure)..... ALL tables and views of OWNER....
    when I coonecte to TEMP...
    Not getting table,view List...
    not even data of table or Views.....
    can anybdy help me.......advance thanx ...
    sanjayQuery SELECT * FROM USER_TAB_PRIVS_MADE from the user from which you are executing the procedure
    and Query SELECT * FROM USER_TAB_PRIVS_RECD from the TEMP user.

Maybe you are looking for