Thursday, January 17, 2008

Oracle: A simple way to query and copy grants from one instance to another

suppose you want to copy all the grant of an object in a database to another database the way to do it is to create a recursive query to generate an SQL grant command:

sql> select 'grant ' || privilege || ' on ' || owner||'.'||table_name || ' to ' || grantee from dba_tab_privs where grantee = "GRANTEE YOU WANT TO COPY"

No comments: