【发布时间】:2021-02-11 23:05:20
【问题描述】:
大家好,我正在尝试查找以 GB 为单位的数据库大小以及已用空间和可用空间
查询
select round(sum(used.bytes) / 1024 / 1024 / 1024 ) || 'GB' "Database Size"
, round(sum(used.bytes) / 1024 / 1024 / 1024 ) –
round(free.p / 1024 / 1024 / 1024) || 'GB' "Used space"
, round(free.p / 1024 / 1024 / 1024) || 'GB' "Free space"
from (select bytes
from v$datafile
union all
select bytes
from v$tempfile
union all
select bytes
from v$log) used
, (select sum(bytes) as p
from dba_free_space) free
group by free.p
/
错误
ORA-00911: invalid character
00911. 00000 - "invalid character"
*Cause: identifiers may not start with any ASCII character other than
letters and numbers. $#_ are also allowed after the first
character. Identifiers enclosed by doublequotes may contain
any character other than a doublequote. Alternative quotes
(q'#...#') cannot use spaces, tabs, or carriage returns as
delimiters. For all other contexts, consult the SQL Language
Reference Manual.
*Action:
Error at Line: 2 Column: 48
尝试后仍然无法纠正错误,有什么建议吗?
【问题讨论】:
标签: oracle plsql database-administration