How to install Oracle Database 18c XE on Windows

Get up and running with the free Oracle Database edition on Windows

Oracle Database 18c XE Successful InstallationIn my previous post, I demonstrated how you can install Oracle Database 18c XE on Linux. In this post, you will learn how you can install Oracle Database 18c XE on Windows. I am performing the installation on Windows 10 but it should remain the same for all Windows versions.

Preparing for the installation

Before you can start the installation, you will have to download the Oracle Database 18c XE Windows installer zip file. Head over to https://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html, click on “Accept License Agreement” and download the “Oracle Database 18c Express Edition for Windows x64” zip file.

Oracle 18c XE Download page

Once you have downloaded the zip file, extract it anywhere.

Oracle Database 18c XE extracted folder

Continue reading “How to install Oracle Database 18c XE on Windows”

How to install Oracle Linux on a Raspberry Pi – the easy way

Etcher flashingIn one of my past posts I showed how one can install Oracle Linux on a Raspberry Pi from a Mac via the command line. Luckily my colleague Philippe pointed out to me that things can be even much, much easier thanks to Etcher, an open source tool to flash SD cards and USB drives. Etcher is available for Mac, Linux and Windows, which should make the following steps generic.

tl;dr

  1. Download the latest Oracle Linux image for ARM
  2. Flash your SD card using Etcher
  3. Put the SD card into your Raspberry Pi and boot it up

Continue reading “How to install Oracle Linux on a Raspberry Pi – the easy way”

How to set the date and time on Linux

A quick post for how to set the date and time on Oracle Linux via the date command. This post is more for my own documentation but hey, it might help others as well. To set a date or time you have to pass on the information via a formatted string to the date command. I find calling date twice, once for the date and once for the time, the easiest. The +%D format option allows you to pass on the date as YYYY-MM-DD, e.g. 2019-08-01 for the 1st of August 2019. To set the time, I use the +%T format option to pass on the time as HH24:MI:SS, e.g. 22:31:04.

date +%D -s 2019-08-01
date +%T -s 22:31:04

Format:

date +%D -s YYYY-MM-DD
date +%T -s HH24:MI:SS

How to install Oracle Linux on Raspberry Pi

Did you know that Oracle Linux is also available for ARM processors? That means that you can install Oracle Linux on an SD card for a Raspberry Pi as well. Below I will show you how to do that with a Mac.

tl;dr

  1. Download the latest Oracle Linux image for ARM
  2. Uncompress the image with xz, for example: xz -dkv rpi3-ol7.6-image-20181116.img.xz
  3. Flash the SD card with the Oracle Linux image, using dd, for example: dd if=rpi3-ol7.6-image-20181116.img of=/dev/disk2 bs=16000000
  4. Put the SD card into your Raspberry Pi and boot it up

Continue reading “How to install Oracle Linux on Raspberry Pi”

csv2db – the little CSV command line loader you always wanted

It was over the last holiday season that I wanted to take some time and play around a bit with data. The outcome was rather different than I initially expected. Rather than having worked with the data, I spent a lot of time trying to get some CSV data loaded into a database. I knew that there are great tools such as SQL Developer out there that make loading CSV data trivial, but I wanted something that I could execute via the command line, not requiring a GUI. The simple reason was that I wanted to script the loading part, rather than having to execute some manual, potentially error prone steps whenever loading some data again. Too late I found out, actually just last week, that SQLcl already had what I was after, a load command that does exactly what I wanted:

SQL> help load
LOAD
-----

Loads a comma separated value (csv) file into a table.
The first row of the file must be a header row. The columns in the header row must match the columns defined on the table.

The columns must be delimited by a comma and may optionally be enclosed in double quotes.
Lines can be terminated with standard line terminators for windows, unix or mac.
File must be encoded UTF8.

The load is processed with 50 rows per batch.
If AUTOCOMMIT is set in SQLCL, a commit is done every 10 batches.
The load is terminated if more than 50 errors are found.

LOAD [schema.]table_name[@db_link] file_name

