Transactions and Administration

Harry · 11 Sep 2026 · 8 views

Transactions Protect Your Data

BEGIN  -- in SQL*Plus this starts a transaction
  UPDATE accounts SET balance = balance - 100 WHERE id = 1;
  UPDATE accounts SET balance = balance + 100 WHERE id = 2;
COMMIT;
ROLLBACK;  -- cancels everything since the last COMMIT

Why Oracle Reads Old Data

Oracle uses undo segments and multiversioning. Readers see a consistent snapshot of committed data, so long-running reports never block writers.

Administration Basics

SELECT tablespace_name, bytes/1024/1024 AS mb
FROM dba_data_files;

SELECT username, account_status FROM dba_users;

ALTER USER app_user ACCOUNT LOCK;
ALTER USER app_user ACCOUNT UNLOCK;

Backup Concepts

RMAN (Recovery Manager) is Oracle's dedicated backup tool. Running RMAN, you take full backups and archive logs, then restore to any point in time. Oracle Data Guard keeps a synchronized standby copy for failover.

Key Points

  • COMMIT ends a transaction; ROLLBACK undoes it.
  • Undo data gives readers consistent snapshots.
  • dba_* views are the window into database administration.
  • RMAN and Data Guard provide backup and high availability.
Share this post:

Comments (0)

Please login or register to comment.