Saturday, April 25, 2020

How to set environment for oracle in Linux.

How to set the environment for oracle in Linux.


In this article, we will see how to set the environment for oracle database.

For this make sure you have installed the oracle database in your Linux machine.

If you have installed the oracle database in Linux machine you should find this file named 'oratab' in configurations.


Steps to be followed :

1. If you don't know the SID you can open the oratab file by using the below command.

            cat  /etc/oratab

   The output of the commands looks like below :

   

Here we could see the last line as in the format of 
                        
                            $ORACLE_SID:$ORACLE_HOME: Y

2. By using below command you can set the Oracle SID.

       export ORACLE_SID=db11g

3. Once we set the oracle SID we can set the oracle home.

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

4. Once We set the oracle home then we are also most ready just one set to connect to the database. We need to set the oracle path by using the below command.

export PATH=$PATH:$ORACLE_HOME/bin


5. Now we can able to connect the database by using.

sqlplus username@SID/password

  if you are using the windows authentication method you can give.

sqlplus / as sysdba

(or)

sqlplus sys as sysdba

  The above command let you connect as sys user with sysdba as the role.


Note: We can also use. '. oraenv' command to set the environment we can give the sid but sometimes it won't work. at that time we can use the above process to connect the database.

loading...

No comments:

Post a Comment

tutu etek

tutu etek : tutu etek