cancel
Showing results for 
Search instead for 
Did you mean: 

Can I change the server name at runtime?

MCMartin
Participant
3,481

Is it possible to change the database server name provided through the -n option during runtime?

Is it possible to add an alias to the server name during runtime?

Accepted Solutions (1)

Accepted Solutions (1)

Breck_Carter
Participant

No, and no.

I am curious: What do you need it for?

MCMartin
Participant
0 Kudos

I am more interested in the second part to enable or disable an alias for the server name. This would be of use for us at times a client is switching between machines with identical databases.

Answers (1)

Answers (1)

ian_mchardy
Product and Topic Expert
Product and Topic Expert

When you start a database you can specify an alternate server name for the database. This is an additional server name that can be used only to connect to the database. The alternate server name is the closest thing to changing the server name that SQL Anywhere supports.

High availability uses alternate server names so that a client can use the alternate server name for the database. This alternate server name will be used by which ever of the two partner servers is currently the primary. Perhaps you should consider using high availability which will do this automatically for you.

VolkerBarth
Contributor
0 Kudos

Interestingly - I always have thought -sn is only useful/allowed when using HA. But it isn't, apparently, if I do understand this correctly:)

Obviously when not using HA, you would have to make sure yourself that only one server at a time does use that according -sn alternate server name.

MCMartin
Participant
0 Kudos

Thanks Ian, can I change this alternate name for a database during runtime?

ian_mchardy
Product and Topic Expert
Product and Topic Expert

Unfortunately No. An alternate server name can only be specified when starting a database. The is no way to change or add a alternate server name for a running database. Note that you can start and stop databases on a running server.