Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hello,

I have a database server (dbsrv16.exe) which is running as a windows service. I can see the service running from Sybase central also. But when I am trying to do an isql -S<server name=""> it is throwing me an error saying ""ct_connect(): directory service layer; internal directory control layer error: Requested server not found."

NOTE: I tried pinging the server and the database with dbping and its pinging successfully. I can also find the server name in dsedit.

EDITED: Tried with dbisql and UID=DBA;PWD=sql and it worked. However when I am trying to issue a dbstop on the same server it is showing that the requested server is not found.

Please let me know how or what file/s should I check to resolve this issue.

Thanks

asked 13 Jan '17, 05:21

rohinibasuu's gravatar image

rohinibasuu
567813
accept rate: 0%

edited 16 Jan '17, 05:03


You are using the ISQL utility that comes as part of the SDK for ASE. The native SQL Anywhere Interactive SQL utility is dbisql.

OpenClient CT-ISQL looks up the servername in an "Interfaces" (see -I) file where that servername needs to have been added so the client (ISQL) can find the correct network address and port information there. If your intention was not to use tools meant to connect to ASE (Replication Server or a number of different Open Server based products) then you may want to switch to the native SQL Anywhere Interactive SQL utility

To continue to use CT-ISQL there will be a couple of adjustments needed when connecting to a SQL Anywhere database server. The database server doe need to be started with TCP/IP listener(s) (true by default for dbsrv16) and the entries in your interfaces file must meet a few requirements:

  • with SQL Anywhere you connect to the database (not the server as with ASE) so your servername usually needs to be made to match the database name (DBN) you want to connect to. The IP address(es) and port(s) will need to be one the server is using, but the name usually needs to match the database.

  • Under some circumstance SQL Anywhere may switch the port it will listen on. To address that possibility that you can either use a fixed port (on the db server) or you will need to set up your interfaces entry for the multiple ports that the server may choose to use. If port 2638 is in use (either by a different server on the same machine or another application) then the database server will switch to an alternate port (usually from the sequence 49152, 49153, ...).

This is TDS based communications and that protocol does not provide features to help you be port and ip agile from the client side. This is one of the native features that dbisql will provide you so you may want to revisit my first statements.

permanent link

answered 13 Jan '17, 09:54

Nick%20Elson%20SAP%20SQL%20Anywhere's gravatar image

Nick Elson S...
7.3k35107
accept rate: 32%

Hello Nick,

Thanks a lot for your answer. The application I am working uses SQL Anywhere 16 as a remote database where the server name and the database name are not the same. When I am trying to do dbstop -y -c dsn=SAAP_RCS_rem_0101, it is showing that the server is not found. When I tried with dbisql -c "Server=SAAPDB_RCS_SAPDOC02_0101;DBN=SAAP_RCS_rem_0101;UID=DBA;PWD=sql", it got connected to the database running on the specified server. But when I replaced User with another valid db user, it showed an invalid login.

I tried to get the service details: dbsvc -g SAAPDB_RCS_SAPDOC02_0101

SQL Anywhere Service Utility Version 16.0.0.1324
Service "SAAPDB_RCS_SAPDOC02_0101":
    Network Server
    Real service name: SQLANYs_SAAPDB_RCS_SAPDOC02_0101
    Display Name: SQL Anywhere - SAAPDB_RCS_SAPDOC02_0101
    Display Description: SAAPDB_RCS_SAPDOC02_0101
    Service group: SQLANYServer
    Automatic Startup
    Using LocalSystem account
    Allowed to interact with desktop
    Executable: C:\Program Files\SQL Anywhere 16\BIN64\dbsrv16.exe
    Service command line options: -n SAAPDB_RCS_SAPDOC02_0101 C:\SAP\SAAP\0101\db\0101\SAAP_RCS.db -n SAAP_RCS_rem_0101 -o C:\SAP\SAAP\0101\db\logs\eng_log_0101 -on 4M -x shmem,tcpip(port=5657) -xs http(port=8080;dbn=SAAP_RCS_rem_0101;MaxRequestSize=10M;log=C:\SAP\SAAP\0101\db\logs\web_log_0101.txt) -gd ALL -z

Sybase sql.ini file has the following entry

[SAAPDB_RCS_SAPDOC02_0101]
master=NLWNSCK,SAPDOC02,5657
query=NLWNSCK,SAPDOC02,5657

Can you please help me understand why dbstop is saying that the server is not found when the server is up and running.

(A small note about myself: Originally a database developer, experienced in sybase ase 12.5 and 15.x. Recently working as an administrator for SQL Anywhere 16 database)

(16 Jan '17, 04:47) rohinibasuu
Replies hidden
1

When I am trying to do dbstop -y -c dsn=SAAP_RCS_rem_0101, it is showing that the server is not found. When I tried with dbisql -c...

Then the details of the ODBC DSN do not match those listed explicitly as connection parameters. What entries does the DSN contain w.r.t. HOST, ENGINE/SERVER, DBN, UID?

But when I replaced User with another valid db user, it showed an invalid login.

Note that SQL Anywhere (in contrast to ASE and MS SQL Server) does not have a master database but handles each database separately, even when they run on the same database engine. Therefore you do not connect/login to a server and then switch to a particular database, but you connect directly to a running database. - So could it be those other user credentials do belong to a different database (and you would require to specify a different DBN here)?


Note, in order to find SQL Anywhere databases on the network, the DBLOCATE utility is more helpful than the Windows service entries - when used with option "-d", it lists the names of the all running databases of all running SQL Anywhere database servers within a network (unless those are hidden via -sb0), including the machine name, port and database server name.

(16 Jan '17, 07:21) Volker Barth

Your DBSTOP command is using a DSN and the DBISQL connection is using a connection string. Have you tried the same connection string used by DBISQL with the DBSTOP command. If you need a DSN (most SA tools avail of the DSN as a connection parameter source and do not directly use ODBC for connectivity), you need to map the working connection parameters to the DSN. There is a test connection option in the DSN to validate the settings.

the context of service. Why not simply stop the service? If you dbstop, the service is going believe it has been terminated abnormally.

(16 Jan '17, 09:06) Chris Keating

The -S option is for some other product, not SQL Anywhere.

Try -c "ENG=ddd16;DBN=ddd16;UID=dba;PWD=sql;"

permanent link

answered 13 Jan '17, 07:59

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050
accept rate: 20%

Yeah I was using isql, which is for sybase ase.

(16 Jan '17, 04:52) rohinibasuu
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×37
×11
×3

question asked: 13 Jan '17, 05:21

question was seen: 5,331 times

last updated: 16 Jan '17, 09:06