How much size of disk Tablespace can consume in proportion to Data in DB? [message #563658] |
Thu, 16 August 2012 06:51 |
|
nitinkalra2000
Messages: 4 Registered: August 2012 Location: India
|
Junior Member |
|
|
We are using Oracle 10g
and have 10 tablespaces defined for our Database which have 108 tables.
Size of 108 tables is around 251 MB as seen during importing the dump.
While creating these 10 tablespaces I used below parameters for allocation of space
SIZE 1M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE 1M;
which set the initial space for 10 tablespaces to around 1032Kb each.
Now my Question is after importing the dump , how the disk space for 10 tablespaces increases to 398 MB in total ?
Is there any relation of Tablespace disk space and Actual Data present in the tables ?
|
|
|
|
|
|
|
Re: How much size of disk Tablespace can consume in proportion to Data in DB? [message #563710 is a reply to message #563708] |
Thu, 16 August 2012 10:05 |
|
Michel Cadot
Messages: 68718 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Ah, understand! these are spaces of data, not space used by Oracle, in addition to data you have Oracle overhead (column header, row header, block header, extent header, segment header...), space used by pctfree you reserve for futur updates in each table and free space not used in the latest extent.
Regards
Michel
|
|
|
|
|
|
|
Re: How much size of disk Tablespace can consume in proportion to Data in DB? [message #563761 is a reply to message #563730] |
Thu, 16 August 2012 18:31 |
|
alan.kendall@nfl.com
Messages: 163 Registered: June 2012 Location: Culver City, California
|
Senior Member |
|
|
The total gigabytes = the gigabytes of sort + the gigabytes of undo + the gigabyes of
redo logs + the gigabytes of tables/index + the gigabytes of free space as can be
seen in the following sql.
HOST_NAME INSTANCE_N Total_gig= gig_sort+ gig_undo+ gig_redo+ gig_tables+ GIG_FREE
------------ ---------- ---------- --------- --------- --------- ----------- --------
proddb04 NDOCP1 96.816 23.906 16.000 10.000 39.803 7.107
proddb05 NDOCP2 96.816 23.906 16.000 10.000 39.803 7.107
proddb06 NDOCP3 96.816 23.906 16.000 10.000 39.803 7.107
proddb07 NDOCP4 96.816 23.906 16.000 10.000 39.803 7.107
proddb04 NWEBP1 126.430 20.000 32.000 10.000 44.672 19.758
proddb05 NWEBP2 126.430 20.000 32.000 10.000 44.672 19.758
proddb06 NWEBP3 126.430 20.000 32.000 10.000 44.672 19.758
proddb07 NWEBP4 126.430 20.000 32.000 10.000 44.672 19.758
csprdesbdb01 CSESBP1 101.887 7.813 11.719 1.465 73.011 7.880
csprdesbdb02 CSESBP2 101.887 7.813 11.719 1.465 73.011 7.880
csstgesbdb01 CSESBS1 102.851 8.789 15.625 2.197 63.039 13.201
csstgesbdb02 CSESBS2 102.851 8.789 15.625 2.197 63.039 13.201
The full total_gig.sql follows:
set lines 120
set wrap off
set feedback off
set termout off
drop table ack_sort;
drop table ack_allo;
drop table ack_undo;
drop table ack_free;
drop table ack_redo;
create table ack_sort as select sum(d.bytes)/1024/1024/1024 gig_sort from dba_temp_files d;
create table ack_allo as select sum(d.bytes)/1024/1024/1024 gig_allo from dba_data_files d
where tablespace_name not like '%UNDO%';
create table ack_undo as select sum(d.bytes)/1024/1024/1024 gig_undo from dba_data_files d
where tablespace_name like '%UNDO%';
create table ack_free as select sum(f.bytes)/1024/1024/1024 gig_free from dba_free_space f
where tablespace_name not like '%UNDO%';
create table ack_redo as select sum(v$log.bytes)/1024/1024/1024 gig_redo from v$log;
set termout on
col "%_non_tables" for 999.9
column host_name format a12
column instance_name format a10
column gig_free format 999.999
column "gig_sort+" format 999.999
column "gig_undo+" format 999.999
column "Total_gig=" format 999.999
column "gig_redo+" format 999.999
column "gig_tables+" format 999.999
column "gig_allo" format 999.999
column "%_Sort" format 999.9
column "%_Undo" format 999.9
column "%_Redo" format 999.9
select host_name,instance_name,gig_sort+gig_undo+gig_redo+gig_allo "Total_gig=",
gig_sort "gig_sort+",gig_undo "gig_undo+",gig_redo "gig_redo+",gig_allo-gig_free "gig_tables+",gig_free,
((gig_sort+gig_undo+gig_redo+gig_allo)-(gig_allo-gig_free))/(gig_sort+gig_undo+gig_redo+gig_allo)*100 "%_Non_Tables",
(gig_sort)/(gig_sort+gig_undo+gig_redo+gig_allo)*100 "%_Sort",
(gig_undo)/(gig_sort+gig_undo+gig_redo+gig_allo)*100 "%_Undo",
(gig_redo)/(gig_sort+gig_undo+gig_redo+gig_allo)*100 "%_Redo"
from ack_sort,ack_allo,ack_undo,ack_free,ack_redo,v$instance;
set termout off
drop table ack_sort purge;
drop table ack_allo purge;
drop table ack_undo purge;
drop table ack_free purge;
drop table ack_redo purge;
set feedback on
set termout on
|
|
|
|
|
|
|
|
|
|
Re: How much size of disk Tablespace can consume in proportion to Data in DB? [message #564026 is a reply to message #563718] |
Mon, 20 August 2012 09:41 |
tim2boles
Messages: 38 Registered: August 2008 Location: Clarksburg, WV
|
Member |
|
|
One thing you may want to consider is reviewing some of the information out there that shows you the relationship between the logical structures that oracle uses (tablespaces, indexes, tables, data block) and the physical structures that the OS uses (disks, blocks, bytes. You also have to remember that fragmentation can occur within a table and within a tablespace depending on how storage is defined and the delete,drop and creation of logical structures.
Here are a couple of links that might help your overall understanding.
http://docs.oracle.com/cd/B19306_01/server.102/b14220/physical.htm
http://docs.oracle.com/cd/B19306_01/server.102/b14220/logical.htm
I know this does not answer your question, but it should help you to understand that it is not a straight forward calculation.
As for calculation of tablespace usage...there are tons of scripts out there. I did a quick search through google and found this page near the top.
http://gavinsoorma.com/2009/07/script-tablespace-free-space-and-fragmentation/
Regards
Tim Boles
|
|
|