DEV Community

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

Posted on

Oracle Database 21c installation on Windows and connect with SQL Developer

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


Oracle Database 21c installation on Windows and connect with SQL Developer
Enter fullscreen mode Exit fullscreen mode

Oracle Database 21c installation on Windows and connect with SQL Developer - Oracle 21c Installation Guide

Pre-Installation Requirements

System Requirements

OS: Windows Server 2025 (64-bit)
RAM: Minimum 8 GB
Disk Space: At least 50 GB free space
CPU: Intel or AMD x86-64 processor
User Account:

Use an account with Administrator privileges.

Disable UAC (User Account Control):

Open Control Panel → User Accounts → Change User Account Control Settings
Set to Never Notify.

Firewall Configuration:

Allow TCP port 1521 for Oracle Database.
Install Prerequisites:

Install .NET Framework 4.8 (if not already installed).
Apply the latest Windows Updates.

Step 1: Download Oracle Database 21c

Go to the Oracle Technology Network (OTN): Oracle Database Downloads

Download Oracle Database 21c for Windows (64-bit).

https://www.oracle.com/database/technologies/oracle21c-windows-downloads.html
Step 2: Extract the Installer

Extract the downloaded .zip file to a folder (e.g., C:\Oracle21c).
Open a Command Prompt as Administrator.

Navigate to the extracted folder.

Step 3: Run Oracle Universal Installer

Run setup.exe from the extracted folder.

Follow the installation wizard:

Installation Type: Choose Enterprise Edition (recommended).

Database Configuration: Select Create a database.

Destination Folder: C:\app\oracle\product\21c\
Administrative Password: Set a strong password (example : Tiger123)
Oracle Base: C:\app\oracle\product\21c\
Oracle Home: C:\app\oracle\product\21c\oradata
Verify prerequisites and click Install.

Step 4: Configure Listener

Open Net Configuration Assistant (NETCA).

Select Listener Configuration → Add.

Set:

Listener Name: LISTENER
Protocol: TCP
Port: 1521
Start the listener using:

lsnrctl status
if not running then

lsnrctl start
--OR--

Add an entry for your listner.ora file:

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.224.128)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
)
)
Step 5: Create Database

Open Database Configuration Assistant (DBCA).

Choose Create a database.

Select Advanced Configuration → General Purpose or Transaction Processing.

Set parameters:

Global Database Name: ORCL

SID: ORCL

Enable Automatic Memory Management.

Enable Archiving (if required).

Click Finish to create the database.

Step 6: Verify Database Installation

Open SQL*Plus:

sys as sysdba
or in cmd

sqlplus / as sysdba
Run two query for Open all the pluggable databases by default:

ALTER PLUGGABLE DATABASE ALL OPEN;
ALTER PLUGGABLE DATABASE ALL SAVE STATE;
Run a test query:

SELECT * FROM v$version;
Ensure the database is running:

lsnrctl status
Step 7: Secure Oracle Installation

Run Oracle Database Security Wizard.

Configure password policies.

Enable Database Auditing.

Apply patches using Oracle OPatch Utility.

Step 8: Enable Automatic Startup

Ensure Oracle services start automatically:

Open Services.msc

Locate:

OracleServiceORCL
OracleOraDB21HomeListener
Set Startup Type: Automatic.
Step 9: Confirm You Are in the Correct PDB

Switch to the pluggable database (PDB) where you want to create the user.

Connect as SYSDBA:

sqlplus / as sysdba
Check the current container:

SHOW CON_NAME;
If it shows CDB$ROOT, you are in the container database (CDB), not the pluggable database.

Switch to your PDB (replace PDB_NAME with the name of your pluggable database):

show pdbs;
ALTER SESSION SET CONTAINER = ORCLPDB;
Verify you are now in the PDB:

SHOW CON_NAME;
Step 10: Create the Tablespace

Find the current path of the datafiles:

SQL> SELECT NAME FROM V$DATAFILE;
If you haven’t created the dhruv tablespace, do so first:

CREATE TABLESPACE dhruv DATAFILE 'C:\APP\ORACLE\PRODUCT\21C\ORADATA\ORCL\ORCLPDB\dhruv01.dbf' SIZE 50M AUTOEXTEND ON NEXT 10M MAXSIZE 1G;
Step 11: Create the User

Create a local user without the C## prefix in the PDB:

show pdbs;
CREATE USER dhruv IDENTIFIED BY Password1 DEFAULT TABLESPACE dhruv QUOTA UNLIMITED ON dhruv;
Step 12: Grant Privileges to the User

Grant necessary privileges to the new user:

GRANT dba to dhruv;
--GRANT CONNECT, RESOURCE TO dhruv;

--GRANT DB_DEVELOPER_ROLE TO dhruv;

Connect as an admin user (like SYS as SYSDBA) and check the status:

SELECT username, account_status FROM dba_users WHERE username = 'DHRUV';
If it's locked:

ALTER USER dhruv ACCOUNT UNLOCK;
If expired:

ALTER USER dhruv IDENTIFIED BY Password1;
Step 13: Verify the User

Log in as the new user to confirm:

sqlplus dhruv/Password1@ORCLPDB
--OR--

Login with SQL Developer:

download SQL Developer from below link:

https://www.oracle.com/in/database/sqldeveloper/technologies/download/
In SQL Developer:

Connection Name: (anything, e.g., DHRUV)
Username: dhruv
Password: Password1
Connection Type: Basic
Role: default (not SYSDBA)
Hostname: localhost
Port: 1521
Service Name: ORCLPDB ← very important
Enter fullscreen mode Exit fullscreen mode

Your Oracle Database 21c installation on Windows is complete. You can now connect to it using SQL Developer. Let me know if you encounter any issues!

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.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)