Finding HWM [message #321589] |
Tue, 20 May 2008 15:24 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
shrinika
Messages: 306 Registered: April 2008
|
Senior Member |
|
|
Hello,
I have couple of question.
1) Can any one please ensure that the below query will tell us the HWM?
select sum(blocks) - sum(empty_blocks) from user_tables
WHERE TABLE_NAME='EMP1';
2) Can any one please tell me why the below two query gives differnet figure?? My understanding here is, sum(blocks) should be same for user_segments & user_tables..
SQL> select sum(blocks) from dba_tables where table_name='EMP1';
SUM(BLOCKS)
-----------
5380
SQL> select sum(blocks) from dba_segments where segment_name='EMP1';
SUM(BLOCKS)
-----------
5504
SQL>
|
|
|
|
Re: Finding HWM [message #321592 is a reply to message #321590] |
Tue, 20 May 2008 15:49 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
shrinika
Messages: 306 Registered: April 2008
|
Senior Member |
|
|
Michel, I would like to thank for your immediate reply. I am good with second question answer. But regarding first question, i analyzed the table before i ran the query.
In the below scenario, Can i say that, this is the right query to find the HWM? Please clarify this... Thanks again
SQL> EXECUTE DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'SCOTT',TABNAME => 'EMP1',ESTIMATE_PERCENT =>
10,METHOD_OPT => 'FOR ALL COLUMNS SIZE 1',CASCADE => TRUE)
PL/SQL procedure successfully completed.
SQL> select sum(blocks) - sum(empty_blocks) from user_tables
2 WHERE TABLE_NAME='EMP1';
SUM(BLOCKS)-SUM(EMPTY_BLOCKS)
-----------------------------
21523
SQL>
|
|
|
|
|