top of page

SQL Queries to get packages and tables information from DB2 database

  • Writer: Jha Chandan
    Jha Chandan
  • Oct 20, 2023
  • 1 min read

You can copy and keep below SQL oneliners to get packages and tables details from DB2 database.

ree

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


jc_logo.png

Hi, thanks for stopping by!

Welcome to my “Muse & Learn” blog!
Muse a little, learn a lot.✌️

 

Here you’ll find practical SQL queries, troubleshooting tips with fixes, and step-by-step guidance for common database activities. And of course, don’t forget to pause and muse with us along the way. 🙂
 

I share insights on:​​

  • Db2

  • MySQL

  • SQL Server

  • Linux/UNIX/AIX

  • HTML …and more to come!
     

Whether you’re just starting out or looking to sharpen your DBA skills, there’s something here for you.

Let the posts
come to you.

Thanks for submitting!

  • Instagram
  • Facebook
  • X
2020-2025 © TechWithJC

Subscribe to Our Newsletter

Thanks for submitting!

  • Facebook
  • Instagram
  • X

2020-2025 © TechWithJC

bottom of page