0% found this document useful (0 votes)
38 views1 page

DB Growth Script

The document contains two SQL scripts that query the v$datafile view to summarize Oracle database file growth over time in gigabytes and group results by month or year. The scripts summarize storage usage and growth for monitoring and planning purposes.

Uploaded by

ToneySnrYawe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views1 page

DB Growth Script

The document contains two SQL scripts that query the v$datafile view to summarize Oracle database file growth over time in gigabytes and group results by month or year. The scripts summarize storage usage and growth for monitoring and planning purposes.

Uploaded by

ToneySnrYawe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

script- 1

col growth_gb format 999G999D99


col month format a20

select to_char(creation_time, 'YYYY MM') month, sum(bytes)/1024/1024/1024 growth_gb


from v$datafile
where creation_time > SYSDATE - 720
group by to_char(creation_time, 'YYYY MM')
order by 1 desc

script -2

select to_char(CREATION_TIME,'RRRR') year, to_char(CREATION_TIME,'MM') month,


round(sum(bytes)/1024/1024/1024) GB
from v$datafile
group by to_char(CREATION_TIME,'RRRR'), to_char(CREATION_TIME,'MM')
order by 1, 2;

You might also like