以 KB 为单位确定 SQL 结果集的大小

2021-12-24 00:00:00 sql oracle oracle10g plsql

我希望找到如何在 OracleDB 中获取结果集的 kb 大小.我不是系统管理员,但经常运行返回超过 100k 行的查询,我需要找到一种方法来确定总 kb 大小.谢谢

I am hoping to find how I can get the kb size of a result set in OracleDB. I am not an sysadmin, but often run queries that return over 100k rows and I would need to find a way to determine what is the total kb size. thank you

推荐答案

在 SQL*Plus 中:

In SQL*Plus:

SET AUTOTRACE ON

SELECT *
FROM emp
WHERE rownum <= 100;

        27  recursive calls
         0  db block gets
        19  consistent gets
         4  physical reads
         0  redo size
     **11451  bytes sent via SQL*Net to client**
       314  bytes received via SQL*Net from client
         8  SQL*Net roundtrips to/from client
         0  sorts (memory)
         0  sorts (disk)
       100  rows processed

要使用 AUTOTRACE 需要 PLUSTRACE 角色,默认情况下不会授予该角色.了解更多.

To use AUTOTRACE requires the PLUSTRACE role, which is not granted by default. Find out more.

相关文章