Oracle Database 21c Express Edition Installation and Setup on Windows

Chandan Kumar Mandal
2 min readOct 10, 2023

--

Installation

  1. Download from https://www.oracle.com/database/technologies/xe-downloads.html
  2. Run Oracle Database 21c Express Edition.msi
  3. Follow the instructions.

Note: Remember the password you entered for the SYS, SYSADMIN that is required to log into https://localhost:5500/em/

Initial Access & Setup

Press Win + S keys and type “SQL Plus” and run the program.

It will open a command line where you have to perform following operations:

Proofs

In this below log I have:

  1. Created demo user scott with password tiger.
  2. Logged in to the service with user scott.
  3. Created a student table with primary key regNo and tried to enter same key for 2 different rows.
  4. Inserted 2 rows.
  5. Displayed all rows and columns.
  6. (SQL Plus command) Adjusted the name column format to display 50 characters to prevent wrapping of values alternatively you can do set wrap off if you want to them to be truncated.

SQL*Plus: Release 21.0.0.0.0 - Production on Tue Oct 10 11:57:09 2023
Version 21.3.0.0.0

Copyright (c) 1982, 2021, Oracle. All rights reserved.

Enter user-name: / as sysdba

Connected to:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

SQL> select name from v$pdbs;

NAME
--------------------------------------------------------------------------------
PDB$SEED
XEPDB1

SQL> connect sys/oracle@localhost:1521/XEPDB1 as sysdba;
Connected.
SQL> create user scott identified by tiger default tablespace users quota unlimited on users;

User created.

SQL> grant create session, create table to scott;

Grant succeeded.

SQL> connect scott/scott@localhost:1521/XEPDB1
Connected.
SQL>
SQL> create table students(regNo number PRIMARY KEY, name varchar2(255));

Table created.

SQL> insert into students values(10000, 'Chandan Kumar Mandal');

1 row created.

SQL> insert into students values(10000, 'Badbil Don');
insert into students values(10000, 'Badbil Don')
*
ERROR at line 1:
ORA-00001: unique constraint (SCOTT.SYS_C008220) violated


SQL> insert into students values(10001, 'Badbil Don');

1 row created.

SQL> select * from students;

REGNO
----------
NAME
--------------------------------------------------------------------------------
10000
Chandan Kumar Mandal

10001
Badbil Don


SQL> column name format a50
SQL> select * from students;

REGNO NAME
---------- --------------------------------------------------
10000 Chandan Kumar Mandal
10001 Badbil Don

Now smash that clap button 50 times!

--

--

Chandan Kumar Mandal
Chandan Kumar Mandal

No responses yet