HowToForums.net Forum Index HowToForums.net
An Open Source of Knowledge
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

HowTo IBM Informix dbspace performance layout

 
Post new topic   Reply to topic    HowToForums.net Forum Index -> Informix
View previous topic :: View next topic  
Author Message
jacob
Site Admin
Site Admin


Joined: 16 Mar 2006
Posts: 73
Location: USA

PostPosted: Sat Oct 28, 2006 6:48 am    Post subject: HowTo IBM Informix dbspace performance layout Reply with quote

Hi
This script is useful to automate the deploy of a high performance Informix Database install...
It can be adjusted to suite your needs in terms of size and paths...
it provides you the base structure script to enhance performance by tweaks like removing the Physical and Logical Logs from the Root DBspace, and so forth...

see also
IBM informix high performance onconfig:
http://howtoforums.net/viewtopic.php?t=90

HowTo IBM Informix HDR - High-Availability Data Replication
http://howtoforums.net/viewtopic.php?t=89

Code:

#!/bin/bash
# if you have existing chunks in db_chunks, wipe them out
# this is intended for a fresh install
#
# ONSPACE USAGE
#
#Usage:
# onspaces { -a <spacename> -p <path> -o <offset> -s <size> [-m <path> <offset>]
#               { { [-Mo <mdoffset>] [-Ms <mdsize>] } | -U }
#               } |
#
#          { -c { -d <DBspace> [-t]
#                    -p <path> -o <offset> -s <size> [-m <path> <offset>] } |
#               { -b <BLOBspace> -g <pagesize>
#                    -p <path> -o <offset> -s <size> [-m <path> <offset>] } |
#               { -S <SBLOBspace> [-t]
#                    -p <path> -o <offset> -s <size> [-m <path> <offset>]
#                    [-Mo <mdoffset>] [-Ms <mdsize>] [-Df <default-list>] } |
#               { -x <Extspace> -l <Location> } } |
#
#          { -d <spacename> [-p <path> -o <offset>] [-f] [-y] } |
#
#          { -f[y] off [<DBspace-list>] | on [<DBspace-list>] } |
#
#          { -m <spacename> {-p <path> -o <offset> -m <path> <offset> [-y] |
#                           -f <filename>} } |
#
#         { -r <spacename> [-y] } |
#
#          { -s <spacename> -p <path> -o <offset> {-O | -D} [-y] } |
#
#         { -ch <sbspacename> -Df <default-list> } |
#
#          { -cl <sbspacename> }
#
#    -a  - Add a chunk to a DBspace, BLOBspace or SBLOBspace
#    -c  - Create a DBspace, BLOBspace, SBLOBspace or Extspace
#    -d  - Drop a DBspace, BLOBspace, SBLOBspace, Extspace, or chunk
#    -f  - Change dataskip default for specified DBspaces
#    -m  - Add mirroring to an existing DBspace, BLOBspace or SBLOBspace
#    -r  - Turn mirroring off for a DBspace, BLOBspace or SBLOBspace
#    -s  - Change the status of a chunk
#    -ch - Change default list for smart large object space
#    -cl - garbage collect smart large objects that are not referenced
#    default-list = {[LOGGING = {ON|OFF}]  [,ACCESSTIME = {ON|OFF}]
#            [,AVG_LO_SIZE = {1 - 2097152}] }
#
#
#
##################################################
#
#  THE MAGIC BELOW...
#
#################################################
echo "    -->   Start: $(date)"

cd /opt/informix/db_chunks


# take the onconfig i am using here and create a template
# PHYSDBS must be set to rootdbs before executing
# LOGFILES must be set to 3 before executing
echo "Shutting down Informix, you mite see an error if it is already down"
onmode -yk

killall startLogBackup.sh
killall ontape


#Root DBspace 1gb - size and file location set in onconfig
#will be automatically created when databse is initialized
echo "Prepare rootdbs_chunk01..."
touch rootdbs_chunk01
cat /dev/null > rootdbs_chunk01
echo "done...starting initialization"

# Initialize the db, wipes out everything!!!
oninit -i
sleep 15
echo "informix status..."
onstat -

# Create and move Physical Log DBspace1 100mb
# make sure faketape is set to null, this will stop informix, and
# take a level 0 bkup in order for the physdbs change to take effect
echo "Move Physical Log to phydbs1_chunk01..."

touch phydbs1_chunk01
cat /dev/null > phydbs1_chunk01
onspaces -c -d phydbs1 -p /opt/informix/db_chunks/phydbs1_chunk01 -o 0 -s 104852

