Using Sybase

<<

BrianReynolds

User avatar

Posts: 53

Joined: October 21st, 2008, 11:47 am

Location: Limerick

Skype name: leitrim_94

Post April 30th, 2009, 3:10 pm

Using Sybase

These are some of the adventures I had when setting up our QE to run with the new Sybase Driver on Linux x86.

We download the EAServer developer edition 5.2. Installation of this was pretty standard, a java-based wizard with the usual Next->Next->Finish routine. Installed in /opt/sybase/EAServer

From the docs, the next thing to do was start the EAServer. I ran /opt/sybase/EAServer/bin/serverstart.sh, and the first thing I hit was

jagsrv: error while loading shared libraries: libstdc++.so.2.8: cannot open shared object file: No such file or directory

Blimely, that's an old one ... 2.8 !! I had to install the "compat" libraries on the Suse Linux 9.0, but on the newer openSuse 11.0, that wasn't even an option (the compat rpm only goes back as far as 2.9 ). So we won't be running this on openSuse then .....

After that, he seemed happy, and the server happily reports

8<

Starting services...
Done binding to all configured Name Servers.
Accepting connections.

>8

It seems that EAServer does come with a sample DB, but John O'M had recommend using SQLAnywhere from Sybase. So I got a development version from

http://www.sybase.com/products/database ... qlanywhere

Again, this install went through pretty painlessly, and the nice people at Sybase (or rather the nice robot mailer) sent me a development license key.

I used the following to start the sample DB (in the background)

>> . /opt/sqlanywhere11/bin32/sa_config.sh
>> dbspawn dbeng11 -n mydemo11 /opt/sqlanywhere11/demo.db

Next step was defining an ODBC DSN. I think that SQLAnywhere provide their own ODBC implementation, but ideally, I'd like to continue to use our existing unixODBC setup (it has worked fine for DB2, Mysql, Adabas-D and Postgres!)

The SQLAnywhere docs recommend that I set the ODBCINI env variable, so

export ODBCINI=/usr/local/etc/odbc.ini

and in my odbc.ini I have

[My_DSN]
Driver=/opt/sqlanywhere11/lib32/libdbodbc11.so
DatabaseFile=/opt/sqlanywhere11/demo.db

When I started the Portus and tried to run our QE, the My_DSN DSN was found OK, but it just seg faulted in the middle of nowhere. So, at guess, I sourced the sa_config file and everything seemed kosher.

E.g

if test -e "/opt/sqlanywhere11/bin32/sa_config.sh"; then
echo "Setting Sybase Environment : "
source /opt/sqlanywhere11/bin32/sa_config.sh

export ODBCINI=/usr/local/etc/odbc.ini
fi

/usr/local/portus/apache2/bin/apachectl start
<<

BrianReynolds

User avatar

Posts: 53

Joined: October 21st, 2008, 11:47 am

Location: Limerick

Skype name: leitrim_94

Post May 8th, 2009, 2:15 pm

In addition, in a testing environment if you don't want to worry about having to add user and password security credentials, you can add the UID+PWD to the odbc.ini

E.g.

[My_DSN]

Driver=/opt/sqlanywhere11/lib32/libdbodbc11.so

DatabaseFile=/opt/sqlanywhere11/demo.db

UID=dba

PWD=sql
<<

BrianReynolds

User avatar

Posts: 53

Joined: October 21st, 2008, 11:47 am

Location: Limerick

Skype name: leitrim_94

Post June 16th, 2009, 3:05 pm

In addition, this is a log of the installation of Sybase Adaptive Server Enterprise Express Edition on Linux x86 ( SLES 10 )

* Downloaded ASE 15.0.3 and installed as per the docs choosing default options

* Start the server

source /opt/sybase/SYBASE.sh

$SYBASE/$SYBASE_ASE/install/startserver -f $SYBASE/$SYBASE_ASE/install/RUN_CLARE

* Set the server server password

$SYBASE/$SYBASE_OCS/bin/isql -Usa -P -Sserver_name
1> sp_password null, new_password
2> go

* Install Sample databases

isql -Usa -P***** -SCLARE -i $SYBASE/$SYBASE_ASE/scripts/installpubs2

* Edited /etc/unixODBC/odbcinst.ini and added

[Adaptive Server Enterprise]
Description = Sybase ODBC Driver
Driver = /opt/sybase/DataAccess/ODBC/lib/libsybdrvodb.so
FileUsage = -1

* Edited /etc/unixODBC/odbc.ini and added

[sampledsn]
Description = Sybase ODBC Data Source
UserID = sa
Password = ********
Driver = Adaptive Server Enterprise
Server = clare
Port = 5000
Database = pubs2
UseCursor = 1

Note : The "Server" is the machine hostname. The "Port" comes from the /opt/sybase/interfaces

* Install Sybase stored procedures for use with ODBC

cd /opt/sybase/DataAccess/ODBC/sp/
./install_odbc_sprocs CLARE sa *******

* Edit the Portus environment to pick up Sybase

vi /usr/local/portus/xmiddleEnv.sh
** add the line at bottom **

source /opt/sybase/SYBASE.sh

* Stop and Start Portus

cd /usr/local/portus/apache2/bin/
./apachectl stop
./apachectl start

you can access the pubs2 sample via the "sampledsn" DSN

Return to SQL

cron
Powered by phpBB® Forum Software © phpBB Group.
Designed by ST Software