中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

oracle如何查看表空間大小及使用情況

小億
203
2024-03-21 16:14:55
欄目: 云計算

可以使用以下SQL語句來查看表空間的大小及使用情況:

  1. 查看表空間的總大小、已使用空間和剩余空間:
SELECT tablespace_name,
       ROUND(SUM(bytes) / 1024 / 1024, 2) AS total_space_mb,
       ROUND(SUM(bytes - decode(maxbytes, 0, bytes, maxbytes)) / 1024 / 1024, 2) AS used_space_mb,
       ROUND(SUM(decode(maxbytes, 0, bytes, maxbytes) - bytes) / 1024 / 1024, 2) AS free_space_mb
  FROM dba_data_files
 GROUP BY tablespace_name;
  1. 查看每個數據文件的使用情況:
SELECT file_name,
       tablespace_name,
       ROUND(bytes / 1024 / 1024, 2) AS file_size_mb,
       ROUND(bytes - decode(maxbytes, 0, bytes, maxbytes) / 1024 / 1024, 2) AS used_space_mb,
       decode(maxbytes, 0, bytes, maxbytes) / 1024 / 1024 AS max_space_mb,
       autoextensible,
       status
  FROM dba_data_files;
  1. 查看每個表空間的數據文件及其使用情況:
SELECT tablespace_name,
       file_name,
       ROUND(bytes / 1024 / 1024, 2) AS file_size_mb,
       ROUND(maxbytes / 1024 / 1024, 2) AS max_size_mb,
       ROUND(bytes - decode(maxbytes, 0, bytes, maxbytes) / 1024 / 1024, 2) AS used_space_mb,
       decode(maxbytes, 0, bytes, maxbytes) / 1024 / 1024 AS max_space_mb,
       autoextensible,
       status
  FROM dba_data_files;

0
岳西县| 崇礼县| 太白县| 福海县| 乐至县| 田阳县| 榆社县| 阳江市| 扬州市| 永仁县| 苏尼特右旗| 渝中区| 安远县| 湛江市| 洛川县| 昌乐县| 正安县| 大邑县| 收藏| 阿城市| 太和县| 兴业县| 清水县| 芮城县| 湟中县| 溆浦县| 平阴县| 丰宁| 秦安县| 苍南县| 旅游| 清流县| 江川县| 江山市| 濮阳市| 读书| 龙泉市| 漯河市| 错那县| 峨边| 文水县|