Get the App
SLTechnology News&Howtos  ›  Database  › 

Example Analysis of tablespaces in oracle

Shulou Source: shulou.com Published: 2022-05-31 21:19:24 11月15日 Update

This article mainly introduces the example analysis of table space in oracle, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

Oracle Tablespace Example Details

Query Tablespace

SELECT UPPER(F.TABLESPACE_NAME) "Tablespace name", D.TOT_GROOTTE_MB "Tablespace size", D.TOT_GROOTTE_MB - F.TOTAL_BYTES "Used Space", TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100, 2), '990.99') "usage ratio", F.TOTAL_BYTES "free space", F.MAX_BYTES "Maximum block" FROM (SELECT TABLESPACE_NAME, ROUND(SUM(BYTES) / (1024 * 1024), 2) TOTAL_BYTES, ROUND(MAX(BYTES) / (1024 * 1024), 2) MAX_BYTES FROM SYS.DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) F, (SELECT DD.TABLESPACE_NAME, ROUND(SUM(DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB FROM SYS.DBA_DATA_FILES DD GROUP BY DD.TABLESPACE_NAME) D WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME ORDER BY 4 DESC;

Add a table space file:

ALTER TABLESPACE TESTTBSADD DATAFILE 'D:/ora/datafile/users.ora' SIZE 500MAUTOEXTEND ON Thank you for reading this article carefully. I hope that Xiaobian will share the "Sample Analysis of Tablespace in Oracle" this article is helpful to everyone. At the same time, I hope that everyone will support it a lot. Pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

Tags: Space articles tables examples analysis maximum value interest at the same time size examples documents more friends query tables knowledge free editing industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno Redmi Docker macOS