About Configuring the Database Connections
Learn how to install the automation script and perform the steps that lead to having functional Node-RED, Mosquitto, and Oracle Database instances. This also includes configuring the different solution components to connect to one another.
Run the Script
The script in the GitHub repo automates the provisioning of the environment and installs the dependencies.
Connect the Database
Once everything is up and running (which takes around 15 minutes), you'll need to add in the user name and password into Node-RED to connect to the database.
- Log into Node-RED
<Machine IP>:1880
. - Double-click on the oracledb node.
- Click the edit button.
- Replace with Oracle Autonomous Database.
Configure the Autonomous Database
Set up the user and schema needed by Node-RED, and create a test table with which to test the solution.
Configure the Node-RED Connection
Connect Node-RED to the previously set up Autonomous Database.
- In OCI, navigate Autonomous Database.
- Click Database connection.
- Copy the connection screen.
- Connect (via SSH) to the Node-RED server that was provisioned.
- Edit
tnsnames.ora
. - Add the connection string:
vi /opt/oracle/product/$DBHOME/dbhomeFree/network/admin/tnsnames.ora
- Paste the connection string.
- Rename the connection string to:
adb = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=adb.eu-frankfurt-1.oraclecloud.com))(connect_data=(service_name=ixcsyvrmtjm8ebr_iottest_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))
- Edit
- Navigate to the Node-RED console.
- Edit the oracledb node.
- Modify the server connection and security.
Note:
If you get errorORA-12506: TNS:listener rejected connection based on service ACL filtering
, modify the Access Control List to include the IP of your Node-RED server. You'll also need to add the IP of the machine you are connecting from, and disable the requirement for mTLS.
Set Up Oracle APEX
You can use the data from Kaggle or your own sensor data.
- Launch database actions.
- Click APEX WORKSPACES.
- Complete the form to create a workspace, ensuring you use the same database user created earlier.
- Launch the APEX dashboard.
- Click Create application.
- Select Sample Charts.
- Configure the charts to read the data from your table.