Creating a Data Source Name

When connecting to your data store using a DSN, you only need to configure the odbc.ini file. Set the properties in the odbc.ini file to create a DSN that specifies the connection information for your data store. For information about configuring a DSN-less connection instead, see Configuring a DSN-less Connection.

If your machine is already configured to use an existing odbc.ini file, then update that file by adding the settings described below. Otherwise, copy the odbc.ini file from the Setup subfolder in the connector installation directory to the home directory, and then update the file as described below.

To create a Data Source Name:

  1. In a text editor, open the odbc.ini configuration file.

    Note: If you are using a hidden copy of the odbc.ini file, you can remove the period (.) from the start of the file name to make the file visible while you are editing it.

  2. In the [ODBC Data Sources] section, add a new entry by typing a name for the DSN, an equal sign (=), and then the name of the connector.

    For example, in a macOS machine:

    [ODBC Data Sources]

    Sample DSN=Simba Oracle ODBC Driver

    For example, for a 32-bit connector on a Linux machine:

    [ODBC Data Sources]

    Sample DSN=Simba Oracle ODBC Driver 32-bit

  3. Create a section that has the same name as your DSN, and then specify configuration options as key-value pairs in the section:
    1. Set the Driver property to the full path of the connector library file that matches the bitness of the application.
    2. For example, in a macOS machine:

      Driver=/Library/simba/oracleodbc/lib/liboracleodbc_sb64.dylib

      For example, for a 32-bit connector on a Linux machine:

      Driver=/opt/simba/oracleodbc/lib/32/liboracleodbc_sb32.so

    3. To specify the Oracle database that you want to connect to, do one of the following:
      • To use server information that is defined in your tnsnames.ora configuration file, do the following:
        1. Set the TNS property to the net service name that you want to use.
        2. On your Linux or macOS machine, update the TNS_ADMIN environment variable to point to the path of the tnsnames.ora file.

        For example:

        TNS=oracleconnection1

      • Or, to use simultaneous cloud connections, specify the path to an Oracle Cloud Wallet configuration file or folder by doing the following:
        1. Extract cloud wallets within separate locations. For example, [Wallet1Dir] and [Wallet2Dir].
        2. Copy the tnsnames.ora contents of each wallet and paste them within your tnsnames.ora file (located in TNS_ADMIN).
        3. Add the respective wallet locations under the security of the respective TNS alias:

        4. NameOfTNSEntry =

          (DESCRIPTION=

          (ADDRESS_LIST =

          (ADDRESS=(PROTOCOL=tcps)(HOST=xyz.somewhere.c0m)(PORT=12345678))

          )

          (CONNECT_DATA=(SERVICE_NAME=NameOfService))

          (SECURITY =

          (MY_WALLET_DIRECTORY = [Wallet1Dir])

          )

          )

        5. Establish the connection using TNS.
      • Note: For more information about multiple wallet connections, see "One client needing multiple wallets and/or multiple SQLNET.ORA files - (Solved/workaround)" in the Oracle Applications and Infrastructure Community: https://community.oracle.com/tech/apps-infra/discussion/4301296/one-client-needing-multiple-wallets-and-or-multiple-sqlnet-ora-files-solved-workaround.
      • Or, to specify server information directly in the DSN, do the following:
        1. Set the Host property to the IP address or host name of the Oracle server.
        2. Set the Port property to the number of the TCP port that the server uses to listen for client connections.
        3. Set the SVC property to the service name of the Oracle database that you want to access.

        For example:

        Host=192.168.222.160

        Port=1521

        SVC=ORCL

      Note: If you specify TNS in addition to Host, Port, and SVC, the TNS setting takes precedence and the connector connects using the server information defined in the tnsnames.ora configuration file.
    4. Configure authentication as needed. For more information, see Configuring Authentication.
    5. Configure SSL encryption as needed. For more information, see Configuring SSL Verification.
    6. Optionally, set additional key-value pairs as needed to specify other optional connection settings. For detailed information about all the configuration options supported by the Simba Oracle ODBC Driver, see Driver Configuration Options on page 1.
  4. Save the odbc.ini configuration file.
    Note: If you are storing this file in its default location in the home directory, then prefix the file name with a period (.) so that the file becomes hidden. If you are storing this file in another location, then save it as a non-hidden file (without the prefix), and make sure that the ODBCINI environment variable specifies the location. For more information, see Specifying the Locations of the Connector Configuration Files.

    For example, the following is an odbc.ini configuration file for macOS containing a DSN that connects to Oracle, with statement caching enabled and the number of statements in the statement cache set to 20. Also, the connector uses 1000000 bytes as the buffer size for data retrieval:

    [ODBC Data Sources]

    Sample DSN=Simba Oracle ODBC Driver

    [Sample DSN]

    Driver=/Library/simba/oracleodbc/lib/liboracleodbc_sb64.dylib

    Host=192.168.222.160

    Port=1521

    SVC=ORCL

    UID=jsmith

    PWD=simba123

    ENABLESTMTCACHE=true

    STMTCACHESIZE=20

    MEMLIM=1000000

    For example, the following is an odbc.ini configuration file for a 32-bit connector on a Linux machine, containing a DSN that connects to Oracle, with statement caching enabled and the number of statements in the statement cache set to 20. Also, the connector uses 1000000 bytes as the buffer size for data retrieval:

    [ODBC Data Sources]

    Sample DSN=Simba Oracle ODBC Driver 32-bit

    [Sample DSN]

    Driver=/opt/simba/oracleodbc/lib/32/liboracleodbc_sb32.so

    Host=192.168.222.160

    Port=1521

    SVC=ORCL

    UID=jsmith

    PWD=simba123

    ENABLESTMTCACHE=true

    STMTCACHESIZE=20

    MEMLIM=1000000

You can now use the DSN in an application to connect to the data store.