Repository navigation
7.a . Scripts
Sayan Bhattacharya edited this page May 4, 2026
·
4 revisions
Q. HR have whatever tables ,those tables select and insert privileges give a new user and view it. write a script.
ans> select 'grant select,insert on '||owner||'.'||object_name||' to nick;' from dba_objects where owner like 'HR' and object_type like 'TABLE';
command is [ select grantee,owner,table_name,grantor,privilege from dba_tab_privs where grantee like 'NICK' and owner like 'HR' ]
select 'revoke '||privilege||' on '||owner||'.'||table_name||' from nick;' from dba_tab_privs where grantee like 'NICK';