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
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.
answered 15 Dec '14, 16:10