0% found this document useful (0 votes)
17 views

lecture-6

The document provides an overview of database administration, detailing the roles and responsibilities of database administrators (DBAs) in managing database systems. It covers essential topics such as database architecture, installation and configuration of database servers, and best practices for database management. Additionally, it discusses various types of database management systems (DBMS) and the tools available for effective database administration.

Uploaded by

pekogroup2017
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

lecture-6

The document provides an overview of database administration, detailing the roles and responsibilities of database administrators (DBAs) in managing database systems. It covers essential topics such as database architecture, installation and configuration of database servers, and best practices for database management. Additionally, it discusses various types of database management systems (DBMS) and the tools available for effective database administration.

Uploaded by

pekogroup2017
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Database Systems and Security

Introduction to Database Administration

Evrad KAMTCHOUM

CENTER FOR CYBERSECURITY AND MATHEMATICAL CRYPTOLOGY


THE UNIVERSITY OF BAMENDA

January 16, 2025

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 1 / 46


Contents

1 Introduction to Database Administration

2 Overview of Database Management Systems (DBMS) and Database


Administration Roles

3 Database Architecture and Components

4 Installation and Configuration of Database Servers

5 Database Management Tools and Utilities

6 Conclusion

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 2 / 46


Introduction to Database Administration

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 3 / 46


What is Database Administration?

Definition
Database administration refers to the tasks and responsibilities involved in
managing and maintaining a database system to ensure its performance,
availability, security, and reliability.

Database Administration involves managing and maintaining database


systems to ensure their availability, reliability, and performance.

Database Administrators (DBAs) are responsible for implementing,


configuring, maintaining, and performing critical tasks related to
databases.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 4 / 46


Responsibilities of a Database Administrator

Installation and Configuration:


Setting up database servers and configuring database settings.
Security Management:
Implementing access controls and ensuring data security.
Example: Granting and revoking user permissions.
1 GRANT SELECT , INSERT ON database . table TO ’
username ’;
2 REVOKE INSERT ON database . table FROM ’ username ’
;
3

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 5 / 46


Responsibilities of a Database Administrator (2)

Backup and Recovery:


Planning and executing backup strategies.
Performing data recovery in case of data loss.
Example: Backup and restore commands.
1 BACKUP DATABASE dbname TO DISK = ’
backup_location ’;
2 RESTORE DATABASE dbname FROM DISK = ’
backup_location ’;
3

Performance Tuning:
Monitoring and optimizing database performance.
Using indexing, query optimization, and other techniques.
Monitoring and Maintenance:
Regularly checking database health and performance.
Scheduling maintenance tasks like defragmentation and updates.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 6 / 46


Responsibilities of a Database Administrator (3)

Data Integrity and Consistency:


Ensuring that data is accurate and consistent across the database.
Implementing constraints, triggers, and other mechanisms to maintain
data integrity.
Capacity Planning:
Planning for future database growth and scalability.
Ensuring the database can handle increased loads and new applications.
Documentation:
Maintaining comprehensive documentation of database configurations,
procedures, and policies.
Documenting backup and recovery procedures, security measures, and
performance tuning steps.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 7 / 46


Database Administration Tools

Database Management Systems (DBMS):


Examples: MySQL, PostgreSQL, Oracle, SQL Server.

Monitoring Tools:
Examples: Nagios, Zabbix, SolarWinds.

Backup and Recovery Tools:


Examples: Bacula, Veeam, SQL Server Management Studio (SSMS).

Performance Tuning Tools:


Examples: pgAdmin, MySQL Workbench, Oracle Enterprise Manager.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 8 / 46


Best Practices for Database Administration

Regular Backups:
Schedule regular backups and test restore procedures.
Security:
Implement strong authentication and encryption.
Regularly update and patch database software.
Monitoring:
Continuously monitor database performance and health.
Set up alerts for critical issues.
Documentation:
Maintain thorough documentation of database configurations,
procedures, and policies.
Capacity Planning:
Plan for future growth and scalability.
Regular Maintenance:
Schedule regular maintenance tasks like indexing and defragmentation.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 9 / 46


Overview of Database Management Systems (DBMS)
and Database Administration Roles

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 10 / 46


