Modify General Connection Attributes

If you have not modified the db.ini file, proceed to the Manually Edit the db.ini File section. You can either directly modify the sys.odbc.ini file for the active TimesTen database and the sys.odbc.ini file for the standby TimesTen database or you can follow the steps in the Modify First Connection Attributes section. The first approach (modifying the sys.odbc.ini file directly) is less disruptive.

This section discusses the procedure for directly modifying the sys.odbc.ini files.

The sys.odbc.ini file is located in the TimesTen container of the Pod containing the active TimesTen database and in the TimesTen container of the Pod containing the standby TimesTen database. After you complete the modifications to the sys.odbc.ini files, subsequent applications can connect to the database using these general connection attributes.

This example illustrates how to edit the sys.odbc.ini files.

  1. Use the kubectl exec -it command to invoke a shell in the active Pod. (In this example, sample-0 is the active Pod.)

    % kubectl exec -it sample-0 -c tt -- /bin/bash
    Last login: Thu Jan 16 22:43:26 UTC 2025 on pts/8
  2. Verify the current directory (/tt/home/timesten).

    % pwd
    /tt/home/timesten
  3. Navigate to the directory where the sys.odbc.ini file is located. The sys.odbc.ini file is located in the /tt/home/timesten/instances/instance1/conf directory. Therefore, navigate to the instances/instance1/conf directory.

    % cd instances/instance1/conf
    
  4. Edit the sys.odbc.ini file, adding, modifying, or deleting the general connection attributes for your DSN. (sample, in this example.)

    Note:

    Ensure that you only make modifications to the TimesTen general connection attributes. Data store attributes and first connection attributes cannot be modified by directly editing the sys.odbc.ini file.

    This example modifies the sample DSN, adding the ConnectionCharacterSet general connection attribute and setting its value equal to AL32UTF8 (represented in bold).

    vi sys.odbc.ini
    
    [ODBC Data Sources]
    sample=TimesTen 22.1 Driver
    tt=TimesTen 22.1 Driver
     
    [sample]
    Datastore=/tt/home/timesten/datastore/sample
    PermSize=200
    DatabaseCharacterSet=AL32UTF8
    ConnectionCharacterSet=AL32UTF8
    DDLReplicationLevel=3
    AutoCreate=0
    ForceDisconnectEnabled=1
    ...
    
  5. Use the ttIsql utility to connect to the sample database and verify the value of the ConnectionCharacterSet attribute is AL32UTF8 (represented in bold).

    % ttIsql sample
     
    Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
    Type ? or "help" for help, type "exit" to quit ttIsql.
     
     
     
    connect "DSN=sample";
    Connection successful: 
    DSN=sample;UID=timesten;DataStore=/tt/home/timesten/datastore/sample;
    DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;
    AutoCreate=0;PermSize=200;DDLReplicationLevel=3;ForceDisconnectEnabled=1;
    (Default setting AutoCommit=1)
    

You have successfully modified the sys.odbc.ini file located in the TimesTen container of the active Pod (in this example, sample-0). Use the same procedure to modify the sys.odbc.ini file located in the TimesTen container of the standby Pod (in this example, sample-1).

For example:

  1. Use the kubectl exec -it command to invoke a shell in the standby Pod (sample-1, in this example).
    % kubectl exec -it sample-1 -c tt -- /bin/bash
    Last login: Thu Jan 16 23:08:08 UTC 2025 on pts/0
  2. Verify the current directory (/tt/home/timesten).
    % pwd
    /tt/home/timesten
  3. Navigate to the directory where the sys.odbc.ini file is located. The sys.odbc.ini file is located in the /tt/home/timesten/instances/instance1/conf directory. Therefore, navigate to the instances/instance1/conf directory.
    % cd instances/instance1/conf
    
  4. Edit the sys.odbc.ini file, adding, modifying, or deleting the same general connection attributes that you modified for the active database. Therefore, this example modifies the sample DSN, adding the ConnectionCharacterSet general connection attribute and setting its value equal to AL32UTF8 (represented in bold).
    vi sys.odbc.ini
    
    [ODBC Data Sources]
    sample=TimesTen 22.1 Driver
    tt=TimesTen 22.1 Driver
     
    [sample]
    Datastore=/tt/home/timesten/datastore/sample
    PermSize=200
    DatabaseCharacterSet=AL32UTF8
    ConnectionCharacterSet=AL32UTF8
    DDLReplicationLevel=3
    AutoCreate=0
    ForceDisconnectEnabled=1
    ...
    
  5. Use the ttIsql utility to connect to the sample database and verify the value of the ConnectionCharacterSet attribute is AL32UTF8 (represented in bold).
    % ttIsql sample
     
    Copyright (c) 1996, 2025, Oracle and/or its affiliates. All rights reserved.
    Type ? or "help" for help, type "exit" to quit ttIsql.
     
     
     
    connect "DSN=sample";
    Connection successful:
    DSN=sample;UID=timesten;DataStore=/tt/home/timesten/datastore/sample;
    DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;
    AutoCreate=0;PermSize=200;DDLReplicationLevel=3;ForceDisconnectEnabled=1;
    (Default setting AutoCommit=1)
    

You have successfully modified the sys.odbc.ini file located in the TimesTen container of the active Pod (sample-0) and the sys.odbc.ini file located in the TimesTen container of the standby Pod (sample-1). The ConnectionCharacterSet general connection attribute has also been modified.