📘 CodingMarble Learn

Database Operation and Maintenance

A database must run all day and never lose data. The database administrator (DBA) decides who can do what, keeps backups, restores the data after a failure, watches speed and storage, and does regular maintenance like clean-up and updates. This lesson shows each job step by step.

🎬 Step-by-step story

  1. Three kinds of people use the database: a customer, a clerk and an outsider. All of them want in.
  2. The admin gives permissions. The customer can only read, the clerk can edit, the outsider is blocked.
  3. Every day the admin makes a backup copy of the data. The yellow cylinder is the copy.
  4. Something goes wrong. A fault, a power cut or a mistake. The main database turns red.
  5. Recovery: the data is copied back from the backup. The database is green again.
  6. Maintenance keeps it healthy. Try the Backup, Break and Restore buttons yourself.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Why not let everyone edit?

One mistake or one bad person could damage the data for all. Limited rights lower the risk.

Why make backups when the data is safe now?

Disks fail, power cuts and mistakes happen. A backup is your second chance.

What can break a database?

Hardware failure, power loss, software bugs, human mistakes or attacks.

Is all the data back after a restore?

Only up to the time of the last backup. Changes after that need logs or are lost.

What does maintenance do if nothing is broken?

It prevents slow-downs and failures: clean up, updates and re-organising. Try it in free play.

Database administration

The database administrator (DBA) looks after the database every day.

Backup and recovery

A backup is a copy of the data kept in a separate place. If the main data is lost or damaged, recovery (restore) copies it back.

Database maintenance

Maintenance keeps the database healthy over the years.

Key formulas and definitions

Worked examples

1. A nightly backup runs at 1 a.m. The disk fails at 5 p.m. How many hours of data may be lost?

From 1 a.m. to 5 p.m. is 16 hours. Up to 16 hours of changes are lost unless there is a more frequent backup.

2. A clerk should add orders but never delete them. Which permissions?

Read and add (insert), but not delete. This is least privilege.

3. A full backup is 100 GB. A daily incremental holds 5 GB. Backup storage for 1 full and 6 incrementals?

100 + 6 x 5 = 130 GB.

Common mistakes

Practice quiz

1. Who looks after a database daily?
2. Copying data to a safe place is:
3. Copying only what changed since the last backup is:
4. Bringing data back after a failure is:
5. Which is routine maintenance?

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What does a database administrator do?

A DBA manages users and permissions, keeps the database safe and fast, makes backups, restores data after problems and does regular maintenance.

Why are backups kept in a different place?

A fire, flood or theft could destroy both the data and a nearby copy. A far copy survives.

What is the difference between backup and recovery?

Backup is making the copy. Recovery is using that copy to bring lost data back.

Where this is taught

Japan高校(専門学科)1〜3年Databases

Learn first

Learn next

Related lessons

All Computer Science lessons