Introduction

Database Management Systems (DBMS)


A Database Management System (DBMS) is software designed to assist in
maintaining and utilizing large collections of data. It provides users and
applications with an interface to interact with the database, while
managing the storage, organization, and retrieval of data.

Database Administration Roles


Database Administration involves the tasks related to managing and
maintaining databases to ensure their efficiency, security, and integrity.
Database administrators (DBAs) are responsible for various aspects of
database management, including design, performance tuning, security,
backup and recovery, and user management.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 11 / 46


Types of Database Management Systems

1 Relational DBMS (RDBMS):


Organizes data into tables with rows and columns.
Uses structured query language (SQL) for data manipulation and
retrieval.
Examples: MySQL, PostgreSQL, Oracle, SQL Server.
2 NoSQL DBMS:
Designed for storing and retrieving unstructured or semi-structured
data.
Provides flexibility and scalability for large-scale distributed systems.
Examples: MongoDB, Cassandra, Redis.
3 NewSQL DBMS:
A hybrid approach combining features of traditional RDBMS and
NoSQL databases.
Aims to provide the scalability of NoSQL databases while maintaining
ACID properties of RDBMS.
Examples: Google Spanner, CockroachDB, VoltDB.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 12 / 46


Database Administration Roles

Responsibilities of Database Administrators (DBAs)


Database Design: Designing the database schema and data models
to meet application requirements and performance goals.
Performance Tuning: Optimizing database performance by
fine-tuning queries, indexing, and database configurations.
Security Management: Implementing security measures to protect
data from unauthorized access, ensuring compliance with regulations.
Backup and Recovery: Establishing backup strategies and recovery
procedures to minimize data loss and downtime in case of failures.
User Management: Managing user accounts, permissions, and
access levels to control database access and ensure data privacy.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 13 / 46


Database Architecture and Components

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 14 / 46


Introduction

Database Architecture
Database architecture refers to the structure and design of a database system, including its
components and the relationships between them. It defines how data is stored, organized, and
accessed within the database system.

Components of Database Architecture


The components of database architecture typically include the following:
Data Models
Database Management System (DBMS)
Database Schema
Storage Structures
Query Processor
Transaction Manager
Concurrency Control
Recovery Manager

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 15 / 46


Data Models

Definition
A data model is a conceptual representation of the data structures and
relationships within a database. It defines the logical structure of the
database and serves as a blueprint for database design.

Relational Model: Organizes data into tables with rows and


columns, linked by keys.
Entity-Relationship Model (ER Model): Represents entities,
attributes, and relationships between them.
Object-Oriented Model: Models data as objects with attributes and
methods.
Hierarchical Model: Represents data in a tree-like structure.
Network Model: Represents data as records connected by pointers.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 16 / 46


Database Management System (DBMS)

Definition
A Database Management System (DBMS) is software that facilitates the
creation, management, and use of databases. It provides users and
applications with an interface to interact with the database, while
managing data storage, retrieval, and security.

Examples of DBMS: MySQL, PostgreSQL, Oracle, SQL Server,


MongoDB.
Features: Data manipulation, query optimization, concurrency
control, backup and recovery, security management.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 17 / 46


Database Schema

Definition
A database schema is a logical structure that defines the organization of
data within a database. It specifies the tables, columns, constraints, and
relationships that constitute the database.

Tables: Entities represented in the database.


Columns: Attributes or fields of the entities.
Constraints: Rules or conditions that restrict the values allowed in
columns.
Relationships: Associations between tables.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 18 / 46


Storage Structures

Definition
Storage structures define how data is physically stored and organized
within the database. They include mechanisms for storing and accessing
data efficiently, such as indexes, files, and buffers.

Indexes: Data structures that improve the speed of data retrieval


operations.
Files: Storage containers for database objects, managed by the
operating system.
Buffers: Memory areas used to cache frequently accessed data,
reducing disk I/O.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 19 / 46


Query Processor

Definition
The query processor is responsible for interpreting and executing queries
submitted to the database. It includes components for query parsing,
optimization, and execution.

Query Parsing: Analyzing query syntax and semantics to generate


