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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: [Q] Script to generate "grant privilege" on a table?

RE: [Q] Script to generate "grant privilege" on a table?

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Fri, 20 Jun 2003 13:26:11 -0700
Message-ID: <F001.005B6C3B.20030620130049@fatcity.com>


> -----Original Message-----
> From: mike mon [mailto:[EMAIL PROTECTED]
>
> Does anyone has script which can check "grant
> privilege" on a table and generate output for future
> usage?

If you're looking for a script to show existing grants on a table, you could modify this one (that shows existing table / column grants for all objects in a schema)

set verify off
set linesize 110
column sort_id noprint
column grantee format a25
column priv format a65
column grantable heading "ADM" format a3  select

    5 as sort_id,
    d.grantee,
    d.privilege || ' on "' || d.owner ||

       '"."' || d.table_name || '"'
       as priv,

    d.grantable as grantable
  from
    dba_tab_privs d
  where
    d.owner = '&&enter_schema'
union
 select

    7 as sort_id,
    f.grantee,
    f.privilege || ' on "' || f.owner ||

       '"."' || f.table_name || '" ("' || f.column_name || '")'
       as priv,

    f.grantable as grantable
  from
    dba_col_privs f
  where
    f.owner = '&&enter_schema'
order by 1, 2, 3 ;
undefine enter_schema
clear columns
set linesize 80
set verify on
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jacques Kilchoer
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Jun 20 2003 - 15:26:11 CDT

Original text of this message

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