MIMCONTROL - Controlling the Database Server
MIMCONTROLfunctionality is supplied on all platforms as a complete administration tool for managing database servers.
UNIX: The database servers on a Unix node can be controlled using the mimadmin command (see the mimadmin man-page). This command invokes the
MIMCONTROLprogram, and other programs, as required. The
MIMCONTROLcommand can also be used directly under Unix.A database server on Unix can be administered by the owner of it or by the superuser root. To change ownership of a database the mimdbfiles command is used (see the
mimdbfilesman-page).When a database server on a Unix machine is started for the first time,
MIMCONTROLwill create a default multidefs file containing appropriate default parameter values, based on the amount of memory installed on the machine. Refer to The MULTIDEFS Parameter File for details.Database server performance can be fine-tuned later by adjusting the parameters as required.
VMS: The database servers for the local databases on an OpenVMS node are controlled by using the
MIMCONTROLcommand directly (as described in this section).When a database server on an OpenVMS machine is started for the first time,
MIMCONTROLwill create a default
MULTIDEFSfile containing appropriate default parameter values, based on the amount of memory installed on the machine. Refer to The MULTIDEFS Parameter File for details.Database server performance can be fine-tuned later by adjusting the parameters as required.
Win: The Mimer Administrator can be used to control database servers on Windows platforms.Database servers are also controlled by using the Mimer Controller utility. Refer to the Windows help provided with the Mimer Controller for further details. You must belong to the administrators group to control database servers.It is also possible to use the Windows commands
NET STOP, etc. to control database server processes.
MIMCONTROLis controlled by flagged information specified on the command-line.
The overall syntax for
MIMCONTROL(expressed in short form Unix-style) is:mimcontrol [-bcdegkstwA] [-l chan] [database]
MIMCONTROLis invoked without any options, it displays help options on the command-line.
Output status information about the specified database server as a single-line list suitable for use in a script.For details about the output string resulting from this option, see Database Server Status. Output status information about the specified database server.This option can be combined with the
-soption, see Examples.
Disable new user connections to the database server. Users already connected are not affected.This option can be combined with the
-woptions, see Examples.
Enable new user connections to the database server. Show help text. Kill the database server immediately. This should only be used in emergency situations when a normal stop using the
-toption does not work.The next time the database is started, all databanks that were open at the time the server was killed will be automatically checked. Connected users will receive an error the next time they attempt to access the database.
Force logout of the specified channel number.Use channel numbers displayed by the
USERSoption of the
MIMINFOcommand, see The Users List.
Generate a default multidefs file.Win: This switch is not available in the Windows environment. Start the database server.If the server does not become operational within the specified number of seconds, the server will be killed.Default timeout is 600 seconds.This option can be combined with the
-doptions, see Examples.
Stop a database server. Any remaining users will be logged out.If the server does not stop within the specified number of seconds, the server will be killed.The default timeout is 120 seconds. This option can be combined with the
-woptions, see Examples.
Wait for all connected users to log out.If there are still users connected after the timeout period expires, the command fails.The timeout period should be given in seconds. If no timeout period is specified wait will be performed without any timeout.This option can be combined with the
-toptions, see Examples.
Create a dump directory and produce dumps of all internal database server areas to files in that directory.The files produced can be examined by using the
MIMINFO -fcommand, see MIMINFO - System Information.
VMS: The command
MIMCONTROL/STARTstarts a database server. Adding the
/HOLDqualifier will cause the
MIMCONTROLcommand to wait for the started server to stop before returning control to the DCL prompt. This simplifies writing scripts for automatic server restart.When the
/HOLDqualifier is used, the
MIMCONTROLcommand will exit with the final status code of the stopped database server process.
Specifies the name of the database to access.If a database name is not specified, the default database will be controlled.The default database is determined by the setting of the
SQLHOSTSis not used for
UNIX: The Unix-style command-line flags must be used on a Unix machine. Both short form switches (e.g. -s), and long form switches (e.g. --start) are supported.
VMS: Either the Unix-style (short or long form) or the VMS-style command-line flags may be used on an OpenVMS machine - see the Mimer SQL VMS Guide for more details.
Win: The Unix-style command-line flags can be used from a Command Prompt window. Both short form switches (e.g. -s), and long form switches (e.g. --start) are supported.
Database Server Status
MIMCONTROL/STATUS/DCL) command is a special form of the
MIMCONTROL/STATUS) command which returns the database server status information in the form of a single string containing a comma-separated list which is useful when writing scripts.
UNIX: On Unix, the string returned from
mimcontrol -bcan be piped and processed as required. The Unix command
cutcan be used to extract the list elements, e.g. the following command which will print the second list element:# mimcontrol -b | cut -f2 -d ','
VMS: On OpenVMS, the
MIMCONTROLcommand is silent and sets the DCL symbol
MIMER_STATUSto the value of the status string.The lexical function
F$ELEMENT()can be used to extract the list elements, e.g. the following command will extract the second list element:$LOGINS=F$ELEMENT(1,",",MIMER_STATUS)
Win: On Windows, the string returned from
mimcontrol -bcan be piped and processed as required, depending on the script language being used.
Status String Components
The status string has the following components:server-state,logins,db-directory,connections,server-pid,start-date,bpool-size
Each component is described below:
The server-state value shows the state of the database server. The value is one of: stopped, starting, running, stopping or crashing. The logins value is either: enabled, if new logins are permitted, or disabled, if the server has been ordered to reject new logins. The db-directory field shows the home directory for the database. The connections field shows the number of clients connected to the server. The server-pid field gives the process id of the database server process. The start-date field gives the date and time when the database server was started. The size of the buffer pool (in bytes).
Note: If the database server is not operational, the status string will contain empty fields.
The parameter options can be combined in the following ways, examples are given in both VMS-style and Unix-style:MIMCONTROL/START/DISABLE db_server_name mimcontrol -sd db_server_name mimcontrol --start --disable db_server_nameMIMCONTROL/START/STATUS db_server_name mimcontrol -sc db_server_name mimcontrol -start --status db_server_nameMIMCONTROL/DISABLE/WAIT=180 db_server_name mimcontrol -dw 180 db_server_name mimcontrol --disable --wait=180 db_server_name
The exit code from the
MIMCONTROLcommand is success if all users logged out within the three minute timeout period.
If the timeout period expires and there are still users logged in on the system, the
MIMCONTROLcommand will exit with a warning status code.MIMCONTROL/WAIT/STOP db_server_name mimcontrol -wt db_server_name mimcontrol --wait --stop db_server_name
When all users are logged out, the system will be stopped. If the wait timeout period expires, the
MIMCONTROLcommand will exit with a warning status code without stopping the system.
- The following command is similar to the previous one, but will ensure that no new users log in to the system while waiting for all users to log out:MIMCONTROL/DISABLE/WAIT/STOP db_server_name mimcontrol -dwt db_server_name mimcontrol --disable --wait --stop db_server_name
MIMCONTROLreturns a status code to the environment executing the command. The status code can be examined by scripts.
VMS: On OpenVMS, the status codes correspond to the OpenVMS condition code severity levels.Use the
$SEVERITYsymbol in DCL command procedures.
The following return codes are used:
This code is used when the
MIMCONTROLcommand has executed all options with no problems.
The warning code is used when there was a timeout in one of the options. The complete sequence of options may not have been executed.
> 1 (error)
The error code is used when the specified command could not be executed at all. For instance, if there was an illegal combination of options, or if the specified database name was not found.If an error status code is returned, an informational error message will also be produced.
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40