Unfortunately back then Google didn’t offer me this insight when looking for “load csv data into oracle” and so I was stuck with the methods I already knew and that I found as too cumbersome to deal with. After all, all I wanted was a simple tool that loaded data from CSV files into a table and match the column names with the header of the file:

cat people.csv

"first_name","last_name","city"
"Gerald","Venzl","San Francisco"
"Andreas","Pumberger","New York City"

SELECT * FROM PEOPLE

FIRST_NAME  LAST_NAME  CITY
----------  ---------  -------------
Gerald      Venzl      San Francisco
Andreas     Pumberger  New York City

Continue reading “csv2db – the little CSV command line loader you always wanted”

How to download the latest GitHub repo release via command line

I just fiddled around a bit to find out how to download the latest GitHub release via the command line. Turns out that GitHub doesn’t provide a universal download URL to release binaries like it does for the release browser page itself. The latest release page can always be reached via https://github.com/ORGANIZATION/REPO/releases/latest, e.g. https://github.com/gvenzl/csv2db/releases/latest. Unfortunately that is not true for the binaries, which are available under https://github.com/ORGANIZATION/REPO/archive/RELEASE_TAG.zip and https://github.com/ORGANIZATION/REPO/archive/RELEASE_TAG.tar.gz but not under something generic like https://github.com/ORGANIZATION/REPO/archive/latest.zip and https://github.com/ORGANIZATION/REPO/archive/latest.tar.gz

Continue reading “How to download the latest GitHub repo release via command line”

How to install Python 3 on Oracle Linux

Oracle Linux 7 doesn’t come with Python 3 by default but only with Python 2. Luckily, installing Python 3 can be done with two simple steps:

  1. sudo yum install -y oracle-epel-release-el7
  2. sudo yum install -y python36

The first step installs and enables the Oracle EPEL yum repository (EPEL – Extra Packages for Enterprise Linux) which includes the Python 3.6 version. In case the repository is already installed, yum will detect that and do nothing. So nothing will go wrong if you execute the command unnecessarily or twice.

Continue reading “How to install Python 3 on Oracle Linux”

How to enable auto start/shutdown for Oracle Database 18c Express Edition on Linux

Oracle Database 18c Express Edition can be enabled for automatic startup and shutdown with the Linux operating system. This will not only allow you not to worry about starting and stopping the database but it will also ensure that the database is properly shutdown before the machine is powered off. Enabling auto startup/shutdown is done via two simple commands:

  1. systemctl daemon-reload
  2. systemctl enable oracle-xe-18c

These commands will have to be executed either via the root user or with root privileges:

[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl enable oracle-xe-18c
oracle-xe-18c.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig oracle-xe-18c on

For more information about starting and stopping Oracle Database XE, have a look at the documentation.

How to install Oracle Database 18c XE on Linux

The new version of the free Oracle Database edition, Oracle Database 18c Express Edition, just got released for Linux 64-bit. Getting started is really simple on Oracle Linux, basically a three step process of downloading the RPM file, installing it and then configuring the database. On other Red Hat  compatible Linux distributions you will also have to download the Oracle Database Preinstall RPM alongside the XE RPM file. Here is a quick guide on how to setup Oracle Database 18c XE.

tl;dr

Oracle Linux

  1. Download the RPM file from Oracle Technology Network
  2. Run “yum -y localinstall oracle-database*18c*
  3. Run “/etc/init.d/oracle-xe-18c configure

Other Red Hat compatible Linux distribution

  1. Download the RPM file from Oracle Technology Network
  2. Download the Oracle Database Preinstall RPM via “curl -o oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
  3. Run “yum -y localinstall oracle-database*18c*
  4. Run “/etc/init.d/oracle-xe-18c configure

Continue reading “How to install Oracle Database 18c XE on Linux”

Oracle Database 18c Express Edition is Generally Available!

Oracle just released the new version of Oracle Database Express Edition (XE), a free edition of Oracle Database. This release means something special to me, as I have been closely involved in it and with the great team that brought us Oracle Database 18c XE.

Continue reading “Oracle Database 18c Express Edition is Generally Available!”