Set oracle home on linux

Set oracle home on linux

Depending on your platform, you may have to set environment variables before starting SQL*Plus, or at least verify that they are set properly.

For example, on most platforms, you must set the environment variables ORACLE_SID and ORACLE_HOME . In addition, you must configure the PATH environment variable to include the ORACLE_HOME /bin directory. Some platforms may require additional environment variables:

  • On UNIX and Linux, set environment variables by entering operating system commands.
  • On Windows, Oracle Universal Installer (OUI) automatically assigns values to ORACLE_HOME and ORACLE_SID in the Windows registry.

If you did not create a database upon installation, OUI does not set ORACLE_SID in the registry; after you create your database at a later time, you must set the ORACLE_SID environment variable from a command window.

UNIX and Linux installations come with two scripts, oraenv and coraenv , that you can use to easily set environment variables. For more information, see Oracle Database Administrator’s Reference for Linux and UNIX-Based Operating Systems .

For all platforms, when switching between instances with different Oracle homes, you must change the ORACLE_HOME environment variable. If multiple instances share the same Oracle home, then you must change only ORACLE_SID when switching instances.

Читайте также:  Удалить драйвер видеокарты linux

Example 3-1 Setting Environment Variables in UNIX (C Shell)

setenv ORACLE_SID orcl setenv ORACLE_HOME /u01/app/oracle/product/18.0.0/db_1 setenv LD_LIBRARY_PATH $ORACLE_HOME/lib:/usr/lib:/usr/dt/lib:/usr/openwin/lib:/usr/ccs/lib

Example 3-2 Setting Environment Variables in UNIX (Bash Shell)

export ORACLE_SID=orcl export ORACLE_HOME=/u01/app/oracle/product/18.0.0/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/dt/lib:/usr/openwin/lib:/usr/ccs/lib

Example 3-3 Setting Environment Variables in Windows

Example 3-3 assumes that ORACLE_HOME and ORACLE_SID are set in the registry but that you want to override the registry value of ORACLE_SID to connect to a different instance.

On Windows, environment variable values that you set in a command prompt window override the values in the registry.

Источник

Smart way of Technology

Worked in Database technology for fixed the issues faced in daily activities in Oracle, MS SQL Server, MySQL, MariaDB etc.

Setting Oracle home environment variable in Linux platform

Setting Oracle home environment variable in Linux platform

Setting the Oracle Home and other environment variable in Linux platform:
1. Set at terminal at bash level(temporary at terminals)
2. Set at user level (with bash_profile)

Set at Terminal level (temporary persistent)
Set the destination according to it where oracle is installed and Oracle sid defined as the instance name.
Open the terminal window in Linux and set the following paths will set your Oracle Environment variables.

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0
export ORACLE_SID=test
export PATH=$ORACLE_HOME/bin:$PATH

Set Permanent at user level
When you login with user, the Oracle Home environment variable is already set when you login with user by setting them in bash_profile hidden file in Linux.
Location of bash_profile is /home/oracle/.bash_profile if you are setting in ORACLE user. Suppose user name is oraadmin then location is /home/oraadmin/.bash_profile.

Читайте также:  Chkdsk аналог в linux

— Open bash_profile hidden file in text editor add following line:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0
export ORACLE_SID=test
export PATH=$ORACLE_HOME/bin:$PATH
— Save the file

You can set other environment variable also present in Linux system:

#Oracle Environment
export ORACLE_HOME=/u01/oracle/12.2.0/dbhome_1
export ORACLE_BASE=/u01/oracle
export ORACLE_SID=oracle
export ORACLE_TERM=xterm
export NLS_LANG=AMERICAN
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export JAVA_HOME=/opt/java/jdk1.8.0_14/
export PATH=$JAVA_HOME:$PATH:$ORACLE_HOME/bin

Share this:

Like this:

About SandeepSingh DBA

Hi, I am working in IT industry with having more than 10 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

1 thought on “ Setting Oracle home environment variable in Linux platform ”

  1. Jan Böhm, Michael GeorgJune 19, 2022 at 11:21 pm I hope the pearl script will set an active Directory on my mobile phone. I thank you for all your work, and would be happy, if you reply to my lines, witch I wrote in this small context. Props to the $Header, of the script, from witch I’m very impressed of. I wish all the best… Jan Like Like

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

contactus@smarttechways.com

Blog Stats

Источник

Set oracle home on linux

Depending on your platform, you may have to set environment variables before starting SQL*Plus, or at least verify that they are set properly.

For example, on most platforms, you must set the environment variables ORACLE_SID and ORACLE_HOME . In addition, you must configure the PATH environment variable to include the ORACLE_HOME /bin directory. Some platforms may require additional environment variables:

  • On UNIX and Linux, set environment variables by entering operating system commands.
  • On Windows, Oracle Universal Installer (OUI) automatically assigns values to ORACLE_HOME and ORACLE_SID in the Windows registry.
Читайте также:  Linux and понизить приоритет процесса

If you did not create a database upon installation, OUI does not set ORACLE_SID in the registry; after you create your database at a later time, you must set the ORACLE_SID environment variable from a command window.

UNIX and Linux installations come with two scripts, oraenv and coraenv , that you can use to easily set environment variables. For more information, see Oracle Database Administrator’s Reference for Linux and UNIX-Based Operating Systems .

For all platforms, when switching between instances with different Oracle homes, you must change the ORACLE_HOME environment variable. If multiple instances share the same Oracle home, then you must change only ORACLE_SID when switching instances.

Example 4-1 Setting Environment Variables in UNIX (C Shell)

setenv ORACLE_SID orcl setenv ORACLE_HOME /u01/app/oracle/product/18.0.0/db_1 setenv LD_LIBRARY_PATH $ORACLE_HOME/lib:/usr/lib:/usr/dt/lib:/usr/openwin/lib:/usr/ccs/lib

Example 4-2 Setting Environment Variables in UNIX (Bash Shell)

export ORACLE_SID=orcl export ORACLE_HOME=/u01/app/oracle/product/18.0.0/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/dt/lib:/usr/openwin/lib:/usr/ccs/lib

Example 4-3 Setting Environment Variables in Windows

Example 4-3 assumes that ORACLE_HOME and ORACLE_SID are set in the registry but that you want to override the registry value of ORACLE_SID to connect to a different instance.

On Windows, environment variable values that you set in a command prompt window override the values in the registry.

Источник

Оцените статью
Adblock
detector