Running Oracle database server on a Mac.

Due to my upcoming job having a large part being Oracle, I figured I should install Oracle on my Mac. I found this article on the Oracle site that made running it in a virtual machine look easy. Simply, it’s:

git clone https://github.com/oracle/vagrant-projects
cd vagrant-projects/OracleDatabase/21.3.0-XE 
# Optional: download the Oracle Database installation file and place it in this directory
vagrant up

And that’s where the wheels fell off. I haven’t used Vagrant for a couple of years. My Vagrant fell into a wibbling heap. I needed to do the following to drag everything up to date:

brew install vagrant

And then install Virtualbox from the Virtualbox downloads page. Bringing up vagrant then refreshes the vagrant image, brings the oracle image up to date and runs it.

    oracle21c-xe-vagrant: INSTALLER: Started up
    oracle21c-xe-vagrant: Oracle Linux 8 BaseOS Latest (x86_64)           3.3 MB/s |  49 MB     00:14
    oracle21c-xe-vagrant: Oracle Linux 8 Application Stream (x86_64)      3.2 MB/s |  37 MB     00:11
.
.
.
    oracle21c-xe-vagrant: INSTALLER: Oracle preinstall and openssl complete
    oracle21c-xe-vagrant: INSTALLER: Environment variables set
    oracle21c-xe-vagrant: INSTALLER: Downloading Oracle Database software

You’re going to need the instantclient libraries. Do the following in the instantclient directory, you might want to have copied *.dylib* into /usr/local/lib:

$ chmod u+w *
$ xattr -r -d -s com.apple.quarantine instantclient_19_3

vagrant ssh into the Virtualbox, sudo su – to root, thence to the oracle user and sqlplus sys as sysdba gets you in. This isn’t wildly useful but it’s a start.

Fresh Ubuntu networking and host directories

Networking

When I installed ubuntu 20.04.3, I expected the ubuntu networking to Just Work. That was wrong. And apparently, there’s a new network management subsystem to worry about. A quick Google search led me to the Ubuntu docs and thence to create the file /etc/netplan/01-netcfg.yml:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: true

Then this line enabled the interface:

sudo netplan apply

Host directory

I put all my GitHub/GitLab checkouts in ~/workspace, a hangover from BBC days, along with using VMWare Fusion. Although I tend to use docker more these days. I tried mounting it from within VMWare but no luck. A pointer from a chap on Reddit led me to these lines:

mkdir /mnt/hgfs
sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other

Or alternatively, add the following to /etc/fstab:

.host:/	/mnt/hgfs    fuse.vmhgfs-fuse	auto,allow_other	0	0

And there we go. Disappointingly everything I wanted didn’t work out of the box, but I got it working in the end.

MySQL 8.0 oddity – passwords and password policy

These are all things you can find elsewhere but a couple of password issues came as a surprise to me

MySQL
These are all things you can find elsewhere but a couple of password issues came as a surprise to me when a legacy system got the MySQL 5.7 upgraded to 8.0.

Firstly, password policies are much tighter. There’s a plugin that by default demands an uppercase letter, a number and a punctuation character. That foxes our legacy system whose installer just generates lowercase letters and numbers. Uninstall it.

UNINSTALL COMPONENT 'file://component_validate_password';

Another good one was the the library I was using, and didn’t want to upgrade, didn’t know the default authentication to connect to MySQL. That was easily fixed:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxxxx';
Query OK, 0 rows affected (0.03 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Having gone from a Centos 7 MySQL accidentally to MySQL 8.0 and back again, that’s a world of pain involving the recompiling of the Perl DBD::MySQL and finding the correct .so library.

Damn you linux reference counting.

GitHub logoSo this was an hilarious case of reference counting.

There I was, developing my Perl Catalyst app. I migrate to gitlab like all the other cool kids. I move the original development directory to .bak like a good boy.

But, my plackup is still running and because reference counting, the open files are all still there so I was still happily running. I check out the gitlab version, make changes and NOTHING HAPPENS. Until finally the penny drops, I quit the original, now renamed directory and re-enter the correct one.

Suddenly everything works and hilarity ensues.