For Oracle Database Connections
- To create a connection to ADB with public IP using mTLS
- To create a connection to ADB with public IP using mTLS in JSON file
- To create a connection to an Oracle VM DB system using a private endpoint
- To create a proxy connection to Oracle Database with user name
- To create a proxy connection to Oracle Database with advanced properties
- To create a proxy connection to Oracle Database with the proxy-client parameter
- To create a proxy connection to Oracle Database with the proxy-client parameter in JSON file
To create a connection to ADB with public IP using mTLS
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database -c <target_compartment_ocid> --user-name <database_user> --user-password-secret-id <vault_secret_ocid> --key-stores <keystore_json_array> --connection-string <connection_string> --display-name <connection_name>
This example assumes required secrets already exist in a vault.
For example, specifying all required details as arguments:
oci dbtools connection create-oracle-database -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --user-name "example-user" --user-password-secret-id ocid1.vaultsecret.oc1.phx.example1secrettxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya --key-stores '[{ "keyStoreContent":{ "secretId": "ocid1.vaultsecret.oc1.phx.example1ssowalletxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya","valueType": "SECRETID" }, "keyStoreType": "SSO" }]' --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_low.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")))' --display-name example-connection
To create a connection to ADB with public IP using mTLS in JSON file
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection as
specified in the JSON file:
oci dbtools connection create-oracle-database --from-json "file://<path-to-json>"
This example assumes required secrets already exist in a vault.
For example, specifying all required details in a JSON file:
{
"compartmentId": "ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz",
"connectionString": "(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_low.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\")))",
"displayName": "example-connection-from-json",
"keyStores": [
{
"keyStoreContent": {
"secretId": "ocid1.vaultsecret.oc1.phx.example1ssowalletxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya",
"valueType": "SECRETID"
},
"keyStoreType": "SSO"
}
],
"userName": "example-user",
"userPasswordSecretId": "ocid1.vaultsecret.oc1.phx.example1secrettxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya"
}
In this example there is a JSON file in the current working directory called
example.json as shown
above.
oci dbtools connection create-oracle-database --from-json "file://example.json"
To create a connection to an Oracle VM DB system using a private endpoint
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database -c <target_compartment_ocid> --user-name <database_user> --user-password-secret-id <vault_secret_ocid> --connection-string <connection_string> -private-endpoint-id <private_endpoint_ocid> --display-name <connection_name>
This example assumes required secrets already exist in a vault.
For example:
oci dbtools connection create-oracle-database -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --user-name "example-user" --user-password-secret-id ocid1.vaultsecret.oc1.phx.example1secrettxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya --connection-string "examplevmdb.privatesubnet.example.oraclevcn.com:1521/example_pdb.privatesubnet.example.oraclevcn.com" --private-endpoint-id ocid1.databasetoolsprivateendpoint.oc1.phx.exampleendpoint25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabcdefg --display-name example-connection
To create a proxy connection to Oracle Database with user name
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database -c <target_compartment_ocid>
--user-name <database_user[proxy_client]> --user-password-secret-id <vault_secret_ocid>
--key-stores <keystore_json_array> --connection-string <connection_string>
--private-endpoint-id <private_endpoint_ocid> --display-name <connection_name>
This example assumes a private endpoint and the required secret in a vault already exist. This example can be used without proxy authentication.
For example:
oci dbtools connection create-oracle-database -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --user-name "example-user[proxy-client]" --user-password-secret-id ocid1.vaultsecret.oc1.phx.example1secrettxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya --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_low.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")))" --key-stores '[{ "keyStoreContent":{ "secretId": "ocid1.vaultsecret.oc1.phx.example1ssowalletxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya", "valueType": "SECRETID" }, "keyStoreType": "SSO" }]' --private-endpoint-id ocid1.databasetoolsprivateendpoint.oc1.phx.exampleendpoint25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabcdefg --display-name example-connection
To create a proxy connection to Oracle Database with advanced properties
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database -c <target_compartment_ocid>
--user-name <database_user> --user-password-secret-id <vault_secret_ocid> --key-stores <keystore_json_array>
--connection-string <connection_string> --private-endpoint-id <private_endpoint_ocid>
--display-name <connection_name> --advanced-properties <advanced_properties_json>
This example assumes a private endpoint and the required secret in a vault already exist. This example can be used without proxy authentication.
For example:
oci dbtools connection create-oracle-database -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --user-name "example-user" --user-password-secret-id ocid1.vaultsecret.oc1.phx.example1secrettxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya --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_low.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")))" --key-stores '[{ "keyStoreContent":{ "secretId": "ocid1.vaultsecret.oc1.phx.example1ssowalletxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya", "valueType": "SECRETID" }, "keyStoreType": "SSO" }]' --private-endpoint-id ocid1.databasetoolsprivateendpoint.oc1.phx.exampleendpoint25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabcdefg --display-name example-connection --advanced-properties '{ "oracle.jdbc.proxyClientName": "proxy-client" }'
To create a proxy connection to Oracle Database with the proxy-client parameter
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database -c <target_compartment_ocid> --user-name
<database_user> --user-password-secret-id <vault_secret_ocid> --key-stores <keystore_json_array>
--connection-string <connection_string> --private-endpoint-id <private_endpoint_ocid>
--display-name <connection_name> --proxy-client <proxy_client_json>
This example assumes a private endpoint and the required secret in a vault already exist. This example can be used without proxy authentication.
For example:
oci dbtools connection create-oracle-database -c ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz --user-name "example-user" --user-password-secret-id ocid1.vaultsecret.oc1.phx.example1secrettxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya --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_low.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")))" --key-stores '[{ "keyStoreContent":{ "secretId": "ocid1.vaultsecret.oc1.phx.example1ssowalletxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya", "valueType": "SECRETID" }, "keyStoreType": "SSO" }]' --private-endpoint-id ocid1.databasetoolsprivateendpoint.oc1.phx.exampleendpoint25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabcdefg --display-name example-connection --proxy-client '{ "proxy-authentication-type": "USER_NAME", "user-name": "proxy-client", "roles": [ "connect" ]}'
To create a proxy connection to Oracle Database with the proxy-client parameter in JSON file
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection as specified in
the JSON file:
oci dbtools connection create-oracle-database --from-json "file://<path-to-json>"
This example assumes a private endpoint and the required secret in a vault already exist. This example can be used without proxy authentication.
For example, specifying all required details in a JSON file:
{
"compartmentId": "ocid1.compartment.oc1..example1example25qrlpo4agcmothkbgqgmuz2zzum45ibplooqtabwk3zz",
"connectionString": "(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_low.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\")))",
"displayName": "example-connection-from-json",
"keyStores": [
{
"keyStoreContent": {
"secretId": "ocid1.vaultsecret.oc1.phx.example1ssowalletxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya",
"valueType": "SECRETID"
},
"keyStoreType": "SSO"
}
],
"userName": "example-user",
"userPasswordSecretId": "ocid1.vaultsecret.oc1.phx.example1secrettxiu7mwuabcdefxl67fj5niy4akfzsabcdefzf3423ya",
"proxyClient": {
"proxyAuthenticationType": "USER_NAME",
"userName": "proxyClient",
"userPassword": {
"valueType": "SECRETID",
"secretId": "ocid1.vaultsecret.oc1.phx.amaaaaaacsc5xjaanv6tjndg4dujfcarguywkftbvgsolw5w6fb22rhpb6ta"
},
"roles": [ "connect" ]
}
}
For IAM-Authenticated Connections
- To create a connection to Oracle Database using IAM token-based authentication
- To create a proxy connection to Oracle Database using IAM token-based authentication
- To create a proxy connection with user name using password authentication
- To create a proxy connection with advanced properties using password authentication
- To create a proxy connection with advanced properties using token-based authentication
- To create a proxy connection with the proxy-client parameter using password authentication
- To create a proxy connection with auto-detected proxy client using token-based authentication
To create a connection to Oracle Database using IAM token-based authentication
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database --compartment-id <compartment_ocid>
--display-name <connection_name> --connection-string <connection_string> --authentication-type TOKEN
For example:
oci dbtools connection create-oracle-database --compartment-id ocid1.compartment.oc1..exampleexamplegs3lajseq
--display-name example-iam-connection
--connection-string "(description=(retry_count=0)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<adb-hostname>))(connect_data=(service_name=service-name))(security=(ssl_server_dn_match=yes)))"
--authentication-type TOKEN
To create a proxy connection to Oracle Database using IAM token-based authentication
Use this option when IAM authenticates the proxy user and the database session is established as a proxy client user.
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database --compartment-id <compartment_ocid> --display-name <connection_name>
--connection-string <connection_string> --user-name '[proxy_client1]' --authentication-type TOKEN
For example:
oci dbtools connection create-oracle-database --compartment-id ocid1.compartment.oc1..example7augka7wugqsmsdcyw5olcazkp4no3h47lia
--display-name proxy-abc --connection-string "(description=(retry_count=0)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<adb-hostname>))(connect_data=(service_name=<service-name))(security=(ssl_server_dn_match=yes)))'"
--user-name '[proxy_client1]' --authentication-type TOKEN --endpoint "https://dbtools.<region>.oci.oraclecloud.com"
To create a proxy connection with user name using password authentication
Use this option to authenticate with a database password and connect through a proxy client user.
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database --compartment-id <compartment_ocid>
--display-name <connection_name> --connection-string <connection_string> --user-name 'proxy_user[proxy_client1]'
--authentication-type PASSWORD --user-password-secret-id <password-secret-ocid>
For example:
oci dbtools connection create-oracle-database --compartment-id ocid1.compartment.oc1..exampleaugka7wugqsmsdcyw5olcazkp4no3h47lia
--display-name proxy-abc --connection-string "(description=(retry_count=0)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<adb-hostname>))(connect_data=(service_name=service-name))(security=(ssl_server_dn_match=yes)))"
--user-name 'proxy_user[proxy_client1]' --authentication-type PASSWORD
--user-password-secret-id ocid1.vaultsecret.oc1.exampleaaiaqsoeecjlur7kyptlhu7yggiffb5oqdvfayf6rozrpxma
To create a proxy connection with advanced properties using password authentication
Use this option when you want to specify the proxy client user using connection properties.
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database --compartment-id <compartment_ocid> --display-name <connection_name>
--connection-string <connection_string> --user-name proxy_user --authentication-type PASSWORD
--user-password-secret-id <vault_secret_ocid> --advanced-properties '{ "oracle.jdbc.proxyClientName": "proxy_client1" }' --endpoint <region-url>
For example:
oci dbtools connection create-oracle-database --compartment-id ocid1.compartment.oc1..exampleaugka7wugqsmsdcyw5olcazkp4no3h47lia
--display-name proxy-abc --connection-string "(description=(retry_count=0)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<adb-hostname>))(connect_data=(service_name=service-name))(security=(ssl_server_dn_match=yes)))"
--user-name proxy_user --authentication-type PASSWORD --user-password-secret-id ocid1.vaultsecret.oc1.examplekyptlhu7yggiffb5oqdvfayf6rozrpxma
--advanced-properties '{"oracle.jdbc.proxyClientName":"proxy_client1"}' --endpoint "https://dbtools.<region>.oci.oraclecloud.com/20201005"
To create a proxy connection with advanced properties using token-based authentication
Use this option when you want to specify the proxy client user using connection properties.
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database --compartment-id <compartment_ocid> --display-name <connection_name>
--connection-string <connection_string> --user-name proxy_user --authentication-type TOKEN
--advanced-properties '{ "oracle.jdbc.proxyClientName": "proxy_client1" }' --endpoint <region-url>
For example:
oci dbtools connection create-oracle-database --compartment-id ocid1.compartment.oc1..exampleaugka7wugqsmsdcyw5olcazkp4no3h47lia
--display-name proxy-abc --connection-string "(description=(retry_count=0)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<adb-hostname>))(connect_data=(service_name=service-name))(security=(ssl_server_dn_match=yes)))"
--user-name proxy_user --authentication-type TOKEN --advanced-properties '{"oracle.jdbc.proxyClientName":"proxy_client1"}'
--endpoint "https://dbtools.<region>.oci.oraclecloud.com"
To create a proxy connection with the proxy-client parameter using password authentication
Use this option to provide proxy client details explicitly.
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database --compartment-id <compartment_ocid> --display-name <connection_name>
--connection-string <connection_string> --user-name proxy_user --authentication-type PASSWORD
--user-password-secret-id <vault_secret_ocid> --proxy-client <proxy_client_json> --endpoint <region-url>
For example:
oci dbtools connection create-oracle-database --compartment-id ocid1.compartment.oc1..examplewugqsmsdcyw5olcazkp4no3h47lia
--display-name proxy-abc--connection-string '(description=(retry_count=0)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<adb-hostname>))(connect_data=(service_name=service-name))(security=(ssl_server_dn_match=yes)))'
--user-name 'proxy_user' --authentication-type PASSWORD
--user-password-secret-id ocid1.vaultsecret.oc1.exampleyptlhu7yggiffb5oqdvfayf6rozrpx
--proxy-client '{"proxyAuthenticationType":"USER_NAME","userName":"proxy_client1"}'
--endpoint 'https://dbtools.<region>.oci.oraclecloud.com'
To create a proxy connection with auto-detected proxy client using token-based authentication
Use this option to dynamically determine the proxy client at runtime.
Open a command prompt and run oci dbtools connection
create-oracle-database to create a new Database Tools connection within
the specified compartment:
oci dbtools connection create-oracle-database --compartment-id <compartment_ocid> --display-name <connection_name>
--connection-string <connection_string> --authentication-type TOKEN
--proxy-client '{"proxyAuthenticationType":"USER_NAME","userName":"<proxy-client>"}' --endpoint <region-url>
For example:
oci dbtools connection create-oracle-database --compartment-id ocid1.compartment.oc1..exampleugka7wugqsmsdcyw5olcazkp4no3h47lia
--display-name proxy-abc --connection-string '(description=(retry_count=0)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=<adb-hostname>))(connect_data=(service_name=service-name))(security=(ssl_server_dn_match=yes)))'
--authentication-type TOKEN --proxy-client '{"proxyAuthenticationType":"USER_NAME_AUTO_DETECT"}'
--endpoint 'https://dbtools.<region>.oci.oraclecloud.com'