Anurag, Dave Herring has already supplied a suitable example of a script. If you want some extra thoughts I wrote about the problem at the following URL: http://jonathanlewis.wordpress.com/2010/02/06/shrink-tablespace/ Regards Jonathan Lewis http://jonathanlewis.wordpress.com ----- Original Message ----- From: "Anurag Verma" <anuragdba@xxxxxxxxx> To: "ORACLE-L" <oracle-l@xxxxxxxxxxxxx> Sent: Sunday, November 27, 2011 3:48 AM Subject: How to find out the segments (whether it is table or index) at the end of each datafile in a tablespace. how to find out the segments (whether it is table or index) at the end of each datafile in a tablespace. I am trying to reduce the sizes of several datafiles, but getting the below error message. -- //www.freelists.org/webpage/oracle-l