Database Management via Shdbinst.exe
The Shdbinst.exe console utility is used to work with the database, with which you can perform the following operations:
- creating a new database
- restoring a database from an archived copy
- updating the current database.
Shdbinst.exe Parameters
To get a list of supported parameters, you need to run Shdbinst.exe from the command line (cmd.exe) without specifying parameters.
The path to the utility: C:\UCS\StoreHouse_5\Shdbinst.exe
Launch examples
Creating a new database:
Shdbinst.exe /sSDBSERV /fC:\UCS\StoreHouse_5\Database\SH5DB /i22 /tC:\UCS\StoreHouse_5\Database\SH5DBLog /aAdmin /d"New db" /uAdmin /lC:\UCS\StoreHouse_5\Server\shcrtdb64.dll
Recovering the database:
Shdbinst.exe /sSDBSERV /fC:\UCS\StoreHouse_5\Database\SH5DB /i22 /tC:\UCS\StoreHouse_5\Database\SH5DBLog /aAdmin /d"Restore db" /uAdmin /bC:\UCS\StoreHouse_5\Backup\backup.bkp
Updating the database:
Shdbinst.exe /sSDBSERV /fC:\UCS\StoreHouse_5\Database\SH5DB /i22 /tC:\UCS\StoreHouse_5\Database\SH5DBLog /aAdmin /d"Update db" /uAdmin /bC:\UCS\StoreHouse_5\Backup\backup.bkp /lc:\UCS\StoreHouse_5\Server\shcrtdb64.dll
or
Shdbinst.exe /s127.0.0.1 /fC:\UCS\StoreHouse_5\Database\SH5DB /i1024 /tC:\UCS\StoreHouse_5\Database\SH5DBLog /aAdmin /d"Update db" /uAdmin /lc:\UCS\StoreHouse_5\Server\shcrtdb64.dll
Supported parameters
- /s<Server_name> — the name of the SH5 server for connection
- /f<DB_File_Name> — the name of the DB file, which should include the full path to the file
- /i<DB_Size> — the size of the created database, MB
- /t<Transactions_Log_Name> — the name of the transaction log file, which should include the full path to the file
- /z<Transactions_Log_Size> — the size of the transaction log to be created, MB, 10Mb by default
- /a<Admin_Name> — the name of the DB administrator
- /p<Admin_Password> — DB administrator's password, empty by default
- /d<DB_Description> — DB description, empty by default
- /b<Backup_Copy_File_name> — the name of the backup file when restoring or updating the database, may include the full path to the file
- /l<Control_Library)path> — the path to the shcrtdb64.dll library, is used for creating or updating a database
- /u<User_name> — user name, when the database is loaded
- /v<User_password> — user password, when the database is loaded
Error codes
- 0 Ok
- 1 Invalid parameter
- 2 Parameter not found
- 3 Error initializing domm.dll
- 4 Error initializing sdbcli.dll
- 5 Error executing procedure domm.dll
- 6 Error executing procedure sdbcli.dll
- 7 Unknown error
- 8 Operation aborted by user
Starting the server
To start the server, run Sdba and Sdbserv via the command line.
Launching Sdba Service
- Service name: Sdba or Sdba64
- Display name: Sdbserv assistent or Sdbsrv64 assistent
- Command line: <full_path> + /s parameter.
Example of the command: C:\UCS\StoreHouse_5\Shdbinst>C:\UCS\StoreHouse_5\Server\Sdba64.exe /s
Launching Sdbserv Service
- ServiceName and DisplayName: Sdbserv: + <server_instance_name> or Sdbsrv64: + <server_instance_name>
- Command line: full_path + /s parameter + /n parameter + <server_instance_name>
Example: C:\UCS\StoreHouse_5\Shdbinst>c:\UCS\StoreHouse_5\Server\SdbSrv64.exe /s /nSDBSERV
You can check whether the services have started or not in the processes, in the task manager
Registry Settings
Server Parameters
General Server Parameters
The server parameters are located in HKLM\SOFTWARE\UCS\Sdbserv.2 (root branch).
If the instance name is not specified when starting the server (the /n parameter), the HKLM\SOFTWARE\UCS\Sdbserv branch is used.2\SDBSERV
Parameters available in the root branch HKLM\SOFTWARE\UCS\Sdbserv.2:
- Autorun (string) is a list of server instances separated by semicolumn for autostart at Windows launch (but not by services)
- RootDir (string) is the directory from which the server and its utilities are started
Server Instance Parameters
The parameters of a specific server instance are stored in the HKLM\SOFTWARE\UCS\Sdbserv.2\<Server_instance_name> branch
Parameters available in the server instance branch:
General Server Parameters
- params (DWORD) - bitmask of the following parameters:
- AutoRepair=1 — to automatically restore the database from the transaction log
- DisableAutoValidation=2 — to prohibit checking the data file when loading while the transaction log recording is broken
- OpenDbReadOnly=4 — the database file is opened only for reading (read only)
- PriorityHigh=8 — to run with high priority
- PriorityIdle=16 — to run with low priority
- ShowInitErrors=64 — initialization errors will be displayed on the screen (ignored for the service)
- SafeMode=128 — only the database file will be loaded without application libraries
If the AutoRepair flag is not set and an incomplete transaction is detected, then
- the service will be stopped
- non-service will be stopped if the ShowInitErrors flag is not set
- otherwise, a dialog box will be displayed on the screen
Logging Parameters
- lgprms (DWORD) - bitmask of the following parameters (optional parameter):
- Logins=1
- ChannelEvts=2
Other Parameters
descr (string) — description of the server role, for information (optional parameter)
- dbfile (string) — the full path to the DB file
- dblog (string) — the full path to the database transaction log
- minwss (DWORD) — the size of the minimum working set of the server process (see the Microsoft documentation) in kilobytes, (optional parameter, it is strongly recommended not to set the parameter if not necessary)
- maxwss (DWORD) — the size of the maximum working set of the server process (see the Microsoft documentation) in kilobytes, (optional parameter, it is strongly recommended not to set the parameter if not necessary)
- maxch (DWORD) — the maximum size of the reserved cache in bytes (optional parameter, it is recommended to use the default value)
- incch (DWORD) — the minimum memory size in bytes to increase the cache size in case of exhaustion of previously assigned memory (optional parameter, it is recommended to use the default value)
- logfile (string) — the full path to the server log file (may be empty)
- libpath (string) — the path to the directory with the user's libraries
- bkppath (string) — the path to the database backup storage directory
bkpprms (DWORD) — automatic backup options; contain the structure
struct { BYTE Type; // Copy type (0—disable automatic backup; 1—enable) BYTE Period; // Frequency in days minus 1 [1, 256] WORD Time; // Time in minutes [00:00, 23: 59] }
- monitor (string) — the full path to the monitor library
- threads (DWORD) — the maximum number of threads for data processing (optional parameter, at the moment if the parameter is defined, its value must strictly be equal to one)
- stack (DWORD) — the stack size used when creating the stream (optional parameter, by default, 1 MB)
- tam (string) — prefix of ThreadAffinityMask (tam0, tam1,...) (optional parameter)
- tip (string) — prefix of ThreadIdealProcessor (tip0, tip1,...) (optional parameter)
- nplist (DWORD) — protocol bitmask (optional parameter, 1—local, 2—tcp/ip; both by default)
- np1p (string) — tcp/ip port
- np1to (string) — tcp/ip timeout
Client Parameters
The client parameters are stored in the root branch HKLM\SOFTWARE\WOW6432Node\UCS\Sh.5 (x64) or HKLM\SOFTWARE\WOW6432Node\UCS\Sh.5 (x86):
- dmalib (string) — full path to shadm.bpl (obligatory parameter)
- dmlgnt (DWORD) — login type (optional parameter, default is 0)
It can take values: - 0 — to display the login dialog with the choice of the authentication type
- 1 — to display the login dialog only with the type of authentication via the server
- 2 — to display the login dialog only with the Windows authentication type
- 3 — if only one server is registered in the list of servers, authentication is performed via Windows, an error message is displayed if an error occurs; if the number of servers is not equal to 1, the dialog is as with the login type 0
- 4 — if only one server is registered in the list of servers, authentication is performed via Windows, if an error occurs, a login dialog is displayed with the choice of the authentication type; if the number of servers is not equal to 1, the dialog is as with the login type 0
- dmsrvs (string) — list of servers
- dmsrva (string) — list of server aliases
- dmusrm (DWORD) — max. stored number of users (optional parameter, by default 5)
- dmsrvm (DWORD) — max. stored number of additional servers entered manually (optional parameter, default is 5)
- dmopts (DWORD) — bitmask of the following parameters (optional parameter, 0 by default)
- dmRegOptionsEnableExServers=1 — allow manual input of servers.