The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

I have created a service using Sybase Central. The service has a name, is started, and running.

Do I need to register it somehow to make it available? The reason I ask is because...

I now want to create a database using the service. But, the CREATE DATABASE WIZARD in Sybase Central will not allow me to select a server (it is greyed out). The only option is to start a new server. I don't want to start a new server, I want to use the server that is running under the service.

What am I missing?

asked 15 Dec '14, 14:14

hello's gravatar image

hello
30224
accept rate: 0%


What you may be "missing" is that SQL Anywhere is profoundly different from other products such as Microsoft SQL Server and Sybase ASE... with SQL Anywhere, connections are ONLY made to databases, not servers.

SQL statements can only be run on a connection, and with SQL Anywhere all connections are made to databases, not servers. If you started a server without a database, you still have to "connect to a database" in order to run a SQL statement.

(Yes, it is possible to start a SQL Anywhere server, as a service, without specifying a database... in this case you must specify the -n servername parameter in the service setup).

You can still "connect to a database" if no database is running on the server, but you have to connect to the phantom "utility database" to do that. ISQL will let you connect to the utility database, but I'm guessing Sybase Central might not.

For example, here are the configuration parameters for a SQL Anywhere service named "emptyservice" that starts dbsrv16.exe network server with server name "emptyserver" and sets the utility database password to "SQL":

-n emptyserver -su SQL

Here is a Windows command file to connect ISQL to the utility database:

"%SQLANY16%\bin64\dbisql.com"^
  -c "ENG=emptyserver; DBN=utility_db; UID=dba; PWD=SQL"

You can't do much with the utility database... you can't do a CREATE TABLE, but you can do a CREATE DATABASE:

CREATE DATABASE 'c:\temp\realdatabase.db';

You can also start that database on the same server:

START DATABASE 'c:\temp\realdatabase.db';

HOWEVER... in most cases the utility database is useless, and starting a server before creating a database is also pointless. With SQL Anywhere, creating a database comes first, then starting that database with a server.

A final word: unlike Oracle and other products, "servers" are not as important as databases. A server is just a running instance of dbeng16.exe or dbsrv16.exe, and it exists only to run databases. In a 24x7 high availability production setup, servers become more important, but NOT in a development environment... in development there is no need to create a single omnipotent continuously-running server for all your databases. Instead, create the database, then start it by launching one of the db*.exe executables.

permanent link

answered 15 Dec '14, 16:10

Breck%20Carter's gravatar image

Breck Carter
26.7k418577825
accept rate: 20%

Thanks for the reply.

So, if I understand you correctly, I need to create a database FIRST...then create the service.

I have tried that using Sybase Central.

But when I do that, the database is not using the service at all. I know this because the service shows 'Stopped' after I create it. Yet the database still runs as an application. Even if I include the -n parameter when creating the service, the database still won't communicate with the service. The database and the service are two separate entities that exist on one computer but don't communicate.

How do I link the two using Sybase Central to get them to communicate? My goal then, is to allow many people on the network to log into the database as clients.

Thanks for any info.

(15 Dec '14, 17:26) hello

OK. I think I figured it out.

I need to add ANOTHER parameter value after the -n (service name).

The second parameter should be the name of the database to run with the service.

SO...my parameter entry is:

-n MyService "C:\Mydatabase"

And it works!!!!

Note to SAP...it would really be helpful to just add another screen to the wizard asking for the location of the database instead of having to place it as a parameter value. :)

(15 Dec '14, 17:56) hello
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:

×8

question asked: 15 Dec '14, 14:14

question was seen: 557 times

last updated: 15 Dec '14, 17:56