データソース設定ファイル(UNIXおよびLinux®)

ドライバ・マネージャとODBCドライバは、'.odbc.ini設定ファイルを使用してデータ・ソースに関する情報を取得する。

.odbc.ini ファイルは通常、ユーザーのホーム・ディレクトリーに格納します。 ファイル名の先頭にピリオドを付けるのは、ファイルをホーム・ディレクトリーに配置する場合のみです。

自分のNetezza Performance Server・システムのシステム・データ・ソースにアクセスするように '.odbc.iniファイルのエントリーを構成するには、Netezza Performance Serverのシステム管理者から次の構成情報を入手し、'.odbc.iniファイルの情報に置き換えてください:
Database
Netezza Performance Server・システム上のシステム・データベースの名前。
SchemaName
Netezza Performance Serverシステム上の指定したデータベース内のスキーマ名。 このフィールドは、データベース内で複数のスキーマをサポートするNetezza Performance Serverシステムで使用します。 スキーマを指定しない場合は、データベースのデフォルトのスキーマに接続されます。
User name
システム・データ・ソースにアクセスするための有効なユーザー ID
Server name
Netezza Performance Server・システムのサーバー・ホスト名または IP アドレス。
Password
システム・データ・ソースにアクセスするためのパスワード
パスワードにはダブルクォーテーションやセミコロンを使用しないでください。

次の例は、ODBCドライバーをインストールした後の'/usr/local/nz/lib/ディレクトリにある'odbc.ini.sampleファイルの内容を示している。 このサンプル・ファイルには、すべてのNetezza Performance Server・システムにあるシステム・データ・ソースが記述され、各パラメーターを説明するコメントが含まれています。 このサンプル・ファイルの内容と、置き換える管理者からの情報を使用して、独自の .odbc.ini ファイルを構成してください。 ソースとターゲットのデータ型に違いがある可能性があるので、問題が発生しないように UnicodeTranslationOption=utf8 のコードを .odbc.ini ファイルに追加します。

UnicodeTranslationOption=utf8
;
;  odbc.ini
;
[ODBC Data Sources]
NZSQL = NetezzaSQL


[NZSQL]
;Path of a driver used for database connection
Driver                = /usr/local/nz/lib/libnzodbc.so

;A decription used to identify the database connection properties.
Description           = NetezzaSQL ODBC

;The name of a machine or IP address where the database is located.
Servername            = 127.0.0.1

;The port number to connect.
Port                  = 5480

;The name of a database.
Database              = dev

;The schema in the database. If unspecified, driver connects to 
:default schema for the database.
SchemaName            = sample_schema

;The name of a valid user.
Username              = guest

;The password for  the user.
Password              = password

;Only Select SQL statements will be allowed if this field is checked.
ReadOnly              = false

;When this option is enabled and the application bindtype is same as 
;backend datatype the query performance will be faster. Query 
;performance gain will be achieved only for single select statements 
;(not for batch queries).It also works in case when application bind 
;type is different than backend datatype but there are some
;restrictions on it.
FastSelect            = false

;When set to true, system tables will be included in the available
table list.
ShowSystemTables      = false

;When set to true, use old (2.5) functionality for returning schemas in
SQLTables.
LegacySQLTables       = false

;Specifies login timeout in seconds.
LoginTimeout          = 0

;Specifies query timeout in seconds.
QueryTimeout          = 0

;Specifies date format as follows -
; 1: YMD
; 2: MDY
; 3: DMY
DateFormat            = 1

;When selected, driver treats SQL_C_NUMERIC buffers as SQL_C_CHAR
buffers.
NumericAsChar         = false

;Return SQL_BIT as "1"/"0" when char.
SQLBitOneZero         = false

;When enabled, replaces all occurences of CRLF, CR and LF with a single
space.
StripCRLF             = false

;Specifies level of security on the system
securityLevel         = preferredUnSecured

;Name of the Root CA certificate.
caCertFile            =

;Specifies maximum errors allowed. 0 value means no limit on
loadMaxErrors value.
;loadMaxErrors         = 1

;If value is true, it rounds the data of numeric columns whose
precision exceeds the precision defined.
;loadRoundFraction     = 0


[ODBC]
IANAAppCodePage=4
InstallDir=/opt/odbc32v51
Trace=0
TraceDll=/opt/odbc32v51/lib/odbctrac.so
TraceFile=odbctrace.out
UseCursorLib=0

データソースのプロパティについては、 ODBCDriver Setupを使用したDSNとドライバのオプションの構成で説明しています。 この情報を参考にして、.odbc.ini ファイルのエントリーに適切な値を選択してください。