Now we are all working from home, I’ve noticed that my MAC laptop is severely overloaded when I do live demos during webinars. After all, it’s running my camera, Zoom, PowerPoint, my Java app, and monitoring tools.
So, I decided it was time to move my demo environment to the Oracle Cloud, where I quickly provisioned a 2-OCPU VM running Linux following the instructions in my previous blog post.
Once I had my VM up and running, I wanted a proper desktop experience, so I needed VNC.
After a quick google search, I found the video below, which provides a very easy to follow, step by step guide to installing and configuring TigerVNC VNCServer on OCI infrastructure. I followed all of these steps except for the final stage where they describe adding the VNCServer to your firewall.
I’m married to a security expert, who strongly advised against this approach. He told me it would be far more secure to use an SSH tunnel instead of opening the firewall for the VNC port.
Below the video are the full set of commands I used in my setup, including how to establish the ssh tunnel, so you can quickly cut and paste them.
Commands to setup VNCServer on OCI
— ssh to your OCI VM environment
$ ssh opc@[your oci ip address]
— Become root
$ sudo bash
— Check to see if you already have ‘Server With GUI’ in your list of installed environment groups
# yum group list
— Assuming you don’t have ‘Server With GUI’ installed
# yum group install "Server with GUI"
— Confirm ‘Server With GUI’ is now in your list of installed environment groups
# yum group list
— Install TigerVNC
# yum install tigervnc-server -y
— Once installed exit the root session
— As the opc user set the VNCServer password
— Return to root
$ sudo bash
— Copy the VNC service template file from /lib/systemd to /etc/systemd and include \:1.service in the destination filename
# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@\:1.service
— Edit the config file to replace placeholders with ops
# vi /etc/systemd/system/vncserver@\:1.service
— Reload the server unit configuration files
# systemctl daemon-reload
— Enable the VNC service
# systemctl enable vncserver@\:1.service
— Start the VNC service
# systemctl start vncserver@\:1.service
— Confirm the VNC service is started
# systemctl status vncserver@\:1.service
— Tiger VNCServer is now up and running
— On your Mac, you need to open the ssh tunnel by running the following command
$ ssh -L5901:127.0.0.1:5901 opc@[your oci ip address]
— Once the tunnel is open, you can start the VNC viewer and enter the IP address 127.0.0.1:1
How to setup Swingbench and DB Time Monitor on OCI VM
Once I had the VNCServer up and running, I need my workload generator and monitoring tools.
However, I had a little more trouble setting up the graphical Database Time Monitor. Unlike Swingbench, which can use OpenJDK, Database Time Monitor needs an Oracle JVM. Lucky for me, I just needed to do a yum install of jdk1.8 and then switch the Java version for the shell where I started the Database Time Monitor using the following commands.
$ sudo yum install -y jdk1.8
$ sudo alternatives --config java
There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- * 1 java-1.8.0-openjdk.x86_64 + 2 /usr/java/jdk1.8.0_261-amd64/bin/java Enter to keep the current selection[+], or type selection number:
How to install Oracle SQLcl on OCI VM and Connect to ADB
The final step was to set up Oracle SQLcl on my VM. If you aren’t familiar with SQLcl it’s a free command-line interface for the Oracle Database, similar to SQL*Plus but with a bunch of additional functionality. Jeff Smith has a super useful video to help you get started with it.
For non-OCI environments, you can download SQLcl from Oracle.com, but on OCI, Kris Rice showed me how to do it via a yum install.
$ sudo yum install sqlcl
Once installed, you can connect to an Autonomous Database using a Wallet file as follows:
./sql /nolog SQLcl: Release 17.4.0 Production on Mon Aug 10 19:44:11 2020 Copyright (c) 1982, 2020, Oracle. All rights reserved. SQL> set cloudconfig /Users/mcolgan/Downloads/Wallet_swingbenchatp.zip SQL> connect admin@swingbenchatp_tp Password? (**********?) ************** Connected.
You can see this demo environment in action during my Oracle Developer Live session where I demonstrate how to achieve Hyperscale with Oracle Autonomous Database.