Connecting to a database from Linux and UNIX systems: 64-bit considerations

To enable a broker to connect to a database, define the ODBC data source name (DSN) for the database.

Before you start:

The ODBC Driver Manager has no graphical application to help you to configure the ODBC DSNs. You must define a 64-bit ODBC connection as a DSN in a plain text file (called odbc64.ini) on the computer that hosts the broker.

Important: Before you can create a broker on HP-UX on Itanium, define the 64-bit ODBC data source name (DSN) that the broker will use to connect to the broker database.

Define 64-bit DSNs in the following situations:
  • On HP-UX on Itanium, the broker is a 64-bit application, and all database connections must be 64-bit connections. Define a 64-bit DSN for the broker database and for any user databases.
  • If you deploy message flows to a 64-bit execution group on a Linux® or UNIX® system, define a 64-bit DSN for the broker database and any user databases. The broker database, and all user databases, must also be 64-bit instances.
  • If you configure a 64-bit queue manager to globally coordinate transactions, the broker database and all user databases must be 64-bit instances (all WebSphere MQ Version 6 queue managers on 64-bit platforms are 64-bit applications).

    Define all your user databases as 64-bit DSNs in the odbc64.ini file, even if you deploy message flows to 32-bit execution groups, and you have defined 32-bit DSNs in odbc.ini.

    If the globally coordinated message flow applications use MRM messages, also define a 64-bit DSN for the broker database.

If you deploy message flow applications to a 32-bit execution group, enable 32-bit connections to all databases, including the broker database; see Connecting to a database from Linux and UNIX systems.

