Sybase_generate_revoke_Scripts

–Revoke script
set nocount on
go
set proc_return_status off
go
select ‘use ‘ + CHAR(10) + “GO”
go
select ‘revoke insert on ‘ + name + ‘ from ‘ + CHAR(10) + “GO” from sysobjects where type in ( ‘U’, ‘V’)
go
select ‘revoke update on ‘ + name + ‘ from ‘ + CHAR(10) + “GO” from sysobjects where type in ( ‘U’, ‘V’)
go
select ‘revoke delete on ‘ + name + ‘ from ‘ + CHAR(10) + “GO” from sysobjects where type in ( ‘U’, ‘V’)
go
select ‘revoke execute on ‘ + name + ‘ from ‘ + CHAR(10) + “GO” from sysobjects where type in ( ‘P’)
go
select ‘revoke Delete Statistics on ‘ + name + ‘ from ‘ + CHAR(10) + “GO” from sysobjects where type in ( ‘U’, ‘V’)
go
select ‘revoke Transfer Table on ‘ + name + ‘ from ‘ + CHAR(10) + “GO” from sysobjects where type in ( ‘U’, ‘V’)
go
select ‘revoke Truncate Table on ‘ + name + ‘ from ‘ + CHAR(10) + “GO” from sysobjects where type in ( ‘U’, ‘V’)
go
select ‘revoke Update Statistics on ‘ + name + ‘ from ‘ + CHAR(10) + “GO” from sysobjects where type in ( ‘U’, ‘V’)
go

${SYBASE}/${SYBASE_OCS}/bin/isql -b -D dbname -S IDKTPAP1 -U dba_oper -i /tmp/t/revoke_script.sql -o revoke_script_dbname.sql

-P *

–Databases – RO Groups
KA_Indo – , ReadOnly
KGlobal – , ReadOnly
KK_Indo – , ReadOnly
KV_Indo – , ReadOnly
K_Indo – , ReadOnly

dbktp_feedloader – , kplustp_ro_group
interf – , ReadOnly
ktparch – , kplustp_ro_group
ktpplus – , kplustp_ro_group

— MDA – is this needed – dba_ro_group (gudanav_ro, mhapnih_ro, miroand_ro, stoimar_ro) doesn’t seem to have any permissions, what is the point of it.

set nocount on
go
set proc_return_status off
go
select ‘revoke insert on ‘ + name + ‘ to dba_ro_group’ from sysobjects where type in ( ‘U’, ‘V’)
go
select ‘revoke update on ‘ + name + ‘ to dba_ro_group’ from sysobjects where type in ( ‘U’, ‘V’)
go
select ‘revoke delete on ‘ + name + ‘ to dba_ro_group’ from sysobjects where type in ( ‘U’, ‘V’)
go