From tday6@csc.com Fri, 21 Sep 2001 06:34:21 -0700 From: tday6@csc.com Date: Fri, 21 Sep 2001 06:34:21 -0700 Subject: RE: coalesce tablespace Message-ID: MIME-Version: 1.0 Content-Type: text/plain This script will show you how much you will gain via a coalesce. Not all tablespaces will coalesce to 100%. rem rem FILE: BEFORE_AFTER.SQL rem location: $HOME/bin rem invocation: @before_after TABLESPACE (where TABLESPACE is the rem name of the tablespace being investigated) rem rem From "Oracle DBA Handbook" by Kevin Loney, Oracle Press rem rem This SQL*Plus script evaluates a target tablespace to determine rem the potential benefit of coalescing the neighboring free space rem extents. If the "New FSFI" value is beneath your threshold, rem then the tablespace must be defragmented. rem spool before_after.lst set verify off pagesize 60 ttitle center 'Before-After Changes Report for '&&1 skip 2 break on starting_file_id skip 1 column new_length format 99999999 column num_fragments format 99999999 column current_top format 99999999 SELECT starting_file_id, /*starting file ID for extent*/ starting_block_id, /*starting block ID for extent*/ sum(blocks) new_length, /*combine length for extents*/ count(blocks) num_fragments, /*number of frags combined*/ max(blocks) current_top /*largest extent of the set*/ FROM contig_space WHERE tablespace_name = upper('&&1') GROUP BY starting_file_id, starting_block_id HAVING count(*)>1 ORDER BY 1,2 / ttitle center 'Old FSFI rating for '&&1 skip 1 column fsfi format 999.999 SELECT sqrt(max(blocks)/sum(blocks))* (100/sqrt(sqrt(count(blocks)))) fsfi FROM sys.dba_free_space WHERE tablespace_name = upper('&&1') / ttitle center 'New FSFI rating for '&&1 skip 1 column new_fsfi format 999.999 SELECT sqrt(max(sum_blocks)/sum(sum_blocks))* (100/sqrt(sqrt(count(sum_blocks)))) fsfi FROM new_look WHERE tablespace_name = upper('&&1') / spool off Mohammad Rafiq To: Multiple recipients of list ORACLE-L @hotmail.com> cc: Sent by: root Subject: RE: coalesce tablespace 09/20/2001 04:50 PM Please respond to ORACLE-L Following script may be used to check whether coalesing is required or not. If lasr column not 100% then coalesce that tbs.... select substr(tablespace_name,1,10)TS_NAME,total_extents "Total_Extnts",extents_coalesced,round(percent_extents_coalesced,0) from dba_free_space_coalesced / MOHAMMAD RAFIQ Reply-To: ORACLE-L@fatcity.com To: Multiple recipients of list ORACLE-L Date: Thu, 20 Sep 2001 12:21:21 -0800 It would take contiguous free extents and make them larger extents, which would be more likely to reuse. Especially if there are many smaller ones, this moot if using LMT. It is a very quick procedure and good to do occasional, you can check in dba_data_files_coalesced to see if the number is far from 100%, if it is less than 75% or so, just throw a coalesce on the tablespace. "Do not criticize someone until you walked a mile in their shoes, that way when you criticize them, you are a mile a way and have their shoes." Christopher R. Spence Oracle DBA Phone: (978) 322-5744 Fax: (707) 885-2275 Fuelspot 73 Princeton Street North, Chelmsford 01863 -----Original Message----- Sent: Thursday, September 20, 2001 3:40 PM To: Multiple recipients of list ORACLE-L We have tablespaces in acceptance and production that are being resized for growth. Pctincrease is set at 0. Would it also help to coalesce the tablespace? What are the benefits of this command? Thanks, Sandi -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: Sandi.McClary@flyingj.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Christopher Spence INET: cspence@FuelSpot.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohammad Rafiq INET: rafiq9857@hotmail.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: tday6@csc.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).