統計資料庫每天的資料增長量
統計資料庫每天的資料增長量
select t.*
from (SELECT D.TABLESPACE_NAME,
SPACE "SUM_SPACE(M)",
BLOCKS SUM_BLOCKS,
SPACE - NVL(FREE_SPACE, 0) "USED_SPACE(M)",
ROUND((1 - NVL(FREE_SPACE, 0) / SPACE) * 100, 2) "USED_RATE(%)",
FREE_SPACE "FREE_SPACE(M)"
FROM (SELECT TABLESPACE_NAME,
ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
SUM(BLOCKS) BLOCKS
FROM DBA_DATA_FILES
GROUP BY TABLESPACE_NAME) D,
(SELECT TABLESPACE_NAME,
ROUND(SUM(BYTES) / (1024 * 1024), 2) FREE_SPACE
FROM DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME) F
WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME(+)
UNION ALL
SELECT D.TABLESPACE_NAME,
SPACE "SUM_SPACE(M)",
BLOCKS SUM_BLOCKS,
USED_SPACE "USED_SPACE(M)",
ROUND(NVL(USED_SPACE, 0) / SPACE * 100, 2) "USED_RATE(%)",
SPACE - USED_SPACE "FREE_SPACE(M)"
FROM (SELECT TABLESPACE_NAME,
ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
SUM(BLOCKS) BLOCKS
FROM DBA_TEMP_FILES
GROUP BY TABLESPACE_NAME) D,
(SELECT TABLESPACE,
ROUND(SUM(BLOCKS * 8192) / (1024 * 1024), 2) USED_SPACE
FROM V$SORT_USAGE
GROUP BY TABLESPACE) F
WHERE D.TABLESPACE_NAME = F.TABLESPACE(+)) t
order by "USED_RATE(%)" desc;
SQL> select t.*
2 from (SELECT D.TABLESPACE_NAME,
3 SPACE "SUM_SPACE(M)",
4 BLOCKS SUM_BLOCKS,
5 SPACE - NVL(FREE_SPACE, 0) "USED_SPACE(M)",
6 ROUND((1 - NVL(FREE_SPACE, 0) / SPACE) * 100, 2) "USED_RATE(%)",
7 FREE_SPACE "FREE_SPACE(M)"
8 FROM (SELECT TABLESPACE_NAME,
9 ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
10 SUM(BLOCKS) BLOCKS
11 FROM DBA_DATA_FILES
12 GROUP BY TABLESPACE_NAME) D,
13 (SELECT TABLESPACE_NAME,
14 ROUND(SUM(BYTES) / (1024 * 1024), 2) FREE_SPACE
15 FROM DBA_FREE_SPACE
16 GROUP BY TABLESPACE_NAME) F
17 WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME(+)
18 UNION ALL
19 SELECT D.TABLESPACE_NAME,
20 SPACE "SUM_SPACE(M)",
21 BLOCKS SUM_BLOCKS,
22 USED_SPACE "USED_SPACE(M)",
23 ROUND(NVL(USED_SPACE, 0) / SPACE * 100, 2) "USED_RATE(%)",
24 SPACE - USED_SPACE "FREE_SPACE(M)"
25 FROM (SELECT TABLESPACE_NAME,
26 ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
27 SUM(BLOCKS) BLOCKS
28 FROM DBA_TEMP_FILES
29 GROUP BY TABLESPACE_NAME) D,
30 (SELECT TABLESPACE,
31 ROUND(SUM(BLOCKS * 8192) / (1024 * 1024), 2) USED_SPACE
32 FROM V$SORT_USAGE
33 GROUP BY TABLESPACE) F
34 WHERE D.TABLESPACE_NAME = F.TABLESPACE(+)) t
35 order by "USED_RATE(%)" desc;
TABLESPACE_NAME SUM_SPACE(M) SUM_BLOCKS USED_SPACE(M) USED_RATE(%) FREE_SPACE(M)
------------------------------ ------------ ---------- ------------- ------------ -------------
SYSTEM 700 89600 506.94 72.42 193.06
SYSAUX 600 76800 264.69 44.12 335.31
USERS 5 640 1.25 25 3.75
TEMP 31 3968 3 9.68 28
UNDOTBS1 215 27520 12.81 5.96 202.19
DBADATATBS 2048 262144 1.12 .05 2046.88
6 rows selected.
SQL>
select t.*
from (SELECT D.TABLESPACE_NAME,
SPACE "SUM_SPACE(M)",
BLOCKS SUM_BLOCKS,
SPACE - NVL(FREE_SPACE, 0) "USED_SPACE(M)",
ROUND((1 - NVL(FREE_SPACE, 0) / SPACE) * 100, 2) "USED_RATE(%)",
FREE_SPACE "FREE_SPACE(M)"
FROM (SELECT TABLESPACE_NAME,
ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
SUM(BLOCKS) BLOCKS
FROM DBA_DATA_FILES
GROUP BY TABLESPACE_NAME) D,
(SELECT TABLESPACE_NAME,
ROUND(SUM(BYTES) / (1024 * 1024), 2) FREE_SPACE
FROM DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME) F
WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME(+)
UNION ALL
SELECT D.TABLESPACE_NAME,
SPACE "SUM_SPACE(M)",
BLOCKS SUM_BLOCKS,
USED_SPACE "USED_SPACE(M)",
ROUND(NVL(USED_SPACE, 0) / SPACE * 100, 2) "USED_RATE(%)",
SPACE - USED_SPACE "FREE_SPACE(M)"
FROM (SELECT TABLESPACE_NAME,
ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
SUM(BLOCKS) BLOCKS
FROM DBA_TEMP_FILES
GROUP BY TABLESPACE_NAME) D,
(SELECT TABLESPACE,
ROUND(SUM(BLOCKS * 8192) / (1024 * 1024), 2) USED_SPACE
FROM V$SORT_USAGE
GROUP BY TABLESPACE) F
WHERE D.TABLESPACE_NAME = F.TABLESPACE(+)) t
order by "USED_RATE(%)" desc;
SQL> select t.*
2 from (SELECT D.TABLESPACE_NAME,
3 SPACE "SUM_SPACE(M)",
4 BLOCKS SUM_BLOCKS,
5 SPACE - NVL(FREE_SPACE, 0) "USED_SPACE(M)",
6 ROUND((1 - NVL(FREE_SPACE, 0) / SPACE) * 100, 2) "USED_RATE(%)",
7 FREE_SPACE "FREE_SPACE(M)"
8 FROM (SELECT TABLESPACE_NAME,
9 ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
10 SUM(BLOCKS) BLOCKS
11 FROM DBA_DATA_FILES
12 GROUP BY TABLESPACE_NAME) D,
13 (SELECT TABLESPACE_NAME,
14 ROUND(SUM(BYTES) / (1024 * 1024), 2) FREE_SPACE
15 FROM DBA_FREE_SPACE
16 GROUP BY TABLESPACE_NAME) F
17 WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME(+)
18 UNION ALL
19 SELECT D.TABLESPACE_NAME,
20 SPACE "SUM_SPACE(M)",
21 BLOCKS SUM_BLOCKS,
22 USED_SPACE "USED_SPACE(M)",
23 ROUND(NVL(USED_SPACE, 0) / SPACE * 100, 2) "USED_RATE(%)",
24 SPACE - USED_SPACE "FREE_SPACE(M)"
25 FROM (SELECT TABLESPACE_NAME,
26 ROUND(SUM(BYTES) / (1024 * 1024), 2) SPACE,
27 SUM(BLOCKS) BLOCKS
28 FROM DBA_TEMP_FILES
29 GROUP BY TABLESPACE_NAME) D,
30 (SELECT TABLESPACE,
31 ROUND(SUM(BLOCKS * 8192) / (1024 * 1024), 2) USED_SPACE
32 FROM V$SORT_USAGE
33 GROUP BY TABLESPACE) F
34 WHERE D.TABLESPACE_NAME = F.TABLESPACE(+)) t
35 order by "USED_RATE(%)" desc;
TABLESPACE_NAME SUM_SPACE(M) SUM_BLOCKS USED_SPACE(M) USED_RATE(%) FREE_SPACE(M)
------------------------------ ------------ ---------- ------------- ------------ -------------
SYSTEM 700 89600 506.94 72.42 193.06
SYSAUX 600 76800 264.69 44.12 335.31
USERS 5 640 1.25 25 3.75
TEMP 31 3968 3 9.68 28
UNDOTBS1 215 27520 12.81 5.96 202.19
DBADATATBS 2048 262144 1.12 .05 2046.88
6 rows selected.
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29500582/viewspace-1321585/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何估算Oracle資料庫每日資料增長量Oracle資料庫
- 如何監控ORACLE資料庫表的增長量Oracle資料庫
- Oracle資料庫的資料統計(Analyze)Oracle資料庫
- SQL語句統計每天、每月、每年的 資料SQL
- 每天會生成巨大的資料庫,請教系統設計方法?- Reddit資料庫
- 開源和雲成了資料庫的增長引擎?資料庫
- 【資料庫設計】資料庫的設計資料庫
- 您能否應對您的資料庫增長挑戰?資料庫
- 完全無事務的資料庫SCN增長之謎資料庫
- sql統計各種奇葩的資料庫表資料SQL資料庫
- oracle資料庫連續相同資料的統計方法Oracle資料庫
- A/Btest——視覺設計與資料增長擦出的火花視覺
- 統計資料庫中表大小資料庫
- 每天自動備份Oracle資料庫Oracle資料庫
- 資料庫:系統設計的核心資料庫
- 對資料庫的統計和分析。資料庫
- 資料驅動企業增長
- Oracle資料庫日常問題-歸檔異常增長Oracle資料庫
- 好程式設計師大資料培訓分享MySQL資料庫約束條件和自增長序列程式設計師大資料MySql資料庫
- 騰訊QQ大資料 :從“增長黑客”談資料驅動的方法大資料黑客
- 資料庫系統設計概述資料庫
- 6 收集資料庫統計資訊資料庫
- MySQL資料庫審計系統MySql資料庫
- 基本的資料庫增刪改查資料庫
- 資料庫的統計(select)確實會影響資料庫的更新(update)的資料庫
- sqlserver資料庫如何每時/每天/每月/每年任取一條資料SQLServer資料庫
- 資料庫系統概述之國產資料庫資料庫
- angualrJs對資料庫資料處理的增刪改查JS資料庫
- Stackoverflow提問數量同比增長排名前10的資料庫資料庫
- 大廠的資料質量中心繫統設計
- 5 測量資料庫效能資料庫
- Oracle、mysql資料庫增、刪、改OracleMySql資料庫
- 分庫資料如何查詢統計
- SQL Server統計資料庫中表大小SQLServer資料庫
- 資料庫系統設計:分割槽資料庫
- 圖資料庫 Nebula Graph 的資料模型和系統架構設計資料庫模型架構
- 資料庫text型別的長度?資料庫型別
- 資料庫系統檔案啟動資料庫資料庫