Provides information for initializing a vendor device and for establishing a logical link between DB2® and the vendor device.
None
Database
sqluvend.h
int sqluvint ( struct Init_input *in,
struct Init_output *out,
struct Return_code *return_code);
For each media I/O session, DB2 will call this API to obtain a device handle. If for any reason, the vendor storage API encounters an error during initialization, it will indicate it via a return code. If the return code indicates an error, DB2 may choose to terminate the operation by calling the sqluvend API. Details on possible return codes, and the DB2 reaction to each of these, is contained in the return codes table (see table below).
DB2 names the backup being written or the restore to be read via fields in the DB2_info structure. In the case of an action = SQLUV_READ, the vendor product must check for the existence of the named object. If it cannot be found, the return code should be set to SQLUV_OBJ_NOT_FOUND so that DB2 will take the appropriate action.
After initialization is completed successfully, DB2 will continue by calling other data transfer APIs, but may terminate the session at any time with an sqluvend call.
Literal in Header File | Description | Probable Next Call | Other Comments |
---|---|---|---|
SQLUV_OK | Operation successful. | sqluvput, sqluvget (see comments) | If action = SQLUV_WRITE, the next call will be to the sqluvput API (to BACKUP data). If action = SQLUV_READ, verify the existence of the named object prior to returning SQLUV_OK; the next call will be to the sqluvget API to restore data. |
SQLUV_LINK_EXIST | Session activated previously. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_COMM_ERROR | Communication error with device. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_INV_VERSION | The DB2 and vendor products are incompatible | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_INV_ACTION | Invalid action is requested. This could also be used to indicate that the combination of parameters results in an operation which is not possible. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_NO_DEV_AVAIL | No device is available for use at the moment. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_OBJ_NOT_FOUND | Object specified cannot be found. This should be used when the action on the sqluvint call is "R" (read) and the requested object cannot be found based on the criteria specified in the DB2_info structure. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_OBJS_FOUND | More than 1 object matches the specified criteria. This will result when the action on the sqluvint call is "R" (read) and more than one object matches the criteria in the DB2_info structure. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_INV_USERID | Invalid userid specified. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_INV_PASSWORD | Invalid password provided. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_INV_OPTIONS | Invalid options encountered in the vendor options field. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_INIT_FAILED | Initialization failed and the session is to be terminated. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_DEV_ERROR | Device error. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_MAX_LINK_GRANT | Max number of links established. | sqluvput, sqluvget (see comments). | This is treated as a warning by DB2. The warning tells DB2 not to open additional sessions with the vendor product, because the maximum number of sessions it can support has been reached (note: this could be due to device availability). If action = SQLUV_WRITE (BACKUP), the next call will be to sqluvput API. If action = SQLUV_READ, verify the existence of the named object prior to returning SQLUV_MAX_LINK_ GRANT; the next call will be to the sqluvget API to restore data. |
SQLUV_IO_ERROR | I/O error. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |
SQLUV_NOT_ENOUGH_SPACE | There is not enough space to store the entire backup image; the size estimate is provided as a 64-bit value in bytes. | No further calls. | Session initialization fails. Free up memory allocated for this session and terminate. A sqluvend API call will not be received, since the session was never established. |