Oracle SQL Tutorial
Lesson 39 of 96 41% of course

Users — Complete Guide

1 · 9 min · 5/24/2026

Learn Users — Complete Guide in our free Oracle SQL Tutorial series. Step-by-step explanations, examples, and interview tips on Toolliyo Academy.

Sign in to track progress and bookmarks.

Users — Complete Guide — OracleCore
Article 39 of 96 · Module 5: Security & User Management · Performance Tuning
Target keyword: users oracle tutorial · Read time: ~24 min · Oracle: 23ai · Project: OracleCore — Performance Tuning

Introduction

Users — Complete Guide is essential for developers and DBAs building OracleCore Enterprise Oracle Platform — Toolliyo's 96-article Oracle master path covering installation, architecture, SQL*Plus, multitenant PDBs, tablespaces, PL/SQL, RMAN, Flashback, AWR, RAC, Data Guard, OCI, 23ai features, and enterprise OracleCore projects. Every article includes EXPLAIN plans, SGA/PGA internals, transaction flows, and minimum 2 ultra-detailed enterprise database examples (banking RAC, airline reservations, telecom billing, ERP multitenant, healthcare TDE, OCI Autonomous, Data Guard DR).

In Indian IT and product companies (TCS, Infosys, HDFC, Flipkart), interviewers expect users with real banking transactions, e-commerce scale, deadlock handling, and query tuning — not toy SELECT * demos. This article delivers two mandatory enterprise examples on Performance Tuning.

After this article you will

  • Explain Users in plain English and in Oracle SQL / instance architecture terms
  • Apply users inside OracleCore Enterprise Oracle Platform (Performance Tuning)
  • Compare naive literal SQL vs OracleCore indexed, bind-variable, and AWR-monitored production patterns
  • Answer fresher, mid-level, and senior Oracle SQL, PL/SQL, RAC, and DBA interview questions confidently
  • Connect this lesson to Article 40 and the 96-article Oracle roadmap

Prerequisites

Concept deep-dive

Level 1 — Analogy

Users on OracleCore teaches Oracle step by step — architecture, PL/SQL, RAC, Data Guard, and enterprise database patterns.

Level 2 — Technical

Users powers enterprise databases in OracleCore: normalized schemas, tuned indexes, ACID transactions, AWR monitoring, and secure bind-variable SQL. OracleCore implements Performance Tuning with RAC, Data Guard, and RMAN production patterns.

Level 3 — Query execution flow

[App / .NET / Java / PL/SQL]
       ▼
[Oracle Net → Listener → Service/PDB]
       ▼
[Parse → Optimize (CBO) → Execute]
       ▼
[B-tree indexes / Row locks / Redo log]
       ▼
[AWR · ADDM · RMAN · Data Guard]

Common misconceptions

❌ MYTH: Oracle does not need indexes on small tables.
✅ TRUTH: Plan indexes early — full scans hurt as tables grow to millions of rows.

❌ MYTH: RAC fixes all performance problems.
✅ TRUTH: RAC adds HA; slow SQL still needs tuning via AWR and indexes.

❌ MYTH: Data Guard replaces RMAN backups.
✅ TRUTH: Standby is not backup — still need RMAN with tested restore procedures.

Project structure

OracleCore/
├── tablespaces/         ← Datafiles and storage
├── schema/              ← Tables, views, constraints
├── indexes/             ← B-tree and bitmap indexes
├── plsql/               ← Packages and procedures
├── security/            ← Users, roles, TDE
├── ha/                  ← RAC + Data Guard
└── monitoring/          ← AWR · OEM · ADRCI

Step-by-Step Implementation — OracleCore (Performance Tuning)

Follow: design schema → write bind-variable SQL → add indexes → run EXPLAIN PLAN → wrap in transaction → enable AWR → integrate into OracleCore Performance Tuning.

Step 1 — Anti-pattern (literal SQL, no index, full scan)

-- ❌ BAD — literal SQL + full table scan
SELECT * FROM orders WHERE customer_id = ${customerId};
-- Hard-coded literal; no bind variable; no index on customer_id

Step 2 — Production Oracle SQL

