2017-06-25

Error when connecting from isql to Sybase

When you try to connect to Sybase / SAP ASE following error may be raised:

CT-LIBRARY error:
        ct_connect(): network packet layer: internal net library error: Protocol driver call to parse connection information failed"

All those issues are described in this online Sybase course, but if you are looking for the immediate help  continue reading,  what can be cause the error?

Environment may be not setup


For Sybase tools to work, the environment needs to be setup. This means that environmental variables needs to be present. To test if you have those variables may look like that:

echo $SYBASE

This should return a path to installation directory. If nothing is returned issue as sap user:

.  ./SYBASE.sh

(note the additional dot at the beginning). This will define all the settings and will cause that commands will know where and how to connect, so maybe your problem would be solved.

2017-06-10

sqsh - smart replacement of rough isql

isql is a tool allowing to work with Sybase from command line, but it is not a very convenient tool. It is not possible to use history of commands and even command line editing doesn't work! Fortunately there are still hard-working programmers,who for free develop great tools!

This time I want to write about sqsh that can be downloaded from: https://en.wikipedia.org/wiki/Sqsh

The most important features that I like very much are:

  • command line editing (you can use left & right arrows)
  • history, that is saved even between sessions
  • executing the commands after ";" (you don't have to type "go" - just end the query with ";" and it will run)
  • compatibility in the scope of options with isql
The only part that makes some problems is, that to have it working you need to install it and the installation must be done starting with source code (BTW - this is also an advantage)

Installation step by step with all the problems that I have met:

Copy the sources and un-tar them:

tar xvf sqsh-2.5.16.1.tgz

This command will create a folder with source code. Change directory to it and execute a configure command:

./configure

In my case this resulted with error message:

configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

So I needed to read the config.log file. I have found entry like:

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2244: checking build system type
configure:2258: result: x86_64-unknown-linux-gnu
configure:2278: checking host system type
configure:2291: result: x86_64-unknown-linux-gnu
configure:2467: checking for gcc
configure:2497: result: no
configure:2560: checking for cc
configure:2607: result: no
configure:2663: checking for cl.exe
configure:2693: result: no
configure:2717: error: in `/opt/sap/sqsh-2.5':
configure:2719: error: no acceptable C compiler found in $PATH
See `config.log' for more details

Ok, so I needed to install compiler. I have found firt available compilers:

dnf search gcc

selected one of them and installed:

dnf install gcc.x86_64

Now I could to proceed with configure:

./configure

Unfortunately this ended with error again:

checking Open Client installation... no
configure: error: Unable to locate Sybase installation. Check your SYBASE environment variable setting.


Sybase system tables

To develop scripts that automate the administration, we need to use system tables. They contain information like list of devices, databases, logins, objects, messages and much more. Some of them are specific to the server like sysdatabases the other are specific to databases like sysobjects or sysprocedures.

There is a nice poster presenting the diagram of all of those system metadata tables. Click here to download it  here http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc70204.1550/pdf/a155pst.pdf

Thank you Kasia for sharing!

2017-06-03

Error: ninit: bind, Cannot assign requested address

When Sybase starts than it binds to network interfaces as defined in master entires of interfaces file under the server name. For example for the server SAP01, the colored entries determine network interfaces where sybase will bind:


SAP01
        master tcp ether localhost 5000
        query tcp ether localhost 5000
        master tcp ether 192.168.137.100 5000

SAP01_BS
        master tcp ether localhost 5001
        query tcp ether localhost 5001


SAP01_XP
        master tcp ether localhost 5002
        query tcp ether localhost 5002


SAP01_JSAGENT
        master tcp ether localhost 4900
        query tcp ether localhost 4900

However sometimes network was not ready when server was started and than following entries can be started in the errorlog:

network name localhost, interface IPv4, address 127.0.0.1, type tcp, port 5000, filter NONE
network name 192.168.137.100, interface IPv4, address 192.168.137.100, type tcp, port 5000, filter NONE
ninit: bind, Cannot assign requested address

Probably server restart will solve the issue, however you may decide to use an online operation:

Start following commands:

sp_listener status
GO

sp_listener start, '192.168.137.100:5000'
GO

sp_listener status
GO

The 'status' procedures just display the interfaces where sybase is listening. The 'start' command performs the binding operation. Values of IP and port should be the same as in the interfaces file.

In the same time in the errorlog following successful message should be recorded:

network name 192.168.137.100, interface IPv4, address 192.168.137.100, type tcp, port 5000, filter NONE
Listener with protocol tcp, host 192.168.137.100, port 5000 started.


SAP Adaprive Server Enterprise

SAP Adaprive Server Enterprise
SAP Adaprive Server Enterprise