To Monitor the increment of space of the tablespace based on the table [message #511005] |
Thu, 09 June 2011 01:23 |
ram anand
Messages: 244 Registered: February 2008 Location: india
|
Senior Member |
|
|
hi,
How to check for the increment of a space of the tablespace based on the particular table.
(i.e.)
Say a scenario, if am trying to load the data for a particular table , for first i loaded some 10000 records and then again loading 50000 records ,so based on the icrement of the reocrds the tablespace size also increases gradually . so for this scenario how to monitor the increment of the space.
let me know the suggestion for the same ,Thanks in advance.
|
|
|
|
|
|
|
|
|
|
|
|
Re: To Monitor the increment of space of the tablespace based on the table [message #511053 is a reply to message #511029] |
Thu, 09 June 2011 04:43 |
ram anand
Messages: 244 Registered: February 2008 Location: india
|
Senior Member |
|
|
hi MIchel,
Whether below query is correct for this case,if it's worng can u pls highlight it.
SELECT dfs.tablespace_name, ds.segment_name,
SUM (ds.BYTES) / 1024 / 1024 AS used_mb,
SUM (dfs.BYTES) / 1024 / 1024 AS free_mb,
SUM (ddf.BYTES) / 1024 / 1024 AS allocated_mb
FROM dba_segments ds, dba_free_space dfs, dba_data_files ddf
WHERE ds.tablespace_name = dfs.tablespace_name AND dfs.file_id = ddf.file_id
AND dfs.tablespace_name = <tblspac_name>
GROUP BY dfs.tablespace_name, ds.segment_name
|
|
|
|
|
Re: To Monitor the increment of space of the tablespace based on the table [message #511057 is a reply to message #511056] |
Thu, 09 June 2011 05:06 |
|
Michel Cadot
Messages: 68718 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:For a particular segment name(say table XXXX) of the tablespace say 'XX001' need used,free,and allocated space
Use a subquery for each part:
- on dba_segments to get segment size
- on dba_data_files to get tablespace size
- on dba_free_space to get tablespace free size
(- the difference between the 2 previous gives the allocated space in the tablespace)
- join each subquery on tablespace name
Quote: for every 10000 records insert.
No Oracle table/view will give you that.
You have to calculate it by yourself: size before, size after -> diff.
Regards
Michel
|
|
|