SQWareProduction:postgres:etc:.profile: Difference between revisions

From Wiki_dbSQWare
Jump to navigation Jump to search
m Updated by BatchUser
m Updated by BatchUser
 
(10 intermediate revisions by the same user not shown)
Line 4: Line 4:
File content:
File content:
<pre>
<pre>
#!/bin/ksh
#!/bin/bash
###################################################################
###################################################################
# SQWareProduction for Postgres module of dbSQWare is developped with GPL License 3.0 :
# SQWareProduction for Postgres module of dbSQWare
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#  
#  
# dbSQWare is distributed in the hope that it will be useful,
# dbSQWare is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS for a PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS for a PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# CGU/CGA for more details.
#  
#  
# You should have received a copy of the GNU General Public License
# You should have received a copy of the CGU/CGA
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# along with this program.  If not, see <http://www.dbsqware.com/licenses/>.
#  
#  
# For information : contact@dbsqware.com or www.dbsqware.com
# For information : contact@dbsqware.com or www.dbsqware.com
###################################################################
###################################################################
## @Synopsis template .profile for unix users Postgres
## @Synopsis template .profile for unix users Postgres
## @Copyright Copyright 2010-2015, OctopusDBA
## @Copyright Copyright 2007-2025, dbSQWare (www.dbsqware.com)
## @License GPL v3
## @Contributor : Pierre-Jean Catez


export gvsqw_PgBin=$HOME/SQWareProduction/postgres//bin
export PATH=/usr/pgsql-12/bin:$PATH
export PG_SID=MYS_XXXX_YYY
export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
export MYSQL_HOME=$HOME/uct/5.1.40
export PGDATA=/pgdata/$PG_SID/data
export MEM_HOME=$HOME/uct/postgresmonitoragent-2.1.0.1093
export PGHOST=/var/run/postgresql/$PG_SID
export PATH=$MYSQL_HOME/bin:/usr/sbin:$PATH
export PGPORT=5432
export LANG='en_US.UTF-8'


#dbSQWare
#dbSQWare
export gvsqw_Env=''
export gvsqw_Env='PRD'
export gvsqw_PgBin=$HOME/SQWareProduction/postgres/bin
lvsqw_IsTerminal=$(tty 2>&1 >/dev/null;echo $?)
lvsqw_IsTerminal=$(tty 2>&1 >/dev/null;echo $?)
if [ "$lvsqw_IsTerminal" = "0" ] && [ -r $gvsqw_PgBin/../etc/.profile_confort ]
if [ "$lvsqw_IsTerminal" = "0" ] && [ -r $gvsqw_PgBin/../etc/.profile_confort ]
then
then
  . $gvsqw_PgBin/../etc/.profile_confort
. $gvsqw_PgBin/../etc/.profile_confort
fi
fi
###################################################################
###################################################################
## Multi instance
export PATH=/usr/pgsql-12/bin:$PATH
export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
export LANG='en_US.UTF-8'
lvsqw_Instance=$1
export PG_SID=$lvsqw_Instance
case $lvsqw_Instance in
PG_110)
    export PATH=/usr/pgsql-11/bin:$PATH
    export LD_LIBRARY_PATH=/usr/pgsql-11/lib:$LD_LIBRARY_PATH
    export PGDATA=/pgdata/$PG_SID/data
    export PGHOST=/var/run/postgresql/$PG_SID
    export PGPORT=5441
    ;;
PG_120)
    export PATH=/usr/pgsql-12/bin:$PATH
    export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
    export PGDATA=/pgdata/$PG_SID/data
    export PGHOST=/var/run/postgresql/$PG_SID
    export PGPORT=5442
    ;;
PG_130)
    export PATH=/usr/pgsql-13/bin:$PATH
    export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
    export PGDATA=/pgdata/$PG_SID/data
    export PGHOST=/var/run/postgresql/$PG_SID
    export PGPORT=5443
    ;;
PG_140)
    export PATH=/usr/pgsql-14/bin:$PATH
    export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
    export PGDATA=/pgdata/$PG_SID/data
    export PGHOST=/var/run/postgresql/$PG_SID
    export PGPORT=5444
    ;;