To configure a 64-bit DSN for a database:

  1. Copy the odbc64.ini sample file that is supplied in the install_dir/DD64 directory to a location of your choice; for example, copy the file to your user ID's home directory. Each broker service user ID on the system can therefore use its own DSN definitions.

    See the sample file contents in odbc64.ini sample file.

  2. Ensure that the odbc64.ini file has file ownership of mqm:mqbrkrs, and has the same permissions as the supplied odbc64.ini sample file.
  3. Set the ODBCINI64 environment variable to point to your odbc64.ini file, specifying a full path and file name.

    If you have already run the mqsiprofile script, the ODBCINI64 environment variable is set to a default value. Change the value of the variable so that it points to the location of your odbc64.ini file, ensuring that the fully-qualified file path is correct.

  4. On all systems except HP-UX on Itanium, set the library search path environment variable to show the location of the 32-bit libraries for the database manager that you are using.

    If you are using a 64-bit queue manager (all WebSphere MQ Version 6 queue managers on 64-bit platforms are 64-bit queue managers) to globally coordinate transactions, setting the library search path might prevent you running any WebSphere MQ commands in the same environment. For more information, see 'Implications of a 64-bit queue manager' in the Quick Beginnings section for your operating system in the WebSphere MQ Version 6 information center online, or in the WebSphere MQ Version 5.3 book on the WebSphere MQ library Web page.

    For more information about the library search path, see the database manager's documentation.

    The library search path environment variable depends on your operating system:
    • On Linux and Solaris: LD_LIBRARY_PATH
    • On HP-UX: SHLIB_PATH
    • On AIX®: LIBPATH
    1. If you are connecting to a 64-bit DB2® database instance, add DB2 instance directory/sqllib/lib32 to the start of the library search path environment variable. For example, on Solaris:
      export LD_LIBRARY_PATH=DB2 instance directory/sqllib/lib32:$LD_LIBRARY_PATH

      This step is necessary because some parts of the broker must see a 32-bit environment. However, this step might prevent you from running DB2 commands in this environment shell. To enter DB2 commands, start a separate environment shell, and run db2profile for the relevant database instance. If you have DB2 Version 9 installed, and are connecting to a 64-bit DB2 database instance on HP-UX, add DB2 instance directory/sqllib/lib32 to the start of the library search path for environment variable LD_LIBRARY_PATH, and SHLIB_PATH.

    2. If you are using a 64-bit Oracle instance, add $ORACLE_HOME/lib32 to the start of the library search path environment variable.
      For example, on HP-UX:
      export SHLIB_PATH=$ORACLE_HOME/lib32:$SHLIB_PATH

      This step is necessary because some parts of the broker must see a 32-bit environment.

  5. If you are using a 64-bit DB2 instance, set the environment variable MQSI_LIBPATH64 to include the regular 64-bit database libraries. For example, on AIX:
    export MQSI_LIBPATH64=DB2_instance_directory/sqllib/lib64:$MQSI_LIBPATH64
  6. If you are using a DB2 database instance that is installed on AIX, a single process can make a maximum of 10 connections using shared memory to a DB2 database. Therefore, if you deploy more than one or two message flows at the same time, you might see connection failures characterized by the DB2 error message SQL1224N. The connection errors are reported in the system log from the broker's execution group.

    To resolve this issue, use a TCP/IP connection to the database instance; see DB2 error message SQL1224N is issued when you connect to DB2 for details.

  7. Edit the final stanza in the odbc64.ini file (the [ODBC] stanza) to specify the location of the ODBC Driver Manager, and to control tracing. The exact details in the stanza depend on the operating system.
    To ensure that you edit the correct odbc64.ini file, open the file in the vi text editor by using the following command:
    vi $ODBCINI64
    or vi $ODBCINI on Linux on x86.
    1. Start of changeIn InstallDir, add the WebSphere Message Broker installation location to complete the fully qualified path to the ODBC directory.End of change If you do not set this value correctly, the ODBC definition will not work.
    2. In Trace, set the value to 0; if your IBM service representative asks you to enable ODBC trace, set the value to 1.
    3. In TraceFile, type the fully-qualified path and file name to which the ODBC trace is written. Trace files can become large; specify a directory with plenty of free disk space.
    4. Start of changeIn TraceDll, add the WebSphere Message Broker installation location to complete the fully qualified path to the ODBC trace DLL.End of change
    5. Accept the default values that are shown in the sample odbc64.ini file for all the other entries in the stanza. For example:
      • On AIX:
        [ODBC]
        Trace=0
        TraceFile=<A Directory with plenty of free space>/odbctrace.out
        TraceDll=<Your install directory>/DD64/lib/odbctrac.so
        InstallDir=<Your install directory>/DD64
        UseCursorLib=0
        IANAAppCodePage=4
      • On HP-UX on PA-RISC:
        [ODBC]
        Trace=0
        TraceFile=<A Directory with plenty of free space>/odbctrace.out
        TraceDll=<Your install directory>/DD64/lib/odbctrac.sl
        InstallDir=<Your install directory>/DD64
        UseCursorLib=0
        IANAAppCodePage=4
  8. Edit the first stanza in the odbc64.ini file (the [ODBC Data Sources] stanza) to list the DSN of each database. For example:
    • On AIX:
      [ODBC Data Sources]
      WBRKBKDB=IBM DB2 ODBC Driver
      MYDB=IBM DB2 ODBC Driver
      ORACLEDB=DataDirect 5.0 64bit Oracle Wire Protocol
      SYBASEDB=DataDirect 5.0 64bit Sybase Wire Protocol
      SQLSERVERDB=DataDirect 5.0 64bit SQL Server Wire Protocol
    • On HP-UX on PA-RISC:
      [ODBC Data Sources]
      WBRKBKDB=IBM DB2 ODBC Driver
      MYDB=IBM DB2 ODBC Driver
      ORACLEDB=DataDirect 5.0 64bit Oracle Wire Protocol
      SYBASEDB=DataDirect 5.0 64bit Sybase Wire Protocol
      SQLSERVERDB=DataDirect 5.0 64bit SQL Server Wire Protocol
    The DB2 database called WBRKBKDB in the example, is the broker database that is created by the Default Configuration wizard (available on Linux on x86 only). If you are not using the default configuration, you do not need to list this database in the odbc64.ini file.

    List all your DSNs in your odbc64.ini file, regardless of the database manager. You can define multiple DSNs to resolve to the same database; however, if you are using global coordination of transactions, do not use this option because it might cause data integrity problems.

  9. For each database that you listed in the [ODBC Data Sources] stanza, create a stanza in the odbc64.ini file after the [ODBC Data Sources] stanza. The entries in the stanza depend on the database manager. The information for different operating systems can differ; for example, the file paths to the drivers.
    For a DB2 database instance:
    1. In Driver, accept the value shown in the sample odbc64.ini file.
    2. In Description, type a meaningful description of the database. This field is for information only, and does not affect the connection.
    3. In Database, type the DB2 alias. The data source name must be the same as the database alias name. If you are using a remote DB2 database, set up your client-server connection to resolve this alias to the correct database. For more information, see the DB2 documentation.
      For example, on AIX:
      [MYDB]
      Driver=libdb2Wrapper64.so
      Description=MYDB DB2 ODBC Database
      Database=MYDB
    For an Oracle database:
    1. Start of changeIn Driver, add the WebSphere Message Broker installation location to complete the fully qualified path to the driver that is shown in the sample odbc64.ini file. End of change
    2. In Description, type a meaningful description of the database. This field is for information only, and does not affect the connection.
    3. In HostName, type the IP address of the instance on which the Oracle database is running.
    4. In PortNumber, type the port number on which the Oracle database is listening.
    5. In SID, type the Oracle System Identifier of the database as known on the Oracle database server.
    6. Accept the default values that are shown in the sample odbc64.ini file for all the other entries in the stanza. For example:
      • On AIX:
        [ORACLEDB]
        Driver=<Your install directory>/DD64/lib/UKora20.so
        Description=DataDirect 5.0 64bit Oracle Wire Protocol
        HostName=<Your Oracle Server Machine Name>
        PortNumber=<Port on which Oracle is listening on HostName>
        SID=<Your Oracle SID>
        CatalogOptions=0
        EnableStaticCursorsForLongData=0
        ApplicationUsingThreads=1
        EnableDescribeParam=1
        OptimizePrepare=1
        WorkArounds=536870912
        ProcedureRetResults=1
        ColumnSizeAsCharacter=1
      • On HP-UX on PA-RISC:
        [ORACLEDB]
        Driver=<Your install directory>/DD64/lib/UKora20.sl
        Description=DataDirect 5.0 64bit Oracle Wire Protocol
        HostName=<Your Oracle Server Machine Name>
        PortNumber=<Port on which Oracle is listening on HostName>
        SID=<Your Oracle SID>
        CatalogOptions=0
        EnableStaticCursorsForLongData=0
        ApplicationUsingThreads=1
        EnableDescribeParam=1
        OptimizePrepare=1
        WorkArounds=536870912
        ProcedureRetResults=1
        ColumnSizeAsCharacter=1
    For a Sybase database:
    1. Start of changeIn Driver, add the WebSphere Message Broker installation location to complete the fully qualified path to the driver that is shown in the sample odbc64.ini file. End of change
    2. In Description, type a meaningful description of the database. This field is for information only, and does not affect the connection.
    3. In Database, type the name of the database to which to connect by default. If you do not specify a value, the default is the database that is defined by your system administrator for each user.
    4. In NetworkAddress, type the network address of your Sybase ASE server (which is required for local and remote databases). Specify an IP address in the following format:
      <servername or IP address>,<portnumber>
      For example, Sybaseserver,5000. You can also specify the IP address directly; for example, 199.226.224.34,5000. You can find the port number in the Sybase interfaces file, which is named interfaces on Linux and UNIX systems.
    5. Accept the default values that are shown in the sample odbc64.ini file for all the other entries in the stanza. For example:
      • On AIX:
        [SYBASEDB]
        Driver=<Your install directory>/DD64/lib/UKase20.so
        Description=DataDirect 5.0 64bit Sybase Wire Protocol
        Database=<Your Database Name>
        ApplicationUsingThreads=1
        EnableDescribeParam=1
        OptimizePrepare=1
        SelectMethod=0
        NetworkAddress=<YourServerName>,<YourPortNumber>
        SelectUserName=1
      • On HP-UX on PA-RISC:
        [SYBASEDB]
        Driver=<Your install directory>/DD64/lib/UKase20.sl
        Description=DataDirect 5.0 64bit Sybase Wire Protocol
        Database=<Your Database Name>
        ApplicationUsingThreads=1
        EnableDescribeParam=1
        OptimizePrepare=1
        SelectMethod=0
        NetworkAddress=<YourServerName>,<YourPortNumber>
        SelectUserName=1
    For an SQL Server database:
    1. In Driver, add the WebSphere Message Broker installation location to complete the fully qualified path to the driver that is shown in the sample odbc64.ini file.
    2. In Description, type a meaningful description of the database. This field is for information only, and does not affect the connection.
    3. In Address, type the network address of your database server (which is required for local and remote databases). Specify an IP address in the following format:
      <servername or IP address>,<portnumber>
    4. In Database, type the name of the database to which to connect by default. If you do not specify a value, the default is the database that is defined by your system administrator for each user.
    5. Accept the default values that are shown in the sample odbc64.ini file for all the other entries in the stanza.
      For example, on AIX:
      [SQLSERVERDB]
      Driver=<Your_install_directory>/merant/lib/UKmsss20.so
      Description=DataDirect 5.0 SQL Server Driver
      Address=<Your SQLServer Host>,<Your SQLServer server port>
      Database=<Your Database Name>
      AnsiNPW=Yes
      QuoteId=No
  10. Ensure that you have edited all three parts of the odbc64.ini file:
    • The [ODBC Data Source] stanza at the top of the odbc64.ini file.
    • A stanza for each data source.
    • The [ODBC] stanza at the end of the odbc64.ini file.
    If you do not configure all three parts correctly, the ODBC DSNs are not valid, and the broker cannot connect to the database.
You have now configured 64-bit ODBC database connections.
Next: Configure the environment for issuing console commands, and for running the broker, so that the broker can access the required database libraries. For more information, see Setting your environment to support access to databases.
Related tasks
Creating a DB2 database on Linux and UNIX systems
Creating the broker and user databases
Connecting to a database from Linux and UNIX systems
Changing the database heap size on DB2 broker databases
Related reference
Supported databases
odbc64.ini sample file
Related information
WebSphere MQ Version 6 information center online
WebSphere MQ library Web page
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009.
Last updated : 2009-01-07 15:22:13

ah25530_