web analytics

Oracle: grant permissions to the whole schema

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

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.