Use Spider ODBC to Connect to Oracle
This guide details how to configure Spider to connect to an Oracle database via ODBC, enabling data migration and federated access to Oracle tables.
Overview
This article describes how to use Spider ODBC to connect to Oracle. This can make it easier to migrate, by not requiring a wholesale cutover, but instead enabling a piecemeal approach.
The setup looks as shown in this figure:

Prerequisites
In MariaDB,
The Spider storage engine must be installed.
The Spider storage engine plugin must be installed in MariaDB Enterprise Server. This is described in the instructions below.
An ODBC driver manager, unixODBC, must be installed.
In Oracle Database,
The ODBC driver must be installed.
The Oracle Basic Client must be installed. This is a prerequisite for installing the ODBC driver.
Instructions
In your working directory, create a folder to hold the Oracle ODBC RPMs mkdir oracle_odbc_rpms, then change to that directory.
Download the following files (make sure to use the appropriate driver for your scenario):
Install the RPMs:
Add the following to /etc/odbcinst.ini:
The driver path may be different if you downloaded a different version of the Oracle driver, be sure to update it with correct path for your scenario.
Add the following to /etc/odbc.ini:
Driveris the driver name in the/etc/odbcinst.ini.Descriptioncan be whatever you like, just make sure you use the same value later.ServerNameis the TNSName given for our Oracle connection.Be sure to populate your user name and password.
Add the following line to /etc/tnsnames.ora:
Name the connection string as you like — just be sure to use the same name in the
odbc.inifile.Make sure to include your hostname and IP address, and the service name for your instance.
Verify that the ODBC connection is working with:
ORARDSis the section name we gave our entry inodbc.ini. If you are using something different, replaceORARDSwith whatever you use.If any errors come up, double-check the values entered into the
.inifiles.
Start the MariaDB database:
Log in to MariaDB, and run the following:
This creates a new database and a table that should be able to connect to an Oracle server via ODBC.
DSNmust be the same put in theodbc.ini file.It's best to always use upper case for both column names and the table value in the comment section, because these values are passed directly to Oracle Database, which prefers upper-case object names.
You should now be able to select data from spider_test.contacts table. That data is coming from the remote Oracle database.
Notes
Spider ODBC to Oracle tables does not support
INSERT SELECTstatements, where the Spider table is the source of the data. (MENT-1588).If the version of MariaDB does not have the spider_direct_aggregate variable, you aren't able to use a few aggregate functions on their own. (MENT-1558).
If you get the following error message:
Error from ODBC 0 01004 [Oracle][ODBC]String data, right truncated., you need to set a larger value for the variable spider_buffer_size. (MENT-1557).
See Also
Connecting to Oracle from MariaDB Enterprise Server using Spider Blog post by Anders Karlsson, January 2024 - 13 minute read
This page is: Copyright © 2025 MariaDB. All rights reserved.
Last updated
Was this helpful?

