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 set its environment variables
1) DEMO
2) TEST
3) +ASM
4) ORCL1
5) ORCL2
6) ORCL3
#? 4
oracle@server123:ORCL1:/local/home/oracle >
$ s
SQL*Plus: Release 12.1.0.2.0 Production on Mon Mar 27 12:50:56 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
SQL> set linesize 300
SQL> select name||’ – ‘||instance_name||’@’||host_name||’ – ‘||DB_UNIQUE_NAME||’ – ‘||version||’ – ‘||open_mode||’ – ‘||to_char(startup_time,’DD-MON-YYYY HH24:MI:SS’) || ‘ – ‘|| database_role from v$database, v$instance;
NAME||’-‘||INSTANCE_NAME||’@’||HOST_NAME||’-‘||DB_UNIQUE_NAME||’-‘||VERSION||’-‘||OPEN_MODE||’-‘||TO_CHAR(STARTUP_TIME,’DD-MON-YYYYHH24:MI:SS’)||’-‘||DATABASE_ROLE
—————————————————————————————————————————————————————————————————————————-
ORCL1 – ORCL1@server123.com – ORCL1 – 12.1.0.2.0 – READ WRITE – 20-NOV-2016 23:55:13 – PRIMARY
Dinesh Pal
Nice
Deneen
Hey! This is my first visit to your blog! We are a team of volunteers
and starting a new initiative in a community in the same niche.
Your blog provided us beneficial information to work on. You have done a wonderful
job!
Lon
Very quicily this web page will be famous among all blogging and site-building viewers,
due to it’s pleasant articles orr reviews
Brent
Your style is unique in comparison to other people I have read stuff from.
Thanks for posting when you’ve got the opportunity, Guess
I’ll just book mark this site.
Ernesto
Your style iis unique compared tto other folks I’ve read stuff from.
Thanks for posting when you’ve ggot the opportunity, Guess I will just bkok mark this web site.
Ellie
Hello, i read your blog from time to time and i own a similar one and i was just wondering if you get a lot of spam feedback?
If so how do you protect against it, any plugin or
anything you can advise? I get so much lately it’s driviing mme mad sso aany
assistance is very much appreciated.
Sharyn
This site was… how doo I say it? Relevant!! Finally I have found something that helped me.
Thankk you!
vimeo.com
Hello to efery one, because I am actually eager oof reading this website’s post to be updated onn a regular
basis. It contains goid information.
Mckenzie
Appreciate the recommendation. Will tryy it out.
Rakesh
Very good post Vinod. Below are my suggestions. Hope this will help you else please ignore them
1. Try to post the screenshot of the result instead of text output.
2. Avoid “root” (Can try sudo)
Sneha
Interesting
Manikanta
Good Artical
Satyanarayana
Quality data