Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI SQL Client ODBC

Create a driver Init file (init<sid>​.ora)

  • Last UpdatedJan 04, 2023
  • 2 minute read

You must create an initialization file for your Oracle Database Gateway for ODBC. Oracle supplies a sample initialization file named: initdg4odbc.ora. The sample file is stored in the ORACLE_HOME\hs\admin directory.

To create an initialization file for the ODBC gateway, copy the sample initialization file and rename it to: initsid.ora, where sid is the system identifier (SID) you want to use for the instance of the non-Oracle system to which the gateway connects.

The gateway system identifier (SID) is an alphanumeric character string that identifies a gateway instance. You need one gateway instance, and therefore one gateway SID, for each ODBC source you are accessing.

If you want to access two ODBC sources, you need two gateway SIDs, one for each instance of the gateway. If you have only one ODBC source but want to access it sometimes with one set of gateway parameter settings, and other times with different gateway parameter settings, then you will need multiple gateway SIDs for the single ODBC source. The SID is used as part of the file name for the initialization parameter file.

Examples

# This is a sample agent init file that contains the HS parameters that are
# needed for the Database Gateway for ODBC
#
# HS init parameters
#
HS_FDS_CONNECT_INFO=pisqlclient
HS_FDS_TRACE_LEVEL=DEBUG
HS_FDS_TIMESTAMP_MAPPING=TIMESTAMP
#
# Environment variables required for the non-Oracle system
#
#set <envvar>=<value>

Where:

Parameter

Description

HS_FDS_CONNECT_INFO

pisqlclient is the name of the system DSN defined in the Microsoft Windows ODBC Data Source Administrator.

HS_FDS_TRACE_LEVEL

Specifies the level of tracing. You should generally leave this commented out, as tracing can degrade performance.

In this example, it is enabled to be able to verify how test queries are mapped to PI SQL Client ODBC.

This setting generates a log file for each SQL*Plus connection. Gateway log files are stored in the ORACLE_HOME\hs\trace folder. For example, ORACLE_HOME\hs\trace\piodbc_agt_516.trc.

HS_FDS_TIMESTAMP_MAPPING

By default, Oracle maps the SQL_TYPE_TIMESTAMP ODBC data type into DATE, which does not support fractional seconds. To get the full precision, this setting changes the mapping into the TIMESTAMP data type.

Related Links
TitleResults for “How to create a CRG?”Also Available in