Note:

Secure Shell to Oracle Exadata Database Service from a Microsoft Azure Linux VM in Oracle Database@Azure

Introduction

In this tutorial, we will explore the recent release of Oracle Database@Azure which provides customers access to Oracle Exadata Database Service within Microsoft Azure. We will examine how to Secure Shell (SSH) into the Oracle Exadata Database Service that make up the Exadata Virtual Machines (VM) cluster within the Exadata Cloud Infrastructure in Microsoft Azure. This allows quick access from the command line to connect to an Exadata database to verify database connectivity and run initial test queries to ensure data is being retrieved properly. It is a fast way to ensure that everything is functioning as expected in your Oracle Database@Azure environment so that you can build the needed application or tool communication to your Exadata data source.

Objectives

Prerequisites

Task 1: Connect to your Microsoft Azure VM which acts as a Jumpbox

Configure PuTTY tool to connect the Microsoft Azure VM which will be used as a jumpbox to connect your Oracle Exadata Database Service.

  1. Open PuTTY Configuration and define the Microsoft Azure VM connection parameters.

    PuTTy SSH private key

    Add your Microsoft Azure VM SSH private key.

    PuTTy SSH private key

  2. Run the ssh-keygen command to create a new SSH authentication key pair on the existing Microsoft Azure VM.

    New RSA SSH key pair

  3. Copy the content of the public key from id_rsa.pub file to your clipboard.

    RSA SSH public key

Task 2: Authorize your Microsoft Azure VM to access the Oracle Exadata Database Service VM Cluster

  1. In the Exadata VM Cluster Details page, click Add SSH Keys to add the SSH RSA public key.

    OCI VMC Details

  2. Select Paste SSH keys and enter your SSH key content.

    Add SSH keys

  3. Click Save changes.

    Save Changes

Task 3: Connect to the Oracle Exadata Database Service VM Cluster

  1. Note the Private IP addresses for each of the two database servers.

    Exadata VMs

  2. Initiate a connection to the Oracle Exadata Database Service from your Microsoft Azure VM.

    SSH to Exadata VM

Task 4: Set up the required Oracle Environment to start SQL*Plus

  1. Log in as the Oracle user on the database server.

    Become Oracle user

  2. Update the Oracle user environment settings based on the desired target Exadata database.

    [oracle@ab-hn-prefix-civwz1 ~]$ ls -l
    total 8
    -rwxrwx--- 1 oracle oinstall 667 Jan 24 17:36 ABDBOUT1.env
    -rwxrwx--- 1 oracle oinstall 667 Mar 12 14:49 ABDBOUT2.env
    [oracle@ab-hn-prefix-civwz1 ~]$
    [oracle@ab-hn-prefix-civwz1 ~]$ source ABDBOUT1.env
    [oracle@ab-hn-prefix-civwz1 ~]$
    
  3. Run SQL*Plus command line tool to interact with the database.

    [oracle@ab-hn-prefix-civwz1 ~]$ sqlplus
    SQL*Plus: Release 19.0.0.0.0 - Production on Mon Mar 25 22:31:19 2024
    Version 19.21.0.0.0
    Copyright (c) 1982, 2022, Oracle.  All rights reserved.
    Enter user-name: sys as sysdba
    Enter password:
    Connected to:
    Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production
    Version 19.21.0.0.0
    SQL>
    
  4. Connect to the pluggable database (PDB) by changing to the corresponding PDB.

    SQL> alter session set container=ABDBOUT1PDB;
    Session altered.
    SQL>
    

Task 5: Run SQL query and Review the Result

  1. Run the following command to format the SQL*Plus display.

    SQL> COL table_name FORMAT a40; 
    
  2. Run the SQL query to verify data being retrieved from the Exadata database.

    SQL> SELECT table_name, num_rows, last_analyzed FROM dba_tables where owner='SH' AND table_name NOT LIKE 'DR%' ORDER BY num_rows DESC;
    
  3. Verify the SQL output.

    TABLE_NAME                                 NUM_ROWS LAST_ANAL
    ----------------------------------------   -------- ---------
    SALES                                        918843 21-FEB-24
    COSTS                                         82112 12-MAR-24
    CUSTOMERS                                     55500 21-FEB-24
    TIMES                                          1826 19-FEB-24
    PROMOTIONS                                      503 21-FEB-24
    PRODUCTS                                         72 29-FEB-24
    COUNTRIES                                        35 19-FEB-24
    CHANNELS                                          5 21-FEB-24
    FWEEK_PSCAT_SALES_MV                              0 19-FEB-24
    SUPPLEMENTARY_DEMOGRAPHICS                        0 19-FEB-24
    CAL_MONTH_SALES_MV                                0 19-FEB-24
    
    11 rows selected.
    
    SQL>
    

Task 6: Terminate the Session

  1. Run the following command to exit the SQL*Plus session.

    SQL> exit
    Disconnected from Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production
    Version 19.21.0.0.0
    [oracle@ab-hn-prefix-civwz1 ~]$
    
  2. Run the following command to exit the Oracle user session.

    [oracle@ab-hn-prefix-civwz1 ~]$ exit
    logout
    [opc@ab-hn-prefix-civwz1 ~]$
    
  3. Close your connection to the Oracle Exadata Database Service.

    [opc@ab-hn-prefix-civwz1 ~]$ exit
    logout
    Connection to 10.1.1.58 closed.
    [azureuser@aboutolin1: ~] #3 >
    
  4. Close your PuTTy session to the Microsoft Azure Linux VM.

    [azureuser@aboutolin1: ~] #3 exit
    

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.