SQL Queries to get packages and tables information from DB2 database
You can copy and keep below SQL oneliners to get packages and tables details from DB2 database.
1. SQL to get the Package details
select pkgname, pkgschema, pkgversion, unique_id, boundby, total_sect, valid, format, isolation, blocking from syscat.packages order by pkgschema, pkgname, pkgversion;
2. SQL to get the package details for the schema user
select pkgname, pkgschema, pkgversion, unique_id, boundby, total_sect, valid, format, isolation, blocking from syscat.packages where pkgschema = USER order by pkgschema, pkgname, pkgversion;
3. SQL to get the table creation time details
select tabname, tabschema, type, create_time from syscat.tables order by tabschema, tabname;
4. SQL to get the table details for user schema
select tabname, tabschema, type, create_time from syscat.tables where tabschema = USER order by tabschema, tabname;
5. SQL to get system tables details for schema SYSCAT
select tabname, tabschema, type, create_time from syscat.tables where tabschema = 'SYSCAT' order by tabschema, tabname;
6. SQL to get the details for NULL ID packages
select pkgname, pkgschema, pkgversion, unique_id, boundby, total_sect, valid, format, isolation, blocking from syscat.packages where pkgschema = 'NULLID' order by pkgschema, pkgname, pkgversion;
That's all in this post. If you liked this blog and interested in knowing more about IBM Db2. Please Like, Follow, Share & Subscribe to www.ImJhaChandan.com.
Comments