Connecting to the Oracle Autonomous Data Warehouse via Oracle Cloud Data Science Service
This tutorial demonstrates how to connect two Oracle cloud services, Oracle Autonomous Data Warehouse and the Cloud Data Science services.
Join the DZone community and get the full member experience.Join For Free
In this article, I will link Oracle's two different cloud services. I hope it will be a useful article in terms of awareness.
As it is known, Oracle recently announced the Data Science Cloud Service. This service is a cloud service with features that will speed up the work of professionals dealing with data science, artificial intelligence, machine learning. You can read detailed information about this service by clicking on the link.
The Data Science Cloud service is a platform with a Jupyter Notebook interface. While developing a model in this interface, we have a wide variety of options to read the data that will be the subject of our development. In this study, I will use Autonomous Data Warehouse (ADW) service, which is also a cloud service. I will connect to ADW through the Data Science Cloud service and read the data from the tables here.
You may also enjoy: Connecting an Autonomous Data Warehouse With Python
First of all, we need an Oracle Client to connect to the Oracle ADW service. By typing the following command on the terminal screen we set up above, we can get this client to download on the Oracle Data Science Cloud Service machine.
Yes, after running our command, we can observe that the related client has been downloaded shortly. However, the file we downloaded is a .zip file, so we open this compressed file by running the command below on the terminal screen.
We opened our client (you can see that the instantclient_19_5 folder has occurred in the directory) and now let's upload the wallet, which we will connect to ADW and download by the ADW service, to our Oracle Data Science service. We can easily upload via the buttons on the screen.
After loading our ADW Wallet to the environment, we will move the wallet into the client we opened in the service with the following 2 commands and extract it from the zip file.
Finally, we need to update the wallet path in the sqlnet.ora file in the wallet we extracted. (sqlnet.ora -> instantclient_19_5 / network / admin / sqlnet.ora)
Let's first look at the content of sqlnet.ora.
Open this file. We need to change the part of the “?” character where we open our wallet with the full path and save and close it. We can do this change with vi as well as through the interface. As a result, our sqlnet.ora file should be as follows.
We have now provided all the necessary conditions to connect through the notebook. Now, let's start a new notebook from the interface and try to reach ADW with Python code.
As you can see, we were able to read a sample data in our ADW Cloud Service and put it in a data frame from a notebook we started in Data Science Cloud Service.
Opinions expressed by DZone contributors are their own.