Using the Command Line Interface (CLI)

Use the CLI to manage Database Tools connections.

For information about using the CLI, see Command Line Interface (CLI). For a complete list of flags and options available for CLI commands, see the Command Line Reference.

Topics:

For Oracle Database Connections

To update Oracle connections

Open a command prompt and run oci dbtools connection update-oracle-database to update the specified connection:

oci dbtools connection update-oracle-database --connection-id <connection_ocid> 
--<property_to_update> <new_value>

For example, changing the display name of a connection:

oci dbtools connection update-oracle-database --connection-id 
ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz 
--display-name new-connection-name

For example, changing the password secret associated with a connection:

oci dbtools connection update-oracle-database --connection-id 
ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz 
--user-password-secret-id ocid1.vaultsecret.oc1.phx.newexample1secrettxiu7mwuabcdexl67fj5niy4akfzsabcdefzf3423ya

For example, changing the connection string of a connection:

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")))'

For example, removing the proxy client information of a connection:

oci dbtools connection update-oracle-database --connection-id
ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz
--proxy-client '{ "proxy-authentication-type": "NO_PROXY"}'

To validate Oracle connections

Open a command prompt and run oci dbtools connection validate-oracle-database to validate the specified connection:

oci dbtools connection validate-oracle-database --connection-id <connection_ocid>
Note

Response data with a code of OK indicates the connection is working as expected.

For example:

oci dbtools connection validate-oracle-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz

To list Oracle connections

Open a command prompt and run oci dbtools connection list to view the details of all Oracle connections within a specified compartment:

oci dbtools connection list -c <target_compartment_ocid> --type ORACLE_DATABASE

For example:

oci dbtools connection list -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --type ORACLE_DATABASE

For MySQL Database Connections

To update MySQL connections

Open a command prompt and run oci dbtools connection update-mysql-database to update the specified connection:

oci dbtools connection update-mysql-database --connection-id <connection_ocid> --<property_to_update> <new_value>

For example, changing the display name of a connection:

oci dbtools connection update-mysql-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --display-name new-connection-name

For example, changing the password secret associated with a connection:

oci dbtools connection update-mysql-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --user-password-secret-id ocid1.vaultsecret.oc1.phx.newexample1secrettxiu7mwuabcdexl67fj5niy4akfzsabcdefzf3423ya

For example, changing the connection string of a connection:

oci dbtools connection update-mysql-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --connection-string "mysql://10.0.0.42:3306/somenewdatabase"

To validate MySQL connections

Open a command prompt and run oci dbtools connection validate-mysql-database to validate the specified connection:

oci dbtools connection validate-mysql-database --connection-id <connection_ocid>
Note

Response data with a code of OK indicates the connection is working as expected.

For example:

oci dbtools connection validate-mysql-database --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz

To list MySQL connections

Open a command prompt and run oci dbtools connection list to view the details of all MySQL connections within a specified compartment:

oci dbtools connection list -c <target_compartment_ocid> --type MYSQL

For example:

oci dbtools connection list -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --type MYSQL

For All Connection Types

To list all connections

Open a command prompt and run oci dbtools connection list to view the details of all connections within a specified compartment:

oci dbtools connection list -c <target_compartment_ocid>

For example:

oci dbtools connection list -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz

To get a connection

Open a command prompt and run oci dbtools connection get to view the details of a specified connection:

oci dbtools connection get --connection-id <connection_ocid>

For example:

oci dbtools connection get --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz

To delete a connection

Open a command prompt and run oci dbtools connection delete to delete the specified connection:

oci dbtools connection delete --connection-id <connection_ocid>

For example:

oci dbtools connection delete --connection-id ocid1.databasetoolsconnection.oc1.phx.example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz