WorkingScripts

The Stuff that Just Works

WorkingScripts header image 2

DB2 Scripts – Table Management

March 4th, 2008 by Iouri Chadour

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')

Tags:   · · No Comments

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Leave a Comment

0 responses so far ↓

There are no comments yet...Kick things off by filling out the form below.