Home » Infrastructure » Linux » environment variables (rad hat linux 5)
environment variables [message #656672] Fri, 14 October 2016 02:28 Go to next message
arifmd1705
Messages: 37
Registered: May 2016
Location: uae
Member
Hi experts,

i recently started learning and practicing on linux , i wanted to know why we need environment variables. Can these environment variables be set by us. There are certain system environment variables like ORACLE_SID, ORAENV which we give while connecting oracle database on linux , are they created by default in bash or do we need to create them.
Re: environment variables [message #656676 is a reply to message #656672] Fri, 14 October 2016 03:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You need to set all environment variables you use to work.
Some are set by default by your system administrator (like PATH) but none of those that concern any application (including Oracle rdbms like ORACLE_HOME, ORACLE_SID...) and you most likely have to add your own settings to those that are set by default, for instance adding $ORACLE_HOME/bin to the PATH variable set by your sysadmin.

Re: environment variables [message #656677 is a reply to message #656672] Fri, 14 October 2016 03:16 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
Environment variables are used to set, well, your environment Smile i.e. Where your Oracle Home is, set the path to executables, etc. You can set them yourself or they can be set in a supplier-provided script. Check out /usr/local/bin/oraenv, for example. This script sets your environment based on the contents of /etc/oratab.
Re: environment variables [message #656679 is a reply to message #656676] Fri, 14 October 2016 04:45 Go to previous messageGo to next message
arifmd1705
Messages: 37
Registered: May 2016
Location: uae
Member
thanks Michael and gazzag , is it necessary to have bash scripting knowledge to be become Oracle DBA, i purchased some online material from udemy "learning linux in 5 days by jason cannon", please advice where i can find some good resources for learning the linux and shell scripting.
Re: environment variables [message #656682 is a reply to message #656679] Fri, 14 October 2016 05:19 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
Quote:
is it necessary to have bash scripting knowledge to be become Oracle DBA
Not if you use Windows Smile

But yes, shell scripting is a vital skill for a DBA. It allows you to automate a lot of administration and customise your environment. The book you reference, doesn't have great reviews on Amazon, but there are plenty of decent resources on the internet where you can find examples to learn from. No doubt one of the regulars here will be able to point you at something specifically.
Re: environment variables [message #656685 is a reply to message #656679] Fri, 14 October 2016 06:29 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
You don't need to know any more Linux than you know Windows. There isn't much difference. You set the same variables: PATH, ORACLE_HOME, and ORACLE_SID. Just tiny syntax differences, for example in a Windows cmd shell you use the set command, in a Linux bash shell you use the export command. They do the same thing.

[Updated on: Fri, 14 October 2016 06:29]

Report message to a moderator

Re: environment variables [message #656689 is a reply to message #656679] Fri, 14 October 2016 08:00 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
arifmd1705 wrote on Fri, 14 October 2016 02:45
thanks Michael
please advice where i can find some good resources for learning the linux and shell scripting.
Before you learn Linux, you need to learn how to use GOOGLE

https://www.google.com/webhp?hl=en&tab=ww#hl=en&q=linux+tutorial
Re: environment variables [message #656695 is a reply to message #656689] Fri, 14 October 2016 11:27 Go to previous message
arifmd1705
Messages: 37
Registered: May 2016
Location: uae
Member
thanks all of you.
Previous Topic: Create Linux VM in a Virtual Box (split from hijacked topic)
Next Topic: OS user Who started Oracle Instance
Goto Forum:
  


Current Time: Thu Mar 28 17:35:15 CDT 2024