DB2 Common Syscat Query

Source: Internet
Author: User
Tags db2
--Query the corresponding view of the specific content.
Select varchar (text) | | '; ' from Syscat. views where VIEWNAME like '%v$_% '




--generates a statement that deletes a view.

Select ' Drop View ' | | viewname| | '; ' from Syscat. Views where  VIEWNAME like '%v$_% '



--Do you want to find all the patterns in the entire database? The following statement can implement:





--The query table corresponds to the permissions situation
DB2 =>select * FROM Syscat.tabauth




--View db's corresponding permissions situation
DB2 =>select * FROM Syscat.dbauth


--The Query column corresponds to the permissions
DB2 =>select * FROM Syscat.colauth




--Get the current DB2 version
DB2 =>select * FROM Sysibm.sysversions




--How do I view the stored procedures of a database?
DB2 =>select * from SYSCAT. Procedures




--How do I see constraints on a table?
DB2 =>select * from SYSCAT. CHECKS WHERE tabname =




--How do I see the reference complete constraint for a table?
DB2 =>select * from SYSCAT. REFERENCES WHERE tabname =




--How do you know the bufferpools situation?
DB2 =>select * from SYSCAT. Bufferpools




--How do you know how many tables a user has?
DB2 =>select * from SYSIBM. Systables WHERE creator= ' USER '


--How do I know the function under the user?
DB2 =>select * from IWH. Userfunction




DB2 =>select * from SYSIBM. Sysfunctions


--How do I know the view number under the user?
DB2 =>select * from Sysibm.sysviews WHERE creator= ' USER '




--How to know the number of trigger under the user?
DB2 =>select * from SYSIBM. Systriggers WHERE schema= ' USER '




--How do you know the status of Tablespace?
DB2 =>select * from SYSIBM. Systablespaces




How do---know about the sequence situation?
DB2 =>select * from SYSIBM. Syssequences




--How to know the status of index?
DB2 =>select * from SYSIBM. sysindexes




--How do you know the status of a table's fields? Note: The table name is capitalized and the pattern is capitalized
DB2 =>select * from SYSIBM. syscolumns WHERE tbname= '




How do---Know the DB2 data type?
SELECT * FROM SYSIBM. Sysdatatypes




--How do you know the bufferpools situation?
SELECT * FROM SYSIBM. Sysbufferpools




--How do I view the package for a database?
SELECT * FROM Syscat.packages



--How do I view the stored procedures of a database?
DB2 =>select * from SYSCAT. Procedures
DB2 =>select * from Sysibm.sysprocedures






















Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.