Use this script to setup oramenu:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/bin/bash # set -x # Pawan - www.orskl.com - Setting environmental variables from menu. Date: 27-Mar-2017 # # THIS SCRIPT WILL draw the menu of all available Oracle Instances from /etc/oratab. # It will simplify the way you set environment varaibles. # # Get the list of SID's from /etc/oratab file # Draw the menu # let user select the option # set those environment variables. # if [ -f /etc/oratab ] then echo "Please select your SID to set its environment variables" select sid in `cut -f "1" -d "#" /etc/oratab | awk -F: '{print $1}' | grep -v '^$'` do if [ `echo "X"${sid}` == "X" ] then echo "Invalid selection. Select numbers of respectice SID" break else . /usr/local/bin/oraenv <<< $sid >/dev/null break fi done else echo "Oracle is not installed on this server" fi |
~$ chmod +x oramenu ~$ sudo su – root ~# cp /home/oracle/oramenu /usr/local/bin/ ~# exit logout ~$ . oramenu Or Example : $ chmod +x oramenu oracle@server123:ORCL1:/home/oracle > $ . oramenu Please select your SID to… Read More