The outcome to recover
Start with the business function and agreed recovery criterion. If close depends on an application, keys, a partner and data validation, starting a VM does not demonstrate process recovery. Partial testing can be useful when its scope is explicit.
This lesson’s practice contains five synthetic records, R1 through R5. All show elapsed time below the 45-minute RTO, but only R1 jointly meets the recorded criteria. The difference teaches assessment of the conclusion rather than simply accepting the execution report’s status color.
Time and data loss are different dimensions
R3 records 44 minutes of recovery and a seven-minute data gap against a 45-minute RTO and five-minute RPO. Time meets the stated objective, but the gap exceeds its limit. Do not subtract the one-minute RTO margin from RPO: the measures have different origins and meanings.
In a real audit, verify how start, finish and data point were defined, including acceptance and reconciliation. A duration measured only to technical startup may be incompatible with an RTO defined through business acceptance.
Unknown data is not success
R5 has no data-gap value. In SQL, comparison with NULL does not positively confirm compliance. NOT(data_gap > rpo) does not mean “all cases without known failure” either: an unknown result is not selected by WHERE.
Keep an explicit query for null fields and report unknown status separately from pass and fail. Replacing NULL with zero invents absence of loss. COUNT(data_gap) returns four known values while the table contains five exercises.
The denominator should answer the audit question rather than be selected for a function’s convenient behavior.
Dependencies and acceptance evidence
R2 shows 20 minutes but the required key is unavailable and acceptance is absent. R4 shows 35 minutes, but partner connectivity and acceptance were not validated. These records do not demonstrate full recovery despite favorable timing.
Investigate whether dependencies were deliberately excluded, failed or lacked collected evidence. Each situation supports a different conclusion. An honest report may state “technical startup demonstrated; complete process not tested.”
This does not require production impact for every test; it requires a method appropriate to the intended conclusion.
Exercise and follow-up plan
Compare the query selecting only elapsed <= rto with the complete query below. The first returns R1 through R5; the second returns R1. Prepare a different request for R2, R3, R4 and R5: ability to use the key, treatment of the excessive RPO gap, external dependency validation and determination of the data point.
Specify who responds and what evidence closes each item. A new ticket or promised date does not establish remediation. Follow-up ends with evidence proportionate to the observation, retaining limitations when testing remains partial.
Restore the right object and all its dependencies
A verifiable restore starts by identifying the objects making up the outcome: main database, reference data, configuration and execution dependencies. In the lab, positions live in one database and account-to-fund mapping in another. Connection.backup copies the named database; name="main" does not mean “all application databases.” R8 restores positions but omits the mapping database. The absence is observed in the filesystem and probe without creating an empty database to hide it.
Bind each test to the path actually opened. If the probe still points to the source, it can produce a perfect response without querying the restore. Record source, destination, scope, digest and a fresh-connection read. A matching backup digest binds bytes to that copy but does not establish later changes. In your workpaper, draw “selected artifact → restored file → probe connection → business criterion.” The conclusion should follow that path. Related topics: inventory, configuration and audit evidence.
A journal establishes only its applicable prefix
This package’s journal is a list of application operations created for teaching. It is not SQLite’s internal WAL or an Oracle or other vendor recovery mechanism. Each entry contains sequence, order identity, account and unit change. The database retains the latest committed point. Starting at 0, applying 1, 2 and 3 requires the next entry to be exactly the successor. Finding 1 and 3 does not authorize skipping 2 even when the final-numbered file exists.
In R3, the whole replay is one transaction. Entry 1 is staged, missing 2 causes an error and rollback retains checkpoint 0 and initial records. Another design might commit segments separately; its observed point would differ and would need disclosure. Do not assign this behavior to every product. Also check semantic compatibility: contiguous sequences whose amounts changed from cents to euros can yield valid SQL and incorrect data. The takeaway is requiring continuity, compatibility and reconciled effects rather than using the highest file number as the recovered point.
Atomicity and conflicting repetition
Checkpoint, order and position change should represent the same execution commitment. If the checkpoint commits before orders, a later failure can advertise an applied point absent from the data. The lab worker puts these effects in one transaction. In R5, the process exits after staging a change but before COMMIT. A different process reopens the file and observes the earlier state. This tests a specific transaction boundary; it is not a physical disk-loss exercise.
Repeating an operation requires more than finding an ID. R4 compares the already applied sequence’s payload: only an identical repeat is skipped. If O1/A/+30 returns as O1/A/+31, the worker rejects the conflict and retains existing state. Applying a +1 difference without a decision would create an unauthorized correction; replacing only the control record would make evidence diverge from effect. First predict the result, then execute the conflict test. Connect this decision to batch restart control and interface reconciliation. If positions and orders are restored at point 3 while checkpoint and applied-sequence table come from point 0, restoration mixes states. Before reopening retries, reconcile application history with existing effects; a uniqueness error in one table does not establish consistency of the entire process.
Structure, identity and an independent reference
PRAGMA integrity_check assesses database structures, not whether units belong to the right account. The exercise target is A=125 and B=180. R7 introduces A=135 and B=170: the total remains 305, structure is valid and the functional probe passes. Per-account comparison refuses full acceptance. This teaches keeping structural integrity, functional capability and content correctness separate. Do not infer file corruption from a business discrepancy.
The expected reference is written in fixtures/expected.json as literal records: A=100+30−5 and B=200−20. Replay does not generate that reference. If one function produced both outcome and expectation, an account swap could pass on both sides. The harness deliberately changes an observed position and removes an order to confirm that comparison detects those defects. This oracle is separate from implementation but was prepared by the same author; it is not independent human review. In your workpaper, retain the expected-value derivation and the error each comparison can distinguish.
Functional acceptance and choosing a recovery path
The probe opens the restored database, queries data, inserts a test row in a transaction and rolls it back. It then confirms the row did not remain. This demonstrates the exercised write with reversible effect; it does not establish durability of a transaction intentionally rolled back. A separate subprocess responds through stdin/stdout. R6 forces that local partner to exit with error although data is correct. Another PID neither authenticates an external partner nor creates computer or user independence.
Recovery choice uses cumulative criteria. Imagine route A reaches sequence 10 early without subsequent segments, while B reaches 12 at minute 50, followed by 12 minutes of reconciliation and 6 of acknowledgement. If acceptance must occur by 70 and include 12, B forecasts 68 with 2 spare; A misses the required point. These are fictional parameters, separate from program-measured nanoseconds. Finish with a per-variant matrix: structure, data, dependencies, functionality and acceptance. Different failures need different actions.
Practice: eight restores, prediction and evidence
Download and extract this lesson’s package into a new directory. You need Python 3.11 or later with standard-library sqlite3; cloud services, Docker, credentials and extra packages are unnecessary. Read README.md and WORKSHEET.md before executing. From the extracted directory run python3 run.py --output evidence/my-run-1, then python3 run.py --output evidence/my-run-2 and python3 test_lab.py. Output directories must be new: the program refuses to overwrite an exercise.
Before opening results, predict records and acceptance for R1 through R8. Then compare observations.json, process stdout and exit codes, SQLite files and manifest.json. Explain why R3 and R5 retain the previous point through different mechanisms, why R7 retains the total but fails per account and why R8 is not accepted without its dependent component. WORKSHEET contains order, conflict and criterion variations. Produce a short workpaper with condition, evidence, bounded conclusion and next test. Local results do not prove bank RTO, vendor PITR, physical independence or approval by a real person.
Retain the set needed for recovery
Age-based retention can remove ancestors still required by the newest copy. In an incremental model containing only changes since the preceding state, an old baseline requires the complete ordered chain. A validated new full backup may replace that path; removing ancestors before demonstrating the new baseline can make remaining files unusable for the intended point.
Count storage for the entire set, not only its largest file. Dependencies can cross systems. A database copy may reference an object version deleted before the repository copy; valid hashes for both copies do not reconstruct the absent object.
Retain a manifest of referenced versions or demonstrate another method producing a consistent set. Exercise: draw the incremental chain and, separately, database-to-object references; mark what becomes unavailable when each member expires. Takeaway: acceptance concerns the set recovering required state, including dependencies and evidence that it can be used.
Exercise without unintended effects and demonstrate independence
A restored image may start scheduled tasks before the operator finishes configuration. If the trial prohibits production contact, prepare isolation before first boot while retaining only authorized dependencies needed for copies, keys and test destinations.
Synthetic data do not by themselves change a production address saved in the image. Also check whether chosen isolation blocks recovery itself; if so, functional success is not established. Operational acceptance includes the procedure and who executes it.
Fast recovery by a specialist using undocumented steps demonstrates that assisted execution, but not the designated on-call team’s independence required by the criterion. Record missing steps, access and decisions, then assess the corrected procedure with designated operators.
Exercise: compare two network proposals and two execution records, separating isolation, technical capability and satisfaction of the operational criterion. Takeaway: the trial must respect its bounds and produce evidence about both service and actual recovery method.
Exercise files
Standard Python, PT/EN guide, worksheet, fixtures and tests; run in a new directory without real data.
SQLite lab: eight recovery variants
SHA-256 (ZIP)
802b1db9f294941b8166f902840c3fc5ef602c7f9c5172da903c8fc4f4b9d340
SELECT id FROM recovery WHERE elapsed<=rto ORDER BY id;
SELECT id FROM recovery
WHERE elapsed<=rto AND data_gap<=rpo
AND key_available=1 AND partner_validated=1 AND business_accepted=1
ORDER BY id;
SELECT id FROM recovery WHERE data_gap IS NULL;
SELECT COUNT(*),COUNT(data_gap) FROM recovery;Five rehearsals meet the timing condition alone; only one meets every recorded condition. The auditor communicates the four limitations separately.
Common pitfalls
RTO as RPO; NULL as zero; startup time as accepted recovery; excluded partners as full testing; an opened ticket as completed remediation.
Related topics: RTO and RPO · Dependencies and acceptance
Recoverability needs a conclusion by criterion and scope. An aggregate metric should not hide dependencies or unknown data.
References
- Assessing Security and Privacy Controls in Information Systems and Organizations · SP 800-53A Rev. 5 methodology and selected procedures
- CISA Exam Content Outline · Outline effective August 1, 2024; current page rechecked
- Code of Professional Ethics · Current public code inspected
- Assessing Security and Privacy Controls: publication status · Revision 5; release 5.2.0 noted August 27, 2025
- Secure Software Development Framework Version 1.1 · SP 800-218, February 2022
- SSDF publication status · SP 800-218 final version 1.1 landing page
- SELECT · Current SQL reference consulted
- Built-in Aggregate Functions · Current aggregate-function reference consulted
- Python sqlite3: backup and transaction control · Python 3.13 documentation; page observed as3.13.16; local executed interpreter version recorded separately
- SQLite Online Backup API · Unversioned official documentation consulted 2026-10-09
- Contingency Planning Guide for Federal Information Systems · SP800-34 Revision 1; May 2010 base publication