Anatomy of the Docker for Mac virtual disk

In Dockerby Alexander Dobriakov

Experimenting with Docker for Mac (beta), I wanted to look inside the virtual machine running Docker and reclaim unused disk space.
First of all, it stores the virtual disk under ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2.

In the next step, I have copied this file into the folder where a Vagrant Linux VM run, listed content, found a running Docker container and shrunk virtual disk:

Not a lot of science, nevertheless — learned a new tool and now know where to search and what to do if my local Docker is getting occupy too much disk space.

PS: Special thanks to Richard WM Jones for useful tips about guestfs tools and James Coyle for an article Reclaim disk space from a sparse image file (qcow2/vmdk)

Oracle to PostgreSQL Migration with ora2pg, analyse migration speed with R

In PostgreSQLby Alexander Dobriakov

There are multiple options to migrate your database from Oracle® to PostgreSQL. One of the simplest and flexible one is to use an open source tool ora2pg. It is well documented and does its job as expected. You can run it with a verbose output option to get more feedback during migration. At the end of first probe run, I wanted to identify tables, which took the most time for the migration to optimise it with a multiprocess option. Below is the output sample from ora2pg COPY run (DATA_LIMIT=10000):

It is pretty strait-forward to parse useful information out of it with open source command line tools:

The R script toptables.r to aggregate log data:

Results output:

The next step was — to parallelise migration of the biggest tables with JOBS and ORACLE_COPIES options on 8 vCPU host:

Voilà! Data migration runs faster now. Have fun and comment about your experience with ora2pg.