Mo 7
Mo 7
Administration Level-IV
Based on March 2022, Curriculum Version II
Module Title: Database Backup and Recovery
Acronym
API ------------------------------------------------------Application Programming Interface
The design of a DBMS depends on its architecture. Selecting the correct Database
Architecture helps in quick and secure access to data. It can be centralized or decentralized
or hierarchical. The architecture of a DBMS can be seen as either single tier or multi-tier.
The tiers are classified as follows:
1.1.1. Single tier architecture
The simplest of Database Architecture are 1 tier where the Client, Server, and Database all
reside on the same machine. In other word, it keeps all of the elements of an application,
including the interface, Middleware and back-end data, in one place. Developers see these
types of systems as the simplest and most direct way.
The database is directly available to the user. It means the user can directly sit on the
DBMS and uses it.
Any changes done here will directly be done on the database itself. It doesn't provide
a handy tool for end users.
The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.
1.1.2. Two-tier Architecture
The direct communication takes place between client and server. There is no intermediate
between client and server.
Applications on the client end can directly communicate with the database at the server side.
For this interaction, API's like: ODBC, JDBC are used.
2 tier architecture provides added security to the DBMS as it is not exposed to the end user
directly.
1.3 OHS
Occupational Health and Safety (OHS) requirements for database backup and recovery are
crucial to ensure the well-being and safety of individuals involved in managing and
maintaining databases. While OHS standards may vary by region and organization, here are
some general guidelines to consider when it comes to the occupational health and safety
aspects of database backup and recovery:
Workload Management
Monitor and manage the workload of personnel involved in database backup and recovery to
prevent stress and burnout. Encourage breaks and time away from the computer to reduce the
risk of repetitive strain injuries.
Emergency Procedures
Establish clear emergency procedures for unexpected situations during database backup and
recovery processes. Ensure that personnel are aware of evacuation plans and procedures in
case of emergencies.
Security Measures
Equipment Safety
Health Monitoring
Documentation and Procedures
Communication Protocols
Regulatory Compliance
Page 4 of 22 Ministry of Labor and Database Backup and Recovery Version -I
Skills Level IV November, 2023
Author/Copyright
Unit Two: Database Backup Methods
There are different types of backup, and each backup process works differently.
Table 2.1. Comparison of backup type
A comparison of different types of backup
Backup 3 All data All data Selected Changes from backup 2 Changes from backup 1
Backup 4 All data All data Selected Changes from backup 3 Changes from backup 1
1. Full backups
2. Differential backups
A differential backup operation is similar to an incremental the first time it is performed, in
that it will copy all data changed from the previous backup.
3. Mirror backups
A mirror backup is comparable to a full backup. This backup type creates an exact copy of the source
data set, but only the latest data version is stored in the backup repository with no track of different
versions of the files.
One of the benefits of mirror backup is a fast data recovery time. It's also easy to access
individual backed up files. Mirror backup is the fastest backup method because it copies files
and folders to the destination without any compression.
One of the main drawbacks, though, is the amount of storage space required. It needs more storage
space than any other backup type; password protection is not possible and cannot track different
versions of files
3-2-1 rule
To determine the type of backup strategy to be used there are different determinant factors
such as overall business cost, performance, data protection levels, total amount of data
retained and availability goals.
Full daily
The advantage of this method is that users are still able to access the system during the
backup.
2.6.Disk mirroring
Disk mirroring, also known as RAID 1, is the replication of data to two or more disks.
Offsite backup is the replication of the data to a server which is separated geographically
from a production systems site. Offsite data backup may also be done via direct access, over
Wide Area Network (WAN).
An offsite backup is a backup process or facility that stores backup data or applications
external to the organization or core IT environment..
Offsite backups are primarily is used in data backup and disaster-recovery measures.
Scalability:.
Cost & Value:
Fast Deployment
Managed Storage Service:
Connectivity
Performance
Disadvantages
Self-check 2
Part-I multiple choice
6. Click on OK button
Purpose: Taking Database Offline using SSMS (SQL Server Management Studio) and T-
SQL
5. After Opening SQL Server Management Studio and open a Query Editor pane.
Enter and execute the following code:
USE DB_name;
GO
1. After Opening SQL Server Management Studio and open a Query Editor pane. Enter and
execute the following code:
BACKUP DATABASE << databaseName >> TO DISK = 'C:\Backupname.BAK'
The command is BACKUP DATABASE databaseName. The "TO DISK" option specifies that the
backup should be written to disk and the location and filename to create the backup is specified.
- It should check the states of all the transactions, which were being executed.
- A transaction may be in the middle of some operation; the DBMS must ensure the
atomicity of the transaction in this case.
- It should check whether the transaction can be completed now or it needs to be rolled
back.
So, recovery techniques which are based on deferred update and immediate update or
backing up data can be used to stop loss in the database.
Page 16 of 22 Ministry of Labor and Database Backup and Recovery Version -I
Skills Level IV November, 2023
Author/Copyright
Immediate Update: As soon as a data item is modified in cache, the disk copy is
updated.
Deferred Update: All modified data items in the cache are written either after a
transaction ends its execution or after a fixed number of transactions have completed
their execution.
Shadow update: The modified version of a data item does not overwrite its disk copy
but is written at a separate disk location.
In-place update: The disk version of the data item is overwritten by the cache version.
If the system crashes, the latest database backup set is restored and all of the transactions are
re-applied (by users) to bring the database back up to the point just before the crash.
The RTO specifies how quickly systems must be recovered. Unless the business tests
recovery, CIOs will not know if they can meet the RTO and RPO, or if recovery works at all.
The first command does the restore and leaves the database in a restoring state and second
command restores the transaction log backup and then makes the database useable.
RESTORE DATABASE <<DatabaseName>>FROM DISK = 'C:\BackupName.BAK'
WITH NORECOVERY
GO
RESTORE LOG <<DatabaseName>> FROM DISK = 'C:\BackupName.TRN'
WITH RECOVERY
GO
This restores the first two backups using NORECOVERY and then RECOVERY for the last
restore.
RESTORE DATABASE <<DatabaseName>> FROM DISK = 'C:\ BackupName.BAK'
WITH NORECOVERY
Restore full backup, latest differential and two transaction log backups
This restores the first three backups using NORECOVERY and then RECOVERY for the
last restore.
RESTORE DATABASE <<DatabaseName>> FROM DISK = 'C:\ BackupName.BAK'
WITH NORECOVERY
GO
RESTORE DATABASE <<DatabaseName>> FROM DISK = 'C:\ BackupName.DIF'
WITH NORECOVERY
GO
RESTORE LOG <<Database Name>> FROM DISK = 'C:\ BackupName.TRN'
WITH NORECOVERY
GO
RESTORE LOG <<DatabaseName>> FROM DISK = 'C:\ BackupName1.TRN'
WITH RECOVERY
GO
Self-check 3
Part-I multiple choice
D. All
Part-II Give short Answer