db.iniファイルの手動編集

このセクションは、初期接続属性と一般接続属性のどちらか(または両方)を変更する場合に完了します。この項は、「初期接続属性の変更」または「一般接続属性の変更」の項に進む前に完了しておく必要があります。

初期接続属性または一般接続属性を変更するには、sys.odbc.iniファイルを変更する必要があります。

TimesTenClassicオブジェクトをすでに作成し、sys.odbc.iniファイル内の初期接続属性または一般接続属性を1つ以上変更する場合は、db.iniファイルを変更する必要があります。

db.iniファイルの変更方法の詳細は、db.iniファイルを収容するために最初に使用した機能によって異なります。(その可能性のある機能には、ConfigMap、Secretまたは初期化コンテナが含まれます。「/ttconfigディレクトリの移入」を参照してください。)

この例では、最初にdb.iniファイルを収容してTimesTenコンテナの/ttconfigディレクトリを移入するためにConfigMap機能が使用されました。この例では、sample ConfigMapを変更します。

ステップは次のとおりです。

  1. kubectl describeコマンドを使用して、元のsample ConfigMapにあるdb.iniファイル(boldで表示)の内容を確認します。
    % kubectl describe configmap sample
    Name:         sample
    Namespace:    mynamespace
    Labels:       <none>
    Annotations:  <none>
     
    Data
    ====
    adminUser:
    ----
    sampleuser/samplepw
     
    db.ini:
    ----
    PermSize=200
    DatabaseCharacterSet=AL32UTF8
    ConnectionCharacterSet=AL32UTF8
    
    schema.sql:
    ----
    create sequence sampleuser.s;
    create table sampleuser.emp (id number not null primary key, name char (32));
     
    Events:  <none>
    
  2. kubectl editコマンドを使用して、元のsample ConfigMapのdb.iniファイルを変更します。初期接続属性のPermSize600 (boldで表示)に変更します。初期接続属性のTempSizeを追加して、その値を300 (boldで表示)に設定します。ConnectionCharacterSet接続属性を追加します。
    % kubectl edit configmap sample
    # Please edit the object below. Lines beginning with a '#' will be ignored,
    # and an empty file will abort the edit. If an error occurs while saving this 
    # file will be reopened with the relevant failures.
    #
    apiVersion: v1
    data:
      adminUser: |
        sampleuser/samplepw
      db.ini: |
        PermSize=600
        TempSize=300
        DatabaseCharacterSet=AL32UTF8
        ConnectionCharacterSet=AL32UTF8
      schema.sql: |
        create sequence sampleuser.s;
        create table sampleuser.emp (id number not null primary key, name char (32));
    kind: ConfigMap
    metadata:
      creationTimestamp: "2024-04-30T19:23:59Z"
      name: sample
      namespace: mynamespace
      resourceVersion: "71907255"
      selfLink: /api/v1/namespaces/mynamespace/configmaps/sample 
     uid: 0171ff7f-f789-11ea-82ad-0a580aed0453
    ...
    configmap/sample edited
    
  3. kubectl describeコマンドを使用して、sample ConfigMapに対する変更内容を検証します。(変更箇所はboldで表示しています)。
    % kubectl describe configmap sample
    Name:         sample
    Namespace:    mynamespace
    Labels:       <none>
    Annotations:  <none>
     
    Data
    ====
    schema.sql:
    ----
    create sequence sampleuser.s;
    create table sampleuser.emp (id number not null primary key, name char (32));
     
    adminUser:
    ----
    sampleuser/samplepw
     
    db.ini:
    ----
    PermSize=600
    TempSize=300
    DatabaseCharacterSet=AL32UTF8
    ConnectionCharacterSet=AL32UTF8
     
    Events:  <none>
    

sample ConfigMapの変更が完了しました。初期接続属性を変更する場合は、「初期接続属性の変更」に進んでください。一般接続属性のみを変更する場合は、「一般接続属性の変更」に進んでください。