GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  Database Administration
Go To First  |  Previous Question  |  Next Question 
 Database Administration  |  Question 114 of 231    Print  
How to Estimate the size of Tablespace???

  
Total Answers and Comments: 9 Last Update: September 02, 2009     Asked by: hasanvtu 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 27, 2006 03:16:31   #1  
paparao03@gmail.com        

RE: How to Estimate the size of Tablespace???

the following code will help to u to know the exact values i.e. used unused Actually used etc.

set linesize 121
---------------------------------------------------------------------------------------
-- free.sql
--
-- This SQL Plus script lists freespace by tablespace
----------------------------------------------------------------------------------------

column dummy noprint
column pct_used format 999.9 heading |Used
column name format a19 heading Tablespace Name
column Kbytes format 999 999 999 heading Kbytes
column used format 999 999 999 heading Used
column free format 999 999 999 heading Free
column largest format 999 999 999 heading Largest
column max_size format 999 999 999 heading MaxPoss|Kbytes
column pct_max_used format 999. heading |Max|Used
break on report
compute sum of kbytes on report
compute sum of free on report
compute sum of used on report


select (select decode(extent_management 'LOCAL' '*' ' ') ||
decode(segment_space_management 'AUTO' 'a ' 'm ')
from dba_tablespaces where tablespace_name b.tablespace_name) ||
nvl(b.tablespace_name
nvl(a.tablespace_name 'UNKOWN')) name
kbytes_alloc kbytes
kbytes_alloc-nvl(kbytes_free 0) used
nvl(kbytes_free 0) free
((kbytes_alloc-nvl(kbytes_free 0))/
kbytes_alloc)*100 pct_used
nvl(largest 0) largest
nvl(kbytes_max kbytes_alloc) Max_Size
decode( kbytes_max 0 0 (kbytes_alloc/kbytes_max)*100) pct_max_used
from ( select sum(bytes)/1024 Kbytes_free
max(bytes)/1024 largest
tablespace_name
from sys.dba_free_space
group by tablespace_name ) a
( select sum(bytes)/1024 Kbytes_alloc
sum(maxbytes)/1024 Kbytes_max
tablespace_name
from sys.dba_data_files
group by tablespace_name
union all
select sum(bytes)/1024 Kbytes_alloc
sum(maxbytes)/1024 Kbytes_max
tablespace_name
from sys.dba_temp_files
group by tablespace_name )b
where a.tablespace_name (+) b.tablespace_name
order by 1
/


 
Is this answer useful? Yes | No
October 28, 2006 12:19:00   #2  
Imran Khan        

RE: How to Estimate the size of Tablespace???

Hi

can u plz explain me in detail abt the size of tablespace not the code

but i need a theoritical explanation

im waiting for ur reply


 
Is this answer useful? Yes | No
October 30, 2006 06:28:48   #3  
paparao03@gmail.com        

RE: How to Estimate the size of Tablespace???

according to my knowledge concern that is depend on Organization data size ( by estimating the no of tables and No. of rows in one Year two year Three year i.e.

Step 1 : categorize total Data table you want to create ie. Dynamic Semi-dynamic Static. Etc . -This is you can by observing Data Table behavior in different time spans with in a year.

Step: 2: Estimate the tables an find the Average Row Length (ARL). Using pl/sql library.

Step 3: No of rows estimate with in the 1 2 and 3 years.

Step 4: Calclulate the Total Size (tables x Row Length x No of rows require in 3 years)

Step 5: Depending on that we can come to the point to estimate the size of tablespace require.


 
Is this answer useful? Yes | No
December 08, 2006 07:21:54   #4  
manish hoiyani        

RE: How to Estimate the size of Tablespace???

we can estimate the size of the tablespace from the number of datafiles going to attach with it or you can use dba_data_files view to find the size for the particular tablespace....


 
Is this answer useful? Yes | No
January 17, 2007 06:13:44   #5  
varinder        

RE: How to Estimate the size of Tablespace???
Size of tablespace means how much space is left in tablespace for insertion of data.there is a concept of high water mark which identifiesd the point after the all blocks belong to tablespace are never used.there are two types of tablespace one is LOCALLY MANAGER and other is DICTIONARY MANAGED. In locally Managed free extends are managed automatically by bitmap.whereas in DICTIONARY managed DBA has to managed the free extends also coalescing is required in DICTIONARY managed tabelespace
 
Is this answer useful? Yes | No
March 06, 2007 11:41:51   #6  
ram        

RE: How to Estimate the size of Tablespace???

this command lists all tablespaces with size in the database!

select owner sum(bytes/1024/1024/1024) from dba_segments group by owner

 
Is this answer useful? Yes | No
March 13, 2007 08:32:40   #7  
SIDHIK        

RE: How to Estimate the size of Tablespace???

it depends on how many .dbf files u r going to store it will be ur size of data
oracle recommends if one .dbf file size exceeds size of 2gb then we have to create a new .dbf etension file . it is the physical file while tablespace is logical storage area containing segments


 
Is this answer useful? Yes | No
September 02, 2009 17:31:24   #8  
cmanne Member Since: January 2006   Contribution: 49    

RE: How to Estimate the size of Tablespace???
select tablespace_name sum(bytes)/1024/1024
from
dba_data_files
group by tablespace_name
order by tablespace_name;

 
Is this answer useful? Yes | No
September 02, 2009 17:35:01   #9  
cmanne Member Since: January 2006   Contribution: 49    

RE: How to Estimate the size of Tablespace???
During the design phase of database The tablesapce size is estimated by calculating the size of typical row of various tables that are going to reside in that tablespace multiplied by the number of expected rows inside the table. If any of the index segments defined on the tables are going to reside in the tablespace one should also take the size of the index segments to estimate the size of the tablespace.
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape