Document Type | Technical Information
Category | Installation
Document Number | TINTI008
Overview
This covers an example of profile settings when using Tibero multi-instances sharing the engine in a Unix environment.
By pre-setting which instance to use when logging in with an OS account, you can reduce operational errors.
NoteTesting was conducted in the following environment.
Tibero: Tibero6 FS06
OS: CentOS release 6.2 (Final)
Shell: bash
Method
Example Modification
In the example below, modify the values in red according to your installation environment.
- . TB_HOME: Change to the engine path.
- . Change tibero01 and tibero02 to the actual Tibero SIDs you intend to install and operate.
- . LD_LIBRARY_PATH: The environment variable name specifying the shared library directory needs to be set differently depending on the OS as shown below.
### Tibero 6 ENV ###
export TB_HOME=/home/tibero6/tibero6
export TB_PROF_DIR=$TB_HOME/bin/prof
export PATH=.:$TB_HOME/bin:$TB_HOME/client/bin:$PATH
export LD_LIBRARY_PATH=$TB_HOME/lib:$TB_HOME/client/lib:$LD_LIBRARY_PATH
export VALUE=true
while ($VALUE)
do
echo "SELECT TIBERO_SID"
echo "------------------------------"
echo "1. tibero01"
echo "2. tibero02"
echo "------------------------------"
echo -e "==>ANS> \c"
read ans
echo "------------------------------"
if [ "$ans <> " " ]
then
if [ $ans -eq 1 ]
then
export TB_SID=tibero01;
export VALUE=false;
fi
if [ $ans -eq 2 ]
then
export TB_SID=tibero02;
export VALUE=false;
fi
fi
done;
echo "##############################"
echo "## Tibero instance is $TB_SID ##"
echo "##############################"
export PS1="[$TB_SID@`hostname`:\$PWD] "
########## TIBERO alias ##########
alias tbhomet='cd $TB_HOME'
alias tbbin='cd $TB_HOME/bin'
alias tblog='cd ${TB_HOME}/instance/${TB_SID}/log'
alias tbcfg='cd $TB_HOME/config'
alias tbcfgv='vi $TB_HOME/config/$TB_SID.tip'
alias tbcli='cd $TB_HOME/client/config'
alias tbcliv='vi ${TB_HOME}/client/config/tbdsn.tbr'
alias tbi='cd ~/tbinary'
alias tm='cd ~/tbinary/monitor;monitor;cd -'
Application
Apply this to the profile of the OS account where the DB is installed.
Depending on the shell type, a .profile file may be used instead of .bash_profile.
vi ~/.bash_profile
Apply as below or log out and log in again to the OS account.
. ~/.bash_profile or source ~/.bash_profile
Test Results
Every time the profile is applied or the OS account logs in, you can select the SID as shown below.
Enter the number next to ANS for the DB SID to use and press Enter.
SELECT TIBERO_SID ------------------------------ 1. tibero01 2. tibero02 ------------------------------ --ANS>1
You can check in real-time which SID is assigned at the shell prompt.
############################## ## Tibero instance is tibero01 ## ############################## [tibero01@testserver:/home/tibero6]