Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Getting GRANTs for actual user

Getting GRANTs for actual user

From: R. Heydenreich <rheydenr_at_htwm.de>
Date: 9 Sep 2003 07:48:20 -0700
Message-ID: <ccb2643c.0309090648.69f39267@posting.google.com>


Hi all,

I'm looking for a possibility to get the GRANTs for a user for a certain SEQUENCE. The first solution is as follows:

SELECT 'GRANT ' || PRIVILEGE || ' ON ' ||   (SELECT DISTINCT user_name
   FROM v$open_cursor
   WHERE sid in

     (SELECT s.sid 
      FROM v$session s 
      WHERE s.audsid = USERENV('SESSIONID')
      )
   ) || '.' || table_name || ' TO ' || grantee || 
     DECODE (grantable, 'YES', ' WITH GRANT OPTION', 'NO', '', '')
GRANT_COMMAND
FROM user_tab_privs
WHERE table_name = 'sequence_name';

This generates the following lines, f.i.:

GRANT_COMMAND



GRANT ALTER ON MYSCHEMANAME.SEQUENCE_NAME TO MYUSERNAME GRANT SELECT ON MYSCHEMANAME.SEQUENCE_NAME TO MYUSERNAME I think, this is not the optimal solution. How can I make this statement faster and easier?

Greatings,
Ralf. Received on Tue Sep 09 2003 - 09:48:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US