-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathany_rights.sql
52 lines (38 loc) · 1.28 KB
/
any_rights.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--==============================================================================
-- GPI - Gunther Pippèrr
-- Desc: get the user rights and grants
-- Date: September 2012
--
--==============================================================================
set verify off
set linesize 130 pagesize 300
define USER_NAME = &1
column grantee format a25
column GRANTOR format a25
column PRIVILEGE format a25 heading "Priv"
column table_name format a20 heading "Table|Name"
column ADMIN_OPTION format a3 heading "Adm|OPT"
column COMMON format a3 heading "Com"
column INHERITED format a7 heading "Inherit"
column table_name format a26 heading "User|Name"
ttitle left "ANY for &&USER_NAME" skip 2
select grantee, table_name, privilege
from dba_tab_privs
where privilege like '%PRIVILEGES%'
and table_name like upper('&&USER_NAME.')
order by table_name,PRIVILEGE
/
ttitle left "Any PRIVILEGES for &&USER_NAME" skip 2
select GRANTEE
, PRIVILEGE
, ADMIN_OPTION
, COMMON
, INHERITED
from dba_sys_privs
where privilege like '% ANY %'
and grantee like upper('&&USER_NAME.')
order by GRANTEE,PRIVILEGE
/
ttitle OFF
column table_name format a20 heading "table_name"
--------------