Skip to content
April 3, 2015 / doganay

GENERATE INDEX AND INDEX PARTITION REBUILD SCRIPT

def MYUSER='USER1';
set lines 1000 pages 1000
select 'alter session set sort_area_size=2147483647;' from dual
union all
select 'alter index "'||owner||'"."'||index_name||'" rebuild online;' from dba_indexes where owner='&&MYUSER'
union all
select 'alter index "'||index_owner||'"."'||index_name||'" rebuild partition "'||partition_name||'" online;' from dba_ind_partitions where index_owner='&&MYUSER';
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: