Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle list user grants

-- 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';
Comment

PREVIOUS NEXT
Code Example
Sql :: display index in sql 
Sql :: adding indexing on a db model in mysql using sequelize 
Sql :: grant mysql 
Sql :: sql last 3 rows 
Sql :: postgres in operator with comma separated values 
Sql :: script to add datafile to tablespace 
Sql :: mysql safe mode 
Sql :: insert multiple rows in sql workbench 
Sql :: sql auto date 
Sql :: org.h2.jdbc.jdbcsqlsyntaxerrorexception table not found 
Sql :: how to get mysql db size 
Sql :: sql add months to date 
Sql :: docker export psql sql 
Sql :: sql select data from last week 
Sql :: docker run mysql image 
Sql :: epoch time converter in snowflake 
Sql :: create database collation 
Sql :: sql select where in list 
Sql :: postgres autoincrement primary key 
Sql :: incorrect string value: mysql 
Sql :: sql select max value from multiple rows 
Sql :: ORA-00942 
Sql :: mysql update row 
Sql :: how to add where command in update comand with joins 
Sql :: how to update date value in sql 
Sql :: show constraints mysql 
Sql :: start mysql 
Sql :: sql distinct with count 
Sql :: oracle convert int to date 
Sql :: cannot drop database because it is currently in use 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =