on 2014 Dec 15 2:14 PM
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?
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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. 🙂
User | Count |
---|---|
64 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.