>> calculate approximately the time of rebuilding index
Well, you can get a timing from sqlplus:
CODE
set timing on
alter index fred rebuild tablespace newts;
If you are nohupping them, you can just snap sysdate before and after.
***********************************************************************
>> as far as I understand it will be a huge loading on CPU during this operation.
No, index rebuilding is mostly disk I/O. The steps are to read the structure from the existing index, rebuild the nodes, and then rename.
To minimize time in a batch window, you want to saturate your I/O subsystem and that depends on how many disk spindles you have. If I have 10 disks, I can rebuild in 10 parallel streams.
You can use nohup to submit parallel streams
CODE
master_reorg.ksh
#!/bin/ksh
# Written by Donald Keith Burleson
# usage: nohup don_reorg.ksh > don_reorg.lst 2>&1 &
# Ensure that running user is oracle . . . . .
oracle_user=`whoami|grep oracle|grep -v grep|wc -l`;
oracle_num=`expr $oracle_user`
if [ $oracle_num -lt 1 ]
then echo "Current user is not oracle. Please su to oracle and retry."
exit
fi
# Ensure that Oracle is running . . . . .
oracle_up=`ps -ef|grep pmon|grep -v grep|wc -l`;
oracle_num=`expr $oracle_up`
if [ $oracle_num -lt 1 ]
then echo "ORACLE instance is NOT up. Please start Oracle and retry."
exit
fi
#************************************************************
# Submit parallel CTAS reorganizations of important tables
#************************************************************
nohup reorg.ksh CUSTOMER >customer.lst 2>&1 &
nohup reorg.ksh ORDER >order.lst 2>&1 &
nohup reorg.ksh ITEM >item.lst 2>&1 &
nohup reorg.ksh LINE_ITEM >line_item.lst 2>&1 &
BTW you specify OPQ for the index rebuild.
How many CPU's do you have on the production server?