Shutting the database down when the hostname is changed is expected as designed:
- Effectively this is to prevent a database from being started from a different machine that has the filesystem mounted
- It is also to prevent the database from being started/accessed when it has already been started or is being accessed single-user.
The database does not bind to a variable (hostname). The hostname will be whatever the hostname is when the database is started and this is then the information that is stored in the database .lk file together with the the PID and mode.
The Watchdog sub-process of the login Broker (or WDOG if started), periodically checks for the existence and validity of the .lk file. If it has been removed or no longer valid, the database must be shut down because now there is no protection against starting it up while it is already running, which is absolutely certain to lead to database corruption. For further information refer to Article:
To restart the database after hostname failure:
A. Restart the database using the new -H <hostname> parameter, or
B. Revert the hostname of the system to its previous value.
The Master Block information from the previous crashed instance may additionally need to be cleared:
$ proutil dbname -C truncate bi
$ prostrct list dbname dbname.st
$ prostrct repair dbname dbname.st
Isolating the hostname change:
Changing the hostname under a running database will result in the database shutting down, to prevent such issues in future should be self-evident.
Outside of IT or Network Administrators deliberately changing the hostname at runtime, the 'expected' hostname in the 4192 message yields the first clue:
1. User entry error
While the hostname command prints the name of the current host, a super-user can set the hostname by giving an argument.
Example: <dbname>.lk : HOSTNAME is <hostname>, expected -f. (4192)
Some UNIX platforms (like Linux) support the -f argument, which returns the fully qualified domain name, but others (like Solaris for example) do not and will change the hostname to "-f". But not exclusively, it all depends who or what ran the 'hostname' command and what argument was supplied.
2. A script that's running the hostname command.
Example: <dbname>.lk : HOSTNAME is <hostname>, expected . (4192)
A hostname command is most often (but not always) run from a Perl script, WebServer, or mail utility (like sendmail). Only those involved with the environment will be able to provide further information.
3. DHCP services change the hostname
Example: a database is hosted on the Google Cloud. Refer to Article:
4. Restarting the NIC resolves to the short name before resolving to the long name.
Example: The HOSTS file has an entry for the short name which resolves immediately on the NIC restart.