DB/Oracle

23c oraclelinux8

newlibra 2023. 4. 30. 19:27

sudo -s

dnf install -y oraclelinux-developer-release-el8

dnf config-manager --set-enabled ol8_developer 


dnf -y install oracle-database-preinstall-23c

dnf -y localinstall oracle-database-free-23c-1.0-1.el8.x86_64.rpm


sudo -s
/etc/init.d/oracle-free-23c configure


export ORACLE_SID=FREE 
export ORAENV_ASK=NO 
. /opt/oracle/product/23c/dbhomeFree/bin/oraenv

ORACLE_HOME = /opt/oracle/product/23c/dbhomeFree
The Oracle base has been set to /opt/oracle


sudo systemctl enable oracle-free-23c


Edit /etc/oratab and change N to Y in the FREE line: FREE:/opt/oracle/product/23c/dbhomeFree:Y
    
Open up a firewall port so the DB can be accessed from other machines:
    sudo firewall-cmd --permanent --add-port=1521/tcp
    sudo firewall-cmd --reload

Back on the VirtualBox GUI on the host, after shutting down the VM, I then enabled port forwarding for port 1521 by navigating to VM settings->Network->Advanced->Port Forwarding and clicking the “+” icon. I added a TCP rule for host port 1521 mapping to guest port 1521. (Scroll right if you don’t see the guest port column).

Reboot the VM (in my case). I can then connect to the DB from my host machine like sqlplus system@localhost/freepdb1