-- ✅ PRODUCTION — Users on OracleCore (Performance Tuning)
SELECT order_id, order_date, total
FROM orders
WHERE customer_id = :customer_id
ORDER BY order_date DESC
FETCH FIRST 50 ROWS ONLY;
-- Bind variable; index on (customer_id, order_date)

Step 3 — Full script

CREATE ROLE oraclecore_app_role;
GRANT SELECT, INSERT, UPDATE ON oraclecore.orders TO oraclecore_app_role;
-- Verify in SQL Developer: EXPLAIN PLAN + AWR top SQL
-- Check ADDM findings after deploy

The problem before Oracle — Users

Mission-critical systems need proven ACID, HA, and DBA tooling. OracleCore replaces fragile setups with RAC, Data Guard, RMAN, and enterprise-grade security.

  • ❌ Single-instance DB with no DR — hours of downtime on hardware failure
  • ❌ Manual backups without RMAN validation — untested restore when crisis hits
  • ❌ Full table scans on billion-row tables — billing batch misses SLA
  • ❌ Shared SYSDBA credentials — audit failure and security breach risk

OracleCore applies Oracle architecture, indexing, RMAN, and HA patterns from day one.

Database architecture

Users in OracleCore module Performance Tuning — category: SECURITY.

Users, roles, privileges, profiles, and enterprise security policies.

[App / .NET / Java / PL/SQL]
       ↓
[Oracle Net → Listener → Service/PDB]
       ↓
[Instance: SGA + PGA + Background Processes]
       ↓
[Database Files: Datafiles, Redo, Control]
       ↓
[AWR · ADDM · RMAN · Data Guard]

SQL execution flow

StageComponentOracleCore pattern
ParseShared poolBind variables; avoid literal SQL
OptimizeCBO + statsDBMS_STATS; review explain plan
ExecuteBuffer cache / indexesB-tree indexes on hot filters
MonitorAWR / ASHAlert on top SQL and wait events

Real-world example 1 — AWR-Driven SQL Tuning

Domain: Performance. Checkout API slowed after prodiv. OracleCore uses AWR report, SQL Tuning Advisor, and new composite index on (customer_id, order_date).

Architecture

AWR snapshot every 30 min
  ADDM findings → index recommendations
  SQL Plan Baseline for stable plans
  OEM alerts on top SQL regressions

Oracle SQL / PL/SQL

SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL, NULL, 'ALLSTATS LAST'));

CREATE INDEX idx_orders_cust_date ON orders (customer_id, order_date) COMPRESS 1;

Outcome: Query elapsed 12s → 80ms; CPU wait eliminated.

Real-world example 2 — Airtel Telecom Billing at Scale

Domain: Telecom. CDR ingestion generates billions of rows monthly. OracleCore uses interval partitioning, parallel DML, and materialized views for billing summaries.

Architecture

cdr_records partitioned monthly
  local indexes on subscriber_id
  MV refresh FAST ON COMMIT for daily totals
  RMAN incremental backup nightly

Oracle SQL / PL/SQL

CREATE TABLE cdr_records (
  cdr_id NUMBER,
  subscriber_id NUMBER NOT NULL,
  call_date DATE NOT NULL,
  duration_sec NUMBER,
  charge NUMBER(10,2)
) PARTITION BY RANGE (call_date) INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
(PARTITION p0 VALUES LESS THAN (DATE '2025-01-01'));

Outcome: Billing cycle 8h → 45min; storage compression 3:1 ratio.

DBA & performance tips

  • Use bind variables in application SQL — reduces hard parses in shared pool
  • Review AWR top SQL and ADDM findings weekly on production
  • Test RMAN restore quarterly — backup without tested restore is worthless
  • Document RAC/Data Guard runbooks before go-live

When not to use this Oracle pattern for Users

  • 🔴 Small dev apps — Oracle licensing and ops overhead may exceed benefit
  • 🔴 Document-heavy flexible schema — consider NoSQL or JSON-first stores
  • 🔴 RAC before exhausting single-instance tuning and Data Guard
  • 🔴 Over-partitioning tiny tables — management cost exceeds query benefit

Testing & validation

-- Manual assertion
SELECT COUNT(*) INTO v_count FROM USERS WHERE status = 'ACTIVE';
-- Assert v_count = expected

Pattern recognition

