The Vertica ODBC client driver provides an interface for creating client applications with several languages:
To install ODBC, see Installing the ODBC client driver.
This is the multi-page printable view of this section. Click here to print.
The Vertica ODBC client driver provides an interface for creating client applications with several languages:
To install ODBC, see Installing the ODBC client driver.
To install ODBC, follow the instructions according to your platform. For a list of supported platforms, see Client drivers support.
This page covers a non-FIPS installation. To install ODBC on a FIPS-compliant system, see Installing the FIPS client driver for ODBC and vsql.
Installing Vertica from the RPM automatically installs the ODBC client driver, so you do not need to install them again on the machine running Vertica. To use the ODBC client driver in this case, create a DSN.
To install the ODBC client driver manually on other machines:
Log in to the client system as root.
Verify that your system has a supported ODBC driver manager.
Download the ODBC client driver for Linux in the format appropriate for your distribution.
Install or extract the driver:
If you downloaded the .rpm
, install the driver:
--force
flag.
$ rpm -Uvh driver_name.rpm
If you downloaded the .tar
, create the /opt/vertica/
directory if it does not already exist, copy the .tar
to it, navigate to it, and extract the .tar
:
$ mkdir -p /opt/vertica/
$ cp driver_name.tar.gz /opt/vertica/
$ tar vzxf driver_name.tar.gz
This creates two directories:
/opt/vertica/include
: Contains the header file.
/opt/vertica/lib64/
(64-bit) or /opt/vertica/lib/
(32-bit): Contains library files.
Set the following ODBC driver settings in vertica.ini
. For details on each, see ODBC driver settings:
ErrorMessagesPath
: Required, the path of the directory containing the ODBC driver's error message files.
ODBCInstLib
: The path to the ODBC installer library. This is only required if the driver manager's installation library is not in the environment variables LD_LIBRARY_PATH
or LIB_PATH
.
DriverManagerEncoding
: The UTF encoding standard used by the driver manager. This is only required if your driver manager does not use UTF-8.
The following is an example configuration in vertica.ini
:
Use encoding for the 64-bit UNIXODBC driver manager.
Use the error messages defined in the standard Vertica 64-bit ODBC driver installation directory.
Log all warnings and more severe messages to log files in /tmp/
[Driver]
DriverManagerEncoding=UTF-16
ODBCInstLib=/usr/lib64/libodbcinst.so
ErrorMessagesPath=/opt/vertica
LogLevel=4
LogPath=/tmp
To install the ODBC client driver on macOS:
Verify that your system has a compatible driver manager. The driver is designed to be used with the standard iODBC Driver Manager that ships with macOS. You can also use unixODBC.
Download the ODBC client driver.
If you installed a previous version of the ODBC driver, your system might already have a registered driver named "Vertica". You must remove or rename this older version of the driver before installing a new version from the .pkg
installer. Renaming the older version allows you to retain the old version after you install the new one.
Run the installer.
Log into the client macOS in one of two ways:
As an administrator account if you are installing the driver for system-wide use.
As the user who needs to use the Vertica ODBC driver.
Open a terminal.
Install the .pkg
file containing the ODBC driver using the command:
sudo installer -pkg path/to/client/driver/vertica-odbc-xx.x.x-x.pkg -target /
To install the ODBC client driver on Windows:
Download the client driver installer for Windows.
Run the installer.
Open a terminal as an Administrator.
Run the following command to silently install the drivers to C:\Program Files\Vertica Systems
:
VerticaSetup.exe -q -install InstallFolder="C:\Program Files\Vertica Systems"
To upgrade ODBC:
To upgrade or downgrade ODBC:
Upgrade: Newly installed versions of the Vertica ODBC driver for macOS automatically upgrade the relevant driver system settings. Any DSNs associated with a previous version of the driver are not affected, except that they begin using the newer version of the driver.
Downgrade: Run the uninstall script to remove the current version of the Vertica ODBC driver for macOS. Complete this step before installing an older driver version.
Download the Windows client driver installer.
Run the installer and follow the prompts to upgrade the driver. The installer upgrades existing drivers in place.
Reboot your system.
If you installed ODBC with the .rpm
:
$ rpm -e package_name
If you installed ODBC with the .tar
, delete the directory manually.
Uninstalling the macOS ODBC Client-Driver does not remove any existing DSNs associated with the driver.
To uninstall:
Open a terminal window.
Run the command:
sudo /Library/Vertica/ODBC/bin/Uninstall
Open the Add or Remove Programs menu.
EIther uninstall the Vertica Client Installer to remove all client drivers from the system or, to only uninstall ODBC, uninstall the following applications:
Vertica ODBC Driver (32 Bit)
Vertica ODBC Driver (64 Bit)
A Data Source Name (DSN) is the logical name that is used by Open Database Connectivity (ODBC) to refer to the driver and other information that is required to access data from a data source. Whether you are developing your own ODBC client code or you are using a third-party tool that needs to access Vertica using ODBC, you need to configure and test a DSN. The method you use depends upon the client operating system you are using.
Refer to the following sections for information specific to your client operating system.
You define DSN on Linux and other UNIX-like platforms in a text file. Your client's driver manager reads this file to determine how to connect to your Vertica database. The driver manager usually looks for the DSN definitions in two places:
/etc/odbc.ini
~/.odbc.ini
(a file named .odbc.ini
in the user's home directory)
Users must be able to read the odbc.ini
file in order to use it to connect to the database. If you use a global odbc.ini
file, consider creating a UNIX group with read access to the file. Then, add the users who need to use the DSN to this group.
The structure of these files is the same—only their location differs. If both files are present, the ~/.odbc.ini
file usually overrides the system-wide /etc/odbc.ini
file.
The odbc.ini
is a text file that contains two types of lines:
Section definitions, which are text strings enclosed in square brackets.
Parameter definitions, which contain a parameter name, an equals sign (=), and then the parameter's value.
odbc.ini
. If your parameter value is greater than 1000 characters (for example, OAuthAccessToken), you must pass it through a connection string rather than specifying it in odbc.ini
.
The first section of the file is always named [ODBC Data Sources], and contains a list of all the DSNs that the odbc.ini
file defines. The parameters in this section are the names of the DSNs, which appear as section definitions later in the file. The value is a text description of the DSN and has no function. For example, an odbc.ini
file that defines a single DSN named Vertica DSN could have this ODBC Data Sources section:
[ODBC Data Sources]
VerticaDSN = "vmartdb"
Appearing after the ODBC data sources section are sections that define each DSN. The name of a DSN section must match one of the names defined in the ODBC Data Sources section.
To create or edit the DSN definition file:
Using the text editor of your choice, open odbc.ini
or ~/.odbc.ini
.
Create an ODBC Data Sources section and define a parameter:
Whose name is the name of the DSN you want to create
Whose value is a description of the DSN
For example, to create a DSN named VMart, you would enter:
[ODBC Data Sources]
VMart = "VMart database on Vertica"
Create a section whose name matches the DSN name you defined in step 2. In this section, you add parameters that define the DSN's settings. The most commonly-defined parameters are:
Description – Additional information about the data source.
Driver – The location and designation of the Vertica ODBC driver, or the name of a driver defined in the odbcinst.ini
file (see below). For future compatibility, use the name of the symbolic link in the library directory, rather than the library file:
(
/opt/vertica/lib
, on 32-bit clients
/opt/vertica/lib64
, on 64-bit clients
For example, the symbolic link for the 64-bit ODBC driver library is:
/opt/vertica/lib64/libverticaodbc.so
The symbolic link always points to the most up-to-date version of the Vertica client ODBC library. Use this link so that you do not need to update all of your DSNs when you update your client drivers.
Database – The name of the database running on the server. This example uses vmartdb for the vmartdb.
ServerName — The name of the server where Vertica is installed. Use localhost if Vertica is installed on the same machine.
You can provide an IPv4 address, IPv6 address, or host name.
In mixed IPv4/IPv6 networks, the DNS server configuration determines which IP version address is sent first. Use the PreferredAddressFamily
option to force the connection to use either IPv4 or IPv6.
UID — Either the database superuser (same name as database administrator account) or a user that the superuser has created and granted privileges. This example uses the user name dbadmin.
PWD —The password for the specified user name. This example leaves the password field blank.
Port — The port number on which Vertica listens for ODBC connections. For example, 5433.
ConnSettings — Can contain SQL commands separated by a semicolon. These commands can be run immediately after connecting to the server.
SSLKeyFile — The file path and name of the client's private key. This file can reside anywhere on the system.
SSLCertFile —The file path and name of the client's public certificate. This file can reside anywhere on the system.
Locale — The default locale used for the session. By default, the locale for the database is: en_US@collation=binary (English as in the United States of America). Specify the locale as an ICU Locale. See the ICU User Guide (http://userguide.icu-project.org/locale) for a complete list of parameters that can be used to specify a locale.
PreferredAddressFamily:
The IP version to use if the client and server have both IPv4 and IPv6 addresses and you have provided a host name, one of the following:
ipv4
: Connect to the server using IPv4.
ipv6
: Connect to the server using IPv6.
none
: Use the IP address provided by the DNS server.
For example:
[VMart]
Description = Vmart Database
Driver = /opt/vertica/lib64/libverticaodbc.so
Database = vmartdb
Servername = host01
UID = dbadmin
PWD =
Port = 5433
ConnSettings =
AutoCommit = 0
SSLKeyFile = /home/dbadmin/client.key
SSLCertFile = /home/dbadmin/client.crt
Locale = en_US@collation=binary
See ODBC DSN connection properties for a complete list of parameters including Vertica-specific ones.
Instead of giving the path of the ODBC driver library in your DSN definitions, you can use the name of a driver defined in the odbcinst.ini
file. This method is useful method if you have many DSNs and often need to update them to point to new driver libraries. It also allows you to set some additional ODBC parameters, such as the threading model.
Just as in the odbc.ini
file, odbcinst.ini
has sections. Each section defines an ODBC driver that can be referenced in the odbc.ini
files.
In a section, you can define the following parameters:
Description— Additional information about the data source.
Driver— The location and designation of the Vertica ODBC driver, such as
/opt/vertica/lib64/libverticaodbc.so
For example:
[Vertica]
Description = Vertica ODBC Driver
Driver = /opt/vertica/lib64/libverticaodbc.so
Then, in your odbc.ini
file, use the name of the section you created in the odbcinst.ini
file that describes the driver you want to use. For example:
[VMart]
Description = Vertica Vmart database
Driver = Vertica
If you are using the unixODBC driver manager, you should also add an ODBC section to override its standard threading settings. By default, unixODBC serializes all SQL calls through ODBC, which prevents multiple parallel loads. To change this default behavior, add the following to your odbcinst.ini
file:
[ODBC]
Threading = 1
On Linux and UNIX systems, you need to configure some additional driver settings before you can use your DSN. See ODBC driver settings for details.
The unixODBC driver manager includes a utility named isql, which is a simple ODBC command-line client. It lets you to connect to a DSN to send commands and receive results, similarly to vsql.
To use isql to test a DSN connection:
Run the following command:
$ isql –v DSNname
Where DSNname
is the name of the DSN you created.
A connection message and a SQL prompt display. If they do not, you could have a configuration problem or you could be using the wrong user name or password.
Try a simple SQL statement. For example:
SQL> SELECT table_name FROM tables;
The isql tool returns the results of your SQL statement.
To create a DSN for Microsoft Windows clients, you must perform the following tasks:
A Data Source Name (DSN) is the ODBC logical name for the drive and other information the database needs to access data. The name is used by Internet Information Services (IIS) for a connection to an ODBC data source.
This section describes how to use the Vertica ODBC Driver to set up an ODBC DSN. This topic assumes that the driver is already installed, as described in Installing Client Drivers on Windows.
Open the ODBC Administrator. For example, you could navigate to Start > Control Panel > Administrative Tools > Data Sources (ODBC).
Decide if you want all users on your client system to be able to access to the DSN for the Vertica database.
If you want all users to have access, then click the System DSN tab.
Otherwise, click the User DSN tab to create a DSN that is only usable by your Windows user account.
Click Add to create a new DSN to connect to the Vertica database.
Scroll through the list of drivers in the Create a New Data Source dialog box to locate the Vertica driver. Select the driver, and then click Finish.
The Vertica ODBC DSN configuration dialog box appears.
Click the More >>> button to view a description of the field you are editing and the connection string defined by the DSN.
Enter the information for your DSN. The following fields are required:
DSN Name — The name for the DSN. Clients use this name to identify the DSN to which they want to connect. The DSN name must satisfy the following requirements:
Its maximum length is 32 characters.
It is composed of ASCII characters except for the following: { } , ; ? * = ! @ \
It contains no spaces.
Server — The host name or IP address of the Vertica server to which you want to connect. Use localhost, if Vertica is installed on the same machine.
You can provide an IPv4 address, IPv6 address, or host name.
In mixed IPv4/IPv6 networks, the DNS server configuration determines which IP version address is sent first. Use the PreferredAddressFamily
option to force the connection to use either IPv4 or IPv6.
The PreferredAddressFamily
option is available on the Client Settings tab.
Backup Servers — A comma-separated list of host names or IP addresses used to connect to if the server specified by the Server field is down. Optional.
Database —The name of the Vertica database.
User Name — The name of the user account to use when connecting to the database. If the application does not supply its own user name when connecting to the DSN, this account name is used to log into the database.
The rest of the fields are optional. See DSN Parameters for detailed information about the DSN parameters you can define.
If you want to test your connection:
Enter at least a valid DSN name, Server name, Database, and either User name or select Windows authentication.
If you have not selected Windows authentication, you can enter a password in the Password box. Alternately, you can select Password for missing password to have the driver prompt you for a password when connecting.
Click Test Connection.
When you have finished editing and testing the DSN, click OK. The Vertica ODBC DSN configuration window closes, and your new DSN is listed in the ODBC Data Source Administrator window.
Click OK to close the ODBC Data Source Administrator.
After creating the DSN, you can test it using Microsoft Excel 2007.
On 64-bit versions of Windows, the default ODBC Data Source Administrator creates and edits DSNs that are associated with the 64-bit Vertica ODBC library.
Attempting to use these 64-bit DSNs with a 32-bit client application results in an architecture mismatch error. Instead, you must create a specific 32-bit DSN for 32-bit clients by running the 32-bit ODBC Administrator usually located at:
c:\Windows\SysWOW64\odbcad32.exe
This administrator window edits a set of DSNs that are associated with the 32-bit ODBC library. You can then use your 32-bit client applications with the DSNs you create with this version of the ODBC administrator.
When you install an ODBC driver and create a Data Source Name (DSN) the DSN settings are stored in the registry, including the password. Encrypting passwords on ODBC DSN applies only to Windows systems.
Encrypting passwords on an ODBC data source name (DSN) provides security against unauthorized database access. The password is not encrypted by default and is stored in plain-text.
Use the EncryptPassword parameter to enable or disable password encryption for an ODBC DSN:
EncryptPassword = true
enables password encryption
EncryptPassword = false
(default) disables password encryption
Set EncryptPassword
in the Windows registry - HKEY_LOCAL_MACHINE > Software > Vertica > ODBC > Driver EncryptPassword=<true/false>
.
For 32 bit driver running on 64 bit windows verify password encryption here:
HKEY_LOCAL_MACHINE > Software > Wow6432Node > Vertica > ODBC >
Driver > EncryptPassword=<true/false>
Encrypted passwords get updated in the following registry locations:
For a user DSN:
HKEY_CURRENT_USER-> Software -> ODBC -> ODBC.INI -> DSNNAME -> PWD
For a system DSN:
HKEY_LOCAL_MACHINE-> Software -> ODBC -> ODBC.INI -> DSNNAME -> PWD
Use Windows Registry editor to determine if password encryption is enabled based on the value of EncryptPassword. Depending on the type of DSN you installed, check the following:
For a user DSN: HKEY_CURRENT_USER > Software > ODBC > ODBC.INI > dsn name > isPasswordEncrypted=<1/0>
For a system DSN: HKEY_LOCAL_MACHINE > Software > ODBC > ODBC.INI > dsn name > isPasswordEncrypted=<1/0>
For each DSN, the value of the isPasswordEncrypted
parameter indicates the status of the password encryption, where 1
indicates an encrypted password and 0
indicates an unencrypted password.
You can use Microsoft Excel to verify that an application can connect to an ODBC data source or other ODBC application.
Open Microsoft Excel, and select Data > Get External Data > From Other Sources > From Microsoft Query.
When the Choose Data Source dialog box opens:
Select New Data Source, and click OK.
Enter the name of the data source.
Select the Vertica driver.
Click Connect.
When the Vertica Connection Dialog box opens, enter the connection information for the DSN, and click OK.
Click OK on the Create New Data Source dialog box to return to the Choose Data Source dialog box.
Select VMart_Schema*, and verify that the Use the Query Wizard check box is deselected. Click OK.
When the Add Tables dialog box opens, click Close.
When the Microsoft Query window opens, click the SQL button.
In the SQL window, write any simple query to test your connection. For example:
SELECT DISTINCT calendar_year FROM date_dimension;
* If you see the caution, "SQL Query can't be represented graphically. Continue anyway?" click **OK**. * The data values 2003, 2004, 2005, 2006, 2007 indicate that you successfully connected to and ran a query through ODBC.
Select File > Return Data to Microsoft Office Excel.
In the Import Data dialog box, click OK.
The data is now available for use in an Excel worksheet.
You can use the Vertica ODBC Driver to set up an ODBC DSN. This procedure assumes that the driver is already installed, as described in Installing the ODBC client driver.
Using your web browser, download and install the Apple ODBC Administrator Tool.
Locate and open the ODBC Administrator Tool after installation:
Navigate to Finder > Applications > Utilities.
Open the ODBC Administrator Tool.
Click the Drivers tab, and verify that the Vertica driver is installed.
Specify if you want all users on your client system to be able to access the DSN for the Vertica database:
If you want all users to have access, then click the System DSN tab.
Otherwise, click the User DSN tab to create a DSN that is only usable by your Macintosh user account.
Click Add... to create a new DSN to connect to the Vertica database.
Scroll through the list of drivers in the Choose A Driver dialog box to locate the Vertica driver. Select the driver, and then click OK. A dialog box opens that requests DSN parameter information.
In the dialog box, enter the Data Source Name (DSN) and an optional Description. To do so, click Add to insert keywords (parameters) and values that define the settings needed to connect to your database, including database name, server host, database user name (such as dbadamin), database password, and port. Then, click OK.
In the ODBC Administrator dialog box, click Apply.
See ODBC DSN connection properties for a complete list of parameters including those specific to Vertica.
After configuring the ODBC Administrator Tool, you may need to configure additional driver settings before you can use your DSN, depending on your environment. See Additional ODBC Driver Configuration Settings for details.
iodbctest
utility. For details, see Testing an ODBC DSN using iodbctest.
The standard iODBC Driver Manager on OS X includes a utility named iodbctest that lets you test a DSN to verify that it is correctly configured. You pass this command a connection string in the same format that you would use to open an ODBC database connection. After configuring your DSN connection, you can run a query to verify that the connection works.
For example:
# iodbctest "DSN=VerticaDSN;UID=dbadmin;PWD=password"
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0607.1008
Driver: 07.01.0200 (verticaodbcw.so)
SQL> SELECT table_name FROM tables;
table_name
--------------------------------------------------------------------------------------------------------------------------------
customer_dimension
product_dimension
promotion_dimension
date_dimension
vendor_dimension
employee_dimension
shipping_dimension
warehouse_dimension
inventory_fact
store_dimension
store_sales_fact
store_orders_fact
online_page_dimension
call_center_dimension
online_sales_fact
numbers
result set 1 returned 16 rows.
The following tables list the connection properties you can set in the DSNs for use with Vertica's ODBC driver. To set these parameters, see Setting DSN connection properties.
These connection properties are the minimum required to create a functioning DSN.
Property | Description |
---|---|
Driver | The file path and name of the driver used. |
Database | The name of the database running on the server. |
Servername |
The host name or IP address of any active node in a Vertica cluster. You can provide an IPv4 address, IPv6 address, or host name. In mixed IPv4/IPv6 networks, the DNS server configuration determines which IP version address is sent first. Use the You can also use the aliases "server" and "host" for this property. |
UID | The database username. |
Property | Description |
---|---|
Port |
The port number on which Vertica listens for ODBC connections. Default: 5433 |
PWD |
The password for the specified user name. You may insert an empty string to leave this property blank. Default: None, login only succeeds if the user does not have a password set. |
PreferredAddressFamily |
The IP version to use if the client and server have both IPv4 and IPv6 addresses and you have provided a host name, one of the following:
Default: none |
Property | Description |
---|---|
AutoCommit |
A Boolean value that controls whether the driver automatically commits transactions after executing a DML statement. Default: true |
BackupServerNode |
A string containing the host name or IP address that client libraries can try to connect to if the host specified in ServerName is unreachable. Connection attempts continue until successful or until the list of server nodes is exhausted. Valid values: Comma-separated list of servers optionally followed by a colon and port number. |
ConnectionLoadBalance |
A Boolean value that indicates whether the connection can be redirected to a host in the database other than the ServerNode. This affects the connection only if the load balancing. is set to something other than "none". When the node differs from the node the client is connected to, the client disconnects and reconnects to the targeted node. See About Native Connection Load Balancing in the Administration Guide. Default: false |
ConnSettings |
A string containing SQL commands that the driver should execute immediately after connecting to the server. You can use this property to configure the connection, such as setting a schema search path. Reserved symbol: In the connection string semicolon ( |
ConnectionTimeout |
The number of seconds to wait for a request to complete before returning to the client application. This is equivalent to the SQL_ATTR_CONNECTION_TIMEOUT parameter in the ODBC API. Default: 0 (no timeout) |
ConvertSquareBracketIdentifiers |
Controls whether square-bracket query identifiers are converted to a double quote identifier for compatibility when making queries to a Vertica database. Default: false |
DirectBatchInsert | Deprecated, always set to true. |
DriverStringConversions |
Controls whether the ODBC driver performs type conversions on strings sent between the ODBC driver and the database. Possible values are:
Default: OUTPUT |
Locale |
The locale used for the session. Specify the locale as an ICU Locale. **See **the ICU User Guide for a complete list of properties that can be used to specify a locale. Default: |
PromptOnNoPassword |
[Windows only] Controls whether users are prompted to enter a password, if none is supplied by the connection string or DSN used to connect to Vertica. See Prompting windows users for passwords. Default: false |
ReadOnly |
A true or false value that controls whether the connection can read data only from Vertica. Default: false |
ResultBufferSize |
Size of memory buffer for the large result sets in streaming mode. A value of 0 means ResultBufferSize is turned off. Default: 131072 (128KB) |
TransactionIsolation |
Sets the transaction isolation for the connection, one of the following:
See Changing Transaction Isolation Levels for an explanation of transaction isolation. Default: Server Default |
Workload |
The name of the workload for the session. For details, see Workload routing. Default: None (no workload) |
Property | Description | Standard/ Vertica |
---|---|---|
Description |
Description for the DSN entry. Required? No Insert an empty string to leave the description empty. |
Standard |
Label / SessionLabel |
Sets a label for the connection on the server. This value appears in the client_label column of the V_MONITOR.SESSIONS system table. Label and SessionLabel are synonyms and can be used interchangeably. |
Vertica |
The following connection properties pertain to OAuth in ODBC.
odbc.ini
. If your parameter value is greater than 1000 characters (for example, OAuthAccessToken), you must pass it through a connection string rather than specifying it in odbc.ini
.
Property | Description |
---|---|
OAuthAccessToken |
An OAuth token that authorizes a user to the database. Either OAuthAccessToken or OAuthRefreshToken must be set (programmatically or manually) to authenticate to Vertica with OAuth authentication. You can omit both OAuthAccessToken and OAuthRefreshToken only if you authenticate to your identity provider directly with single sign-on through the client driver, which requires the machine running the ODBC driver to have access to a web browser. For details on the different methods for retrieving access tokens, see Retrieving access tokens. |
OAuthRefreshToken |
Allows a user to refresh and obtain a new OAuthAccessToken when their old one expires. Either OAuthAccessToken or OAuthRefreshToken must be set (programmatically or manually) to authenticate to Vertica with OAuth authentication. You can omit both OAuthAccessToken and OAuthRefreshToken only if you authenticate to your identity provider directly with single sign-on through the client driver, which requires the machine running the ODBC driver to have access to a web browser. For details on the different methods for retrieving access tokens, see Retrieving access tokens. If you set this parameter, you must also set the following refresh properties in OAuthJsonConfig:
In cases where introspection fails (e.g. when the access token expires), Vertica responds to the request with an error. If introspection fails and OAuthRefreshToken is specified, the driver attempts to refresh and silently retrieve a new access token. Otherwise, the driver passes error to the client application. |
OAuthJsonConfig |
A JSON string or file that lets you set the following:
Unlike oauthaccesstoken or oauthrefreshtoken, which must be set programmatically by the client when they attempt to connect, the same oauthjsonconfig can be reused between connections to the database. For example, to set it as a
To set it inside separate a
|
Property | Description | Standard/ Vertica |
---|---|---|
SSLMode |
Controls whether the connection to the database uses SSL encryption, one of the following. For information on using these parameters to configure TLS, see Configuring TLS for ODBC Clients:
Default: prefer |
Vertica |
SSLCertFile | The absolute path of the client's public certificate file. This file can reside anywhere on the system. | Vertica |
SSLKeyFile | The absolute path to the client's private key file. This file can reside anywhere on the system. | Vertica |
Use the following properties for client authentication using Kerberos.
Property | Description | Standard/ Vertica |
---|---|---|
KerberosServiceName |
Provides the service name portion of the Vertica Kerberos principal; for example: Default: vertica |
Vertica |
KerberosHostname |
Provides the instance or host name portion of the Vertica Kerberos principal; for example: Default: Value specified in the servername connection string property |
Vertica |
The properties in the following tables are common for all user and system DSN entries. The examples provided are for Windows clients.
To edit DSN properties:
On UNIX and Linux client platforms, you can edit the odbc.ini
file. The location of this file is specific to the driver manager. See Creating an ODBC DSN for Linux.
On Windows client platforms, you can edit some DSN properties using the Vertica ODBC client driver interface. See Creating an ODBC DSN for windows clients.
You can also edit the DSN properties directly by opening the DSN entry in the Windows registry (for example, at HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\
DSNname
). Directly editing the registry can be risky, so you should only use this method for properties that cannot be set through the ODBC driver's user interface, or via your client code.
You can set properties in the connection string when opening a connection using the SQLDriverConnect()
function:
sqlRet = SQLDriverConnect(sql_hDBC, 0, (SQLCHAR*)"DSN=DSNName;Locale=en_GB@collation=binary", SQL_NTS, szDNS, 1024,&nSize, SQL_DRIVER_NOPROMPT);
In the connection string ';' is a reserved symbol. If you need to set multiple properties as part of the ConnSettings property use '%3B' in place of ';'. Also use '+' instead of spaces.
For example:
sqlRet = SQLDriverConnect(sql_hDBC, 0, (SQLCHAR*)"DSN=Vertica SQL;ConnSettings=set+search_path+to+a,b,c%3Bset+locale=ch;SSLMode=prefer", SQL_NTS,
szDNS, 1024,&nSize, SQL_DRIVER_NOPROMPT);
Your client code can retrieve DSN property values after a connection has been made to Vertica using the SQLGetConnectAttr()
and SQLGetStmtAttr()
API calls. Some properties can be set and using SQLSetConnectAttr()
and SQLSetStmtAttr()
.
For details of the list of properties specific to Vertica see ODBC Header Files specific to Vertica.
DriverManagerEncoding
: The UTF encoding standard used by the driver manager. This can be one of the following:
UTF-8
UTF-16
UTF-32
The ODBC driver encoding must match that of your driver manager. The following table lists default encodings for various platforms that take effect if you do not set this parameter. If the defaults do not match the encoding used by your driver manager, you must set it manually. Consult your driver manager's documentation for details on its encoding.
Client Platform | Default Encoding |
---|---|
Linux 32-bit | UTF-32 |
Linux 64-bit | UTF-32 |
Linux Itanium 64-bit | UTF-32 |
OS X | UTF-32 |
Windows 32-bit | UTF-16 |
Windows 64-bit | UTF-16 |
ErrorMessagesPath
: Required, the path of the directory containing the ODBC driver's error message files. These files (ODBCMessages.xml
and VerticaMessages.xml
) are stored in the same directory as the Vertica ODBC driver files (for example, opt/vertica/en-US
in the downloaded .tar
).
ODBCInstLib
: The path to the ODBC installer library. This setting is only required if the directory containing the library is not set in the LD_LIBRARY_PATH
or LIB_PATH
environment variables. The library files for the major driver managers are:
UnixODBC: libodbcinst.so
iODBC: libiodbcinst.so
(libiodbcinst.2.dylib
on macOS)
DataDirect: libodbcinst.so
You can also control client-server message logging for both ODBC and ADO.NET. For details, see Configuring ODBC logs.
To set these parameters on Linux or macOS:
Create a file vertica.ini
anywhere on the client system. Common locations are in /etc/
for a shared configuration, or the home directory for a per-user configuration.
Verify that users of the ODBC driver have read privileges on the file.
Set the VERTICAINI
environment variable to the path of vertica.ini
. For example:
$ export VERTICAINI=/etc/vertica.ini
[Driver]
in vertica.ini
:[Driver]
[Driver]
, set parameters with the following format. Each parameter must have its own line:[Driver]
DriverManagerEncoding=UTF-16
ODBCInstLib=/usr/lib64/libodbcinst.so
The Windows client driver installer automatically configures all necessary settings for the ODBC driver. Settings are stored in the registry in HKEY_LOCAL_MACHINE\SOFTWARE\Vertica\ODBC\Driver
.
If you want to configure ODBC further, use the ODBC Data Sources program.
The following parameters control whether and how the ODBC client driver logs messages between the client and server.
The way you set these parameters differs between operating systems:
On Linux and macOS, edit vertica.ini
you created during the installation. For example, to log all warnings and more severe messages to log files in /tmp/
:
[Driver]
LogLevel=4
LogPath=/tmp
On Windows, edit the keys in the Windows Registry under HKEY_LOCAL_MACHINE\SOFTWARE\Vertica\ODBC\Driver
.
LogLevel: The severity of messages that are logged between the client and the server. The valid values are:
0: No logging
1: Fatal errors
2: Errors
3: Warnings
4: Info
5: Debug
6: Trace (all messages)
The value you specify for this setting sets the minimum severity for a message to be logged. For example, setting LogLevel to 3 means that the client driver logs all warnings, errors, and fatal errors.
LogPath: The absolute path of a directory to store log files. For example: /var/log/verticaodbc
On Windows clients, ODBC log entries can be sent to Event Tracing for Windows (ETW) so they appear in the Windows Event Viewer:
Register the driver as a Windows Event Log provider and enable the logs.
Activate ETW by adding a string value LogType with data ETW to your Windows Registry.
Understand how Vertica compresses log levels for the Windows Event Viewer.
Know where to find the logs within Event Viewer.
Understand the meaning of the Event IDs in your log entries.
To use ETW logging, you must register the ODBC driver as a Windows Event Log provider. You can choose to register either the 32-bit or 64-bit driver. After you have registered the driver, you must enable the logs.
Open a command prompt window as Administrator, or launch the command prompt with the Run as Administrator option.
Run the command wevtutil im
to register either the 32-bit or 64-bit version of the driver.
For the 64-bit ODBC driver, run:
wevtutil im "c:\Program Files\Vertica Systems\ODBC64\lib\VerticaODBC64.man"
/resourceFilePath:"c:\Program Files\Vertica Systems\ODBC64\lib\vertica_9.1_odbc_3.5.dll"
/messageFilePath:"c:\Program Files\Vertica Systems\ODBC64\lib\vertica_9.1_odbc_3.5.dll"
For the 32-bit ODBC driver, run:
wevtutil im "c:\Program Files (x86)\Vertica Systems\ODBC32\lib\VerticaODBC32.man"
/resourceFilePath:"c:\Program Files (x86)\Vertica Systems\ODBC32\lib\vertica_9.1_odbc_3.5.dll"
/messageFilePath:"c:\Program Files (x86)\Vertica Systems\ODBC32\lib\vertica_9.1_odbc_3.5.dll"
Run the command wevtutil sl
to enable the logs.
For 64-bit ODBC driver logs, run:
wevtutil sl VerticaODBC64/e:true
For the 32-bit ODBC driver logs, run:
wevtutil sl VerticaODBC32/e:true
wevtutil sl
command, substituting /e:false
in place of /e:true
when you issue the statement. Alternatively, you can enable or disable logs within the Windows Event Viewer itself.
By default, Vertica does not send ODBC log entries to ETW. To activate ETW, add the string LogType
to your Windows registry, and set its value to ETW
.
Start the registry editor by typing regedit.exe
in the Windows Run command box.
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Vertica\ODBC\Driver
in the registry.
Right-click in the right pane of the Registry Editor window.
Select New, then select String Value.
Change the name of the string value from New Value #1
to LogType
.
Double-click the new LogType
entry. When prompted for a new value, enter ETW
.
Exit the registry editor.
ETW is disabled by default. When ETW is enabled, you can disable it by clearing the value ETW from the LogType string.
While LogLevel ranges from 0 through 6, this range is compressed for the Windows Event Viewer to a range of 0 through 3.
Vertica LogLevel Setting | Vertica LogLevel Description | Log level sent to the Windows Event Viewer | Log level displayed by the Windows Event Viewer |
---|---|---|---|
0 | (No logging) | 0 | (No logging) |
1 | Fatal Errors | 1 | Critical |
2 | Errors | 2 | Error |
3 | Warnings | 3 | Warning |
4 | Info | 4 | Information |
5 | Debug | 4 | |
6 | Trace (all messages) | 4 |
The following examples show how LogLevel is converted when displayed in the Windows Event Viewer.
A LogLevel of 5 sends fatal errors, errors, warnings, info and debug log level entries to Event Viewer as Level 4 (Information).
A LogLevel of 6 sends fatal errors, errors, warnings, debug and trace log level entries to Event Viewer as Level 4.
Launch the Windows Event Viewer.
From Event Viewer (Local), expand Applications and Services Logs.
Expand the folder that contains the log you want to review (for example, VerticaODBC64
).
Select the Vertica ODBC log under the folder. Entries appear in the right pane.
Note the value in the Event ID field. Each Event Log entry includes one of four Event IDs:
0: Informational (debug, info, and trace events)
1: Error
2: Fatal event
3: Warning