Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Database Administration >> how to know size of database

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: how to know size of database
 Neeraj  Posted: Feb 14, 2008 05:43:37 AM

 Total Post: 258
 Joined: Jan, 2007






 hi,
tell me how cud i know the size of oracle 10g/9i database.

 arun
Posted: Feb 14, 2008 07:26:06 AM  

 Total Post: 28
 Joined: Sep, 2007






 
select sum(bytes/1024/1024/1024) from dba_data_files

The above query gives u database size in GB.

Pls run the query using system or sys user.



 dbavinod
Posted: Feb 15, 2008 02:03:36 AM  

 Total Post: 90
 Joined: Sep, 2006






 
Size of DB is always size of total space used in all datafiles. U can have look through OEM or u need to query datafiles for used space minus Db blocks used but free now.

Vinod

 Rohit Chouhan
Posted: Feb 15, 2008 04:56:48 AM  

 Total Post: 11
 Joined: Aug, 2007






 
You can use the following script to find out the free & Occupied size of the tablespaces in database.

set echo off

set heading on

set feedback off

set termout off

set trimspool on

set pagesize 50000

set linesize 80



column TSNAME format A30 heading "TableSpace"

column USED_MB format 999,999,999 heading "MB Used"

column FREE_MB format 999,999,999 heading "MB Free"

column PCT_FREE format 999 heading "%Free"

column EXTENTS format 999,999 heading "#Extents"

column DBNAME noprint new_value DB_NAME

column SDATE noprint new_value SYS_DATE

column FDATE noprint new_value DATESTAMP



select name DBNAME,

to_char(sysdate,'DD-MON-YYYY HH24:MI') SDATE,

to_char(sysdate,'YYYY-MM-DD_HH24_MI') FDATE

from v$database;



break on report

compute sum of USED_MB on report

compute sum of FREE_MB on report

compute sum of EXTENTS on report



spool tsused.&&DB_NAME..&&DATESTAMP..txt



ttitle left SYS_DATE center ' Free and used space(MB) by tablespace for database: ' DB_NAME right 'Page: ' format 99 SQL.PNO skip 2



select TS.TABLESPACE_NAME,

nvl(round(US.USED_MB),0) USED_MB,

nvl(round(FS.FREE_MB),0) FREE_MB,

round(100 * nvl(FS.FREE_MB,0) / (nvl(FS.FREE_MB,1) +

nvl(US.USED_MB,0))) PCT_FREE,

nvl(US.EXTENTS,0) EXTENTS

from (select TABLESPACE_NAME from SYS.DBA_TABLESPACES) TS,

(select TABLESPACE_NAME, sum(bytes)/1024/1024 FREE_MB from

SYS.DBA_FREE_SPACE group by TABLESPACE_NAME) FS,

(select TABLESPACE_NAME, sum(bytes)/1024/1024 USED_MB, count(*)

EXTENTS from SYS.DBA_EXTENTS group by TABLESPACE_NAME) US

where TS.TABLESPACE_NAME = US.TABLESPACE_NAME (+)

and TS.TABLESPACE_NAME = FS.TABLESPACE_NAME (+)

order by TS.TABLESPACE_NAME

/


 Mohammed Taj
Posted: Feb 16, 2008 10:07:08 AM  

 Total Post: 746
 Joined: Jul, 2007






 
>>>tell me how cud i know the size of oracle 10g/9i database.
database size depands on database files
and database files is "controlfile,datafiles,redolog files"
sum of all three files called database size.

you can also include "archivelog,parameter,passwordfiles(non database files).


 Rohit Chouhan
Posted: Feb 18, 2008 12:20:12 AM  

 Total Post: 11
 Joined: Aug, 2007






 
Redo log files size will be fixed, until unless you modify that.
Control file size will not be increasing rapidly.
for Permanent datafiles above script can be used.
it wont show you size of temporary datafiles.

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Vinoth Kumar367
  Gopu Gopi340
  Gitesh Trivedi322
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software