Distributed Tuning Interface Guide
The following topics introduce the Zen Distributed Tuning Interface:
You can also go directly to
Distributed Tuning Interface Reference for detailed information on the use of DTI in Zen.
Overview of Distributed Tuning Interface
The purpose of Distributed Tuning Interface (DTI) is to provide an application programming interface for configuration, monitoring, and diagnostics of Zen components.
Note: For brevity, throughout the rest of this manual Distributed Tuning Interface is referred to by as DTI.
String Arguments Encoding
A user application uses the client’s OS encoding at the API level. DTI handles internally the differences between OS encodings on the server and client.
If an older client is communicating with the server, the database engine assumes that the client is using an encoding compatible with those available on the server.
API Categories
The categories of available APIs are summarized in
DTI Function Groups.
Execution Privileges
Generally, you want your DTI application to be able to call any of the DTI functions and view or modify all configuration settings. To ensure this full access, connect to the server by providing a name and password of a user with administrative level privileges on the server machine. This applies if the DTI application is running locally through a Terminal Services session or running remotely. An application running locally can omit the user name and password and still be able call any of the DTI functions and view or modify all configuration settings. See
Making a Connection to a Server Using DTI.
Without administrator level privileges, an application running locally through a Terminal Services session or running remotely returns an access error for most of the DTI functions. Only a subset of the functions work. For example, many of the functions that can modify configuration settings when full access is permitted are restricted to read-only access.
Basics Of Using DTI
Header Files
The DTI functions are defined in the following header files:
• btitypes.h
• catalog.h
• config.h
• connect.h
• ddf.h
• dticonst.h
• dtilicense.h
• dtisecurity.h
• monitor.h
Link Libraries
The following table lists the link libraries for DTI and the release version in which the library was first available on Windows, Linux, and macOS. Link your application to the appropriate library as defined in the table.
The functions for the DTI are documented in
Distributed Tuning Interface Reference.
Before Calling Any Functions
When you want to invoke DTI, you must first call the
PvStart() function. Then you can call multiple DTI functions before ending the session.
When ending a session, you must call
PvStop() to close the session.
Sample Programs For DTI
By default, the runtime files for the DTI access method are installed with the Zen database engine and with Zen Client. At a minimum, you need Zen Client to create a DTI application.
The header files and sample files are available by online download. Sample files pertaining to a particular development environment are installed in separate directories, as shown in the following table.
For additional information, see the DTI release notes (readme_dti.htm) installed with the Zen database engine.
Common Tasks With DTI
This topic outlines key tasks that are often used with DTI.
Making a Connection to a Server Using DTI
This documents the procedure for obtaining a connection handle to a server, which is a first step for many DTI functions.
To obtain a Connection handle to a server
1. Start a DTI session
// initialize status code return
BTI_LONG status = 0;
// Call PvStart function with its reserved
// parameter
status = PvStart(0);
2. Connect to a server
// initialize variables
BTI_LONG status = 0;
BTI_CHAR_PTR uName = "jsmith";
BTI_CHAR_PTR pword = "123";
BTI_CHAR_PTR svrName = "myserver";
BTI_LONG hConn = 0xFFFFFFFF;
// after execution, hConn contains connection
// handle to pass to other functions
status = PvConnectServer(svrName, uName, pword, &hConn);
// if status != 0, handle errors now
Connection handles are required by many DTI functions. You can have multiple connections open at a time. For each connection or handle, however, you should call the PvDisconnect() function to release the handle.
status = PvDisconnect(phConn);
Obtaining a Setting ID Using DTI
Many of the configuration functions take a setting ID as a parameter. This procedure describes the prerequisite functions for obtaining a setting ID.
To obtain the ID for a Specific Setting
4. Scan for the setting that you want.
7. End the DTI session by calling
PvStop().
Passing a DTI Structure as a Parameter
Many functions require that you pass a DTI structure when making the functional call. The following code segment shows an example of a function call including a structure. See
DTI Structures for more information about DTI structures.
WORD rValue = P_OK;
WORD tableCount;
rValue = PvGetTableNames(m_DictHandle, &tableList, &tableCount);