Oracle 20c DBCA

As you probably know, Oracle 20c is available only as a preview on the cloud. If you’d like to create a new server on Oracle Cloud with 20c, here is a post with the instructions.

However, I thought of a way to still check the new dbca and it’s quite simple. Once you have a running server, it seems that the DB VM already contains tigervnc. So all you need to do is to start the vnc server, open the port, and connect to the server in order to start GUI session.

Start VNC server

If you do not how to do this, this is very simple as everything is already configured on the DB VM. Login as user oracle to the server and follow these steps:

  1. Run: vncserver
  2. You’ll be requested to enter a password for the session
  3. Choose if you’d like to enable a “read only” option

Here is how it looks like:

[oracle@db20 ~]$ vncserver

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used

New 'db20:1 (oracle)' desktop is db20:1

Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/db20:1.log

Now you can see that the session is db20:1. The port for the session is 5900 plus the number after the colon (so 5901 in my case). Unless you already have vnc server running, :1 will be used.

Open the port

There are 2 steps here. One is the cloud security rule and the other one is the firewall configured at the linux level.

VCN

To create a rule to allow VNC to the cloud server (screenshots below):

  1. login to your cloud account
  2. Go to Networking -> Virtual Cloud Networks
  3. Click on the VCN that your server is configured on
  4. Go to the relevant subnet
  5. Click on the security list at the bottom half of the screen
  6. Add an ingress rule
  7. Configure the rule with source: x.x.x.x/24 port: 5901 (assuming the VNC is running with :1). In the screenshot below you can see that I opened the entire internet to me VNC (using 0.0.0.0/0). This is not recommended, you should only open your IP/network.

Linux

The server has iptables running by default, so we need to allow the VNC port (5901 in our case) in at the OS level as well.

Unfortunately we can’t edit iptables to add a rule in the middle, so the process will be:

  1. Save the entire iptables ruleset to a file
  2. Add the rule to allow port 5901
  3. Restore the iptables rules from the file

To do that perform the following:

  1. Login to you OCI server
  2. Switch to root (command: sudo su -)
  3. Save the iptables rules (command: iptables-save > /tmp/iptables)
  4. Open the /tmp/iptables file
  5. Add the following line (screenshot below):
    -A INPUT -p tcp -m tcp –dport 5901 -j ACCEPT
    Right before the line:
    -A INPUT -j REJECT –reject-with icmp-host-prohibited
  6. Load the new rules (command: iptables-restore < /tmp/iptables)

Screenshot of my rules file (the new rule is highlighted):

Connect and run dbca

That’s it, now open a VNC client on your computer and connect to the public IP of the server with: x.x.x.x:1.

Once you’re in just run dbca and dbca will open:

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post