TECHNICAL DOCS

Build an image from raw data files or a restore script and deliver containers with Oracle database clones on Linux

This article describes building a simple image on Linux for an Oracle database and delivering fast clones in containers from the image on Linux. The control plane runs on Windows while the cloning and containerization service runs on Linux. You need two downloads - the Windocks installer for Windows and the .Deb package for Linux. You may choose to call the Windocks Linux API directly if you don't want the Windows control plane - contact support@windocks.com for documentation on this.

 

 

Hardware requirements

The Windocks service is a software install on standard Linux (Ubuntu). The recommended minimum machine size for Oracle support is 8GB RAM with 80GB of disk not counting database sizes. If you want to deliver clones of an Oracle database of size say 1TB, then get a separate disk of size 1 TB + room for growth + room for fresh writes to the clones. The clones do not take disk space when you create them, only the images occupy the 1TB disk space. The cloning service requires one or more separate disks so you must add a separate disk to your machine (The single disk that most VMs come with is used to run the Windocks service and containers. The cloning service requires a different disk for delivering database clones, so you cannot use the single disk of the VM for the cloning service).

 

 

Software requirements

Ubuntu 18.04 onwards is supported. The installer package is a .deb file. Email support@windocks.com for the .deb file.

 

 

User account

You need a sudo user account. Configure the account in /etc/sudoers so that a password is not required each time sudo is used. To do this, edit the file with
sudo visudo
In the file add the following line at the bottom:
YOUR_USERNAME_HERE ALL=(ALL) NOPASSWD: ALL

You may need to log out of ssh and log back in for it to take effect.

 

 

Install steps on Linux

Login to Ubuntu with the sudo account and run the following:

mkdir ~/windocksinstall

# Copy the .deb file into ~/windocksinstall

cd ~/windocksinstall
dpkg -x windockslinux.deb .

# Download the Oracle Zip installer from https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#19c (the Linux x86-64 file)
# Copy the Oracle LINUX install file into ~/windocksinstall/oraclezip/19.3.0
# Repeat copy for all oracle versions you want

cp ~/LINUX.X64_193000_db_home.zip ~/windocksinstall/oraclezip/19.3.0

# Get the disks needed for the cloning system. Windocks Linux needs one or more disks for database cloning
# For example, If you are on AWS, then create one or more volumes and attach the volume(s) to your EC2 VM
# The disk(s) should be visible in the fdisk command (for example /dev/xvdf )

sudo fdisk -l

cd ~/windocksinstall/install
cat install.sh

# Follow the instructions in install.sh

# Following a reboot of Ubuntu, you need to start Windocks again by
cd /var/www/windocks
dotnet WebApi.Service.dll

Open the firewall ports on the Linux machine for a range of container ports 10001 to 11000. These are the host ports for the containers.

 

 

Install steps on Windows

Run the Windows installer. On Windows open the file windocks\config\node.conf and uncomment the lines below and set the values. Save the node.conf file and restart the Windocks service. Put in the IP address or DNS name of the Linux server for ORACLE_LINUX_SERVICE_IP_OR_DNS

ORACLE_LINUX_SERVICE="1"
ORACLE_LINUX_SERVICE_IP_OR_DNS="18.237.65.109"
ORACLE_LINUX_SERVICE_PORT="80"
ORACLE_LINUX_SERVICE_HTTPS="0"
ORACLE_LINUX_SERVICE_TIMEOUT_SECONDS="3600"

 

 

Building the image

See the sample in windocks\samples\oraclelinux. On Windows, create a file named dockerfile (# indicates comments). Start with the sample windocks\samples\oraclelinux\dockerfile and find the SETUPCLONING section that matches your data source. You may use Dumps, a script, or a standby container as your source of data. For large databases, we recommend you use a standby container as your source of data since that brings over incremental changes from production to keep images current with production

If you use a standby as the source of data, then the first step is to create a live standby container using a Windocks API. On the Linux machine, populate the file createstandby.json and run the curl command against the Windocks server as shown in that file.

Copy the file configstandby.json to /var/www/windocks, and populate the values in it. To get the standby IP, use docker inspect on the Linux machine

Build the image from the above dockerfile. This will create an image

In a command line on the Windocks server:
docker build -t yourimagename path\to\directory\containing\dockerfile

Alternatively, use the web application and click on Build in the top menu and click Browse. Select all the files in the directory (dockerfile, any script files) and then Open. Then click Build.

You may also use the REST API to build the image.

 

 

Creating the container

Create a container from the image. This can be done using a command line (only on the Windocks machine), or the web application (from any machine) or from the REST API (any machine)

In a command line on the Windocks server:
docker run -d yourimagename

This will deliver a container with a writeable database clone of the Oracle database

You may also create containers with the clones from the web application at ServerIp:/index.html or the file windocks\ui\index.html in Chrome or Firefox

You may also create containers with the REST API here

Extend CI/CD to your data layer