an execution plan.
Query Optimization: Generating the most efficient execution plan
based on cost estimates and available indexes.
Query Execution: Retrieving data from storage structures and
processing query results.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 20 / 46


Transaction Manager

Definition
The transaction manager ensures the atomicity, consistency, isolation, and
durability (ACID properties) of database transactions. It coordinates
concurrent transactions and manages transaction logs for recovery
purposes.

Atomicity: Ensures that all operations within a transaction are


completed successfully or rolled back as a single unit.
Consistency: Maintains data integrity and enforces constraints
during transactions.
Isolation: Ensures that transactions are executed independently of
each other to prevent interference.
Durability: Guarantees that committed transactions are permanently
saved, even in the event of system failures.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 21 / 46


Concurrency Control

Definition
Concurrency control ensures that multiple transactions can execute
concurrently without interfering with each other. It includes mechanisms
for locking, timestamping, and transaction scheduling.

Locking: Prevents conflicting operations on shared data by acquiring


and releasing locks.
Timestamping: Assigns timestamps to transactions to determine
their order of execution and detect conflicts.
Transaction Scheduling: Orders transactions based on their
timestamps and resolves conflicts.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 22 / 46


Recovery Manager

Definition
The recovery manager ensures the durability of data by maintaining
transaction logs and restoring the database to a consistent state after
failures. It includes mechanisms for logging changes, checkpointing, and
performing recovery operations.

Logging: Records changes made by transactions in a log file for


recovery purposes.
Checkpointing: Periodically saves the current state of the database
to facilitate faster recovery.
Recovery Operations: Restores the database to a consistent state
by applying logged changes and rolling back incomplete transactions.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 23 / 46


Installation and Configuration of Database Servers

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 24 / 46


Introduction

Database Servers
A database server is a computer system that hosts a database
management system (DBMS) and provides database services to client
applications over a network. Installing and configuring a database server
involves setting up the necessary software and configuring various
parameters to ensure optimal performance, security, and reliability.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 25 / 46


Installation Steps

1 Selecting the DBMS: Choose the appropriate DBMS for your


requirements, such as MySQL, PostgreSQL, SQL Server, Oracle, etc.
2 Downloading the Software: Download the installation package or
binaries for the selected DBMS from the official website or package
repository.
3 Installing the Software: Run the installation wizard or execute the
installation commands to install the DBMS software on the server.
4 Configuring the Installation: Configure the DBMS installation by
specifying parameters such as installation directory, port numbers,
and authentication settings.
5 Verifying the Installation: Verify that the installation was successful
by checking for the presence of executable files and configuration files.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 26 / 46


Configuration Settings

Key Configuration Settings


Network Configuration: Specify the network settings such as hostname, IP
address, and port numbers for client-server communication.
Authentication and Authorization: Configure user authentication
methods, password policies, and access control settings to secure the
database server.
Storage Configuration: Define storage parameters such as data directory,
tablespaces, and file locations for storing database files.
Performance Tuning: Adjust database parameters such as memory
allocation, buffer sizes, and query optimization settings for optimal
performance.
Backup and Recovery: Set up backup schedules, retention policies, and
recovery procedures to protect data and ensure business continuity.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 27 / 46


Best Practices

Best Practices for Database Server Installation and Configuration


Follow Security Guidelines: Implement security best practices such
as strong authentication, encryption, and firewall rules to protect the
database server from unauthorized access and attacks.
Regular Updates: Keep the DBMS software and operating system
up to date with the latest security patches and updates to address
vulnerabilities and improve performance.
Monitor Performance: Monitor database server performance using
monitoring tools and metrics to identify bottlenecks and optimize
resource usage.
Backup and Disaster Recovery: Implement a robust backup
strategy with offsite storage and periodic testing of recovery
procedures to ensure data integrity and availability in case of failures.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 28 / 46


Database Management Tools and Utilities

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 29 / 46


Introduction

Database Management Tools


Database management tools are software applications designed to assist
database administrators (DBAs) in managing and maintaining databases.
These tools provide a user-friendly interface for performing various
database administration tasks, such as schema design, data manipulation,
performance tuning, backup and recovery, and monitoring.

Categories of Database Management Tools


