SMA and LLA Guide : Creating and running LLA applications : Starting and shutting down LLA server : Explicit startup with SSC API function SSCStartServer
  
Explicit startup with SSC API function SSCStartServer
To start solidDB® explicitly, have the user application call the solidDB® Server Control API function SSCStartServer().
SSCStartServer (int argc, char* argv [ ],
SscServerT* h, SscStateT runflags)
where the parameters are:
Parameter
Description
argc
The number of command-line arguments.
argv
Array of command-line arguments that are used during the function call. The argument argv[0] is reserved for the path and filename of the user application only and must be present. For valid options, see SSCStartServer options below.
h
Each server has a “handle” (a pointer to a data structure) that identifies that server and indicates where information about that server is stored. This handle is required when referencing the server with other Control API functions. The handle of the server is provided to you when you call the SSCStartServer function.
To get the handle of the server, you create a variable that is of type pointer-to-server-handle. You create an SSCServerT *, which is a pointer to a handle (essentially a pointer to a pointer) and you pass that when you call SSCStartServer. If the server is created successfully, the SSCStartServer function writes the handle (pointer) of the new server into the variable whose address you passed.
runflags
The value for this parameter is a combination of 2 flags: the open flag and the netcopy disabling flag. The following flag symbols can be used:
SSC_STATE_OPEN – the open flag is set to 1: new connections are allowed.
SSC_STATE_CLOSED – the open flag is set to 0: all new network and LLA connections are rejected, except for connections from solidDB® Remote Control (solcon) program.
SSC_DISABLE_NETCOPY – the netcopy disabling flag is set to 1: in HotStandby configuration, no netcopy can be received by the server for which the SSC_DISABLE_NETCOPY is set.
The flag does not prevent the server to act as a source of netcopy. If only SSC_DISABLE_NETCOPY flag is set, the server is in the closed state. To enable netcopy, use the SSC API function SSCSetState() with the runflag value SSC_STATE_OPEN or SSC_STATE_CLOSED.
runflags = SSC_STATE_OPEN | SSC_STATE_CLOSED | SSC_DISABLE_NETCOPY
Tip: The flags can be used in combinations, for example:
...
rc = SSCStartServer(g_argc, g_argv, &hh, SSC_STATE_OPEN|SSC_DISABLE_NETCOPY);
...
If the server is started as closed, it can be opened with ADMIN COMMAND 'open', or with the solcon command open. The same effect can be achieved with the SSC API function SSCSetState().
Starting LLA server without an existing database
When you start the server for the first time, solidDB® creates a database only if you have specified the database administrator username, password, and a name for the default database catalog.
For example:
SscServerT h; char* argv[4];
argv[0] = "appname"; /* path and filename of the user app. */
argv[1] = "-UDBA"; /* user name */
argv[2] = "-PDBA"; /* user's password */
argv[3] = "-CDBA"; /* catalog name */
/* Start the server */
rc = SSCStartServer(argc, argv, &h, run_flags);
If you start the server without an existing database and do not specify a database catalog name, solidDB® returns an error that the database is not found.
By default, the database is created as one file (with the default name solid.db or the name you specified in the solid.ini file) in the solidDB® working directory. An empty database containing only the system tables and views uses approximately 850 KB of disk space. The time it takes to create the database depends on the hardware platform you are using.
After the database has been created, solidDB® starts listening to the network for remote client connection requests.
Starting LLA server with an existing database
If you already have an existing database, you do not need to specify the username and password, or the catalog name in the SSCStartServer function call.
See also
Starting and shutting down LLA server