When using database mirroring, an alternate server name must be specified for client applications to be able to connect to
the current primary server without knowing in advance which server is the primary server and which is the mirror server. Both
partner servers must use the same name for the alternate server name. Use the CREATE MIRROR SERVER statement to create the
alternate server names for the primary and mirror servers in a mirroring system. See CREATE MIRROR SERVER statement.
The -sn database option must be specified after the database-file, and applies only to that database.
The database server can be configured to listen for more than one server name for a particular database server. Server names
other than the real server name are called alternate server names, and are specific to a particular database running on the
database server. Clients can specify the alternate server name using the ServerName connection parameter to connect to that
Alternate server names must be unique on the network. If you attempt to start a database on the command line and the alternate
server name you specify is not unique, the database server fails to start. You can also provide an alternate server name using
the START DATABASE statement.
Clients that specify an alternate server name can only connect to the database that specified the alternate server name. They
cannot connect to, create, stop, and drop other databases on the same database server. If the DBN or DBF connection parameter
is specified, it must match the database name or database file, respectively. If the DBN or DBF connection parameter is not
specified, then the database acts as the default database for that server.
The Server Enumeration utility (dblocate) detects alternate server names.
The following command starts the databases satest.db and sample.db on a database server named myserver. The -sn option instructs the database server to use mysample as an alternate server
name when connecting to sample.db.