Skip to content

2. Data Types#

This chapter discusses data types that can be used with Altibase Monitoring API.

Data Structures#

This section describes the data structures used as arguments when calling functions of the Monitoring API.

ABIVSession#

This data structure stores the results of SELECT operations on the V$SESSION performance view.

This data structure has the following members. For more detailed information about each column, please refer to the V$SESSION performance view in the General Reference.

Member Type Corresponding Column in V$SESSION
mID int ID
mTransID long long TRANS_ID
mTaskState[11+1] char TASK_STATE
mCommName[64+1] char COMM_NAME
mXASessionFlag int XA_SESSION_FLAG
mXAAssociateFlag int XA_ASSOCIATE_FLAG
mQueryTimeLimit int QUERY_TIME_LIMIT
mDdlTimeLimit int DDL_TIME_LIMIT
mFetchTimeLimit int FETCH_TIME_LIMIT
mUTransTimeLimit int UTRANS_TIME_LIMIT
mIdleTimeLimit int IDLE_TIME_LIMIT
mIdleStartTime int IDLE_START_TIME
mActiveFlag int ACTIVE_FLAG
mOpenedStmtCount int OPENED_STMT_COUNT
mClientPackageVersion[40+1] char CLIENT_PACKAGE_VERSION
mClientProtocolVersion[40+1] char CLIENT_PROTOCOL_VERSION
mClientPID long long CLIENT_PID
mClientType[40+1] char CLIENT_TYPE
mClientAppInfo[128+1] char CLIENT_APP_INFO
mClientNls[40+1] char CLIENT_NLS
mDBUserName[40+1] char DB_USERNAME
mDBUserID int DB_USERID
mDefaultTbsID long long DEFAULT_TBSID
mDefaultTempTbsID long long DEFAULT_TEMP_TBSID
mSysDbaFlag int SYSDBA_FLAG
mAutoCommitFlag int AUTOCOMMIT_FLAG
mSessionState[13+1] char SESSION_STATE
mIsolationLevel int ISOLATION_LEVEL
mReplicationMode int REPLICATION_MODE
mTransactionMode int TRANSACTION_MODE
mCommitWriteWaitMode int COMMIT_WRITE_WAIT_MODE
mOptimizerMode int OPTIMIZER_MODE
mHeaderDisplayMode int HEADER_DISPLAY_MODE
mCurrentStmtID int CURRENT_STMT_ID
mStackSize int STACK_SIZE
mDefaultDateFormat[64+1] char DEFAULT_DATE_FORMAT
mTrxUpdateMaxLogSize long long TRX_UPDATE_MAX_LOGSIZE
mParallelDmlMode int PARALLEL_DML_MODE
mLoginTime int LOGIN_TIME
mFailOverSource[64+1] char FAILOVER_SOURCE

ABIVSysstat#

This data structure stores the results of SELECT operations on the V$SYSSTAT performance view. This performance view displays statistics about the entire database system.

This data structure has the following members. For more detailed information about each column, please refer to the V$SYSSTAT performance view in the General Reference.

Member Type Corresponding Column in V$SYSSTAT
mValue long long VALUE

ABIVSesstat#

This data structure stores the results of SELECT operations on the V$SESSTAT performance view. This performance view displays statistics about each session.

This data structure has the following members. For more detailed information about each column, please refer to the V$SESSTAT performance view in the General Reference.

Member Type Corresponding Column in V$SYSSTAT
mSID int SID
mValue long long VALUE

ABIStatName#

This data structure stores the results of SELECT operations on the fixed columns of the V$SYSSTAT or V$SESSTAT performance view.

This data structure has the following members. For more detailed information about each column, please refer to the V$SYSSTAT and V​$SESSTAT performance views in the General Reference.

Member Type Corresponding Column in V$SYSSTAT or V$SESSTAT
mSeqNum int SEQNUM
mName[128+1] char NAME

ABIVSystemEvent#

This data structure stores the results of SELECT operations on the V$SYSTEM_EVENT performance view.

This data structure has the following members. For more detailed information about each column, please refer to the V$SYSTEM_EVENT performance view in the General Reference.

Member Type Corresponding Column in V$SYSTEM_EVENT
mTotalWaits long long TOTAL_WAITS
mTotalTimeOuts long long TOTAL_TIMEOUTS
mTimeWaited long long TIME_WAITED
mAverageWait long long AVERAGE_WAIT
mTimeWaitedMicro long long TIME_WAITED_MICRO

ABIVSessionEvent#

This data structure stores the results of SELECT operations on the V$SESSION_EVENT performance view.

This data structure has the following members. For more detailed information about each column, please refer to the V$SESSION _EVENT performance view in the General Reference..

Member Type Corresponding Column in V$SESSION_EVENT
mSID int SID
mTotalWaits long long TOTAL_WAITS
mTotalTimeOuts long long TOTAL_TIMEOUTS
mTimeWaited long long TIME_WAITED
mAverageWait long long AVERAGE_WAIT
mMaxWait long long MAX_WAIT
mTimeWaitedMicro long long TIME_WAITED_MICRO

