Guest User

Untitled

a guest
Feb 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #!/bin/bash
  2. ########################################################################
  3. # Script: sid
  4. #
  5. # Description:
  6. # This script sets ORACLE_SID and ORACLE_HOME environment variables
  7. # in case multiple ORACLE_HOME is shared by a single user.
  8. #
  9. # Usage:
  10. # $ chmod +x ./sid
  11. # $ . sid
  12. #
  13. ########################################################################
  14. echo "ID SID VERSION GI ORACLE_HOME "
  15. echo "-- ----- -------- --- ---------------------------------------"
  16. echo " 1 +ASM1 11.2.0.4 YES /u01/app/11.2.0/grid "
  17. echo "*2 orcl1 11.2.0.4 NO /u01/app/oracle/product/11.2.0/dbhome_1"
  18. echo ""
  19. echo "Please select ID or SID to "
  20. read INPUT
  21. echo ""
  22.  
  23. if [ "${INPUT}" == "1" ] || [ "${INPUT}" == "+ASM1" ]; then
  24. echo "Your environment settings is now set to +ASM1"
  25. ORACLE_SID=+ASM1
  26. ORACLE_HOME=/u01/app/11.2.0/grid
  27. elif [ "${INPUT}" == "2" ] || [ "${INPUT}" == "orcl1" ]; then
  28. echo "Your environment settings is now set to orcl1"
  29. ORACLE_SID=orcl1
  30. ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
  31. else
  32. echo "Invalid input. Please specify correct ID or SID"
  33. fi
  34.  
  35. export ORACLE_SID ORACLE_HOME
  36. export PATH=${ORACLE_HOME}/bin:${PATH}
  37.  
  38. exit 0
Add Comment
Please, Sign In to add comment