小智 6
系统视图 SYSTAB 可能是一个足够好的替代方案。它可以为您提供表中的行数,并且可以为您提供表使用的页数。(在下面的示例中,我将页面数乘以数据库的页面大小以获得总字节大小。)
SELECT
count, -- number of rows in the table
(table_page_count * DB_PROPERTY('PageSize')) tablesize
-- total size, in bytes
FROM SYSTAB
WHERE table_name = 'mytable'; -- or whatever limitations you want on
-- the scope of the query
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助。