Finding the size of database [message #299220] |
Sun, 10 February 2008 21:03 |
kaustubh
Messages: 26 Registered: June 2007
|
Junior Member |
|
|
Hi,
I want to know, how can I find the size of the database. Some articles on internet suggest to query the table "dba_segments" while some suggest querying "dba_data_files", "dba_temp_files" and "sys.v_$log".
Method 1: Using dba_segments:
=============================
select sum(bytes/1024)from dba_segments;
Method 2: Using "dba_data_files", "dba_temp_files" and "sys.v_$log"
====================================================================
select a.data_size+b.temp_size+c.redo_size "total_size"
from ( select sum(bytes) data_size from dba_data_files ) a,( select nvl(sum(bytes),0) temp_sizefrom dba_temp_files ) b,
( select sum(bytes) redo_size from sys.v_$log ) c
Could you please let me know which one of the above is more correct and will give me the exact size of the database?
Also let me know how can I query the size of only the data (i.e. no redo logs, temp files etc)
Thanks and regards,
Kaustubh Kane.
|
|
|
|
Re: Finding the size of database [message #299230 is a reply to message #299220] |
Sun, 10 February 2008 23:46 |
varu123
Messages: 754 Registered: October 2007
|
Senior Member |
|
|
size of a database =size of physical files.
size of data=size occupied in physical files.
Now there are two things
one is your data is growing
second is your datafiles are growing.
In the first case,datagrows inside the datafiles,hence you can use dba_segments,dba_extents to see how much data has been ocupied.
To know whats the size of datafiles,query dba_data_files.
To know the size of database,add datafiles+controlfiles+tempfiles+archived files+redolog files
|
|
|
|
Re: Finding the size of database [message #299874 is a reply to message #299246] |
Wed, 13 February 2008 08:16 |
kaustubh
Messages: 26 Registered: June 2007
|
Junior Member |
|
|
Hi,
size of the database and size of only data are just my terms.
size of the database means the total size of the contents in all the tables, indexes, views, redo, undo etc.
size of only data means the size of the contents in tables only.
I want to know, how can I tell what is the amount of data I currently have in my database.
If somebody asks me what is the size of data in the database, then what and how should I query in the database.
Regards,
Kaustubh Kane
|
|
|
|
|
|
|
|