cancel
Showing results for 
Search instead for 
Did you mean: 

Can you run multiple databases with single network server?

Former Member
4,455

Hi,

I created one database running as a network server, but after I created another database running on the same network server, I could only connect the previous one.

I want to know if this is possible and how to do it, but couldn't find any example online. I have tried this but the service wouldn't start.

dbsrv12 -n server "c:dbdatabase1.db" -n database1 "c:dbdatabase2.db" -n database2

Any idea?

Accepted Solutions (0)

Answers (2)

Answers (2)

MarkCulp
Participant

You can run up to 254 databases on the same network database server.

To connect to a specific database you need to specify the database name in the client connection string. For example, using your database server command line,

  • to connect to the first database (dbdatabase1.db with alias name 'database1') as user 'dba' with a password of 'sql' you would use a connection string like: "servername=server;dbn=database1;uid=dba;pwd=sql"
  • to connect to the second database you would use a connection string similar to "servername=server;dbn=database1;uid=dba;pwd=sql"

Other connection examples can be found in the documentation.

The complete list of connection parameters can be found here. I would recommend that you read through these pages and become familiar with them.

Note the reason that you were able to connect to the first database is that the first database started on the server is the default database if no databasename (dbn) is specified in the connection string.

HTH

Former Member

Yes, multiple databases can be run on one instance of the SQL Anywhere server.

If that service is starting, add a console log output to the start command using the -o parameter (and optionally -on or -os to limit size) like so:

dbsrv12 -n myserver -o server_log.out mydb1.db -n mydb mydb2.db -n mydb2

The output log (server_log.out above) may identify why the server is unable to start.