Lookup by PK → index unique scan. Join heavy → index FK columns. Reporting → materialized views. Money moves → explicit COMMIT. Read scale → Active Data Guard standby. Slow after deploy → AWR top SQL.

Common errors & fixes

🔴 Mistake 1: Literal SQL with concatenated user input
Fix: Use bind variables — prevents SQL injection and reduces hard parses.

🔴 Mistake 2: Missing indexes on WHERE/JOIN columns
Fix: Create B-tree indexes on FK and filter columns used in joins.

🔴 Mistake 3: Long-running transactions holding row locks
Fix: Keep transactions short; COMMIT minimal work units.

🔴 Mistake 4: Ignoring EXPLAIN PLAN and AWR reports
Fix: Run EXPLAIN PLAN on new queries; review AWR top SQL weekly.

Best practices

  • 🟢 Use bind variables — never concatenate user input into SQL
  • 🟢 Index WHERE and JOIN columns on large Oracle tables
  • 🟡 Enable AWR snapshots on every production database from day one
  • 🟡 Run EXPLAIN PLAN after schema or data volume changes
  • 🔴 Never run money/inventory updates outside explicit transactions
  • 🔴 Never deploy without backup strategy and tested restore procedure

Interview questions

Fresher level

Q1: Explain Users in a database design interview.
A: Cover schema, indexes, normalization trade-offs, concurrency, security, backup/HA, and monitoring.

Q2: B-tree vs bitmap index in Oracle?
A: B-tree is default for OLTP equality/range; bitmap suits low-cardinality DWH columns.

Q3: What is Oracle RAC?
A: Multiple instances share ASM storage; Clusterware handles node failover for continuous service.

Mid / senior level

Q4: How do you find and fix a slow query?
A: AWR top SQL → EXPLAIN PLAN → missing index? → add index → verify in next AWR.

Q5: Explain deadlock and how to prevent it.
A: Circular lock wait — consistent lock order, shorter transactions, retry in app.

Q6: How do you secure Oracle?
A: Least-privilege roles, no shared SYSDBA in apps, TDE, unified auditing, Oracle Net encryption.

Coding round

Write Oracle SQL for Users in OracleCore Performance Tuning: show CREATE script, sample query, explain plan notes, and test assertions.

-- Users validation
SELECT COUNT(*) AS actual FROM users WHERE is_active = 1;
-- Assert actual = expected

Summary & next steps

  • Article 39: Users — Complete Guide
  • Module: Module 5: Security & User Management · Level: INTERMEDIATE
  • Applied to OracleCore — Performance Tuning

Previous: Oracle Net Manager — Complete Guide
Next: Roles — Complete Guide

Practice: Run today's SQL in SQL Developer with EXPLAIN PLAN — commit with feat(oracle): article-39.

FAQ

Q1: What is Users?

Users is a core Oracle concept for building production databases on OracleCore — from SQL*Plus to RAC, Data Guard, and OCI.

Q2: Do I need DBA experience?

No — this track starts from zero and builds to enterprise DBA/architect interview level.

Q3: Is this asked in interviews?

Yes — TCS, Infosys, banks ask SQL, PL/SQL, RAC, Data Guard, RMAN, and AWR tuning.

Q4: Which stack?

Examples use Oracle 23ai, SQL Developer, PL/SQL, AWR, RAC, Data Guard, RMAN, OCI.

Q5: How does this fit OracleCore?

Article 39 adds users to the Performance Tuning module. By Article 96 you ship enterprise database systems in OracleCore.

Test your knowledge

Quizzes linked to this course—pass to earn certificates.

Browse all quizzes
Oracle SQL Tutorial

On this page