Database Design Tools
Data Modeling Tools
Database Administration Tools
Performance Monitoring Tools
Backup and Recovery Tools

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 30 / 46


Database Design Tools

Definition
Database design tools are used to create and modify database schemas,
tables, and relationships. They typically provide graphical interfaces for
designing databases and generating SQL scripts to create database objects.

Examples: MySQL Workbench, Oracle SQL Developer, Microsoft


SQL Server Management Studio.
Features: Entity-relationship diagrams, table design, schema
visualization, SQL code generation.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 31 / 46


Data Modeling Tools

Definition
Data modeling tools are used to create conceptual, logical, and physical
data models for databases. They help database designers and architects
visualize data structures, relationships, and constraints before
implementing them in a database management system.

Examples: Erwin Data Modeler, Toad Data Modeler, Lucidchart.


Features: Entity-relationship diagrams, data dictionary, forward and
reverse engineering.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 32 / 46


Database Administration Tools

Definition
Database administration tools are used to manage and monitor databases,
perform routine maintenance tasks, and troubleshoot issues. They provide
features for user management, security configuration, performance tuning,
and monitoring database health.

Examples: dbForge Studio for SQL Server, SQL Diagnostic Manager,


Redgate SQL Toolbelt.
Features: User management, security configuration, performance
monitoring, query optimization, backup and recovery.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 33 / 46


Performance Monitoring Tools

Definition
Performance monitoring tools are used to monitor and analyze the
performance of database servers, identify bottlenecks, and optimize
resource usage. They provide real-time monitoring, alerting, and reporting
capabilities to ensure optimal performance and availability of databases.

Examples: SolarWinds Database Performance Analyzer, Quest


Foglight for Databases, SQL Sentry.
Features: Real-time monitoring, query analysis, wait event analysis,
performance reporting.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 34 / 46


Backup and Recovery Tools

Definition
Backup and recovery tools are used to create and manage database
backups, as well as restore databases to a previous state in case of data
loss or corruption. They provide features for scheduling backups, defining
retention policies, and performing recovery operations.

Examples: Veeam Backup for Microsoft SQL Server, Commvault,


Bacula Enterprise.
Features: Backup scheduling, retention policies, incremental backups,
point-in-time recovery.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 35 / 46


Practical Example: Use of Database Management Tools
Scenario
As a database administrator (DBA) for a large e-commerce platform, you are responsible for
managing a complex database environment with multiple databases serving various applications.
To ensure efficient database operations and performance, you regularly use database
management tools and utilities to streamline tasks and monitor database health.

Use Case: Performance Monitoring


Tool: SolarWinds Database Performance Analyzer
Task: Monitoring database performance in real-time to identify bottlenecks and optimize
resource usage.
Action: Set up custom dashboards to monitor key performance metrics such as CPU
usage, memory utilization, disk I/O, and query execution times.
Benefit: Proactively identify and address performance issues before they impact
application performance or user experience, ensuring optimal database performance.

Discussion
By leveraging database management tools and utilities like SolarWinds Database Performance
Analyzer, DBAs can efficiently monitor, analyze, and optimize database performance, ultimately
improving the reliability and scalability of database systems.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 36 / 46


Exercise: Introduction to Database Administration

Scenario
You have been tasked with setting up a database for a small online bookstore. The bookstore
wants to store information about books, authors, customers, and orders. Your goal is to design
and implement a database schema for the bookstore and perform basic administration tasks.

Tasks
1 Database Design: Design a database schema including tables for books, authors,
customers, and orders. Define appropriate attributes, data types, and relationships
between tables.
2 Schema Implementation: Implement the database schema using SQL. Create tables,
define constraints, and populate the tables with sample data.
3 Basic Administration: Perform basic administration tasks such as creating user accounts,
granting privileges, and backing up the database.

Deliverables
Submit a report detailing your database design, implementation steps, and screenshots
demonstrating the successful completion of administration tasks.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 37 / 46


Exercise Solution: Introduction to Database Administration

Database Design
Books:
book id (PK)
title
author id (FK)
price
quantity in stock
Authors:
author id (PK)
name
Customers:
customer id (PK)
name
email
address

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 38 / 46


Exercise Solution: Introduction to Database Administration

