DBA > Job Interview Questions > Sybase Interview Questions and Answers

The Basics of Connecting to Sybase

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

The Basics of Connecting to Sybase

The following describes how to connect to Sybase ASE on a UNIX machine from a windows client with isql etc. The specific example is Sybase ASE 11.9 on Redhat Linux 6.1, using Windows 95 and NT. (Have both on partitions and the process was the same... This is not a technical review or an in-depth discussion (there are people far more qualified than me for that ;-) ). Rather it is more along the lines of "This is how I managed it, it should work for you". As always there are no guarantees, so it if goes wrong, it's your fault [<g>].

The starting point for this discussion has to be, you've downloaded (or whatever means you used to acquire it) both Sybase ASE for Linux and the PC Client software (a big zip file) and are ready to install. I'm not going to discuss the install process as Sybase managed to do a good job of that, so

I'm leaving well alone. The bit you have to take notice of is when you run srvbuild. This should happen the first time you log on as the user sybase after the install. If it doesn't then you can run it by hand after, it line in the $SYBASE directory under bin. The reason why I'm mentioning this is that srvbuild defaults to installing your database using the name "localhost". Now the problem with localhost is that it is kind of a special case and would mean that you could not connect to your database from anywhere other that the server itself. This would defeat the object of this

discussion, so simply name it something else, bob, george, albert, mydatabase, whatever, the choice is yours.

Having done this (it takes a while to complete) you should now have a running database. so try to connect to it on the local machine with something like isql -SServerName -Usa, (where ServerName is whatever you called it when you ran srvbuild) when it asks for a password, just press enter and you should be greeted by the monumentous welcome

1.
Not a lot for all the work you have done to get to this point, but you've connected to your database and that's the main thing. This is very important as not only does this mean that your database is working, but it also means that the server half of Open Client is working. This is because even isql on the server connects to the database using Open Client and you've just proved it works, cool. Next run dsedit on the server and make a note of the following 3 things:
1: The server name
2: The IP address
3: The port

Your going to need these to get connected from windows.

Now switch to you windows machine, did I remember to tell you to shut down dsedit on the server?, consider it said ;-). Unpack the PC Client software zip file and install it using the instructions that came with it. They worked fine for me and I'm an idiot, so they should work for you. When you've finished, go to the start menu and start dsedit (on my machine it's under programs -> sybase). When it runs, it begins with a dialog asking you which Interface driver to open, I've done this 3 times and went with the default every time, so it should be a safe bet. At this point you can now add your Linux based server. Select the menu item serverobject->add. Then enter the name of the server you just got from your Linux box, in the field labeled "server". It is probably a good idea that it is the same name you got from your Linux based dsedit to ensure that everyone is referring to the same server with the same name. Prevents confusion. This then opens a new window with several fields, one of which is the server name you just entered. The bottom field is the bit where you enter the "nitty gritty", the server IP address and port. To do this right click on the field and select "modify attribute" to open the server address dialog. When this new dialog opens click add to open yet another dialog (is there an award for the most gratuitous use of the word dialog???). OK, this is the last one, honest. Leave the drop down list where it is (hopefully showing TCP/IP or something similar). Instead move straight to the address field and enter the following: the Linux servers IP address followed by the port number (the one from the server dsedit), separated by a comma. On my machine it looks like this.

192.0.0.2,2501

Now you can "OK" your way back out of the dialogs, back up to where you started from and exit dsedit. Then launch isql on the windows box and log in. Personally I did this from a DOS prompt, using exactly the same syntax I did on the Linux box, but that's just because I like it that way. Now you should be happily querying you Linux (or other UNIX for that matter) based Sybase ASE database. What you do with it now, is covered elsewhere in this FAQ from people able to tell you, unlike me. Now just one more time for good measure, I'm going to type the word, wait for it.... Dialog.

(Continued on next question...)

Other Job Interview Questions