A user account cannot ready dba_free_space
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: A user account cannot ready dba_free_space

  1. #1
    Join Date
    Jun 2005
    Posts
    2

    A user account cannot ready dba_free_space

    I've create a user account that has "read only" for a database. I want this user account to also be able to query dba_free_space, dba_data_files,...... Right now, when you try to do something basic, like desc dba_free_space, I get SYS.DBA_FREE_SPACE does not exist. So I believe the user account does not have enough privilege. I want this account to only be able to query the information.

    The user account was created by:

    ursor_1 := DBMS_SQL.OPEN_CURSOR;
    sqlstmt_1 := 'CREATE USER vcgrp IDENTIFIED BY readonly DEFAULT TABLESPACE vc_data
    TEMPORARY TABLESPACE vc_temp
    QUOTA UNLIMITED ON vc_data
    QUOTA UNLIMITED ON vc_temp
    QUOTA UNLIMITED ON vc_index';
    DBMS_SQL.PARSE (cursor_1, sqlstmt_1, DBMS_SQL.NATIVE);
    DBMS_SQL.CLOSE_CURSOR(cursor_1);
    END IF;

    activity := 'granting permissions to vcgrp';
    cursor_1 := DBMS_SQL.OPEN_CURSOR;
    sqlstmt_1 := 'GRANT CREATE SESSION, SELECT ANY TABLE, SELECT ANY DICTIONARY TO vcgrp';
    DBMS_SQL.PARSE (cursor_1, sqlstmt_1, DBMS_SQL.NATIVE);
    DBMS_SQL.CLOSE_CURSOR(cursor_1);

    Is my assumption correct that I'm missing some permission? Thank you

  2. #2
    Join Date
    Jan 2001
    Posts
    3,131
    SQL> create user harry identified by harry;

    User created.

    SQL> grant CREATE SESSION, SELECT ANY TABLE, SELECT ANY DICTIONARY TO harry;

    Grant succeeded.

    SQL> conn harry@test
    Enter password: *****
    Connected.
    SQL> desc dba_free_space;
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    TABLESPACE_NAME VARCHAR2(30)
    FILE_ID NUMBER
    BLOCK_ID NUMBER
    BYTES NUMBER
    BLOCKS NUMBER
    RELATIVE_FNO NUMBER

    SQL> select * from dba_free_space
    2 where rownum <4;

    TABLESPACE_NAME FILE_ID BLOCK_ID BYTES BLOCKS
    ------------------------------ ---------- ---------- ---------- ----------
    RELATIVE_FNO
    ------------
    SYSTEM 1 10021 32768 4
    1

    SYSTEM 1 8444 49152 6
    1

    SYSTEM 1 18369 85458944 10432
    1
    I remember when this place was cool.

  3. #3
    Join Date
    Jun 2005
    Posts
    2
    Is there something that I can check to understand why this didn't work for me? This is not my expertise, so I'm kind of flying blind here.

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    you dont have the priveleges to look at those object, you need to grant them the rights to do it as Mr H said

  5. #5
    Join Date
    Jan 2001
    Posts
    3,131
    There must be a problem problem with this line of code.
    sqlstmt_1 := 'GRANT CREATE SESSION, SELECT ANY TABLE, SELECT ANY DICTIONARY TO vcgrp';

    TO vcgrp;' (is this it?)
    I remember when this place was cool.

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