Friday 3 February 2023

The Oracle DB Developer VM: Installing VSCodium and the Oracle Developer Tools

This post is part of my Oracle DB Developers VM series. Based on the previous postings on how to set up Oracle Linux 8 with the Oracle DB on VirtualBox, this post will show how to install VSCodium with the Oracle integration in this environment on a beginners level.
Gnome, in contrast to KDE, does not come with a good visual editor for developers, so we should install something better. VS Code has gained popularity and Oracle plugins are available, but VSCodium is the better choice because it does not contain telemetry/tracking. And according to this post, getting familiar with VSCodium is a good idea for Oracle developers anyways.
For installing VSCodium, just follow the official instructions:

sudo rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
printf "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | sudo tee -a /etc/yum.repos.d/vscodium.repo
sudo dnf install codium
sudo dnf install dotnet-sdk-2.1

We also need to install the .NET Core Runtime for Linux to run the Oracle Developer Tools for VS Code. It is important to use the older version 2.1.
Double check the dotnet installation with

dotnet --list-sdks
dotnet --list-runtimes

That should return something like:
Searching for Code should now show you VS Code in your activities
Moving the icon to the right into the favorites bar makes it also available in the applications menu.
Start VSCodium, go to the extensions tab and search for Oracle.
Choose the official one from Oracle Corporation and click on Install.
After installation of the extension, on the left bar an Oracle DB tab will appear. Click it and in the Oracle Explorer click the plus (+) and insert your credentials.
Double click the newly created connection. Click around, for example choose a table and select Show Data.
Editing stored procedures and functions also works.
To execute some SQL press F1 and choose Oracle: Develop New SQL or PL/SQL
Select your connection
Type some meaningfull SQL and execute it
That should give you the result set.
By choosing View->Editor Layout->Two Rows and moving the results tab into the lower part of the SQL tab, both can be displayed on one page. Of course, code completion also works.

Of course, all of this works also if you install VSCodium on your host OS. On Windows, just download and run the installer. The required .dotnet libraries are already part of the OS.

So much for the first steps with VSCodium and the Oracle extension. More information can be found on the official Oracle page.