*)
    export PG_SID="NoSID"
    unset PGDATA
    unset PGHOST
    unset PGPORT
    ;;
esac
export gvsqw_Env='PRD'
export gvsqw_PgBin=$HOME/SQWareProduction/postgres/bin
lvsqw_IsTerminal=$(tty 2>&1 >/dev/null;echo $?)
if [ "$lvsqw_IsTerminal" = "0" ] && [ -r $gvsqw_PgBin/../etc/.profile_confort ]
then
. $gvsqw_PgBin/../etc/.profile_confort
fi
</pre>
</pre>
<br>
<br>

Latest revision as of 16:02, 23 February 2025

Sample file for .profile $gvsqw_PgBin/../etc/.profile:
Sample of lines to add to .profile of postgres users.

File content:

#!/bin/bash
###################################################################
# SQWareProduction for Postgres module of dbSQWare
# 
# dbSQWare is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS for a PARTICULAR PURPOSE.  See the
# CGU/CGA for more details.
# 
# You should have received a copy of the CGU/CGA
# along with this program.  If not, see <http://www.dbsqware.com/licenses/>.
# 
# For information : contact@dbsqware.com or www.dbsqware.com
###################################################################
## @Synopsis	template .profile for unix users Postgres
## @Copyright	Copyright 2007-2025, dbSQWare (www.dbsqware.com)

export PATH=/usr/pgsql-12/bin:$PATH
export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
export PGDATA=/pgdata/$PG_SID/data
export PGHOST=/var/run/postgresql/$PG_SID
export PGPORT=5432
export LANG='en_US.UTF-8'

#dbSQWare
export gvsqw_Env='PRD'
export gvsqw_PgBin=$HOME/SQWareProduction/postgres/bin
lvsqw_IsTerminal=$(tty 2>&1 >/dev/null;echo $?)
if [ "$lvsqw_IsTerminal" = "0" ] && [ -r $gvsqw_PgBin/../etc/.profile_confort ]
then
	. $gvsqw_PgBin/../etc/.profile_confort
fi

###################################################################
###################################################################
## Multi instance

export PATH=/usr/pgsql-12/bin:$PATH
export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
export LANG='en_US.UTF-8'

lvsqw_Instance=$1
export PG_SID=$lvsqw_Instance
case $lvsqw_Instance in
PG_110)
    export PATH=/usr/pgsql-11/bin:$PATH
    export LD_LIBRARY_PATH=/usr/pgsql-11/lib:$LD_LIBRARY_PATH
    export PGDATA=/pgdata/$PG_SID/data
    export PGHOST=/var/run/postgresql/$PG_SID
    export PGPORT=5441
    ;;
PG_120)
    export PATH=/usr/pgsql-12/bin:$PATH
    export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
    export PGDATA=/pgdata/$PG_SID/data
    export PGHOST=/var/run/postgresql/$PG_SID
    export PGPORT=5442
    ;;
PG_130)
    export PATH=/usr/pgsql-13/bin:$PATH
    export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
    export PGDATA=/pgdata/$PG_SID/data
    export PGHOST=/var/run/postgresql/$PG_SID
    export PGPORT=5443
    ;;
PG_140)
    export PATH=/usr/pgsql-14/bin:$PATH
    export LD_LIBRARY_PATH=/usr/pgsql-12/lib:$LD_LIBRARY_PATH
    export PGDATA=/pgdata/$PG_SID/data
    export PGHOST=/var/run/postgresql/$PG_SID
    export PGPORT=5444
    ;;
*)
    export PG_SID="NoSID"
    unset PGDATA
    unset PGHOST
    unset PGPORT
    ;;
esac

export gvsqw_Env='PRD'
export gvsqw_PgBin=$HOME/SQWareProduction/postgres/bin
lvsqw_IsTerminal=$(tty 2>&1 >/dev/null;echo $?)
if [ "$lvsqw_IsTerminal" = "0" ] && [ -r $gvsqw_PgBin/../etc/.profile_confort ]
then
	. $gvsqw_PgBin/../etc/.profile_confort
fi