How can you find the size of a database?

Answers were Sorted based on User's Feedback



How can you find the size of a database?..

Answer / ashok

select sum(bytes/1024/1024) from dba_data_file;
it is the size of totaldatafiles

Is This Answer Correct ?    19 Yes 1 No

How can you find the size of a database?..

Answer / karthickumar pillaiyarsamy

select sum(a.blocks)+sum(b.blocks) from dba_data_files a,
v$log b;

Is This Answer Correct ?    3 Yes 2 No

How can you find the size of a database?..

Answer / pvenkiroyal

here is the exact answer for the size of oracle databaase...

select (select sum(bytes/1024/1024/1024) from
dba_data_files)+(select sum(bytes/1024/1024/1024) from
dba_temp_files)+(select sum(bytes/1024/1024/1024) from
v$log)"size in GB" from dual;

Is This Answer Correct ?    1 Yes 1 No

How can you find the size of a database?..

Answer / suman

please clear.....
how we check the size of database. In above answer we check only the database data file size.

But database also contain temporary datafile also.
we check database size--datafile+temp datafiles.

if we use dba_data_file-- it show only datafile size no temp datafile which also include with database size. kindly clear ----

Is This Answer Correct ?    0 Yes 2 No

How can you find the size of a database?..

Answer / vani bhargavi

In general the size of the database is defined as total
size of the physical datafiles.

The following query will help you for the space management
of your database.

Code:

clear breaks
clear computes
clear columns
set pagesize 50
set linesize 120
set heading on
column tablespace_name heading 'Tablespace' justify left
format a20 truncated
column tbsize heading 'Size|(Mb) ' justify left format
9,999,999.99
column tbused heading 'Used|(Mb) ' justify right format
9,999,999.99
column tbfree heading 'Free|(Mb) ' justify right format
9,999,999.99
column tbusedpct heading 'Used % ' justify left format a8
column tbfreepct heading 'Free % ' justify left format a8
break on report
compute sum label 'Totals:' of tbsize tbused tbfree on
report
select t.tablespace_name, round(a.bytes,2) tbsize,
nvl(round(c.bytes,2),'0') tbfree,
nvl(round(b.bytes,2),'0') tbused,
to_char(round(100 * (nvl(b.bytes,0)/nvl(a.bytes,1)),2))
|| '%' tbusedpct,
to_char(round(100 * (nvl(c.bytes,0)/nvl(a.bytes,1)),2))
|| '%' tbfreepct
from dba_tablespaces t,
(select tablespace_name, round(sum(bytes)/1024/1024,2)
bytes
from dba_data_files
group by tablespace_name
union
select tablespace_name, round(sum(bytes)/1024/1024,2) bytes
from dba_temp_files
group by tablespace_name ) a,
(select e.tablespace_name, round(sum(e.bytes)/1024/1024,2)
bytes
from dba_segments e
group by e.tablespace_name
union
select tablespace_name, sum(max_size) bytes
from v$sort_segment
group by tablespace_name) b,
(select f.tablespace_name, round(sum(f.bytes)/1024/1024,2)
bytes
from dba_free_space f
group by f.tablespace_name
union
select tmp.tablespace_name, (sum(bytes/1024/1024) - sum
(max_size)) bytes
from dba_temp_files tmp, v$sort_segment sort
where tmp.tablespace_name = sort.tablespace_name
group by tmp.tablespace_name) c
where
t.tablespace_name = a.tablespace_name (+)
and t.tablespace_name = b.tablespace_name (+)
and t.tablespace_name = c.tablespace_name (+)
order by t.tablespace_name
/

Is This Answer Correct ?    5 Yes 9 No

Post New Answer

More Oracle Architecture Interview Questions

How will you estimate the space required by a non-clustered tables?

2 Answers  


What are the uses of Oracle Rollback Segment?

0 Answers  


What is Server Process?

2 Answers  


How to calculate the approximate size of the SGA based on the size of the block,shared_pool,redo_buffer_cache and db_buffer_cache?

0 Answers  


What is the role of PCTFREE parameter is Storage clause ?

2 Answers  






How will you swap objects into a different table space for an existing database?

2 Answers  


• What is oracle Architecture?

3 Answers  


When does LGWR write to the database?

3 Answers  


What is an Oracle Data Block?

0 Answers  


What is the significance of having storage clause ?

1 Answers  


What is the maximum number of Lock Processes used?

1 Answers  


What are the two types of Server Configurations?

3 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)