【问题标题】:How do I check the current size of the undo tablespace?如何检查撤消表空间的当前大小?
【发布时间】:2020-02-13 15:36:02
【问题描述】:

我在执行返回数百万行的查询时收到以下错误错误:
ORA-30036: unable to extend segment by 128 in undo tablespace 'UNDOTBS2'

错误告诉我溢出的撤消表空间的名称。
如何检查上面命名的撤消表空间的当前大小?
是否有 PL/SQL 命令返回有关给定撤消表空间的元数据?

【问题讨论】:

  • 当您说“查询”时,大概是指更新语句?还是删除?
  • @APC 好吧,从技术上讲,我正在刷新物化视图。所以我正在运行select 语句,然后查询结果作为update/insert 语句在后台被泵入基础表。
  • 从技术上讲,你正在改变状态,这就是为什么 UNDO 表空间是一个问题。如果你只是做一个普通的 SELECT 也没关系。

标签: sql oracle oracle-apex


【解决方案1】:
select t1.tablespace_name "Tablespace name"
       , total_used_space "Used MB"
       , (t1.total_space - t2.total_used_space) "Free MB"
       , t1.total_space "Total MB"
       , round(100 * ( (t1.total_space - t2.total_used_space)/ t1.total_space))
"Percentage Free"
from (select tablespace_name
             , round(sum(bytes) / 1048576) Total_Space
      from dba_data_files
      group by tablespace_name) t1,
     (select round(sum(bytes)/(1024*1024)) total_used_space
             , tablespace_name
      from dba_segments
      group by tablespace_name) t2
      where t1.tablespace_name = t2.tablespace_name ;

【讨论】:

  • 这看起来很不错,谢谢。不幸的是,即使只执行t1 子查询,我也会得到ORA-00942: table or view does not exist。 APEX 与 Oracle DB 有何不同? (我不明白为什么它不同......)
  • 不,这可能意味着您以缺乏 DBA 视图权限的用户身份连接。
  • @APC 宾果游戏。当。我想我将不得不再次骚扰我的内部 IT/DBA 人员。谢谢!
  • 嗨@Giffyguy 很高兴看到它有帮助,祝 DBA 朋友好运:)
  • 嗨 @APC 感谢您如此迅速地对 OP 的评论做出反应,干杯!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-10
  • 2021-12-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多