Here are a few more nice DB2 scripts that would save you time:

Get all tables in Table Space

-- Get all tables in particular tablespaceselect SUBSTR(TABNAME,1,25) "TABNAME", SUBSTR(TABSCHEMA,1,15) "SCHEMA", NPAGES, CARD from syscat.tables where tbspace = '?'

Generate Grants for all tables in Table Space

-- Genereating GRANTS SELECT 'grant select on ' || tabname || ' to PSFDEV' || ';'  FROM syscat.tables WHERE tabname NOT IN (SELECT tabname                         FROM syscat.tabauth                        WHERE grantee = 'PSFDEV')   AND tabschema = 'PSFSSYS'   AND (type = 'T' OR type = 'V')

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
© 2011 WorkingScripts Suffusion theme by Sayontan Sinha

Switch to our mobile site