Go to the official Oracle Instant Client Downloads site and install basic and SDK RPMs like this:
sudo dnf install https://download.oracle.com/otn_software/linux/instantclient/1918000/oracle-instantclient19.18-basic-19.18.0.0.0-2.x86_64.rpm https://download.oracle.com/otn_software/linux/instantclient/1918000/oracle-instantclient19.18-devel-19.18.0.0.0-2.x86_64.rpm
If you wish, you can also install SQLPLus client from same location as well.
On recent Fedora versions, new users already have that setup.
dnf install -y podman-docker
sudoedit /etc/subuid # add line: myusername:10000:54321
sudoedit /etc/subgid # add line: myusername:10000:54330
- Run the script with sudo
$ sudo ./script/oracle/install-instantclient-packages.sh
- Add following ENV variables to your system (
~/.profile
or~/.zshrc
)
LD_LIBRARY_PATH="/opt/oracle/instantclient/:$LD_LIBRARY_PATH"
ORACLE_HOME=/opt/oracle/instantclient/
- Go to the official Oracle Instant Client Downloads site and download the following .rpm packages for your operative system:
- Basic
- SQL Plus
- SDK
On Fedora or a Red Hat based distro, you can just install the RPMs. Instructions for Debian based systems follow.
-
Create a folder in
/opt/oracle
if it does not exist yet (withmkdir -p /opt/oracle
) and save these packages there. -
Install the dependency
libaio1
and the packagealien
. In Ubuntu that is done withsudo apt-get install libaio1 alien
. -
Go to
/opt/oracle
through the terminal (withcd /opt/oracle
) and use alien to convert all those .rpm packages to .deb (withsudo alien --to-deb --scripts *.rpm
). -
Execute all those
.deb
packages withsudo dpkg -i *.deb
. -
Execute the following lines and also add them at the end of
~/.profile
. Replace 'X' for the version of the package that you have just installed.
export ORACLE_HOME=/usr/lib/oracle/X/client64
export PATH=$PATH:$ORACLE_HOME/bin
export OCI_LIB_DIR=$ORACLE_HOME/lib
export OCI_INC_DIR=/usr/include/oracle/X/client64
You need to have Docker installed and running. You also need to be able to run containers as a non-root user.
-
From this repository, do
make oracle-database
and wait a little, or checkpodman logs -f oracle-database
to see DATABASE IS READY TO USE! message.-
This will create an Oracle database container that has a "rails" user to use for development purposes.
-
If you run oracle in another way, then you can create a development user manually like this:
docker exec -it oracle-database sqlplus system/[email protected]:1521/systempdb
CREATE USER rails IDENTIFIED BY railspass; GRANT unlimited tablespace TO rails; GRANT create session TO rails; GRANT create table TO rails; GRANT create view TO rails; GRANT create sequence TO rails; GRANT create trigger TO rails; GRANT create procedure TO rails;
-
-
Finally initialize the database with some seed data by running (omit
ORACLE_SYSTEM_PASSWORD
if you have already granted the necessary permissions to the user)DATABASE_URL="oracle-enhanced://rails:[email protected]:1521/systempdb" ORACLE_SYSTEM_PASSWORD=threescalepass NLS_LANG=AMERICAN_AMERICA.UTF8 USER_PASSWORD=123456 MASTER_PASSWORD=123456 MASTER_ACCESS_TOKEN=token bundle exec rake db:drop db:create db:setup
Add DISABLE_OOB=ON
to sqlnet.ora
(github issue). For installation from archive that would be
echo "DISABLE_OOB=ON" >> /opt/oracle/instantclient/network/admin/sqlnet.ora
For RPM installation (update version 21
with whatever you installed locally).
echo "DISABLE_OOB=ON" >> /usr/lib/oracle/21/client64/lib/network/admin/sqlnet.ora
For IntelliJ/RubyMine, go to Database -> Database Source properties -> Drivers -> Oracle -> Advanced -> oracle.net.disableOob -> true