Distributed Tuning Interface Reference : PvGetDbServerName()
 
PvGetDbServerName()
Retrieves the name of the server where the named database resides.
Header File: catalog.h (See also Header Files)
Function First Available In Library: w3dbav75.dll (Windows), libpsqldti.so (Linux), libpsqldti.dylib (macOS) (See also Link Libraries)
Syntax
BTI_API PvGetDbServerName(
   BTI_LONG           hConnection,
   BTI_CHAR_PTR       dbName,
   BTI_ULONG_PTR      pBufSize,
   BTI_CHAR_PTR       serverName,
   BTI_SINT_PTR       pIsLocal);
Arguments
 
In
hConnection
Connection handle that identifies the server. Connection handles are obtained with the PvConnectServer() function.
In
dbName
Name of the database. A list of all database names for a particular server is obtained with the PvGetDbNamesData() function. A single database name from the resulting list can be obtained with the PvGetDbName() function.
In/Out
pBufSize
Address of an unsigned long containing the size of the buffer. Actual size of server name is returned.
Out
serverName
Contains server name if successful, empty string otherwise.
Out
pIsLocal
Returns zero for remote server, non-zero for local server.
Return Values
 
P_OK
The operation was successful.
P_E_INVALID_HANDLE
Invalid connection handle.
P_E_NULL_PTR
Call with NULL pointer
P_E_BUFFER_TOO_SMALL
The buffer is too small for the string. In this case, the required buffer size is returned in pBufSize.
P_E_NOT_EXIST
Named database does not exist.
P_E_FAIL
Failed for other reasons.
Remarks
The following preconditions must be met:
DTI session started by calling PvStart().
Connection established by PvConnectServer()or if you are performing the operation on a local machine, P_LOCAL_DB_CONNECTION may be used as the connection handle.
See Also
PvStart()
PvConnectServer()
PvGetDbNamesData()
PvGetDbName()
PvDisconnect()
PvStop()