Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to dump users grants to .sql file
Marc Cluet пишет в сообщении <3858c3ec.9307713_at_news.worldonline.es> ...
>Hi
>
>Someone knows how to dump all the grants I've given to a specific user
>as SQL commands to a .sql file so I can execute it on another server
>to give the same permissions to the same user?
>Thank you!
>Marc
>
spool c:\temp\grants.sql
select 'GRANT '||privilege||' ON '||table_schema||'.'||table_name||' TO
'||grantee||decode(grantable, 'YES', ' WITH GRANT OPTION;', ';')
from dba_tab_privs where grantee=<user_name>;
select 'GRANT'||privilege||' TO '||grantee||decode(admin_option, 'YES', '
WITH ADMIN OPTION;', ';')
from dba_sys_privs where grantee=<user_name>;
spool off
I hope this will help you.
Ayc. Received on Thu Dec 16 1999 - 07:52:16 CST
![]() |
![]() |