Various Tutorials
  • About
  • Tutorials
    • 1. Instance for deployment
      • Create instance
      • Install and configure OCI CLI
      • OCI CLI small test
      • Install and configure Terraform
      • Terraform - small test
    • 2. OCI Networking &Terraform
      • 2.1 VCN (basics)
        • 2.1.1 Create a virtual network using Start VCN Wizard
        • 2.1.2 VCN & public subnet (step-by-step in Terraform)
        • 2.1.3 VCN & public subnet (new compartment)
        • 2.1.4 VCN, Terraform and Ansible (Nginx example)
        • 2.1.5 VCN & private subnet (step-by-step in Terraform)
      • 2.2
      • 2.3
    • 3. Untitled
    • 4. Untitled
    • 5. ATP and APEX
      • Setup Autonomous Database
        • Deploying ATP using OCI Interface
        • Deploy with OCI CLI
      • Setup APEX on ATP
      • Connect remotely to ATP
      • ATP, APEX and Jupyter
      • Demo
    • 6. MySQL
      • 6.1. The basics - OCI UI (MySQL DB System)
      • 6.2 The basics - OCI CLI (MySQL DB System)
      • 6.3 Access MySQL DB System
      • 6.4 HeatWave and MySQL DB Service
      • 6.5 Python SDK
      • 6.6 MySQL Replication (Compute Instances)
      • 6.7 Monitoring MySQL instances
        • Deploy MySQL instances
        • Monitoring tools
          • 1. Networking setup
          • 2. Prometheus setup
          • 3. MySQL Prometheus Exporter Setup
          • 4. Grafana setup
          • 5. Grafana metric graphs
    • 7. MySQL OCI &Terraform
      • 7.1 Deploy MySQL DB System with Terraform (basic tutorial)
      • 7.2 Deploy MySQL DB System with Terraform and access the system
      • 7.3 Endpoints
      • 7.4 Channels (troubleshooting)
        • Fixed MySQL source - MDS replication
      • 7.5 Channels (code)
Powered by GitBook
On this page
  • Prepare environment
  • Create application in APEX
  1. Tutorials
  2. 5. ATP and APEX

ATP, APEX and Jupyter

PreviousConnect remotely to ATPNextDemo

Last updated 4 years ago

Suppose you have setup the and you are getting ready to learn more about creating APEX applications

If you remember from one of our previous tutorials, , we were given three choices of creating an application:

For this tutorial, we will build a small example on how to create an application by adding pages to existing data ("New Application").

However, let's suppose we do not have the data on our side. That would imply we need to create a tablespace and populate it.

One approach to implement this would be by connecting to ATP using Jupyter, and then creating and populating a tablespace with the help of python dataframes; once the tablespace is created, we can add it to our application.

Prepare environment

1) Install Jupyter (Ubuntu version, because this environment is deployed on my WSL)

apt install jupyter-notebook

2) Start Jupyter (in my case, I am root) and make sure you have the required packages installed:

root@isaacEXE:/home/ora# jupyter-notebook --allow-root
[W 2021-01-17 21:16:48.015 LabApp] 'allow_root' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-01-17 21:16:48.016 LabApp] 'allow_root' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[...]
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=c0f8eb5b3c8ba697ae6db1c0f8eb5b4c7ae6db1c0f8eb5
     or http://127.0.0.1:8888/?token=c0f8eb5bc8ba697ae6db1c0f8eb5b4c7ae6db1c0f8eb5
[...]

Add one of those links into your browser, got to File>New File>Python3, and make sure you install the required packages, if not present:

root@isaacEXE:/home/ora#  wget https://gist.githubusercontent.com/netj/8836201/raw/6f9306ad21398ea43cba4f7d537619d0e07d5ae3/iris.csv
root@isaacEXE:/home/ora# ls iris*
iris.csv

4) Import the python modules you have just checked:

Next, start your sqlalchemy application by creating the engine. Provide the oracle APEX user - the user you have used for creating workspace, the password and the database along with its priority.

6) Import the dataset iris.csv into your ATP, by using the python dataframes:

7) Create the new tablespace in ATP:

8) Check in SQL Developer is tablespace DATAJUPYTER is created. It should appear for user ZACK:

Create application in APEX

Now you are ready to go back to your APEX workspace.

1) After you select "New Application", you will be brought to a blueprint for creating an application: provide a name, and select "Add Page":

2) Select "Chart"

... and then, provide the name of the tablespace created with Jupyter and two columns columns, along with a desired representation of the dashboard:

2) Provide a page name, in this example "datajupyterpage", and click on "Add Page". You will be brought back to your "Create an Application" page, only this time, the page that contains the data from the tablespace is shown:

3) Proceed by selecting "Check All" from Features, and click "Create Application" to start the creation.

4) As soon as your application is created, you should notice a page as below. Proceed with "Run Application"

5) Provide APEX credentials:

6) You are now ready to access the page you have set-up earlier:

7) Click on it, and it will take you straight to the dashboard representation:

[ ... still in progress ...]

3) Download the data set we will be using to create the tablespace, :

5) Make sure you TNS_ADMIN environment is setup, if not, recheck As a reminder, our TNS_ADMIN was setup under /home/oracky/wallet.

iris.csv
ATP connection,
Setup APEX on ATP
About tnsname.ora