Introduction After this article you will Prerequisites Concept deep-dive Level 1 — Analogy Level 2 — Technical Level 3 — Query execution flow Project structure Step-by-Step Implementation — OracleCore (Performance Tuning) Step 1 — Anti-pattern (literal SQL, no index, full scan) Step 2 — Production Oracle SQL Step 3 — Full script The problem before Oracle — Users Database architecture SQL execution flow Real-world example 1 — AWR-Driven SQL Tuning Architecture Oracle SQL / PL/SQL Real-world example 2 — Airtel Telecom Billing at Scale Architecture Oracle SQL / PL/SQL DBA & performance tips When not to use this Oracle pattern for Users Testing & validation Pattern recognition Common errors & fixes Best practices Interview questions Fresher level Mid / senior level Coding round Summary & next steps FAQ Q1: What is Users? Q2: Do I need DBA experience? Q3: Is this asked in interviews? Q4: Which stack? Q5: How does this fit OracleCore?
Module 1: Introduction & Environment Setup
Introduction to Oracle Database — Complete Guide Oracle Database vs Database Instance — Complete Guide Oracle Architecture — Complete Guide Oracle Database Files — Complete Guide Oracle Storage Structures — Complete Guide Oracle Multitenant Architecture — Complete Guide Oracle DBA Tasks — Complete Guide Oracle VirtualBox Installation — Complete Guide Oracle Linux Installation — Complete Guide Basic Linux Commands — Complete Guide Oracle Database Installation — Complete Guide SQL Developer Installation — Complete Guide Putty & WinSCP Setup — Complete Guide
Module 2: Database Startup & Connection
Database Startup — Complete Guide Database Shutdown — Complete Guide SYS User Connection — Complete Guide SQL*Plus Connection — Complete Guide Listener Management — Complete Guide PDB Switching — Complete Guide Easy Connect — Complete Guide tnsnames.ora — Complete Guide Connection Troubleshooting — Complete Guide
Module 3: Oracle Architecture & Internals
SGA & PGA — Complete Guide Background Processes — Complete Guide Redo Logs — Complete Guide Undo Segments — Complete Guide Control Files — Complete Guide Data Dictionary — Complete Guide Dynamic Performance Views — Complete Guide Oracle Internals — Complete Guide
Module 4: Database Administration
Initialization Parameters — Complete Guide PFILE & SPFILE — Complete Guide ALTER SYSTEM — Complete Guide ALTER SESSION — Complete Guide Parameter Tuning — Complete Guide Oracle Networking — Complete Guide Database Links — Complete Guide Oracle Net Manager — Complete Guide
Module 5: Security & User Management
Users — Complete Guide Roles — Complete Guide Privileges — Complete Guide Profiles — Complete Guide Password Policies — Complete Guide PDB_DBA — Complete Guide SYS User — Complete Guide Oracle Security — Complete Guide
Module 6: Tablespaces & Storage
Tablespaces — Complete Guide Datafiles — Complete Guide Segments — Complete Guide Extents — Complete Guide Blocks — Complete Guide Compression — Complete Guide Row Migration — Complete Guide Space Management — Complete Guide
Module 7: SQL & PL/SQL
SQL Queries — Complete Guide Joins — Complete Guide Window Functions — Complete Guide Stored Procedures — Complete Guide Functions — Complete Guide Packages — Complete Guide Triggers — Complete Guide Exception Handling — Complete Guide
Module 8: Backup, Recovery & Flashback
Undo Management — Complete Guide Redo Management — Complete Guide Flashback Query — Complete Guide Flashback Table — Complete Guide RMAN — Complete Guide Backup Strategies — Complete Guide Point-in-Time Recovery — Complete Guide Disaster Recovery — Complete Guide
Module 9: Performance & High Availability
AWR — Complete Guide ADDM — Complete Guide SQL Tuning Advisor — Complete Guide Explain Plans — Complete Guide Oracle RAC — Complete Guide Oracle ASM — Complete Guide Oracle Data Guard — Complete Guide HA Architecture — Complete Guide
Module 10: Oracle Cloud & Modern Features
Oracle Cloud Infrastructure — Complete Guide Autonomous Database — Complete Guide AI Vector Search — Complete Guide Blockchain Tables — Complete Guide JSON Relational Duality — Complete Guide SQL Firewall — Complete Guide Automatic Indexing — Complete Guide AI Database Features — Complete Guide
Module 11: Real-World Projects
Banking Core System — OracleCore Project Airline Reservation System — OracleCore Project Telecom Billing Platform — OracleCore Project ERP Platform — OracleCore Project Healthcare System — OracleCore Project Government Data Platform — OracleCore Project AI Analytics Platform — OracleCore Project Enterprise Cloud Platform — OracleCore Project RAC Enterprise Cluster — OracleCore Project High Availability Banking Platform — OracleCore Project