Scenario: Grant a Database Privilege to a Flow Runtime
Connect as the IoT domain workspace user, grant a Flow Runtime access to a workspace procedure, verify the grant, and revoke it when no longer needed.
Use this scenario when a flow needs to execute a procedure in the workspace schema of its IoT domain. The workspace user grants EXECUTE to the database user of a Flow Runtime in that domain.
Database grants are separate from IAM policies that authorize access to IoT resources. Give the specific Flow Runtime only the access required by the flow.
For the database nodes used by the flow, see Oracle Database Nodes in the Flow Runtime Node Reference.
Tasks
Before You Begin
- An existing IoT domain and a Flow Runtime belonging to that domain.
- An existing workspace procedure required by the flow. The workspace user must own the procedure or have authority to grant its
EXECUTEprivilege. - Access to SQL in the domain workspace through APEX SQL Workshop or an authorized database client. Configure only the prerequisites for the connection method you use, as described below.
Use the actual database identifiers, including their case. Replace <domainShortId>, <flowRuntimeShortId>, and <procedureName> in the examples with your values.
Access the IoT Domain Workspace
Choose one of the following ways to run SQL as the domain workspace user. Creating a Database Tools connection is not required for privilege delegation.
- APEX SQL Workshop: If APEX access is not configured, follow Configuring Access to your IoT Data. Log in to the domain's APEX workspace, open SQL Workshop, and select the
<domainShortId>__WKSPschema. Open SQL Commands to run the grant, verification and revoke statements below. - A direct database client: Reuse an authorized connection as
<domainShortId>__WKSP. If you need to configure this connection, follow Scenario: Connecting Directly to the IoT Database for its network, allowlist and authentication prerequisites. - Database Tools (optional): If you choose this client, follow Scenario: Connect to IoT Data with Database Tools to create its private endpoint and workspace connection, validate the connection, and open SQL Worksheet. These setup steps apply to the Database Tools option.
Continue with Grant a Database Privilege to a Flow Runtime. The workspace user needs authority to grant the privilege regardless of the SQL client used.
Grant a Database Privilege to a Flow Runtime
Give a Flow Runtime access to a workspace procedure that its flows need.
Choose a method to access the domain workspace. The workspace user must own the procedure or have authority to grant its EXECUTE privilege. Use an existing procedure in the workspace schema and a Flow Runtime belonging to the same IoT domain.
Grant only the object privileges required by the flow. Database grants are separate from IAM policies that authorize access to IoT resources. Remove a grant when the flow no longer needs that access.