sábado, 31 de mayo de 2014

Environment Variables Needed to StartOracle (Linux)

To be able to start the listener, upload the database and Enterprise manage, also known as EM; We have to set the following variables in our console every time we log in, we can also configure them in the ~ / .bash_profile file of the Oracle user (see how to do this).

The first variable is ORACLE_HOME this will have the path that they defined in the installation of the database, for example the home of my database is '/oracle/app/oracle/product/11.2.0/db_1' then in my case The commands that I have to execute as an Oracle user will be:

set ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1
export ORACLE_HOME

The second variable is ORACLE_SID this will have the sid of the database which is also specified when we installed it, it is usually the same name of the database.
If you do not know the SID execute this command as root: 'ps -ef | Grep -i pmon 'and you'll see something like this' oracle 27161 1 0 Mar07? 00:03:53 ora_pmon_ora11g 'where ora11g is the SID.
In my case the SID is 'ora11g' then the commands that I have to execute as an Oracle user to define the variable would be:

set ORACLE_SID=ora11g
export ORACLE_SID

Only one time set up the ORACLE_HOME, ORACLE_SID, and ORACLE_BASE variables (Linux)

To configure our environment variables only once, we have to edit a file called bash_profile, with the Oracle user.
In the file we have to add three ORACLE_BASE variables which is the path where our oracle is, ORACLE_HOME which is the home path of the database and lastly ORACLE_SID which is the sid ne our database.
In my case the ORACLE_BASE is '/ oracle / app / oracle', the ORACLE_HOME is '/oracle/app/oracle/product/11.2.0/db_1' and the ORACLE_SID is 'ora11g'.
To edit the file we run:
Vi ~ / .bash_profile
To add the variables we go to the end of the file and press the insert key, next we add the variables that in my case would be:
 
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=ora11g; export ORACLE_SID

And finally to save the file we press the escape key and type ': wq' we press enter and then we proceed to restart the machine.