查询数据库表空间大小,将结果单位由Bytes显示为MB
发布网友
发布时间:2022-04-23 12:40
我来回答
共1个回答
热心网友
时间:2023-06-30 01:48
SELECT (UR * (UPS * DBS))/1024 AS "M"
FROM (SELECT value AS UR FROM v$parameter WHERE name = 'undo_retention'),
(SELECT undoblks/((end_time-begin_time)*86400) AS UPS
FROM v$undostat
WHERE undoblks = (SELECT MAX(undoblks) FROM v$undostat)),
(SELECT block_size AS DBS
FROM dba_tablespaces
WHERE tablespace_name = (SELECT UPPER(value) FROM v$parameter WHERE name = 'undo_tablespace'));追问额,谢谢了哈,我知道怎么写了,应该是
SELECT (UR * (UPS * DBS))/1024/1024 AS "M"
才对,Bytes是字节,