DBAToolZ - Scripts ( Segment Management ) DBAToolZ Home
 (Last updated 05/21/2003)
Home     Download     Forums     SQL Scripts     Book Review     Links     Feedback


Script Name Description

a_maxe.sql

 * Description	: report segment near their extlimit boundries
 * Usage		: start a_maxe.sql 

c_find_corr_obj.sql

	Finds corrupted object in the datafile
	USE when get ORA-1578 error
	since it needs block_id and file_id parameters

c_ind_rebuild.sql

	This script will rebuild indexes of your choice

c_tab_rec.sql

	Creates DDL script to re-create a table

c_tab_rec_plsql.sql

	Reverse Engineer Table DDL

c_tab_rec_plsql_all.sql

	Reverse Engineer Table DDL including
	constraints. Allows tablespace change for
	INDEXES generated by constraints and the
	TABLE it self. Doesn`t handle partitions.

c_unused.sql

	This script used to get the space usage (High-water mark)
	for TABLE, INDEX or CLUSTER
	The high-water mark for a table is the difference between the
	TOTAL_BLOCKS value and UNUSED_BYTES value returned by this procedure call.
	The UNUSED_BLOCKS value represents the number of blocks above
	the high-water mark, the TOTAL_BLOCKS value reflects the total
	number of blocks allocated to the table
	After executing this script you can reclaim space from a TABLE
	For example:
	TOTAL_BLOCKS = 200
	UNUSED_BLOCKS = 100
	if the database BLOCK size = 4K, then 100 blocks--400K--could be reclaimed
	if you want to leave 20 blocks within the table as unused space above the
	high-water mark, you can alter the table, specifying that the database
	keep 20 blocks--80K:
	SQL> alter table  deallocate unused keep 80K,

c_user_obj_today.sql

	List objects by user created today

c_user_obj_today_drop.sql

	DROPS objects by user prompts for LIKE clause
	use this for cleanups :-)
	spools into a DDL file with DROP stmts ...
	will not run the DDL file

s_db_ext2.sql

	Reports segments close to their maxextents parameter

s_db_seg_where.sql

	THIS Script reports table or index extent maping by datafile.

s_db_segs3.sql

	Reports segments by owner groupping them by
	the current size from dba_segments.

	There is a theory by which you only need 3 types
	of tablespaces:
	  160k (SMALL)
	  5MBm (MEDIUM)
	  160MB (LARGE)
	If you follow this theory you can use this script
	to "place" your segments in the "right" tablespace:
	  1. 160K ts (segs < 5MB)
	  2. 5MB ts (segs < 160MB)
	  3. 160MB ts (segs > 160MB)

s_db_segs_all.sql

	This script gives general idea of segments and extents
	in a database for all the tablespaces

s_db_segs_alter.sql

	Alters segment`s storage parameters (NEXT  and PCTINCREASE 0)
	where  is derived based on the current size from dba_segments:

	There is a theory by which you only need 3 types
	of tablespaces:
	  160k (SMALL)
	  5MBm (MEDIUM)
	  160MB (LARGE)
	If you follow this theory you can use this script

	to "size" your segment`s future extents for the "right" tablespace:
	  1. 160K ts (segs < 5MB)
	  2. 5MB ts (segs < 160MB)
	  3. 160MB ts (segs > 160MB)

s_db_segs_blowout.sql

	THIS Script reports segments that will "blowout"
	on the next extent.

s_db_segs_outbound.sql

	Reports segments that fit the following criteria:
	-------------------------------------------------
	   a)	(160K =< SEG < 5M) NEXT < 160K
	   b)	(5M =< SEG < 160M) NEXT < 5M
	   c)	(160M =< SEG ) NEXT < 160M
	The report should be analyzed and segments can be altered
	by using the following script "s_db_segs_alter.sql"
    

s_tab_ext.sql

	Lists tables/Indexes with > 50 extents

s_tabsp_top_10_segs.sql

	Displays top 10 biggest segments by tablespace
	WARNING:
	Uses ORDER BY with INLINE VIEWS not supported for <8i

s_user_obj.sql

	Reports counts of segments per user/tablespace

DBAToolZ Home | Contact Us
Copyright© 2001 DBAToolZ.com All Rights Reserved.