33The OCI Internet of Things Platform allows you to connect directly to the
44database storing your Digital Twin definitions and telemetry.
55
6- This guide shows how to connect to your IoT database using a Python script.
6+ The
7+ [ Scenario: Connecting Directly to the IoT Database] ( https://docs.oracle.com/en-us/iaas/Content/internet-of-things/connect-database.htm )
8+ section of the documentation shows how to establish a database connection with
9+ [ SQLcl] ( https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/ ) .
10+ This guide focuses on how to connect to your IoT database using a Python script.
711
812## Concepts
913
1014Each IoT Domain Group uses an Oracle Autonomous Database, which is shared by
1115all IoT Domains in that group.
1216
13- To access the database, you must ensure that your client IP address is
17+ To access the database, you must ensure that your client VCN is
1418included in the Allow List defined at the IoT Domain Group level –
15- [ Documentation] ( . ) .
19+ [ Documentation] ( https://docs.oracle.com/en-us/iaas/Content/internet-of-things/connect-database.htm#top__create-vcn ) .
1620
1721When connected, to access the database schemas related to a particular IoT
1822Domain, the OCI user initiating the connection must be part of one of the
19- identity groups listed at the IoT Domain level – [ Documentation] ( . ) .
23+ Identity Domain (Dynamic) Groups listed at the IoT Domain level –
24+ [ Documentation] ( https://docs.oracle.com/en-us/iaas/Content/internet-of-things/connect-database.htm#top__identity-domain ) .
2025
2126Database authentication is handled using
2227[ OCI Identity Database Tokens] ( https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/iam-access-database.html#GUID-CFC74EAF-E887-4B1F-9E9A-C956BCA0BEA9 ) .
@@ -27,10 +32,6 @@ The user account running the script must be properly configured to retrieve
2732oci iam db-token get --scope " urn:oracle:db::id::*"
2833```
2934
30- While the OCI IoT Platform also supports _ Instance Principal_ authentication,
31- this example uses the default API Key Authentication configured in the
32- ` ~/.oci/config ` file.
33-
3435The ` oracledb ` Python module handles token retrieval seamlessly when
3536specifying ` extra_auth_params=token_based_auth ` at connection time.
3637
@@ -63,7 +64,9 @@ Copy `config.distr.py` to `config.py` and set the following variables:
6364- ` db_connect_string ` : The dbConnectionString property of your IoT Domain Group.
6465- ` db_token_scope ` : The dbTokenScope property of your IoT Domain Group.
6566- ` iot_domain_short_name ` : The hostname part of the deviceHost property of your IoT Domain.
66- - ` oci_profile ` : OCI CLI profile to use for token retrieval.
67+ - ` oci_auth_type ` : The OCI Authentication type. Must be either "ConfigFileAuthentication"
68+ for API Key authentication or "InstancePrincipal".
69+ - ` oci_profile ` : OCI CLI profile to use for token retrieval when using API Key authentication.
6770- ` row_count ` : The number of rows retrieved by the sample queries.
6871- ` thick_mode ` : Set to ` True ` to use the ` oracledb ` Thick mode driver.
6972
0 commit comments