SQL Script to generate privileges to be granted

Posted on May 29, 2008. Filed under: DBA/Admin Tips, Scripts, User | Tags: , , , |

Imagine you want to grant same exact privileges of existing user A to User B.

Login as a user who has a dba privilege and run below command to generate the list of privileges to be granted.

select
‘grant ‘ || privilege || ‘ on ‘ || owner || ‘.’ || table_name || ‘ to USER B;’
from
dba_tab_privs
where
grantee = upper(‘&GRANTEE_NAME’);

GRANTEE_NAME is USER A.

You can also check this link (https://oraclepitstop.wordpress.com/2008/05/29/sql-script-to-list-oject-privileges-granted-to-a-particular-user/) to list all the privileges granted to a particular user.

cheers,
OraclePitStop

Advertisements

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: