DEV Community

Cover image for Oracle Database 21c installation on Oracle Linux 8 and connect with SQL Developer
Chitt Ranjan Mahto (Chirag)
Chitt Ranjan Mahto (Chirag)

Posted on

Oracle Database 21c installation on Oracle Linux 8 and connect with SQL Developer

inchirags@gmail.com Oracle DBA Tutorial https://www.chirags.in


Oracle Database 21c installation on Oracle Linux 8 and connect with SQL Developer


Here is a complete step-by-step guide to install Oracle Database 21c on Oracle Linux 8.10, configure it, and connect to it from SQL Developer on another system (like Windows):

βœ… Prerequisites

πŸ“Œ System Requirements

Oracle Linux 8.10 (64-bit)
At least 8 GB RAM recommended
40+ GB free disk space
Internet access or offline RPMs
Enter fullscreen mode Exit fullscreen mode

🧱 Step 1: Prepare Oracle Linux 8.10

πŸ–₯️ 1.1 Update the System

sudo dnf update -y
sudo dnf install -y oracle-epel-release-el8
πŸ› οΈ 1.2 Install Prerequisite Packages

sudo dnf install -y oracle-database-preinstall-21c wget zip unzip vim
πŸ“¦ Step 2: Download & Install Oracle Database 21c

🌐 2.1 Download Oracle 21c RPM (Enterprise Edition)

Download from:

πŸ”— https://www.oracle.com/database/technologies/oracle21c-linux-downloads.html
File:

oracle-database-ee-21c-1.0-1.ol8.x86_64.rpm
πŸ’‘ Upload the RPM to your server using SCP or a USB drive if it's offline.

πŸ“¦ 2.2 Install the RPM

sudo dnf localinstall oracle-database-ee-21c-1.0-1.ol8.x86_64.rpm -y
βš™οΈ Step 3: Configure and Start Oracle Database

🧾 3.1 Run Configuration Script

sudo /etc/init.d/oracledb_ORCLCDB-21c configure
This will:

Create a pluggable database ORCLPDB1

Enable auto startup

Set default password for SYS, SYSTEM, etc. as Oracle_4U
Enter fullscreen mode Exit fullscreen mode

You’ll see output like:

Database configuration complete.
...

πŸ” Step 4: Set Environment Variables in oracle user

su - oracle
echo "export ORACLE_HOME=/opt/oracle/product/21c/dbhome_1" >> ~/.bash_profile

echo "export PATH=\$ORACLE_HOME/bin:\$PATH" >> ~/.bash_profile

echo "export ORACLE_SID=ORCLCDB" >> ~/.bash_profile

source ~/.bash_profile
πŸ”₯ Step 5: Start Oracle Services (if not already running)

sudo systemctl start oracle-database
To enable on boot:

sudo systemctl enable oracle-database
🌐 Step 6: Enable Remote Access

πŸ“ 6.1 Open Listener Port (1521)

sudo firewall-cmd --add-port=1521/tcp --permanent
sudo firewall-cmd --reload
πŸ“ 6.2 Allow Remote Connections in Listener

Edit file:

sudo vi $ORACLE_HOME/network/admin/listener.ora
Make sure the listener is bound to 0.0.0.0 or your server's IP:

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
)
)
Restart the listener:

lsnrctl stop
lsnrctl start
πŸ‘€ Step 7: Create User for Remote Access

πŸ’» Login to SQL*Plus

sqlplus / as sysdba
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED


     2 PDB$SEED                       READ ONLY  NO
     3 ORCLPDB1                       READ ONLY  NO
Enter fullscreen mode Exit fullscreen mode

SQL> SHOW CON_NAME;

CON_NAME

CDB$ROOT
πŸ«™ Check Instance Status.

SQL> SELECT status FROM v$instance;

STATUS

OPEN
If Database is not open then run the below command:

SQL> ALTER DATABASE OPEN;

Database altered.

πŸ‘₯ Create a User

SQL> ALTER SESSION SET CONTAINER = ORCLPDB1;
SQL> CREATE USER chirag IDENTIFIED BY Tiger123;
SQL> GRANT CONNECT, RESOURCE TO chirag;
SQL> ALTER USER chirag DEFAULT TABLESPACE users;
βœ… Optional: Grant DBA

GRANT DBA TO chirag;
πŸ§ͺ Step 8: Test Locally

sqlplus chirag/Tiger123@localhost:1521/ORCLPDB1
If successful, continue to remote access.

πŸ’» Step 9: Connect from SQL Developer (Other System)

https://www.oracle.com/in/database/sqldeveloper/technologies/download/
(Windows 64-bit with JDK 17 included)

https://download.oracle.com/otn_software/java/sqldeveloper/sqldeveloper-24.3.1.347.1826-x64.zip
🎯 Details to Use:

Username: chirag
Password: Tiger123
Hostname: IP of Oracle Linux server (e.g., 192.168.224.133)
Port: 1521
Service Name: ORCLPDB1
πŸ” Use "ip a" on the Oracle server to find its IP address.
Enter fullscreen mode Exit fullscreen mode

πŸ“‚ In SQL Developer:

Click βž• to add new connection.

Enter credentials as above.

Test connection.

Click Connect.
Enter fullscreen mode Exit fullscreen mode

βœ… Optional: Enable Auto-start on Reboot

If DB does not auto start:

sudo systemctl enable oracle-database

🧽 Troubleshooting Tips

Issue Solution
ORA-01017 Wrong username/password
ORA-12514 Service name wrong / not registered
Connection Timeout Firewall issue β€” ensure port 1521 is open
Blank SQL Developer screen Check service name (ORCLPDB1) or use SID (ORCLCDB)
πŸ“š Additional Tips

Check listener status: 
Enter fullscreen mode Exit fullscreen mode

lsnrctl status
Check service names:

lsnrctl services
View logs: $ORACLE_BASE/diag/tnslsnr/hostname/listener/alert/log.xml

Web UI: 
Enter fullscreen mode Exit fullscreen mode

https://localhost:5500/em
For any doubts and query, please write on YouTube video πŸ“½οΈ comments πŸ’¬ section.

Note : Flow the Process shown in video πŸ“½οΈ.

πŸ˜‰Please, Subscribe and like for more videos:

https://www.youtube.com/@chiragtutorial

πŸ’›Don't forget to, πŸ’˜Follow, πŸ’Like, πŸ’–Share πŸ’™&, Comment

Thanks & Regards,

Chitt Ranjan Mahto "Chirag"

https://www.chirags.in


Note: All scripts used in this demo will be available in our website.

        Link will be available in description.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)