回覆列表
  • 1 # 使用者7364316064609

    檢視“oracle”臨時表空間當前使用了多少空間,可按照以下程式。

    SELECT d.tablespace_name "Name", d.status "Status",

    TO_CHAR (NVL (a.BYTES / 1024 / 1024, 0), "99,999,990.90") "Size (M)",

    TO_CHAR (NVL (a.BYTES - NVL (f.BYTES, 0), 0) / 1024 / 1024,

    "99999999.99"

    ) USE,

    TO_CHAR (NVL ((a.BYTES - NVL (f.BYTES, 0)) / a.BYTES * 100, 0),

    "990.00"

    ) "Used %"

    FROM SYS.dba_tablespaces d,

    (SELECT tablespace_name, SUM (BYTES) BYTES

    FROM dba_data_files

    GROUP BY tablespace_name) a,

    (SELECT tablespace_name, SUM (BYTES) BYTES

    FROM dba_free_space

    GROUP BY tablespace_name) f

    WHERE d.tablespace_name = a.tablespace_name(+)

    AND d.tablespace_name = f.tablespace_name(+)

    AND NOT (d.extent_management LIKE "LOCAL" AND d.CONTENTS LIKE "TEMPORARY")

    UNION ALL

    SELECT d.tablespace_name "Name", d.status "Status",

    TO_CHAR (NVL (a.BYTES / 1024 / 1024, 0), "99,999,990.90") "Size (M)",

    TO_CHAR (NVL (t.BYTES, 0) / 1024 / 1024, "99999999.99") USE,

    TO_CHAR (NVL (t.BYTES / a.BYTES * 100, 0), "990.00") "Used %"

    FROM SYS.dba_tablespaces d,

    (SELECT tablespace_name, SUM (BYTES) BYTES

    FROM dba_temp_files

    GROUP BY tablespace_name) a,

    (SELECT tablespace_name, SUM (bytes_cached) BYTES

    FROM v$temp_extent_pool

    GROUP BY tablespace_name) t

    WHERE d.tablespace_name = a.tablespace_name(+)

    AND d.tablespace_name = t.tablespace_name(+)

    AND d.extent_management LIKE "LOCAL"

    AND d.CONTENTS LIKE "TEMPORARY";

  • 中秋節和大豐收的關聯?
  • 水滸傳56到60回主要內容概括?