Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试使用选择查询从 SYSIBM.SYSTABLES 获取特定表空间和数据库的表数。此数量大于存储在 NTABLES 列下的 SYSIBM.SYSTABLESPACE 表中的相同表空间和数据库的表数量。为什么会这样?
这可能是systables存储每个表、视图或别名的条目的事实,实际上是可能不一定包含在表空间中的大量对象。
systables
您可以通过仅列出那些 where type = 'T'(或允许值的其他组合)来确认这一点。
type = 'T'
如果您选择count(*)from systables(对于给定的表空间) 并将其分组type,您可能会发现将其中一些类型分配给表空间相当容易。
count(*)
type