DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Grants...

  1. #1
    Join Date
    Sep 2001
    Location
    Düsseldorf, Germany.
    Posts
    588
    Hi All,

    How I am able to execute SELECT on system.test table as I have granted only INSERT priviledge to scott?

    SQL> connect system/[email protected]
    Connect durchgeführt.
    SQL> CREATE TABLE test (datum DATE);

    Tabelle wurde angelegt.

    SQL> GRANT INSERT ON test TO SCOTT;

    Benutzerzugriff (Grant) wurde erteilt.

    SQL> connect scott/[email protected]
    Connect durchgeführt.
    SQL> CREATE OR REPLACE PROCEDURE insdate AS
    2 BEGIN
    3 INSERT INTO system.test values (SYSDATE);
    4 COMMIT;
    5 END;
    6 /

    Prozedur wurde angelegt.

    SQL> exec insdate;

    PL/SQL-Prozedur wurde erfolgreich abgeschlossen.

    SQL> SELECT * FROM system.test;

    DATUM
    --------
    01.08.02

    SQL> show user
    USER ist "SCOTT"
    SQL>
    SQL>
    SQL> select * from USER_TAB_PRIVS_RECD;

    OWNER TABLE_NAME GRANTOR PRIVILEGE GRA
    -----------------------------------------------------------
    SYSTEM TEST SYSTEM INSERT NO

    Thanks

    Sameer

  2. #2
    Join Date
    Jan 2002
    Location
    Netherlands
    Posts
    1,587
    well ,you might have system as his default tablespace!
    Tarry Singh
    I'm a JOLE(JavaOracleLinuxEnthusiast)
    TarryBlogging
    --- Everything was meant to be---

  3. #3
    Join Date
    Jan 2002
    Location
    Netherlands
    Posts
    1,587
    Query like this...
    Code:
    SQL>  select username,default_tablespace
      2   from dba_users
      3  where username = 'SCOTT';
    
    USERNAME                       DEFAULT_TABLESPACE
    ------------------------------ ------------------------------
    SCOTT                          USERS
    Cheers
    Tarry Singh
    I'm a JOLE(JavaOracleLinuxEnthusiast)
    TarryBlogging
    --- Everything was meant to be---

  4. #4
    Join Date
    Sep 2001
    Location
    Düsseldorf, Germany.
    Posts
    588
    Hi...

    Yes..

    SCOTT's default tablespace was SYSTEM, but now I have altered SCOTT's default tablespace to USERS and also re-granted the only INSERT on test to SCOTT but still when I connect as SCOTT I still able to execute

    SELECT * from SYSTEM.test;

    Is it because I use SYSTEM.test table in one of the SCOTT's procedure? But how come that.. Procedure is onwed by SCOTT and not SYSTEM

    Sameer

  5. #5
    Join Date
    Jan 2001
    Posts
    3,134

    Question

    Did you grant DBA to SCOTT?

    select * from dba_role_privs
    where grantee='SCOTT';

    MH
    I remember when this place was cool.

  6. #6
    Join Date
    Sep 2001
    Location
    Düsseldorf, Germany.
    Posts
    588
    No.. I haven't :-( but still .. see below..


    SQL> show user
    USER is "SYSTEM"
    SQL>
    SQL> select * from dba_role_privs where grantee='SCOTT';

    GRANTEE GRANTED_ROLE ADM DEF
    ------------------------------ ------------------------------ --- ---
    SCOTT CONNECT NO YES
    SCOTT RESOURCE NO YES

    SQL> create table test1 (name varchar2(10));

    Table created.

    SQL> insert into test1 values ('sameer');

    1 row created.

    SQL> commit;

    Commit complete.

    SQL> connect scott/[email protected]
    Connect durchgeführt.
    SQL>
    SQL> select * from system.test1;

    NAME
    ----------
    sameer

  7. #7
    Join Date
    Jan 2002
    Location
    Netherlands
    Posts
    1,587
    user scott has either select any priv(thru any of these 2 roles connect or resource) or he has object privilege on that particular table of user system).

    Try to query something on the sys users tables...
    otehrwise it's not possible to query any other tables.
    Tarry Singh
    I'm a JOLE(JavaOracleLinuxEnthusiast)
    TarryBlogging
    --- Everything was meant to be---

  8. #8
    Join Date
    Sep 2001
    Location
    Düsseldorf, Germany.
    Posts
    588
    Which DD will give me list of privileges given to ROLE
    CONNECT and RESOURCE?

    Sameer

  9. #9
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Code:
    SQL> create user a identified by a
      2  temporary tablespace temp default tablespace users;
    
    User created.
    
    SQL> grant create session, create table to a;
    
    Grant succeeded.
    
    SQL> alter user a quota unlimited on users;
    
    User altered.
    
    SQL> create user b identified by b
      2   temporary tablespace temp default tablespace users;
    
    User created.
    
    SQL>  grant create session to b;
    
    Grant succeeded.
    
    SQL> connect a/a
    Connected.
    SQL> create table xyz (x number(10), y date, z varchar2(10));
    
    Table created.
    
    SQL> grant insert on xyz to b;
    
    Grant succeeded.
    
    SQL> connect b/b
    Connected.
    SQL> desc a.xyz
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     X                                                  NUMBER(10)
     Y                                                  DATE
     Z                                                  VARCHAR2(10)
    
    SQL> select count(*) from a.xyz;
    select count(*) from a.xyz
                           *
    ERROR at line 1:
    ORA-01031: insufficient privileges
    
    
    SQL> insert into a.xyz values (1, sysdate, 'foo');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    SQL> select count(*) from a.xyz;
    select count(*) from a.xyz
                           *
    ERROR at line 1:
    ORA-01031: insufficient privileges
    Jeff Hunter

  10. #10
    Join Date
    Jan 2002
    Location
    Netherlands
    Posts
    1,587
    if you created scott with the scott.sql dem,o script and roles connect and resource weren't altered then he must have had the select any table priv.. as you can see......
    Code:
    SQL> conn system/manager
    Connected.
    SQL> create table tarry
      2  (name varchar2(30),
      3  sex varchar2(10))
      4  /
    
    Table created.
    
    SQL> insert into tarry
      2  values('Pamela','hottt!!');
    
    1 row created.
    
    SQL> disconnect
    Disconnected from Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    SQL> conn scott/tiger
    Connected.
    SQL> select * from system.tarry
      2  /
    select * from system.tarry
                         *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    
    SQL> conn sys/man as sysdba
    Connected.
    
    Grant succeeded.
    
    SQL> conn scott/tiger
    Connected.
    SQL> select * from system.tarry;
    
    NAME                           SEX
    ------------------------------ ----------
    Pamela                         hottt!!
    Cheers!!!!



    Tarry Singh
    I'm a JOLE(JavaOracleLinuxEnthusiast)
    TarryBlogging
    --- Everything was meant to be---

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width