Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

script for checking empty block by segment

Posted on 2011-02-16
3
Medium Priority
?
653 Views
Last Modified: 2012-05-11
Hello,

I search a script for checking empty block by segment.

Thanks

Regards

bibi
0
Comment
Question by:bibi92
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 34912380
0
 
LVL 5

Expert Comment

by:manzoor_dba
ID: 34913206
Hi,

Hope the below example will help..

SQL> analyze table emp compute statistics;

Table analyzed.

SQL> select blocks user_Tables where table_name = 'EMP';

    BLOCKS
     ---------
     26111  

It is showing that currently 26111 blocks has been used by this table, but there may be lots of empty blocks in it ( due to DML Operation) , so we can query the below to find out exactly how many used blocks are there in this table.

SQL> select count( distinct dbms_rowid.ROWID_BLOCK_NUMBER(rowid))  "Actual Blocks" from emp;

ACTUAL BLOCKS
-----------------------
                    20363

it shows that 20363 blocks contains data which means   26111 - 20363 = 5748 , there are totally 5748 empty blocks are there in the emp table.

Thanks...
0
 

Author Closing Comment

by:bibi92
ID: 34914200
Thanks bibi
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question