HOW TO SETUP .ORAENV FILE

HOW TO SETUP .ORAENV:

1. If you are creating a database manually you have to put the entry in ORATAB file. If you are creating database using DBCA then the database entry will automatically filed in ORATAB file.


2. Location of ORATAB FILE :
$ Cd /etc
$ Vi oratab
 

3. Then edit the oratab file. It will look like below:
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
*:/u01/app/oracle/product/9.2.0:N
TSH1:/u01/app/oracle/product/9.2.0:N
juli:/u01/app/oracle/product/9.2.0:N
orcl:/u01/app/oracle/product/10.2.0/db_1:N
+ASM:/u01/app/oracle/product/10.2.0/db_1:N
rmanrep:/u01/app/oracle/product/10.2.0/db_1:N
mom:/u01/app/oracle/product/10.2.0/db_1:N
preetha:/u01/app/oracle/product/10.2.0/db_1:N
4. Then run the .bash_profile ----- > . .bash_profile
5. Then run . oraenv
6. Then enter the name of the database you wanna open


Below is the output for your statements.


$ echo $ORACLE_SID
Sonu
oracle@sujeet{Primary}:Sonu:/home/oracle
 
$ echo $ORACLE_HOME

oracle@sujeet{Primary}:Sonu:/home/oracle 
 
$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/usr/bin
 
 oracle@sujeet{Primary}:Sonu:/home/oracle

Here is the output for the echo $ORACLE_HOME after running . oraenv file. 

$ . oraenv
ORACLE_SID = [Sonu] ? test
oracle@sujeet{Primary}:pavs:/home/oracle
 
 $ echo $ORACLE_HOME
/home/oracle/oracle/product/10.2.0/db_1
 
 oracle@sujeet{Primary}:test:/home/oracle
 
 $ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/usr/bin:/home/oracle/oracle/product/10.2.0/db_1/bin 
 
oracle@sujeet{Primary}:test:/home/oracle
 
 $ echo $ORACLE_SID
test 
 
oracle@sujeet{Primary}:test:/home/oracle
$
 
 

Oracle oraenv

There are 2 Oracle Homes , One 9i and another 10g home

In 10g , there are 2 databases , db1 and db2

Now..i type
$ . oraenv

Enter ORACLE_SID : db1
(Oracle Home is automatically set)

Now i type
$ . oraenv
Enter Oracle_sid: db2
Enter Oracle_Home: (i have to manually type here the oracle home path)

How can i get Oracle Home to be automatically set like above



 

No comments:

ORA-00059: Maximum Number Of DB_FILES Exceeded in 19C database

When I am adding datafile to my 19C database facing the below error. SQL> alter tablespace DATA  add datafile '/u01/data/data15.dbf...