Assignment 6
Name haseeb
Momin Asif
Class BS CS 24
Section C
Id
F24605133 F24605131
Instructor Lec.Shanza Zafar
Subject Digital logic design lab
Date 10-06-2025
Question 1:
Purpose and Importance:
In any database management system (DBMS), backup and recovery are crucial to ensure that
data can be restored in case something goes wrong. Whether it's a hardware failure, accidental
deletion, software error, or a cyberattack, having a good backup strategy means you can recover
important data and keep systems running smoothly.
The main goal is to protect data from loss and to make sure the system can bounce back quickly
from unexpected issues. Without backup and recovery in place, the risk of losing critical
information increases significantly, which can have serious consequences for any organization.
A. What risks are involved if a backup strategy is not implemented?
1. Loss of important data: Once lost, some data might never be recovered, which can be
devastating for businesses.
2. Service downtime: If the database goes down and there’s no way to restore it quickly,
operations can come to a halt.
3. Security threats: In case of malware or ransomware attacks, recovery becomes almost
impossible without a backup.
4. Legal and compliance issues: Many industries have rules requiring data protection.
Failing to back up data can lead to penalties or legal trouble.
5. Financial damage: Downtime and data loss often lead to lost revenue and increased
recovery costs.
B. What are the differences between full backup, differential
backup, and transaction log backup in SQL Server?
Full Backup: This creates a complete copy of the entire database, including all data and
structure. It’s the foundation for all other types of backups. While it takes up more space
and time, it's the most straightforward to restore.
Differential Backup: This backs up only the changes made since the last full backup.
It’s faster and smaller than a full backup, but it still needs the last full backup to be
restored.
Transaction Log Backup: This captures all changes made to the database since the last
transaction log backup. It's useful for restoring data to a specific point in time, especially
in systems that process lots of transactions.
C. When is each type of backup most suitable?
Full Backup: Best for regular, scheduled backups (e.g., daily or weekly), especially
when you want a full copy of the database.
Differential Backup: Ideal for use between full backups when you want to save time and
storage space. It provides a balance between backup size and restore speed.
Transaction Log Backup: Perfect for systems where data changes frequently, such as
financial or retail systems. It allows you to restore the database to a very specific point in
time, which can be a lifesaver during emergencies.
Example:
A school management system might take a full backup every night, differential backups every
few hours during the day, and transaction log backups every 15 minutes during active school
hours to ensure minimal data loss.
Question 2
A
B
c
D
E
Now verifying deleted record has boon restored
Q3
A.
How to Recover the Database to 10:00 AM Using
Transaction Log Backups
If the database was backed up using a full backup followed by regular transaction log backups,
then you can use point-in-time recovery to bring the database back to how it was at 10:00 AM
just before the error happened at 11:00 AM.
Steps:
1. Restore the last full backup.
2. Apply all transaction log backups up to just before the error occurred.
3. Use the STOPAT option to specify exactly 10:00 AM.
This way, you recover only the transactions that were committed up to that time, avoiding the
corrupted changes.
C
. Precautions Before and After Restoration
Before Restoration:
1. Ensure you have recent backups (full and transaction logs).
2. Verify the recovery model is set to FULL or BULK_LOGGED (not SIMPLE).
3. Inform users and disconnect applications to avoid active connections.
4. Switch to SINGLE_USER mode to prevent other sessions from interfering.
5. Back up the current (corrupted) state of the database just in case you need to analyze
or compare it later.
After Restoration:
1. Verify data consistency by checking key tables and records.
2. Inform stakeholders that the database is restored and usable.
3. Resume multi-user access by setting the database back to MULTI_USER.
4. Re-enable automated jobs or triggers that may have been paused.
5. Investigate the cause of corruption to prevent future occurrences.