Technically saying, this is granting permissions to all tables in the schema
SET verify off
SET feedback off
SET pagesize 10000
SET linesize 120ACCEPT main_owner CHAR PROMPT 'MAIN OWNER: '
ACCEPT grant_to CHAR PROMPT 'GRANT TO: '
ACCEPT permissions CHAR PROMPT 'PERMISSIONS (i.e. SELECT,UPDATE): '
spool grant_from_&&main_owner._to_&&grant_to..SQL
SELECT 'grant &&permissions on "&&main_owner"."'
||table_name
||'" to "&&grant_to";' "---"
FROM dba_tables
WHERE owner=UPPER('&&main_owner');
spool off
undefine permissions
undefine main_owner
undefine grant_to
SET feedback off
SET pagesize 10000
SET linesize 120ACCEPT main_owner CHAR PROMPT 'MAIN OWNER: '
ACCEPT grant_to CHAR PROMPT 'GRANT TO: '
ACCEPT permissions CHAR PROMPT 'PERMISSIONS (i.e. SELECT,UPDATE): '
spool grant_from_&&main_owner._to_&&grant_to..SQL
SELECT 'grant &&permissions on "&&main_owner"."'
||table_name
||'" to "&&grant_to";' "---"
FROM dba_tables
WHERE owner=UPPER('&&main_owner');
spool off
undefine permissions
undefine main_owner
undefine grant_to
Leave a Reply