19.2 RCUスキーマの削除

RCUスキーマを削除するには、次のステップを実行します:
  1. 次を実行して、ヘルパー・ポッドが存在するかどうかを確認します:
    kubectl get pods -n <domain_namespace> | grep helper
    
    例:
    kubectl get pods -n oamns | grep helper
    
    出力は次のようになります。
    helper                                  1/1     Running     0          26h
    ヘルパー・ポッドが存在しない場合は、次を実行します:
    • Oracle Access Management (OAM)コンテナ・イメージにOracle Container Registryまたは独自のコンテナ・レジストリを使用する場合:
      kubectl run --image=<image_name-from-registry>:<tag> \
      --image-pull-policy="IfNotPresent" \
      --overrides='{"apiVersion": "v1", "spec":{"imagePullSecrets": [{"name": "orclcred"}]}}' \
      helper -n <domain_namespace> \
      -- sleep infinity
      
      例:
      kubectl run --image=container-registry.oracle.com/middleware/oam_cpu:14.1.2.1.0-jdk17-ol8-<YYMMDD> \
      --image-pull-policy="IfNotPresent" \
      --overrides='{"apiVersion": "v1","spec":{"imagePullSecrets": [{"name": "orclcred"}]}}' \
      helper -n oamns \
      -- sleep infinity
      
    • コンテナ・レジストリを使用せずに、各ワーカー・ノードにイメージをロードしている場合は、次のコマンドを実行します:
      kubectl run helper --image <image>:<tag> -n oamns -- sleep infinity
      
      例:
      kubectl run helper --image oracle/oam_cpu:14.1.2.1.0-jdk17-ol8-<YYMMDD> -n oamns -- sleep infinity
      
      出力は次のようになります:
      pod/helper created
      
  2. 次のコマンドを実行して、ヘルパー・ポッド内でBashシェルを起動します:
    kubectl exec -it helper -n <domain_namespace> -- /bin/bash
    例:
    kubectl exec -it helper -n oamns -- /bin/bash
    これにより、実行中のヘルパー・ポッド内のBashシェルに移動します:
    [oracle@helper ~]$
  3. ヘルパーBashシェルで、次のコマンドを実行して、環境を設定します:
    export CONNECTION_STRING=<db_host.domain>:<db_port>/<service_name>
    
    export RCUPREFIX=<rcu_schema_prefix>
    
    echo -e <db_pwd>"\n"<rcu_schema_pwd> > /tmp/pwd.txt
    説明:
    • <db_host.domain>:<db_port>/<service_name>は、データベース接続文字列です。
    • <rcu_schema_prefix>は、RCUスキーマ接頭辞です。
    • <db_pwd>は、データベースのSYSパスワードです。
    • <rcu_schema_pwd>は、<rcu_schema_prefix>のパスワードです
    例:
    export CONNECTION_STRING=mydatabasehost.example.com:1521/orcl.example.com
    
    export RCUPREFIX=OAMK8S
    
    echo -e <password>"\n"<password> > /tmp/pwd.txt
    
    cat /tmp/pwd.txt
    
    cat /tmp/pwd.txtコマンドで正しいパスワードが表示されることを確認します。
  4. ヘルパーBashシェルで、次のようにRCUスキーマを削除します:
    /u01/oracle/oracle_common/bin/rcu -silent -dropRepository -databaseType ORACLE -connectString $CONNECTION_STRING \
    -dbUser sys -dbRole sysdba -selectDependentsForComponents true -schemaPrefix $RCUPREFIX \
    -component MDS -component IAU -component IAU_APPEND -component IAU_VIEWER -component OPSS \
    -component WLS -component STB -component OAM -f < /tmp/pwd.txt
  5. exitコマンドを発行して、ヘルパーBashシェルを終了します。