on 07-29-2014 3:57 PM
Hello everyone,
I would need to list all empty tables in a database for SAP schema (SAPSR3).
Any idea for a SQL query or how to retrive this information from DBACOCKPIT?
Best Regards,
Valerio
Hi Valerio,
In syscat.tables is info how much pages are used by table.
db2 "select count(*) from syscat.tables where TYPE='T' and STATUS='N' and NPAGES = '0'"
or for listing
db2 "select TABNAME from syscat.tables where TYPE='T' and STATUS='N' and NPAGES = '0'"
There is description for syscat.tables IBM Knowledge Center
See MPAGES and FPAGES too.
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Valerio,
DBACOCKPIT does not provide a list of empty tables but something very close.
Are you using virtual tables in your system? In DBACOCKPIT unter Space -> Virtual Tables you will find a list of virtual tables and a list of candidates for virtual tables.
(1) Virtual tables are always empty since technically they are a special kind of view that can not contain data.
(2) DBACOCKPIT determines candidates for virtual tables by looking for tables that only occupy a minimum size in the tablespace.So the candidates for virtual tables may or may not be empty since some rows fit into the table without the need to increase the minimum size. When converting empty tables DBACOCKPIT executes a "SELECT COUNT(*)" on each canditate before converting it to a virtual table.
Regards
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.