ABIEventName#

This data structure stores the results of SELECT operations on the fixed columns of the V$SYSTEM_EVENT or V$SESSION_EVENT performance view.

This data structure has the following members. For more detailed information about each column, please refer to the V$SYSTEM_EVENT and V​$SESSION_EVENT performance views in the General Reference.

Member Type Corresponding Column in V$SYSTEM_EVENT or V$SESSION_EVENT
mEventID int EVENT_ID
mEvent[128+1] char EVENT
mWaitClassID int WAIT_CLASS_ID
mWaitClass[128+1] char WAIT_CLASS

ABIVSessionWait#

This data structure stores the results of SELECT operations on the V$SESSION_WAIT performance view.

This data structure has the following members. For more detailed information about each column, please refer to the V$SESSION_WAIT performance view in the General Reference.

Member Type Corresponding Column in V$SESSION_WAIT
mSID int SID
mSeqNum int SEQNUM
mP1 long long P1
mP2 long long P2
mP3 long long P3
mWaitClassID int WAIT_CLASS_ID
mWaitTime long long WAIT_TIME
mSecondInTime long long SECOND_IN_TIME

ABISqlText#

This is a data structure used for viewing SQL statement text, the start time of a query and checking whether or not to execute a query.

This data structure has the following members shown in the table below.

Member Type Description
mSessID int Session ID
mStmtID int Statement ID
mSqlText char * Text of the SQL statement
mTextLength int Length of the string stored in mSqlText
mQueryStartTime int The start time of query
mExecuteFlag int Whether or not to execute a query 0: Executable 1: Non-executable
mParseTime long Parsing Time
mSoftPrepareTime long Plan search time in SQL Plan Cache during prepare
mLastQueryStartTime int Most recent query start time
mExecuteTime long Execution running time
mFetchTime long Fetch Time
mFetchStartTime int Current Fetch Start Time
mTotalTime long Total elapsed time
mValidateTime long Justification time
mOptimizeTime long Optimization turnaround time

ABILockPair#

This data structure retrieves a session holding on to a lock and the session waiting to acquire that lock.

This data structure has the following members.

Member Type Description
mHolderSID int ID of the session holding on to the lock
mWaiterSID int ID of the session that is waiting for another session (mHolderSID) to let go of the lock
mLockDesc[32+1] char Mode of the lock that the session (mWaiterSID) is waiting to obtain

ABIDBInfo#

This data structure retrieves database names and database version numbers.

This data structure has the following members.

Member Type Description
mDBName[128+1] char Name of database
mDBVersion[128+1] char Version number of database

ABIReadCount#

This data structure retrieves the number of data pages that were read from the Altibase server.

This data structure has the following members.

Member Type Description
mLogicalReadCount int Number of data pages that were read in the memory buffer
mPhysicalReadCount int Number of data pages that were read on disk

ABIRepGap#

This data structure queries the difference between the work log record of the replication sender and the most recently created log record that occurs on the Altibase server.

This data structure has the following members.

Member Type Description
mRepName[40+1] char Name of the replication object
mRepGap long long The difference between the number of the last log record sent (REP_LAST_SN) and the log record currently being sent (REP_SN)

ABIRepSentLogCount#

This data structure inquires the number of logs sent by the replication sender in the Altibase server.

This data structure has the following members.

Member Type Description
mRepName[40+1] char Name of the replication object
mTableName[128+1] char Name of the table object
mInsertLogCount int Number of Insert logs
mDeleteLogCount int Number of delete logs
mUpdateLogCount int Number of update logs


Enumeration Types#

The following enumeration types can be used with Altibase Monitoring API applications.

enum ABIPropType#

This enumeration type is used with the ABISetProperty function to specify the user name and user password for connecting to an Altibase server.

This enumeration type has the following elements.

Element Description
ABI_USER Used to specify the user name
ABI_PASSWD Used to specify the user password
ABI_LOGFILE Used to specify the file that stores the error messages that occur in Altibase Monitoring API


Considerations#

Almost all Altibase Monitoring API functions take the above data structures as arguments. This section discusses what you should consider when taking these data structures as arguments.

In an application, you need to declare a pointer variable to a data structure and pass this pointer's address value (a double pointer) to an Altibase Monitoring API function. The function allocates memory on heap to the pointer and sets it to the record fetched from the database, and then returns the result set to the application.

Because Altibase Monitoring API functions manage memory for data structures used with Altibase Monitoring API, the application should not directly allocate memory to a pointer in the data structure or deallocate memory returned as the result of a function.

As shown in the following sample code, a pointer in an ABIVSession data structure should be only declared and memory should not be allocated to sVSession. Moreover, if a result value is referenced from sVSession after a function has been executed, only as many array elements as the number of rows in the result set can be accessed.

ABIVSession *sVSession;
int sRowCount;

sRowCount = ABIGetVSession(  &sVSession, 0 );

/*  reference the results selected from sVSession */
for (int i=0; i<sRowCount; i++)
{
    /* sVSession[i].mID; */
    /* sVSession[i].mTransID; */
}