Query tablespace usage in ORACLE ASM, data file path, total size remaining size of bare device disk

Source: Internet
Author: User


In ASM: Query all disk names, total size, remaining size: units MB
-----View the group's information (total size)
Select Name,total_mb, free_mb from V$asm_diskgroup;

---to view disk member information size individually
Select Name,total_mb,free_mb from V$asm_disk;


Or:
[[Email Protected]]asmcmd
Asmcmd>lsdg

Query table spatial data file path and Total size: units MB
SELECT Tablespace_name,
FILE_ID,
file_name,
Round (Bytes/(1024x768), 0) Total_space
From Dba_data_files
ORDER by Tablespace_name;

Query tablespace used, remaining, percent used: units GB
SELECT A.tablespace_name,
B.SIZE_GB,
A.FREE_GB,
Round ((A.FREE_GB/B.SIZE_GB) * +) "free_%"
From (SELECT Tablespace_name,
Round (Sum (bytes) *10/1024/1024/1024)/10 FREE_GB
From
Dba_free_space
GROUP by Tablespace_name) A,
(SELECT Tablespace_name,
Round (Sum (bytes) *10/1024/1024/1024)/10 SIZE_GB
From Dba_data_files
GROUP by Tablespace_name) b
WHERE A.tablespace_name = B.tablespace_name
ORDER BY 4 DESC
/

You can test a table space with a maximum of several data files:
Create tablespace Qiu datafile '/u01/app/oracle/oradata/qiu1.dbf ' size 1M;

Declare
V_STR VARCHAR2 (200);
Begin
For I in 2..1024 loop
V_str:= ' alter tablespace qiu add datafile ' | | ' /u01/app/oracle/oradata/qiu ' | | i| | '. DBF ' | | ' size 1M ';
Execute immediate v_str;
End Loop;
End
/

Query tablespace usage in ORACLE ASM, data file path, total size remaining size of bare device disk

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.