コマンドライン・インタフェース(CLI)の使用
CLIを使用して、データベース・ツール接続を管理します。
CLIの使用の詳細は、コマンドライン・インタフェース(CLI)を参照してください。CLIコマンドで使用できるフラグおよびオプションの完全なリストは、コマンドライン・リファレンスを参照してください。
トピック:
Oracle Database接続用 🔗
Oracle接続を更新するには 🔗
コマンド・プロンプトを開き、oci dbtools connection update-oracle-database
を実行して、指定した接続を更新します:
oci dbtools connection update-oracle-database --connection-id <connection_ocid>
--<property_to_update> <new_value>
たとえば、接続の表示名を変更します。
oci dbtools connection update-oracle-database --connection-id
ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz
--display-name new-connection-name
たとえば、接続に関連付けられているパスワード・シークレットの変更:
oci dbtools connection update-oracle-database --connection-id
ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz
--user-password-secret-id ocid1.vaultsecret.oc1.phx.newexample1secrettxiu7mwuabcdexl67fj5niy4akfzsabcdefzf3423ya
たとえば、接続の接続文字列を変更します。
oci dbtools connection update-oracle-database --connection-id
ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz
--connection-string '(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)
(host=adb.us-phoenix-1.oraclecloud.com))(connect_data=(service_name=example_databaseservice_high.adb.oraclecloud.com))
(security=(ssl_server_cert_dn="CN=adwc.uscom-east-1.oraclecloud.com,
OU=Oracle BMCS US, O=Oracle Corporation, L=Redwood City, ST=California, C=US")))'
たとえば、接続のプロキシ・クライアント情報を削除します。
oci dbtools connection update-oracle-database --connection-id
ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz
--proxy-client '{ "proxy-authentication-type": "NO_PROXY"}'
Oracle接続を検証するには 🔗
コマンド・プロンプトを開き、oci dbtools connection validate-oracle-database
を実行して、指定した接続を検証します:
oci dbtools connection validate-oracle-database --connection-id <connection_ocid>
コードが
OK
のレスポンス・データは、接続が期待どおりに動作していることを示します。
たとえば:
oci dbtools connection validate-oracle-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz
Oracle接続をリストするには 🔗
コマンド・プロンプトを開き、oci dbtools connection list
を実行して、指定したコンパートメント内のすべてのOracle接続の詳細を表示します:
oci dbtools connection list -c <target_compartment_ocid> --type ORACLE_DATABASE
たとえば:
oci dbtools connection list -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --type ORACLE_DATABASE
MySQL Database接続用 🔗
MySQL接続を更新するには 🔗
コマンド・プロンプトを開き、oci dbtools connection update-mysql-database
を実行して、指定した接続を更新します:
oci dbtools connection update-mysql-database --connection-id <connection_ocid> --<property_to_update> <new_value>
たとえば、接続の表示名を変更します。
oci dbtools connection update-mysql-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --display-name new-connection-name
たとえば、接続に関連付けられているパスワード・シークレットの変更:
oci dbtools connection update-mysql-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --user-password-secret-id ocid1.vaultsecret.oc1.phx.newexample1secrettxiu7mwuabcdexl67fj5niy4akfzsabcdefzf3423ya
たとえば、接続の接続文字列を変更します。
oci dbtools connection update-mysql-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --connection-string "mysql://10.0.0.42:3306/somenewdatabase"
MySQL接続を検証するには 🔗
コマンド・プロンプトを開き、oci dbtools connection validate-mysql-database
を実行して、指定した接続を検証します:
oci dbtools connection validate-mysql-database --connection-id <connection_ocid>
コードが
OK
のレスポンス・データは、接続が期待どおりに動作していることを示します。
たとえば:
oci dbtools connection validate-mysql-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz
MySQL接続をリストするには 🔗
コマンド・プロンプトを開き、oci dbtools connection list
を実行して、指定したコンパートメント内のすべてのMySQL接続の詳細を表示します:
oci dbtools connection list -c <target_compartment_ocid> --type MYSQL
たとえば:
oci dbtools connection list -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --type MYSQL
すべての接続タイプ 🔗
すべての接続を表示するには 🔗
コマンド・プロンプトを開き、oci dbtools connection list
を実行して、指定したコンパートメント内のすべての接続の詳細を表示します:
oci dbtools connection list -c <target_compartment_ocid>
例:
oci dbtools connection list -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz