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
π§± 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
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
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.
π In SQL Developer:
Click β to add new connection.
Enter credentials as above.
Test connection.
Click Connect.
β 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:
lsnrctl status
Check service names:
lsnrctl services
View logs: $ORACLE_BASE/diag/tnslsnr/hostname/listener/alert/log.xml
Web UI:
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"
Note: All scripts used in this demo will be available in our website.
Link will be available in description.
Top comments (0)