Skip to content
March 11, 2011 / doganay

GRANT CLONE – GRANT CLONING

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Hi,
You can clone grants of a table. Use this:


set trimspool on
set linesize 200
col privilege format a15
col owner format a15
set pages 100
prompt clone grants...
accept src_tab prompt source_table_name....:
accept dst_tab prompt destination_table_name.....:

select 'grant '|| privilege ||' on '||owner||
'.&&dst_tab to '||grantee||decode(grantable,'YES',' with grant option','')||';' GRANT_SQL
from dba_tab_privs
where table_name like upper(trim('&&src_tab'));

undefine src_tab
undefine dst_tab

try and pray 🙂

Advertisements

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

%d bloggers like this: