Unix shell script to move indexes attached
Fred
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]] On Behalf Of Matt Reinfeldt
Sent: Friday, August 24, 2012 5:27 PM
To: [email protected]
Subject: Re: Anyway to populate ardb.conf other than manual?
Jamie,
Some years ago, I wrote a simple perl script to do this function. I'd have to
dig around for it, but I don't remember being a complicated process. Should be
fairly simple for someone to recreate, if needed.
Matt
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]] On Behalf Of Jamie
Sent: Friday, August 24, 2012 11:35 AM
To: [email protected]
Subject: Anyway to populate ardb.conf other than manual?
Has anyone came up with a database script that can build out the ardb.conf?
We're looking at splitting our indexes and LOBs into a seperate tablespace,
however manually build of an ardb.conf would be very time consuming. We've
been looking at ways to also do this without using an ardb.conf file and having
our DBAs manually maintain the indexes and LOBs...has anyone had any
experiences with that?
Thanks for your help!
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug12 www.wwrug12.com ARSList: "Where the Answers Are"
#! /usr/bin/ksh
#
############################################################################
# File Name: index_fix.sh
# Description: This script is used to correct the Oracle tablespace
# locations for the indexes in the Remedy system.
# Developed: 05/13/06 Fred Grooms
############################################################################
#
AR_TMP_DIR=/usr/tmp
AR_INDX=ARS01_INDX
cd $AR_TMP_DIR
#
sfile1=${AR_TMP_DIR}/index_static_${PPID}.sql
sfile2=${AR_TMP_DIR}/index_dynamic_${PPID}.sql
sfile3=${AR_TMP_DIR}/index_fix_${PPID}.log
#
echo "--" >$sfile1
# echo "Alter session set optimizer_goal = ALL_ROWS;" >$sfile1
echo "--" >>$sfile1
echo "set termout off;" >>$sfile1
echo "set feedback off;" >>$sfile1
echo "set trimspool on;" >>$sfile1
echo "set linesize 400;" >>$sfile1
echo "set pagesize 0;" >>$sfile1
echo "set heading off;" >>$sfile1
echo "set echo off;" >>$sfile1
echo "--" >>$sfile1
#
echo "spool "$sfile2 >>$sfile1
echo "select 'set serverout on;' from dual;" >>$sfile1
echo "select 'set termout on;' from dual;" >>$sfile1
echo "select 'set trimspool on;' from dual;" >>$sfile1
echo "select 'set pagesize 0;' from dual;" >>$sfile1
echo "select 'set heading off;' from dual;" >>$sfile1
echo "select 'set echo on;' from dual;" >>$sfile1
echo "select 'set time on;' from dual;" >>$sfile1
echo "" >>$sfile1
echo "select 'alter index '||index_name||' rebuild tablespace "$AR_INDX"
nologging online;' from user_indexes where tablespace_name!='"$AR_INDX"' and
Index_Type='NORMAL';" >>$sfile1
echo "--" >>$sfile1
echo "select 'alter '||object_type||' '||object_name||' compile;' from
user_objects where status='INVALID' and object_type!='PACKAGE BODY';" >>$sfile1
echo "select 'alter PACKAGE '||object_name||' compile body;' from user_objects
where status='INVALID' and object_type='PACKAGE BODY';" >>$sfile1
echo "--" >>$sfile1
echo "spool off" >>$sfile1
echo "@"$sfile2 >>$sfile1
echo "--" >>$sfile1
echo "quit" >>$sfile1
#
$ORACLE_HOME/bin/sqlplus user/password @$sfile1 >> $sfile3
#
rm $sfile1 $sfile2 >/dev/null
exit 0
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug12 www.wwrug12.com ARSList: "Where the Answers Are"