Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Database Administration » Starting and Connecting to Your Database » The database server » Database server options


-n server option

Sets the name of the database server.

{ dbsrv11 | dbeng11 } -n server-name database-filename ...
Applies to

All operating systems and database servers.


By default, the database server receives the name of the first database file with the path and extension removed. For example, if the server is started on the file samples-dir\demo.db and no -n option is specified, the name of the server is demo.

When a database server starts, it attempts to become the default database server on that computer. The first database server to start when there is no default server becomes the default database server. Shared memory connection attempts on that computer that do not explicitly specify a database server name connect to the default server.


It is recommended that you use the -xd option for database servers being used by deployed applications, and that all clients explicitly specify the name of the database server to which they should connect by using the ENG connection parameter. This ensures that the database connects to the correct database server when a computer is running multiple SQL Anywhere database servers.

There is no character set conversion performed on the server name. If the client character set and the database server character set are different, using extended characters in the server name can cause the server to not be found. If your clients and servers are running on different operating systems or locales, you should use 7-bit ASCII characters in the server name. See Connection strings and character sets.

Database server names must be valid identifiers. Long database server names are truncated to different lengths depending on the protocol. Database server names cannot:


On Windows and Unix, version 9.0.2 and earlier clients cannot connect to version 10.0.0 and later database servers with names longer than the following lengths:

  • 40 bytes for Windows shared memory
  • 31 bytes for Unix shared memory
  • 40 bytes for TCP/IP

The server name specifies the name to be used in the ServerName (ENG) connection parameter of client application connection strings or profiles. With shared memory, unless -xd is specified, there is a default database server that is used if no server name is specified, provided that at least one database server is running on the computer.

Running multiple database servers with the same name is not recommended.

There are two -n options

The -n option is positional. If it appears before any database file names, it is a server option and names the server. If it appears after a database file name, it is a database option and names the database.

For example, the following command names the database server SERV and the database DATA:

dbsrv11 -n SERV sales.db -n DATA

See -n database option.

See also