Oracle: Show user-privileges

Here’s a script to show you the privileges given to one or more specified users. Done quick & dirty so please feel free to beautify it.
The script shows all SYSTEM-privileges (granted by role or direct) and OBJECT-privileges and also the tablespace-quotas granted to the given user-schema.

To hand over more than one user to the query, you have to use a little odd syntax:


Notice that you have to omit the leading and trailing single quotation marks.

undefine Users;

SELECT a.grantee,
  a.granted_role AS GRANTED_BY_ROLE,
  NULL           AS OBJECT,
  NULL           AS OBJ_OWNER
FROM dba_role_privs a
JOIN dba_sys_privs b
ON a.granted_role=b.grantee
WHERE a.grantee IN ('&&Users')
SELECT grantee,
FROM dba_sys_privs
WHERE grantee IN ('&&Users')
SELECT grantee,
  ' ',
WHERE grantee IN ('&&Users') 
SELECT username,
  DECODE(max_bytes, -1, 'unlimited', max_bytes/1024/1024) MAX_MB,
  'TABLESPACE: ' || tablespace_name,
where username in ('&&Users')
order by grantee, privilege;

Bear in mind, that this script doesn’t give an all complete listing of the user’s privileges. For example access-privileges to directory-objects or roles granted by roles are not yet implemented.

Get files from SVN via wget

If one has to manually download all the stuff from a given SVN-branch, this could be a very tedious task right-clicking every thing and saving it to local disk. Luckily this could be automated via wget, which comes with most Linux distributions (there are Windows-ports out there too).

If for example I want to download all the stuff from I “wget” it this way:

wget -e robots=off --wait 1 -r -I /svnroot/mediawiki/trunk/extensions/SemanticForms/

“-e robots=off” ignores the robots.txt
“–wait 1” waits 1 second between the downloads
“-r” scans the server recursively
“-I /svnroot/mediawiki/trunk/extensions/SemanticForms/” includes the given path and below (excluding all the rest)

The latter one (“-I …”) is important! If omitted, wget would scan the whole server up and down – not limited to the “SemanticForms”-subdir.

Edit 2012-05-22:
There is an easier way of limiting the wget-operation to the given branch: the “-np” option. This switch keeps wget from ascending to the parent directory. So you could omit the -I mentioned above and use -np instead to get the same result with less typing. (Thank you Joe for the advice!)