-
[postgres@SZD-L0292622:d0pdas:9220 ~]$ more profile
-
#profile
-
#!/bin/bash
-
DBLIST="/paic/postgres/etc/db_info.txt"
-
if [ ! "$1" = "" ];then
-
PORT=$1
-
else
-
awk -F: '{print $1":"$2":"$3}' $DBLIST |sort -n
-
echo -n "Please Enter pg port:";
-
read PORT;
-
fi
-
-
if [ "$PORT" = "" ];then
-
echo "ERROR: Input can not be empty."
-
elif [ `awk -F: '{print $1}' $DBLIST|grep -w $PORT|wc -l` -gt 0 ]; then
-
PG_SERVER_NAME=`awk -F: '{if ($1 == "'$PORT'") {print $2; exit}}' $DBLIST`
-
export PG_SERVER_NAME
-
-
PGHOME=`awk -F: '{if ($1 == "'$PORT'") {print $3; exit}}' $DBLIST`
-
export PGHOME
-
-
export PGNAME=`echo $PG_SERVER_NAME`
-
export PGPORT=$PORT
-
export PGDATA=/paic/pg$PORT/data
-
export ARCLOG_PATH=/paic/pgbackup/$PGNAME/archlog
-
export BACKUP_PATH=/paic/pgbackup/$PGNAME/pgrman
-
export GGS_HOME=/paic/pg$PORT/app/goldengate
-
export LD_LIBRARY_PATH=$PGHOME/lib:$PGHOME/stackbuilderplus/lib:$GGS_HOME/lib:$LD_LIBRARY_PATH
-
export PATH=$GGS_HOME:$PATH
-
export ODBCINI=$GGS_HOME/odbc.ini
-
export PERL5LIB=/paic/postgres/tools/lib/perl5
-
if [[ $PGHOME =~ 'ppas' ]];then
-
export PYTHONHOME=$HOME/python
-
else
-
unset PYTHONHOME
-
fi
-
-
alias pgdata="cd $PGDATA"
-
alias pglog="cd $PGDATA/pg_log"
-
alias pgxlog="cd $PGDATA/pg_xlog"
-
alias pgbak="cd $BACKUP_PATH"
-
alias pgarc="cd $ARCLOG_PATH"
-
alias pggg="cd /paic/pg$PORT/app"
-
alias vcs='sudo /opt/VRTS/bin/hastatus -sum'
-
alias cgall='/opt/cgtools/cginfo -t perf'
-
alias cg="/opt/cgtools/cginfo -t perf -s cpu|awk 'BEGIN{IGNORECASE=1}{if (NR < 4 || \$2 == \"'$PGNAME'\") print \$0}\';echo '';/opt/cgtools/cginfo -t perf -s mem|awk 'BEGIN{IGNORECASE=1}{if (NR < 4 || \$2 == \"'$PGNAME'\") print \$
-
0}';echo '';/opt/cgtools/cginfo -t perf -s proc|awk 'BEGIN{IGNORECASE=1}{if (NR < 4 || \$2 == \"'$PGNAME'\")print \$1,\$2,\$3,\$4,\$5}'|column -t"
-
-
PATH=$PGHOME/bin:$PATH:$HOME/bin
-
export PATH
-
-
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PGHOME/lib
-
export LD_LIBRARY_PATH
-
else
-
echo "ERROR: Can not found input port."
-
fi
- export PS1='[\u@\h:\[\e[35m\]$PG_SERVER_NAME\[\e[m\]:\[\e[32m\]$PGPORT\[\e[m\] \w]\$ '
- [postgres@SZD-L0292622:d0pdas:9220 ~]$ more /paic/postgres/etc/db_info.txt
- 9220:d0pdas:/paic/postgres/base/11.3:dev:master