Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ########################################################################
- # Script: sid
- #
- # Description:
- # This script sets ORACLE_SID and ORACLE_HOME environment variables
- # in case multiple ORACLE_HOME is shared by a single user.
- #
- # Usage:
- # $ chmod +x ./sid
- # $ . sid
- #
- ########################################################################
- echo "ID SID VERSION GI ORACLE_HOME "
- echo "-- ----- -------- --- ---------------------------------------"
- echo " 1 +ASM1 11.2.0.4 YES /u01/app/11.2.0/grid "
- echo "*2 orcl1 11.2.0.4 NO /u01/app/oracle/product/11.2.0/dbhome_1"
- echo ""
- echo "Please select ID or SID to "
- read INPUT
- echo ""
- if [ "${INPUT}" == "1" ] || [ "${INPUT}" == "+ASM1" ]; then
- echo "Your environment settings is now set to +ASM1"
- ORACLE_SID=+ASM1
- ORACLE_HOME=/u01/app/11.2.0/grid
- elif [ "${INPUT}" == "2" ] || [ "${INPUT}" == "orcl1" ]; then
- echo "Your environment settings is now set to orcl1"
- ORACLE_SID=orcl1
- ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
- else
- echo "Invalid input. Please specify correct ID or SID"
- fi
- export ORACLE_SID ORACLE_HOME
- export PATH=${ORACLE_HOME}/bin:${PATH}
- exit 0
Add Comment
Please, Sign In to add comment