Skip to content

有害部落格同好會

2013/03/15 / Database

SQL 查詢 tablespace

自己組 SQL 來 monitor

SELECT df.tablespace_name TABLESPACE,
       df.max_space_gb max_space_gb,
       df.total_space_gb total_space_gb,
       (df.total_space_gb - fs.free_space_gb) used_space_gb,
       fs.free_space_gb free_space_gb, ROUND(100 * (fs.free_space_gb / df.total_space_gb), 2) pct_free,
       ROUND(100 - 100 * (df.total_space_gb - fs.free_space_gb) / df.max_space_gb, 2) pct_max_free
  FROM (SELECT tablespace_name,
               ROUND(SUM(DECODE(autoextensible, 'YES', maxbytes, bytes)) / 1073741824, 2) max_space_gb,
               ROUND(SUM(bytes) / 1073741824, 2) total_space_gb
          FROM dba_data_files
         GROUP BY tablespace_name) df,
       (SELECT tablespace_name,
               ROUND(SUM(bytes) / 1073741824, 3) free_space_gb
          FROM dba_free_space
         GROUP BY tablespace_name) fs
 WHERE df.tablespace_name = fs.tablespace_name(+)
 ORDER BY fs.tablespace_name;

SELECT df.tablespace_name tablespace, df.max_space_gb max_space_gb, df.total_space_gb total_space_gb, (df.total_space_gb - fs.free_space_gb) used_space_gb, fs.free_space_gb free_space_gb, round(100 * (fs.free_space_gb / df.total_space_gb), 2) pct_free, round(100 - 100 * (df.total_space_gb - fs.free_space_gb) / df.max_space_gb, 2) pct_max_free FROM (SELECT tablespace_name, round(SUM(decode(autoextensible, 'YES', maxbytes, bytes)) / 1073741824, 2) max_space_gb, round(SUM(bytes) / 1073741824, 2) total_space_gb FROM dba_data_files GROUP BY tablespace_name) df, (SELECT tablespace_name, round(SUM(bytes) / 1073741824, 3) free_space_gb FROM dba_free_space GROUP BY tablespace_name) fs WHERE df.tablespace_name = fs.tablespace_name(+) ORDER BY fs.tablespace_name;

Post navigation

Previous Post:

Portable VirtualBox 使用 bridge 網路連線

Next Post:

Discoverer 相關 SQL

分類

  • 新奇有趣の搶先報導
    • Raspberry Pi
    • 手機相關
    • 推薦軟體
    • 新鮮有趣
    • 生活資訊
  • 想破腦袋の程式技巧
    • Oracle EBS
    • Database
    • Excel, VBA
    • php
    • JavaScript, VBScript
    • VS.NET
    • Others
    • Windows
    • SAP
  • 撩動心弦の短文小品
  • 聚沙成塔の理財守則
  • 不可不知の職場實錄
  • 剎那永恆の生活翦影

近期文章

  • 受保護的內容: 如何透過Personalize功能呼叫另一form來回傳值
  • Win10 / 8 / 7 無法安裝 SSD
  • 受保護的內容: 樹梅派+遠端連線
  • EBS R12 取得客戶的phone, email, URL資料
  • 受保護的內容: 管控Workflow Administrator Role

友站

  • Masaya396's 協奏曲
  • 老塗的咁仔店

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

Tag Cloud

你目前使用的瀏覽器不支援 HTML5 的 CANVAS 標籤。

  • LDAP
  • VB6
  • SQL
  • MySql
  • SAP
  • 感情
  • EBS 12.1.3
  • Oracle EBS
  • excel
  • VBA
  • Oracle DB
  • 管理
  • VB.Net
  • HTC
  • javascript
  • EBS 11.5.10
  • php
  • Win7
  • WinXP
  • CSS
© 2025 有害部落格同好會 - Powered by SimplyNews