-- List privileges, including roles, for my_user
SELECT GRANTEE, PRIVILEGE AS PRIVILEGE_ROLE,
NULL AS OWNER, NULL AS TABLE_NAME, NULL AS COLUMN_NAME,
ADMIN_OPTION AS PRIVILEGE,
NULL AS GRANTABLE
FROM DBA_SYS_PRIVS WHERE GRANTEE = 'my_user'
UNION ALL
SELECT r.GRANTEE, r.GRANTED_ROLE AS PRIVILEGE_ROLE, p.OWNER, p.TABLE_NAME,
p.COLUMN_NAME, PRIVILEGE, p.GRANTABLE
FROM DBA_ROLE_PRIVS r LEFT JOIN ROLE_TAB_PRIVS p ON p.ROLE = r.GRANTED_ROLE
WHERE r.GRANTEE = 'my_user';
SELECT USERNAME,
LOCK_DATE,
EXPIRY_DATE
FROM DBA_USERS
WHERE USERNAME IN (SELECT GRANTEE
FROM DBA_SYS_PRIVS
WHERE PRIVILEGE = 'UNLIMITED TABLESPACE')
ORDER BY USERNAME;
DELETE data from a specific table.
INSERT data into a specific table.
CREATE a foreign key reference to the named table or to a subset of columns from a table.
SELECT data from a table, view, or a subset of columns in a table.
CREATE a trigger on a table.
UPDATE data in a table or in a subset of columns in a table.
RUN a specified function or procedure.
USE a sequence generator or a user-defined type.
GRANT ALL PRIVILEGES TO USER_NAME;