How to Run Reorg,Reorgcheck,Runstats & Granting privileges on all tables in a database
Reorg Command on all Tables in a Database db2 -x "select 'reorg table',rtrim(tabschema)||'.'|| rtrim(tabname)from syscat.tables where type = 'T' and TABSCHEMA = 'ABC'" > reorg_out.sql db2 -tvf reorg_out.sql Runstats Command on all tables in a database db2 -x "select 'runstats on table',rtrim(tabschema)||'.'|| rtrim(tabname)from syscat.tables where type = 'T' and TABSCHEMA = 'ABC'" > runstat_out.sql db2 -tvf runstat_out.sql Granting Select Privileges on all Tables in a Database db2 -x "select 'Grant select on table ' || trim(tabschema) || '.' || trim(tabname)|| ' to user test_usr' from syscat.tables where tabschema = 'ABC'" > grants.sql Granting Execute Privileges on all Tables in a Database db2 -x "select 'Grant Execute on procedure ' || trim(procschema) || '.' || trim(procna...