Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
grant DB permissions SQL script (Read 2876 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
grant DB permissions SQL script
22.06.07 at 14:24:11
 
grant DB permissions SQL script
 
The following script can be used in Oracle to create a SQL script to grant permissions to database objects.
 

select decode( aot.object_type
            ,'TABLE','grant insert, update, delete, select on '||object_name||' to myuser;'
            ,'VIEW','grant insert, update, delete, select on '||object_name||' to myuser;'
            ,'PACKAGE','grant execute on '||object_name||' to myuser;'
            ,'PROCEDURE','grant execute on '||object_name||' to myuser;'
            ,'FUNCTION','grant execute on '||object_name||' to myuser;'
            ,'SEQUENCE','grant select on '||object_name||' to myuser;'
            , aot.object_type||' '||object_name
            )
from all_objects aot
where object_name like 'SOMETHING%'  
and aot.owner = 'MYSCHEMA'
and object_type not in ( 'SYNONYM','INDEX','PACKAGE BODY')
order by object_type

 
Sample output:

grant execute on P_SSD to myuser;
grant execute on P_AMG to myuser;
grant execute on P_MWG to myuser;
grant execute on P_MSH to myuser;
grant execute on P_LSD to myuser;
grant execute on P_EOD to myuser;
Back to top
 
« Last Edit: 22.06.07 at 14:26:41 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1