Oracle Database-Verbindungen

So erstellen Sie eine Verbindung zu ADB mit öffentlicher IP mit mTLS

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>
Hinweis

In diesem Beispiel wird davon ausgegangen, dass erforderliche Secrets bereits in einem Vault vorhanden sind.

Beispiel: Sie geben alle erforderlichen Details als Argumente an:

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

So erstellen Sie eine Verbindung zu ADB mit öffentlicher IP mit mTLS in der JSON-Datei

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools zu erstellen, wie in der JSON-Datei angegeben:

oci dbtools connection create-oracle-database --from-json "file://<path-to-json>"
Hinweis

In diesem Beispiel wird davon ausgegangen, dass erforderliche Secrets bereits in einem Vault vorhanden sind.

Beispiel: Geben Sie alle erforderlichen Details in einer JSON-Datei an:

{
  "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"
}
Hinweis

In diesem Beispiel befindet sich eine JSON-Datei im aktuellen Arbeitsverzeichnis mit dem Namen example.json, wie oben gezeigt.
oci dbtools connection create-oracle-database --from-json "file://example.json"

So erstellen Sie eine Verbindung zu einem Oracle VM-DB-System mit einem privaten Endpunkt

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>
Hinweis

In diesem Beispiel wird davon ausgegangen, dass erforderliche Secrets bereits in einem Vault vorhanden sind.

Beispiel:

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

So erstellen Sie eine Proxyverbindung zu Oracle Database mit dem Benutzernamen

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>
Hinweis

In diesem Beispiel wird davon ausgegangen, dass ein privater Endpunkt und das erforderliche Secret in einem Vault bereits vorhanden sind. Dieses Beispiel kann ohne Proxyauthentifizierung verwendet werden.

Beispiel:

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

So erstellen Sie eine Proxyverbindung zu Oracle Database mit erweiterten Eigenschaften

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>
Hinweis

In diesem Beispiel wird davon ausgegangen, dass ein privater Endpunkt und das erforderliche Secret in einem Vault bereits vorhanden sind. Dieses Beispiel kann ohne Proxyauthentifizierung verwendet werden.

Beispiel:

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

So erstellen Sie eine Proxyverbindung zu Oracle Database mit dem Proxy-Client-Parameter:

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>
Hinweis

In diesem Beispiel wird davon ausgegangen, dass ein privater Endpunkt und das erforderliche Secret in einem Vault bereits vorhanden sind. Dieses Beispiel kann ohne Proxyauthentifizierung verwendet werden.

Beispiel:

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" ]}'

So erstellen Sie eine Proxyverbindung zu Oracle Database mit dem Proxy-Client-Parameter in der JSON-Datei

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools zu erstellen, wie in der JSON-Datei angegeben:

oci dbtools connection create-oracle-database --from-json "file://<path-to-json>"
Hinweis

In diesem Beispiel wird davon ausgegangen, dass ein privater Endpunkt und das erforderliche Secret in einem Vault bereits vorhanden sind. Dieses Beispiel kann ohne Proxyauthentifizierung verwendet werden.

Beispiel: Geben Sie alle erforderlichen Details in einer JSON-Datei an:

{
  "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" ]
  }
}

Von IAM authentifizierte Verbindungen

So erstellen Sie eine Verbindung zu Oracle Database mit der tokenbasierten IAM-Authentifizierung

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

oci dbtools connection create-oracle-database --compartment-id <compartment_ocid> 
--display-name <connection_name> --connection-string <connection_string> --authentication-type TOKEN

Beispiel:

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

So erstellen Sie eine Proxyverbindung zu Oracle Database mit der tokenbasierten IAM-Authentifizierung

Verwenden Sie diese Option, wenn IAM den Proxybenutzer authentifiziert und die Datenbanksession als Proxyclientbenutzer eingerichtet ist.

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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

Beispiel:

 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" 

So erstellen Sie eine Proxyverbindung mit dem Benutzernamen mithilfe der Kennwortauthentifizierung

Verwenden Sie diese Option, um sich mit einem Datenbankkennwort zu authentifizieren und eine Verbindung über einen Proxyclientbenutzer herzustellen.

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>

Beispiel:

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

So erstellen Sie eine Proxyverbindung mit erweiterten Eigenschaften mit der Kennwortauthentifizierung

Verwenden Sie diese Option, wenn Sie den Proxyclientbenutzer mit Verbindungseigenschaften angeben möchten.

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>

Beispiel:

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" 

So erstellen Sie eine Proxyverbindung mit erweiterten Eigenschaften mit tokenbasierter Authentifizierung

Verwenden Sie diese Option, wenn Sie den Proxyclientbenutzer mit Verbindungseigenschaften angeben möchten.

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>

Beispiel:

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" 

So erstellen Sie eine Proxyverbindung mit dem Proxy-Client-Parameter mithilfe der Passwortauthentifizierung

Mit dieser Option können Sie Proxyclientdetails explizit angeben.

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>

Beispiel:

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'

So erstellen Sie eine Proxyverbindung mit einem automatisch erkannten Proxyclient mithilfe einer tokenbasierten Authentifizierung

Mit dieser Option können Sie den Proxyclient zur Laufzeit dynamisch bestimmen.

Öffnen Sie eine Eingabeaufforderung, und führen Sie oci dbtools connection create-oracle-database aus, um eine neue Verbindung zu Datenbanktools im angegebenen Compartment zu erstellen:

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>

Beispiel:

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'