Oracle XE 11.2. and MariaDB 10.1 integration on Ubuntu 14.04 and Debian systems
Migrate from Oracle to MariaDB Server. This page provides detailed guidance, tools, and best practices for a smooth and efficient transition of your databases and applications.
Part 1: Installing Oracle Database Express Edition (XE)
This section covers the installation of Java and the Oracle XE database on a Debian-based system like Ubuntu.
Step 1: Download Oracle Database XE
Sign up for an Oracle account (if you don't have one) and log in.
Navigate to the download page for legacy versions of the database. A good starting point is the Oracle Database Express Edition (XE) 11gR2 Archive Downloads Page.
Accept the license agreement.
Download Oracle Database Express Edition 11g Release 2 for Linux x64. The file will be named similarly to
oracle-xe-11.2.0-1.0.x86_64.rpm.zip.
Step 2: Install and Configure Java 8
Oracle XE 11gR2 requires a Java environment.
A) Add the Java PPA and Install
sudo add-apt-repository ppa:webupd8team/java
# Press Enter to accept when prompted
sudo apt-get update
sudo apt-get install oracle-java8-installerB) Verify Java Installation
After the installation completes, verify the version.
java -versionThe output should be similar to:
C) Set JAVA_HOME Environment Variable
Edit the system-wide bash configuration file.
Scroll to the bottom of the file and add the following lines:
Save the file and exit. Then, source the file to apply the changes and verify the variable is set.
The output should be:
Step 3: Install Prerequisite Packages
Additional packages are required to convert and install the Oracle RPM.
Step 4: Convert the Oracle RPM to a DEB Package
The downloaded file is an RPM, which must be converted to a DEB package for Debian-based systems.
Step 5: Create chkconfig and Kernel Configuration
chkconfig and Kernel ConfigurationA) Create a chkconfig Compatibility Script
The Oracle installer expects the chkconfig utility, which doesn't exist on Debian-based systems. Create a compatibility script.
Add the following content to the new file:
Save the file, then make it executable:
B) Configure Kernel Parameters
Create a configuration file for Oracle-specific kernel parameters.
Copy and paste the following into the file. The value for kernel.shmmax should be approximately half of your system's physical RAM, specified in bytes (e.g., 512MB = 536870912 bytes).
Apply the new kernel parameters and verify the fs.file-max setting.
The expected output is 6815744.
Step 6: Final System Adjustments
A) Create Compatibility Links and Directories
B) Configure Shared Memory (/dev/shm)
To avoid a potential ORA-00845: MEMORY_TARGET error, re-mount the /dev/shm directory with a sufficient size. Replace 4096m with the amount of RAM on your machine.
To make this change persistent across reboots, create a startup script.
Add the following content, again replacing 4096m with your machine's RAM size.
Save the file and make it executable:
Step 7: Install and Configure Oracle XE
A) Install the Converted Package
By now, the .deb package should have been created. Install it using \.
B) Run the Oracle Configuration Script
Configure the database by running the script and answering the prompts. The default answers are usually acceptable.
You will be prompted for:
HTTP port for Oracle Application Express (default:
8080)Database listener port (default:
1521)A password for the
SYSandSYSTEMaccounts.Whether to start the database on boot (default:
y)
C) Set Oracle Environment Variables
Edit /etc/bash.bashrc again to add the Oracle-specific variables.
Add the following to the end of the file:
Apply and verify the changes:
D) Start Oracle
Part 2: Installing SQL Developer
Step 1: Download and Install SQL Developer
Go to the Oracle site and download the Linux RPM package for Oracle SQL Developer.
Use
aliento convert the package anddpkgto install it.
Create a configuration directory.
Step 2: Run and Connect to Oracle XE
Launch SQL Developer.
Bash
If it asks for the Java path, provide it:
/usr/lib/jvm/java-8-oracle.Inside SQL Developer, create a new connection with the following details:
Click:
Connections, thenAdd new connectionConnection Name:
XEUsername:
SYSTEMPassword:
<your-password>Connection Type:
Basic, Role:DefaultHostname:
localhostPort:
1521SID:
xe
Part 3: Installing MariaDB and Connecting to Oracle
Step 1: Install MariaDB
Follow the official instructions on the MariaDB website for your specific OS version.
Do NOT copy the commands below. Go to the MariaDB Repository Configuration Tool to generate the correct commands for your system. The following is only an example.
Step 2: Install MariaDB ODBC Connector
Download the "MariaDB Connector/ODBC" for Linux from the MariaDB website.
Extract the archive and copy the library file.
Step 3: Install UnixODBC and CONNECT Engine
Step 4: Configure ODBC Drivers
A) Configure the Oracle Driver
Edit /etc/odbcinst.ini and add the following section:
B) Configure the Oracle DSN
Edit /etc/odbc.ini and add a Data Source Name (DSN) for your Oracle XE database.
Step 5: Test the Oracle ODBC Connection
Use isql to test the connection and create a sample table in Oracle.
You should see the rows 1, 3, 5, 8 returned.
Step 6: Configure and Test the MariaDB CONNECT Engine
A) Set Environment Variables for MariaDB
For the CONNECT engine to find the Oracle libraries, you must add the Oracle environment variables to MariaDB's startup script. Edit /etc/init.d/mysql.
Immediately after ### END INIT INFO, add the following block:
B) Restart MariaDB and Test the Connection
Once logged into the MariaDB client, run the following SQL commands:
You should see the values 1, 3, 5, 8 retrieved from the Oracle table.
Part 4: Connecting to MariaDB via JDBC
Step 1: Install the MariaDB JDBC Driver
Download the "MySQL Connector/J" from the MySQL or MariaDB website.
Extract the archive and copy the
.jarfile to a known location.
Step 2: Configure SQL Developer
Launch SQL Developer:
sudo /opt/sqldeveloper/sqldeveloper.shGo to Tools -> Preferences.
Expand Database and click on Third Party JDBC Drivers.
Click Add Entry... and navigate to the
.jarfile you copied:/usr/lib/jvm/java-8-oracle/lib/mariadb/mysql-connector-java-5.0.8-bin.jar.Click OK to close the preferences.
Step 3: Connect to MariaDB
In SQL Developer, create a new connection.
Switch to the MySQL tab.
Enter the connection details:
Connection Name:
MariaDB via MySQL ConnUsername:
rootPassword:
<your-root-password>Hostname:
localhostPort:
3306
Click Test Connection. It should report
Status: Success.Save and connect. You can now run queries against your MariaDB server in the worksheet.
This page is licensed: CC BY-SA / Gnu FDL
Last updated
Was this helpful?

