Knowledge / Information Technology / Database administration

Database administration

Information Technology (B.E./B.Tech) · Systems and databases · free study notes for exams, placements and interviews

In short

Database administration (DBA work) is the set of activities that keep a database system available, secure, fast and recoverable: installing and configuring the server, creating users and granting privileges, allocating storage, backing up and restoring, monitoring performance, patching, and planning capacity. It sits between the schema designer and the system administrator — the DBA owns the running instance, not the application logic. University syllabi examine it under "Database Administration and Security" (users, roles, grants, views as a security mechanism, backup types, recovery, the data dictionary), and GATE touches recovery and the log. In India it is a large hiring area in itself: TCS, Infosys, Wipro, HCLTech, Cognizant, Capgemini and LTIMindtree staff Oracle/SQL Server/PostgreSQL DBA and "database reliability engineer" roles for banks and telecoms, and DPDP Act compliance has made access control and audit logging an interview subject rather than a footnote.

Explained

What a DBA actually does, and the kinds of DBA

Users, privileges, roles and views as security

Backup, recovery and the log

Storage, space and the data dictionary

Performance administration

High availability, scaling and cloud

Key points

Formulas and examples

Availability A = MTBF / (MTBF + MTTR) — MTBF = mean time between failures, MTTR = mean time to repair/recover (same time unit); expressed as a percentage.
Allowed downtime per year = (1 − A) × 8,760 h (8,760 = 24 × 365).
RPO achieved ≈ log-shipping interval (worst case, for asynchronous shipping); RTO achieved = restore time + log replay time + verification time.
Full backup storage for n days = size of full × number of fulls + Σ (incremental sizes) ; total = base + daily change rate × retention days.
Buffer cache hit ratio = (logical reads − physical reads) / logical reads × 100 %.
Database growth: Size(t) = Size(0) × (1 + g)t — g = growth rate per period, t = number of periods (compound); linear growth uses Size(0) + r × t with r = bytes per period.
Row/table size ≈ rows × (sum of column widths + per-row overhead); add index size and free-space factor (typically 1.2-1.4×).

Example 1 — availability and downtime budget. A banking database fails on average once every 2,500 hours and takes 2.5 hours to recover.

Example 2 — RPO/RTO from a backup plan. Full backup Sunday 01:00 (900 GB), differential daily 01:00 (grows ~60 GB/day), archived logs shipped every 15 minutes. Corruption is detected Thursday at 14:40; the last log arrived at 14:30.

Example 3 — backup storage sizing. Database 900 GB, daily change 3 %, one weekly full + six daily incrementals, retention 4 weeks, compression 2:1.

Example 4 — growth and capacity planning. A table holds 40 million rows; average row 180 bytes plus 20 bytes overhead; two indexes add 35 % of table size; data grows 6 % per month.

Example 5 — reading a plan after a statistics refresh. A query on a 20-million-row orders table returns 1,200 rows but the plan shows a full table scan with an estimate of 2 million rows.

AspectFullDifferentialIncremental
What is copiedEverythingAll changes since last fullChanges since last backup of any kind
Backup time/sizeLargestGrows through the weekSmallest
Restore steps12 (full + latest diff)1 + every incremental in order
RiskLowMediumHighest (one broken link breaks the chain)
RequirementDesignRPORTO
Low-cost internal appNightly full, logical dumpup to 24 hhours
Core bankingSynchronous standby + log archiving~0minutes
Reporting warehouseWeekly full + daily incrementalup to 24 h4-8 h
SaaS multi-tenantStreaming replica + PITR (WAL)minutesminutes-1 h
-- role-based access, least privilege
CREATE ROLE app_rw;
GRANT SELECT, INSERT, UPDATE ON orders, order_items TO app_rw;
CREATE USER app_user WITH PASSWORD '***';
GRANT app_rw TO app_user;                 -- app never owns the tables

-- column security through a view
CREATE VIEW emp_public AS
  SELECT emp_id, name, dept, city FROM employee;   -- salary not exposed
GRANT SELECT ON emp_public TO analyst_role;

-- revoke cascades to grants the clerk passed on
REVOKE SELECT ON orders FROM clerk_role CASCADE;

-- who is running what, and for how long (PostgreSQL)
SELECT pid, usename, state, now() - query_start AS runtime, query
FROM pg_stat_activity
WHERE state <> 'idle' ORDER BY runtime DESC;
-- point-in-time recovery, PostgreSQL recovery settings
restore_command = 'cp /archive/%f %p'
recovery_target_time = '2026-11-04 14:29:00+05:30'
recovery_target_action = 'promote'

Where it is used

Interview questions

Common mistakes

Related topics

Transactions, ACID and indexing · SQL queries and joins · NoSQL databases · Memory management and virtual memory · Processes and threads · Data warehousing and ETL

Open in the Knowledge reader →Find jobs →