onmode -yk
oninit -s
sleep 15

onparams -p -s 102400 -d phydbs1 -y
sleep 15
ontape -s -L 0
echo "done"

echo "Take Informix online..."
onmode -m
echo "done"

##

#Log DBspace1 2x1gb
echo "Create and move Logical Logs to seperate dbspace..."
touch logdbs1_chunk01
touch logdbs1_chunk02
cat /dev/null > logdbs1_chunk01
cat /dev/null > logdbs1_chunk02
onspaces -c -d logdbs1 -p /opt/informix/db_chunks/logdbs1_chunk01 -o 0 -s 1048524
onspaces -a logdbs1 -p /opt/informix/db_chunks/logdbs1_chunk02 -o 0 -s 1048524
echo "done"

# Now to actually move the logs into the new space and out of the root space
# initialy we should of started with 6 logs in rootdbs...
# now we are going to create 6 logs in logdbs1, then drop the logs in rootdbs
# Minimum number of active logical logs is 3, cannot drop logical log.

#create 50 logs in logdbs1
echo "creating 50 logical logs in logdbs..."
(cnt=1; while test $cnt -le 50; do onparams -a -d logdbs1; cnt=$[$cnt+1]; done)
echo "done"

echo " Answer Yes...
This will perform a GRACEFUL SHUTDOWN -
Do you wish to continue (y/n)? y
"
onmode -s

# move the current log to the fourth which is on logdbs1
onmode -l
onmode -l
onmode -l

echo "select yes to... Do you want to back up the current logical log? (y/n) y"
ontape -a
sleep 15

echo "another level 0 bkup..."
ontape -s -L 0
echo "done"

echo "Take Informix online..."
onmode -m
echo "done"

## Here we are actually creating the dbspaces
echo "creating additional db spaces..."

#DBSpace1 2gb
touch dbs1_chunk01
onspaces -c -d dbs1 -p /opt/informix/db_chunks/dbs1_chunk01 -o 0 -s 2097150

#DBSpace2 2gb
touch dbs2_chunk01
onspaces -c -d dbs2 -p /opt/informix/db_chunks/dbs2_chunk01 -o 0 -s 2097150

#DBSpace3 2gb
touch dbs3_chunk01
onspaces -c -d dbs3 -p /opt/informix/db_chunks/dbs3_chunk01 -o 0 -s 2097150

#DBSpace4 2gb
touch dbs4_chunk01
onspaces -c -d dbs4 -p /opt/informix/db_chunks/dbs4_chunk01 -o 0 -s 2097150

#DBSpace5 2gb
touch dbs5_chunk01
onspaces -c -d dbs5 -p /opt/informix/db_chunks/dbs5_chunk01 -o 0 -s 2097150


#Temp DBspace1 2x1gb #tempdbs1 is the default temp dbs we use in onconfig
touch tempdbs1_chunk01
touch tempdbs1_chunk02
cat /dev/null > tempdbs1_chunk01
cat /dev/null > tempdbs1_chunk02
onspaces -c -d tempdbs1 -t -p /opt/informix/db_chunks/tempdbs1_chunk01 -o 0 -s 1048524
onspaces -a tempdbs1 -p /opt/informix/db_chunks/tempdbs1_chunk02 -o 0 -s 1048524

# drop the first log from rootdbs
echo "drop the original first 3 logs"
onparams -d -l 1 -y
onparams -d -l 2 -y
onparams -d -l 3 -y
echo "done"


chmod 660 *
onstat -d
ls -lh



echo "
        NOTE: to add an additional chunk to an existing dbspace use the following examples usage:
        cd /opt/informix/db_chunks/
        touch dbs1_chunk02
        onspaces -a dbs1 -p /opt/informix/db_chunks/dbs1_chunk02 -o 0 -s 2097150

"

echo " SPACES CREATED SUCCESSFULLY "
echo "***************************************************"
echo "*                                                 *"
echo "     -->  End: $(date)"
echo "*                                                 *"
echo "***************************************************"




for search engines
IBM informix dbspaces database performance layout
onconfig tweaks tips and tricks
IBM informix memory usage
IBM Software - Informix Dynamic Server (IDS)
Informix redundancy
howto automate informix
informix deployment best practices
informix guru
informix tips and tricks



Have Fun!!! Smile

"Forgiving is not a Weakness, rather a Godly Strength"
--Jacob
Back to top
Display posts from previous:   
Post new topic   Reply to topic    HowToForums.net Forum Index -> Informix All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group