Intro(3dba)


Intro -- EELS Database access API

Synopsis

#include <eelsdba.h>

Description

The Database Access API is used by Enhanced Event Logging System (EELS) log analysis applications to query the log database. This API provides a database-independent means of accessing the log database. If the underlying database changes, the log analysis applications do not have to be re-written. If a database is substituted for the reference database that is supplied, a dynamically loadable library must be provided to be used instead of /usr/lib/libeelsdba.so. This library must substitute all database access routines that are described in this manual page section.

Data structures

The data structures used by the Database Access API are dependent on the underlying database. The database abstraction layer maps the underlying database's data structures onto the structures used by the various Database Access API routines. Because of this no assumptions should be made about the format of the data structures used by the API.

DBRecordHeader_t

The structure DBRecordHeader_t represents the record header format used by the Database Access API routines.
struct EELSTimeInfo_t {
	U64_t		TimeOff;
	U32_t		TimeUncInt;
	U32_t		TimeUncInd;
	EELSBuffer_t	TimeSrc;
	EELSBuffer_t	TimeZone;
	};

struct EELSOrigInfo_t { EELSBuffer_t OrigHostName; EELSBuffer_t OrigServName; EELSBuffer_t OrigLocAddr; EELSBuffer_t OrigServType; EELSBuffer_t OrigPrinName; EELSBufer_t OrigPrinID; };

struct EELSInitInfo_t { EELSBuffer_t InitAuthAuth; EELSBuffer_t InitDomSpecName; EELSBuffer_t InitDomSpecID; };

struct EELSTargInfo_t { EELSBuffer_t TargLocName; EELSBuffer_t TargLocAddr; EELSBuffer_t TargServType; EELSBuffer_t TargAuthAuth; EELSBuffer_t TargPrinname; EELSBuffer_t TargPrinID; };

struct DBRecordheader_t { U64_t UniqEventID; U32_t SeqNum; pid_t ProcID; EELSBuffer_t GroupID; lwpid_t LWPID; EELSBuffer_t LogSysSrc; U32_t Len; U32_t VerID; U32_t EventNum; EELSBuffer_t EventNumStr; U32_t Outcome; EELSBuffer_t PtrToSrcDom; EELSBuffer_t EventSpecInfo; EELSBuffer_t SrcSpecInfo; EELSTimeInfo_t TimeInfo; EELSOrigInfo_t OrigInfo; EELSInitInfo_t InitInfo; EELSTargInfo_t TargInfo; };

DBResult

The structure DBResult represents the result format used for queries made by dbQuery(3dba), dbListDatabases(3dba), and dbListTables(3dba).
typedef struct _DBResult {
	DBConn	      * Conn;
	char          * TBName;
	DBRow         * TBSchema;
	void	      * DBSpec;
	} DBResult;

DBConn

The structure DBConn is used to store the database connection ID which dbConnect(3dba) returns. The connection ID may then be passed to other database access routines to identify the database connection.
typedef struct _DBConn {
	EELSIHandle   * EELSIHandle;
	char	      * DBName;
	char	      * TBName;
	char	      * TBSchema;
	int             DBFlags;
	void	      * DBSpec;
	} DBConn;

DBRow

The structure DBRow is used with dbGetNextRow(3dba) to access the data value at a row and column located within a database.
typedef struct _DBRow {
	short		DBNumColumns;
	DBColumn      * DBColumns;
	} DBRow;

typedef struct _DBColumn { int DBCType; char * DBValue; int DBLength; char * DBName; int DBIndex; } DBColumn;

References

dbAddDbPriv(3dba), dbAddUserPriv(3dba), dbCheckDatabase(3dba), dbCheckTable(3dba), dbClose(3dba), dbCloseConn(3dba), dbConnect(3dba), dbCreateDatabase(3dba), dbCreateTable(3dba), dbDeleteDatabase(3dba), dbDeleteDbPriv(3dba), dbDeleteTable(3dba), dbDeleteUserPriv(3dba), dbFreePriv(3dba), dbFreeResult(3dba), dbFreeRow(3dba), dbGetColumnIndexByName(3dba), dbGetColumnNameByIndex(3dba), dbGetdbPriv(3dba), dbGetMaxUniqEventID(3dba), dbGetUserPriv(3dba), dbGetError(3dba), dbGetNextRow(3dba), dbGetNextRecord(3dba), dbInitialize(3dba), dbListDatabases(3dba), dbListTables(3dba), dbNumberRows(3dba), dbPrivStr(3dba), dbQuery(3dba), dbTrace(3dba), dbUpdateMaxUniqEventID(3dba), dbWriteRecord(3dba)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004