DBMS VTH Unit
DBMS VTH Unit
Recovery
INDEX
❑ DATABASE
❑ TYPES OF DATABASES
❑ DATABASE MANAGEMENT SYSTEM
❑ DATA RECOVERY ❑ DATA SECURITY
▪ FAILURE CLASSIFICATION ▪ WHY IS DATA SECURITY IMPORTANT?
▪ TRANSACTION FAILURE ▪ SOURCES OF VULNERABILITY
▪ SYSTEM CRASH ▪ SECURITY THREATS: MOST COMMON ATTACKS
▪ DISK FAILURE ▪ DATA SECURITY ARCHITECTURE
▪ STORAGE STRUCTURE ▪ OBJECTIVES OF THE SECURITY ARCHITECTURE
▪ VOLATILE STORAGE ▪ DATABASE SECURITY STRATEGY
▪ NON-VOLATILE STORAGE ▪ KEY PILLARS OF DATABASE SECURITY STRATEGY
▪ RECOVERY AND ATOMICITY ▪ METHODS TO SECURE DATABASES
▪ LOG BASED RECOVERY ▪ DATABASE SECURITY BEST PRACTICES
▪ RECOVERY WITH CONCURRENT ▪ 10 BEST SYSTEMS AVAILABLE FOR BUSINESS
TRANSACTIONS PROFESSIONALS.
▪ CHECKPOINT
▪ HOW DATA RECOVERY WORKS
▪ DATA RECOVERY METHODS.
2
DATABASE
A database is an organized collection of data, generally stored and
accessed electronically from a computer system.
3
Types Of Database
• Traditional Database(TDB)
• A Traditional Database consists of texts and numbers only.
• Multimedia Database(MDB)
• A Multimedia database (MMDB) is a collection of
related multimedia data.
• The multimedia data include one or more primary media data types
such as text, images, graphic objects (including drawings, sketches
and illustrations) animation sequences, audio and video.
• Geographic Information System(GIS)
• A geographic information system (GIS) is a system designed to
capture, store, manipulate, analyse, manage, and present spatial
or geographic data.
4
Types Of Database
• Realtime Database(RDB)
• A real-time database is a database system which uses real-time processing
to handle workloads whose state is constantly changing.
• This differs from traditional databases containing persistent data, mostly
unaffected by time. For example, a stock market changes very rapidly and
is dynamic.
• Data Warehouse(DW)
• Data warehouse (DW or DWH), also known as an enterprise data
warehouse (EDW), is a system used for reporting and data analysis, and is
considered a core component of business intelligence.
• DWs are central repositories of integrated data from one or more disparate
sources. They store current and historical data in one single place that are
used for creating analytical reports for workers throughout the enterprise.
5
Database Management
System(DBMS)
The software which is used to manage database is called Database Management
System (DBMS). For Example, MySQL, Oracle etc. are popular commercial DBMS
used in different applications. DBMS allows users the following tasks:
•Data Definition: It helps in creation, modification and removal of definitions that
define the organization of data in database.
•Data Updation: It helps in insertion, modification and deletion of the actual data in
the database.
•Data Retrieval: It helps in retrieval of data from the database which can be used
by applications for various purposes.
•User Administration: It helps in registering and monitoring users, enforcing data
security, monitoring performance, maintaining data integrity, dealing with
concurrency control and recovering information corrupted by unexpected failure.
6
DATABASE RECOVERY
• Data recovery is the process of restoring data that has been lost,
accidentally deleted, corrupted or made inaccessible.
7
Failure Classification
8
Transaction failure
• A transaction has to abort when it fails to execute or when it
reaches a point from where it can’t go any further. This is called
transaction failure
10
Disk Failure
11
Storage Structure
•Volatile storage
•Non-Volatile storage
12
Volatile storage
• As the name suggests, a volatile storage cannot
survive system crashes. Volatile storage devices are
placed very close to the CPU; normally they are
embedded onto the chipset itself.
• For example, main memory and cache memory are
examples of volatile storage. They are fast but can
store only a small amount of information.
13
Non-Volatile storage
• These memories are made to survive system crashes. They are huge
in data storage capacity, but slower in accessibility.
14
Recovery and Atomicity
• When a system crashes, it may have several transactions being
executed and various files opened for them to modify the data items.
Transactions are made of various operations, which are atomic in
nature.
15
Log-based Recovery
• Log is a sequence of records, which maintains the records of actions
performed by a transaction. It is important that the logs are written
prior to the actual modification and stored on a stable storage media,
which is failsafe.
• The database can be modified using two approaches −
• Deferred database modification − All logs are written on to the stable
storage and the database is updated when a transaction commits.
• Immediate database modification − Each log follows an actual
database modification. That is, the database is modified immediately
after every operation
16
Log-based recovery works as follows −
•The log file is kept on a stable storage media.
•When a transaction enters the system and starts execution, it writes a
log about it.
• <Tn, Start>
17
Recovery with Concurrent
Transactions
• When more than one transaction are being executed in parallel, the logs
are interleaved. At the time of recovery, it would become hard for the
recovery system to backtrack all logs, and then start recovering. To ease
this situation, most modern DBMS use the concept of 'checkpoints’.
18
CHECKPOINT
• Checkpoint is a mechanism where all the previous logs are removed
from the system and stored permanently in a storage disk.
19
CHECKPOINT
20
How data recovery works
• The data recovery process varies, depending on the circumstances
of the data loss, the data recovery software used to create the
backup and the backup target media
21
Data recovery methods
• Standard Data Recovery is where we recover data using standard lab
facilities. This is used typically for recovering data from media in case
of no physical failure.
22
Database Security
• Database security refers to the collective measures used to
protect and secure a database or database management
software from illegitimate use and malicious threats and attacks.
• Database security protects the confidentiality, integrity and
availability(CIA) of an organizations.
• Confidentiality is a set of rules that limits access to information.
• Integrity is the assurance that the information is trustworthy and
accurate.
• Availability is a guarantee of reliable access to the information
by authorized people.
23
Database Security
24
Why is database security important?
•Finances and reputation.
▪Company’s block attacks, including ransomware and breached
firewalls, which in turn keeps sensitive information safe.
▪Prevent malware or viral infections which can corrupt data, bring
down a network, and spread to all end point devices.
▪Ensure that physical damage to the server doesn’t result in the
loss of data.
▪Prevent data loss through corruption of files or programming
errors.
Note: In 2015 ,With an estimated world population of 7.4 billion,7%
of world population was exposed to hackers and 500 million
identities were exposed.
25
Sources of Vulnerability
1. Application:
• SQL injection attack
• Application bypass
2. Test and Dev:
• Access to production data in non- secure environment
• Access to production systems for trouble shooting
3. Administrative Account Misuse:
• System and Application admins, DBA
• Stolen credential, Inadequate Training, Malicious Insiders
4. Operations:
• Lost/Stolen Backups
• Direct OS Access.
26
SECURITY THREATS:MOST
COMMON ATTACKS
1. Privilege abuse: When database users are provided with
privileges that exceeds their day-to-day job requirement, these
privileges may be abused intentionally or unintentionally.
27
3. Database rootkits: A database rootkit is a program that is hidden
inside the database and that provides administrator-level privileges
to gain access to the data and may even turn off alerts triggered by
Intrusion Prevention Systems (IPS).
28
Data Security Architecture
• Security Architecture is the design artifacts that describe how
the security controls (= security countermeasures) are
positioned and related to the overall systems architecture and
serve the purpose to maintain the system's quality attributes.
• An information security architecture is designed to be strategic
to have a longer life than a blueprint, design requirement, or a
topological chart or configuration. It is meant to assist in making
choices associated to the identification, acquisition, design,
application, implementation, deployment, and operation of
elements in the organization’s technical environment.
• The information security architecture should support many
communities, departments, and lines of business, and should
represent the long-term view of technical direction.
29
• An architecture that supports:
1. An effective security program that recognizes that all
information is not identical or continuous in terms of value and
risk over time.
2. A well organized and efficient security program that applies the
right technology to protect the utmost critical assets joint with
quality processes that reduce the risks.
3. A high-quality security program that includes regular
management reviews and technology assessments to ensure
controls.
30
OBJECTIVES OF THE SECURITY 31
ARCHITECTURE
The specific objectives and deliverables of the organization’s
information security architecture can be defined as follows:
• Provides guidance to the organization’s IT corporate and
department decision-makers.
• Supports, enables, and extends the organization’s security
policy and standards by providing specific security-related
guidance.
• Describes general security strategies within the organization’s
information security architecture domain.
• Describes the high-level design objectives.
• Describes the concept of “security zones ”.
• Describes a risk management architecture.
• Leverages leading industry standards and representations to
ensure best security practices are being applied.
DATABASE SECURITY STRATEGY 32
SECURITY STRATEGY
❑ FOUNDATION PILLAR
The “foundation pillar” stresses discovery and
classification of sensitive data and devising a vigorous
authentication, authorization, and access control
framework. In addition, all critical databases must be
patched periodically to remove known vulnerabilities.
• To establish a strong database security foundation,
enterprises should use:
• Database discovery and classification, which provides
information on all databases to focus upon
• AAA mechanisms for appropriate database access
• Patch management protecting against identified
vulnerabilities.
❑ DETECTION PILLAR 34
PRACTICES
• Separate the Database and Web Servers
• Always keep the database server separate from the web
server. Most vendors try to make things easier by having
the database created on the same server that the
application is installed.
• This also makes it easier for an attacker to access the
data because they only need to crack the administrator
account for one server to have access to everything.
• Instead, a database should reside on a separate
database server located behind a firewall, not in the DMZ
with the web server. This makes for a more complicated
setup.
• Encrypt stored files
• The stored files of a web application often contain information about 38
the databases that the software needs to connect to. This
information, if stored in plain text like many default installations do,
provide the keys an attacker needs to access sensitive data.
• Keep in mind that securing your database means you have to shift
your focus from web developer to database administrator. In small
businesses, this may mean added responsibilities and additional buy
in from management. However, getting everyone on the same page
when it comes to security can make a difference between preventing
an attack and responding to an attack.
10 OF THE BEST SYSTEMS AVAILABLE FOR 42
BUSINESS PROFESSIONALS:
▪ Oracle
▪ Microsoft SQL Server
▪ MySQL
▪ PostgreSQL
▪ Microsoft Access
▪ Teradata
▪ IBM DB2
▪ Informix
▪ SAP ASE(Sybase Adaptive Server Enterprise)
▪ Amazon’s SimpleDB
Disk Storage, Basic File
structures And Hashing
CONTENTS
• Introduction
• Secondary Storage Devices
• Buffering of Blocks
• Placing File Records on Disk
• Operations on Files
• Files of Unordered Records (Heap Files)
• Files of Ordered Records (Sorted Files)
• Hashing Techniques
• Parallelizing Disk Access Using RAID Technology
INTRODUCTION
In a computerized database, the data is stored on computer storage
medium, which includes:
• Primary Storage: can be processed directly by the CPU (e.g., the main
memory, cache) –fast, expensive, but of limited capacity
• They must persist over long period of times, but the main memory is a
volatile storage
• For a read command, the block from disk is copied into the buffer.
• For a write command, the contents of the buffer are copied into the
disk.
• A disk controller controls the disk drive and interfaces it to the computer
system.
• The time required that the disk controller mechanically positions the
read/write head on the correct track is called the seek time.
• The time required that the beginning of the desired block rotates into
position under the read/write head is called the rotational delay or
latency.
SECONDARY STORAGE DEVICES
• After finding the desired block, the time required to transfer the data
(read or write a block) is called the block transfer time.
• The seek time and rotational delay are usually much larger than the
block transfer time.
• A tape drive includes a mechanism to read the data from or to write the
data to a tape reel.
BUFFERING OF BLOCKS
• Buffers are reserved in main memory to speed up the processes.
• While one buffer is being read or written (by disk controllers), the CPU
can process data in the other buffers.
• A data type associated with each field, specifies the types of values a
field can take.
• If every record in the file has the same size, the file is of type
fixed-length records.
• If different records in the file have different sizes, the file is of type
variable-length records.
In linked allocation, each file block contains a pointer to the next file
block.
A file header or file descriptor contains information about a file (e.g., the
disk address, record format descriptions, etc.)
OPERATIONS ON FILES
Two main types of operations:
• Retrieval operations: do not change any data in the file
• Update operations: changes the file by insertion or deletion of records
or by modification of field values.
Actual operations for locating and accessing file records implies the
following high-level operations:
• Open
• Reset
• Find
• Read
• FindNext
• Update (insert, delete, modify)
• Close
OPERATIONS ON FILES
• A file organization refers to the way records and blocks are placed on
the storage device.
• A file is said to be static, if the update operations are rarely applied to it,
otherwise it is dynamic.
• A table maintained in the file header converts the bucket number into
the corresponding disk block address.
HASHING TECHNIQUES
Matching bucket numbers to disk block addresses.
HASHING TECHNIQUES
Handling overflow for buckets by chaining.
HASHING TECHNIQUES
• The hashing scheme is called static hashing if a fixed number of
buckets is allocated.