Initiates the definition of a recording session on Historical Server.
This function is applicable only if the connection mode is SMC_SERVER_M_HISTORICAL.
SMC_RETURN_CODE smc_create_recording_session (SMC_CONNECT_ID clientId, SMC_CHARP SMSName, SMC_INT sampleInterval, SMC_CHARP directoryName, SMC_CHARP startTime, SMC_CHARP endTime, SMC_HS_SESS_PROT_LEVEL protectionLevel, SMC_HS_SESS_ERR_OPT errOption, SMC_HS_SESS_SCRIPT_OPT scriptOption, SMC_SESSION_IDP sessionIdHandle)
identifies the connection.
null-terminated string containing the name of the Monitor Server.
the number of seconds to wait between consecutive samplings of data.
null-terminated string containing the full path name to the directory containing the data and error files created by Historical Server during execution of this recording session.
The directory must be writable on the system on which Historical Server is running. This might not be the same system that is running the client application that invoked the function call.
null-terminated string containing the time to start recording, using the format:
yyyy/mm/dd hh:mm[:ss] [time zone]
The default is to start immediately.
null-terminated string containing the time at which to stop the recording, using the format:
yy/mm/dd hh:mm[:ss] [time zone]
The default is to stop 24 hours after startTime.
protection level of the data recorded. Valid values are:
SMC_HS_SESS_PROT_PUBLIC
SMC_HS_SESS_PROT_PRIVATE
indicate what Historical Server must do when encountering a non-fatal error. The choices are:
SMC_HS_SESS_ERR_CONT – continue the session.
SMC_HS_SESS_ERR_HALT – stop the session.
indicate whether Historical Server must create a script that creates tables for loading results (from this recording session) into Adaptive Server. The choices are:
SMC_HS_SESS_SCRIPT_NONE – no script.
SMC_HS_SESS_SCRIPT_SYBASE – Sybase script.
pointer to a variable, which should be declared as type SMC_SESSION_ID. If the call to smc_create_recording_session succeeds, this variable contains the ID for the recording session.
Return value |
Indicates |
---|---|
SMC_RET_SUCCESS |
Function succeeded. |
SMC_RET_FAILURE |
Function failed. |
SMC_RET_INVALID_CONNECT |
Connection does not exist. |
This example assumes that you have created a connection to Historical Server and have a clientId.
SMC_SESSION_ID sessionId; SMC_SESSION_IDP sessionIdHandle = &sessionId;
if (smc_create_recording_session(clientId, "myMonitorServer", 60, /* sample interval (seconds) */ "/usr/hist_serv_home_dir", "95/07/22 15:00", /* start time */ "95/07/23 15:30", /* end time */ SMC_HS_SESS_PROT_PUBLIC, SMC_HS_SESS_ERR_CONT, SMC_HS_SESS_SCRIPT_SYBASE, sessionIdHandle) != SMC_RET_SUCCESS) { printf("smc_create_recording_session failed\n"); /* do some cleanup */ }
In a Historical Server connection, recording sessions and playback sessions are mutually exclusive. An application that connects to Historical Server and creates a playback session must end the playback session using the function smc_terminate_playback before creating a recording session.
Refer to the Adaptive Server Enterprise Monitor Historical Server User’s Guide for more information on the hs_create_recording_session command.
Mode |
Availability |
---|---|
SMC_SERVER_M_LIVE |
No |
SMC_SERVER_M_HISTORICAL |
Yes |
Error |
Indicates |
---|---|
SMC_RET_INTERNAL_ERROR |
Internal error |
SMC_RET_INVALID_SVR_MODE |
Invalid server mode |
smc_initiate_recording