0

I have server under RHEL 6.3 installed on that server Oracle 11gr2 and 12c, I want to create user lets say Ahmad but I want this user to be sysdba on both servers, for single server I edit .bach_profile to be like the following:

11g:

ORACLE_HOSTNAME=oracledev; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/oracle11gr2/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


PATH=$PATH:$HOME/bin
unset USERNAME
cd $ORACLE_BASE
export PATH

and if I want to make him sysdba for 12c I use the following:

export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=oracledev
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/oracle12c/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=cdb1

export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

My question is it possible to marge those parameters together without making a conflict, if yes please advise

2 Answers 2

0

For a start you can use oraenv script to set PATH, LD_LIBRARY_PATH, ORACLE_BASE and ORACLE_HOME:

export ORACLE_SID=ORCL

ORAENV_ASK=NO
. /usr/local/bin/oraenv

ORACLE_SID can be parsed from /etc/oratab file. ORACLE_HOSTNAME maybe from HOSTNAME environment variable.

0

ORACLE_HOME and ORACLE_SID determine where connections go through the IPC protocol. If you can tolerate password authentication, you can use the TCP protocol by specifying a TNSNAMES entry at login. You'll need to add entries for both databases in the TNSNAMES file in each of the two ORACLE_HOMEs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.