Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
Finally I solved this myself (after three days of elaborate search in the net
but in vain) !! But resolved by trial and error !!
Solution :
Only this much is required for connecting to Oracle Database. But ORACLE_HOME
is must.
config.yml :-
database:
adapter: oracle
username: casserver
password: nambiarsu
database: XXXXDB
-------------------------------------
I copied the tnsnames.ora, sqlnet.ora and listener.ora (this may not be reqd.)
to my instant client directory.
[root@rubycas_sn init.d]# ll /usr/lib/oracle/11.2/client64/
total 24
drwxr-xr-x 2 root root 4096 Jul 10 10:54 bin
drwxr-xr-x 2 root root 4096 Jul 10 11:24 lib
drwxr-xr-x 3 root root 4096 Jul 11 16:39 network
[root@rubycas_sn init.d]# ll /usr/lib/oracle/11.2/client64/network/admin/
total 24
-rw-r--r-- 1 root root 553 Jul 11 16:52 listener.ora
-rw-r--r-- 1 root root 194 Jul 11 16:52 sqlnet.ora
-rw-r--r-- 1 root root 1382 Jul 11 16:52 tnsnames.ora
---------------------------------
Relevant data of tnsnames.ora is given below:-
XXXXDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xxx.xxx.xx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = xxxDB)
)
)
--------------------------
Then added the following to /etc/profile.d/oracle_libs.
INSTANT_CLIENT="/usr/lib/oracle/11.2/client64"
LD_LIBRARY_PATH=${INSTANT_CLIENT}/lib/:${LD_LIBRARY_PATH}
PATH=${INSTANT_CLIENT}/bin:${INSTANT_CLIENT}:${PATH}
CLASSPATH=${INSTANT_CLIENT}/lib:${INSTANT_CLIENT}/bin:${CLASSPATH}
export TNS_ADMIN=${INSTANT_CLIENT}
export ORACLE_HOME=${INSTANT_CLIENT}
---------------------------------------------
The Environment is listed below:-
TOMCAT_HOME=/home/tomcat/tomcatCurrent
HOSTNAME=rubycas_sn.xx.xxxxx.in
GEM_HOME=/opt/rubygems
TERM=xterm
SHELL=/bin/bash
RUBYCAS_SERVER_PATH=/opt/rubyCASserverCurrent/bin
CATALINA_HOME=/home/tomcat/tomcatCurrent
HISTSIZE=1000
OLDPWD=/usr/lib/oracle/11.2/client64/network/admin
CATALINA_BASE=/home/tomcat/tomcatCurrent
SSH_TTY=/dev/pts/0
USER=root
LD_LIBRARY_PATH=/usr/sapjco:/usr/lib/oracle/11.2/client64/lib/:
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33
;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32
:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=
00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2
=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:
*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
TNS_ADMIN=/usr/lib/oracle/11.2/client64
MAIL=/var/spool/mail/root
PATH=/opt/rubyCASserverCurrent/bin:/opt/rubyCurrent/bin:/opt/rubygems/bin:/usr
/java/latest/bin:/home/tomcat/tomcatCurrent/bin:/usr/lib/oracle/11.2/client64/
bin:/usr/lib/oracle/11.2/client64:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lo
cal/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
INPUTRC=/etc/inputrc
PWD=/etc/init.d
JAVA_HOME=/usr/java/latest
LANG=en_US.UTF-8
RUBY_HOME=/opt/rubyCurrent
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=1
HOME=/root
LOGNAME=root
GEM_PATH=/opt/rubygems
CLASSPATH=.:/home/tomcat/tomcatCurrent/lib:/home/tomcat/tomcatCurrent/shared/c
lasses:/home/tomcat/tomcatCurrent/shared/lib:/home/tomcat/tomcatCurrent/common
/classes:/home/tomcat/tomcatCurrent/common/lib:/usr/lib/oracle/11.2/client64/l
ib:/usr/lib/oracle/11.2/client64/bin::/usr/sapjco/sapjco.jar
LESSOPEN=|/usr/bin/lesspipe.sh %s
CATALINA_TMPDIR=/home/tomcat/tomcatCurrent/temp
ORACLE_HOME=/usr/lib/oracle/11.2/client64
G_BROKEN_FILENAMES=1
_=/bin/env
-------------------------
Ruby version : ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI
0x6770, Ruby Enterprise Edition 2010.01
Java version : java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
Original comment by nambia...@gmail.com
on 11 Jul 2010 at 12:50
Glad to hear you got it working. The config shouldn't be any different for
RubyCAS than for ActiveRecord in general, but yeah, that doesn't make it any
easier. I've had all kinds of good times in the past trying to get Ruby to talk
through Oracle's proprietary crap.
Original comment by matt.zuk...@gmail.com
on 2 Aug 2010 at 10:03
Original issue reported on code.google.com by
nambia...@gmail.com
on 10 Jul 2010 at 10:20