Database Design
Orders:
order id (PK)
customer id (FK)
order date
Order Items:
order id (FK)
book id (FK)
quantity

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 39 / 46


SQL Implementation of Database Schema

Create Tables
1 CREATE TABLE A u t h o r s (
2 a u t h o r i d INT PRIMARY KEY,
3 name VARCHAR( 1 0 0 )
4 );
5
6 CREATE TABLE Books (
7 b o o k i d INT PRIMARY KEY,
8 t i t l e VARCHAR( 2 5 5 ) ,
9 a u t h o r i d INT ,
10 p r i c e DECIMAL ( 1 0 , 2 ) ,
11 q u a n t i t y i n s t o c k INT ,
12 FOREIGN KEY ( a u t h o r i d ) REFERENCES A u t h o r s ( a u t h o r i d )
13 );
14

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 40 / 46


SQL Implementation of Database Schema

Create Tables
1 CREATE TABLE C u s t o m e r s (
2 c u s t o m e r i d INT PRIMARY KEY,
3 name VARCHAR( 1 0 0 ) ,
4 e m a i l VARCHAR( 2 5 5 ) ,
5 a d d r e s s VARCHAR( 2 5 5 )
6 );
7
8 CREATE TABLE O r d e r s (
9 o r d e r i d INT PRIMARY KEY,
10 c u s t o m e r i d INT ,
11 o r d e r d a t e DATE,
12 FOREIGN KEY ( c u s t o m e r i d ) REFERENCES C u s t o m e r s (
customer id )
13 );
14

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 41 / 46


SQL Implementation of Database Schema

Create Tables
1 CREATE TABLE O r d e r I t e m s (
2 o r d e r i d INT ,
3 b o o k i d INT ,
4 q u a n t i t y INT ,
5 PRIMARY KEY ( o r d e r i d , b o o k i d ) ,
6 FOREIGN KEY ( o r d e r i d ) REFERENCES O r d e r s ( o r d e r i d ) ,
7 FOREIGN KEY ( b o o k i d ) REFERENCES Books ( b o o k i d )
8 );
9

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 42 / 46


Basic Administration Tasks

Creating User Accounts


1 CREATE USER ’ n e w u s e r ’@ ’ l o c a l h o s t ’ IDENTIFIED BY ’ p a s s w o r d ’ ;
2

Granting Privileges
1 GRANT SELECT , INSERT , UPDATE, DELETE ON b o o k s t o r e . ∗ TO ’ n e w u s e r ’@ ’
localhost ’ ;
2

Backing Up the Database


1 mysqldump −u u s e r n a m e −p p a s s w o r d b o o k s t o r e > b o o k s t o r e b a c k u p . s q l
2

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 43 / 46


Conclusion

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 44 / 46


Conclusion

Key Points
DBMS provides an interface for users and applications to interact with
databases, managing data storage, organization, and retrieval.
DBAs play critical roles in designing databases, optimizing performance,
ensuring security, managing backups, and controlling user access.
Database architecture components include data models, DBMS, database
schema, storage structures, query processor, transaction manager,
concurrency control, and recovery manager.
Each component plays a crucial role in managing and accessing data within
the database system, ensuring efficiency, reliability, and integrity.
Database management tools are available for different stages of the
database lifecycle, including design, administration, monitoring, and backup.
Choosing the right tools can significantly improve efficiency, productivity,
and reliability in managing and maintaining databases.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 45 / 46


Conclusion (2)

Summary of Key Points


Role of a Database Administrator (DBA): Understand the critical
functions and responsibilities, including database design, implementation,
maintenance, and security.
Database Design and Implementation: Importance of designing a robust
schema, implementing tables, relationships, and constraints.
Basic Administration Tasks: Creating and managing user accounts,
granting appropriate privileges, and ensuring regular backups.
Performance Monitoring and Optimization: Tools and techniques to
monitor database performance and optimize queries for efficiency.
Backup and Recovery Strategies: Importance of regular backups and
strategies for data recovery to prevent data loss.
Security and User Management: Ensuring database security through
proper user management and access controls.

Evrad KAMTCHOUM (CCMC (UBa)) Database Systems January 16, 2025 46 / 46

You might also like