Topics in Database Administration What is database administration? What is data administration? What are the tasks involved in establishing, creating,

Slides:



Advertisements
Similar presentations
TRANSACTION PROCESSING SYSTEM ROHIT KHOKHER. TRANSACTION RECOVERY TRANSACTION RECOVERY TRANSACTION STATES SERIALIZABILITY CONFLICT SERIALIZABILITY VIEW.
Advertisements

Transactions (Chapter ). What is it? Transaction - a logical unit of database processing Motivation - want consistent change of state in data Transactions.
Monday, 08 June 2015Dr. Mohamed Osman1 What is Database Administration A high level function (technical Function) that is responsible for ► physical DB.
10/25/2001Database Management -- R. Larson Data Administration and Database Administration University of California, Berkeley School of Information Management.
© 2005 by Prentice Hall 1 Chapter 12: Data and Database Administration Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
1 7 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 7 DBMS Functions.
Database Integrity, Security and Recovery Database integrity Database integrity Database security Database security Database recovery Database recovery.
Transaction Management and Concurrency Control
Concurrency Control. R/RR/W W/W User 2 ReadWrite User 1 Read Write R/W: Inconsistent Read problem. W/W: Lost Update problem.
Chapter 15 Transaction Management. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Transaction basics Concurrency.
Transaction Management and Concurrency Control
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Transaction Management and Concurrency Control
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Data and Database Administration
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
Chapter 8 Security Transparencies © Pearson Education Limited 1995, 2005.
IS 4420 Database Fundamentals Chapter 12: Data and Database Administration Leon Chen.
Concepts of Database Management Seventh Edition
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
Database Administration Part 1 Chapter Six CSCI260 Database Applications.
Functions of a Database Management System. Functions of a DBMS C.J. Date n Indexing n Views n Security n Integrity n Concurrency n Backup/Recovery n Design.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Transaction Management and Concurrency Control
 Mechanism for restoring a database quickly and accurately after loss or damage  RESPONSIBILITY OF ?????  Recovery facilities: Backup Facilities Backup.
 Mechanism for restoring a database quickly and accurately after loss or damage  RESPONSIBILITY OF ?????  Recovery facilities: Backup Facilities Backup.
10/5/1999Database Management -- R. Larson Data Administration and Database Administration University of California, Berkeley School of Information Management.
1 © Prentice Hall, 2002 Chapter 12: Data and Database Administration Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Data and Database Administration
© 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 CHAPTER 11: DATA AND DATABASE ADMINISTRATION Modern Database Management 11 th Edition Jeffrey.
Managing Multi-User Databases AIMS 3710 R. Nakatsu.
Data Administration & Database Administration
Concepts of Database Management Sixth Edition
DBSQL 7-1 Copyright © Genetic Computer School 2009 Chapter 7 Transaction Management, Database Security and Recovery.
1 Topics in Database Administration u What is database administration? u What are the tasks involved in establishing, creating, implementing and maintaining.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
The University of Akron Dept of Business Technology Computer Information Systems DBMS Functions 2440: 180 Database Concepts Instructor: Enoch E. Damson.
Concepts of Database Management, Fifth Edition
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
Topics in Database Administration What is database administration? What is data administration? What are the tasks involved in establishing, creating,
Data and Database Administration Chapter 12 (Contd.)
Lecture 12 Recoverability and failure. 2 Optimistic Techniques Based on assumption that conflict is rare and more efficient to let transactions proceed.
D ATABASE A DMINISTRATION L ECTURE N O 3 Muhammad Abrar.
11/7/2012ISC329 Isabelle Bichindaritz1 Transaction Management & Concurrency Control.
Database Security Outline.. Introduction Security requirement Reliability and Integrity Sensitive data Inference Multilevel databases Multilevel security.
Data & Database Administration
MBA 664 Database Management Dave Salisbury ( )
TM 13-1 Copyright © 1999 Addison Wesley Longman, Inc. Data and Database Administration.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
1 Advanced Database Concepts Transaction Management and Concurrency Control.
Data and Database Administration CS263 Lecture 15.
3 Database Systems: Design, Implementation, and Management CHAPTER 9 Transaction Management and Concurrency Control.
1 Data and Database Administration Data and Database Administration By Lec. Adeel Shahzad FromBook-B.
18 September 2008CIS 340 # 1 Last Covered (almost)(almost) Variety of middleware mechanisms Gain? Enable n-tier architectures while not necessarily using.
Chapter 5 Managing Multi-user Databases 1. Multi-User Issues Database Administration Concurrency Control Database Security Database Recovery Page 307.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
9 1 Chapter 9 Transaction Management and Concurrency Control Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
SYSTEMS IMPLEMENTATION TECHNIQUES TRANSACTION PROCESSING DATABASE RECOVERY DATABASE SECURITY CONCURRENCY CONTROL.
CSC314 Day 16 Transaction processing Concurrency Control 1.
Copyright © 2016 Pearson Education, Inc. CHAPTER 12: DATA AND DATABASE ADMINISTRATION Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman,
TM 13-1 Copyright © 1999 Addison Wesley Longman, Inc. Data and Database Administration.
Chapter 12: Data and Database Administration
Managing Multi-User Databases
Transaction Management and Concurrency Control
Functions of a Database Management System
Managing Multi-user Databases
Chapter 10 Transaction Management and Concurrency Control
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

Topics in Database Administration What is database administration? What is data administration? What are the tasks involved in establishing, creating, implementing and maintaining a database for an organization? What are the tasks involved in: – Database transaction integrity? – Database backup/recovery? – Database security? – DBMS efficiency? 1

What are the two general “activity components” of administering a database?

Tasks in “data” administration Planning. – Assist in the development of the IS architecture. – Develop enterprise data model. – Assist in database design for application development. Policies and procedures. – Establish metadata. – Assesses and controls the quality of the data. – Establish policies towards data ownership. Internal marketing. – Explain the concept of data as a shared resource. – Resolve conflicts between organizational areas. 3

More detail: Data Resource Management Tasks Assess organizational data strategy. Evaluate data level of data integration. Evaluate quality of data. Create and maintain metadata. Create and maintain data models. Identify stakeholders and ensure ongoing participation in data management. Evaluate privacy of data. Determine ethical use of data collection and access. Make effective use of data resources through business intelligence capabilities. 4

Tasks in “database” administration Planning. – Guide the selection of hardware and DBMS software. – Choose appropriate tool set for database administration, development and maintenance. Procedures and policies. – Establish security policies. Access. Update. – Establish application development policies. Use of views. Use of indexes. – Establish backup and recovery policies. – Enforce policies. 5

More detail: Technical Management Tasks Install and update the DBMS. Create the database(s). – Establish tablespace and constraints. – Create users. – Manage data dictionary. Populate the database(s). Ensure data integrity. – Triggers and stored procedures. – Referential integrity. – Additional data constructs implemented through SQL. Perform data backup and recovery. Monitor and tune performance. 6

Data AdministratorDatabase Administrator Education Experience Skills

Three of the critical technical tasks of a DBA Database backup and recovery. – Anticipating the event of a database failure. – Establishing & enforcing database backup & recovery procedures. Database security and integrity. – Defining security requirements based on data and application needs. – Establishing and enforcing security procedures. – Establishing and enforcing data integrity procedures. DBMS optimization. – Tracking current response time. – Modifying DBMS parameters to improve response time. 8

Database backup and recovery What is backup and recovery? – Backup: A method of storing data from a database in a format that can be used to rebuild the database if necessary. – Recovery: Mechanisms for restoring a database quickly and accurately after loss or damage. Why have backup and recovery? – Human error. – Hardware failure. – Incorrect or invalid data. – Program errors. – Viruses. – Natural catastrophes. 9

Backup and recovery are based on transactions A transaction is one or more database actions (SQL statements) that are treated as a single unit of work. – If the transaction is successful, then the transaction is committed. – If the transaction is not successful, then the transaction is rolled back or aborted. 10 Imagine a database with this structure

Accepting an order for a product 11 INSERT INTO orderline_tbl VALUES (123,6812,10, 34.99); UPDATE product_tbl SET qoh = qoh - 10 WHERE prod_no = 6812; INSERT INTO order_tbl VALUES (123,’04-dec-2012’, 765, ‘net30’);

DBMS’s have methods to control transactions Databases that support transactions provide specific commands for starting, committing, and rolling back transactions. – Begin transaction. – End transaction. – Commit. – Rollback. – Autocommit. Transaction throughput: The number of transactions processed per time interval. This is a measure of transaction processing performance. 12

Transactions have properties (ACID) Atomicity: A transaction is an indivisible unit of work. – Almost all languages that interface with a DBMS have a way to signify the start and end of a transaction. – Within the start and end are one or more SQL commands. Consistency: The transaction moves a database from one state of consistency, through inconsistency to another state of consistency. Isolation: A transaction executes in isolation from other transactions. – This is also referred to as the “serializability” of transactions. – A transaction can affect another transaction, so the transaction must be completed as though it is isolated in order to be accurate. Durability: Once a transaction is committed, its effects on the database are durable, or permanent. No subsequent actions or failures to the database can cause that transaction to be lost. 13

Transaction boundary decision Division of work into transactions. Objectives: – Minimize transaction duration. – Ensure transaction isolation. Constraint: enforcement of important integrity constraints. 14

Transaction boundary choices. Transaction form example: e30.htm e30.htm One transaction for the entire form? One transaction for the main form and one transaction for all subform records? One transaction for the main form and separate transactions for each subform record? 15

Backup is conducted in 3 processes Backup: A DBMS software utility provides a way to do a complete, full or incremental backup of the database in a consistent state. – Complete: entire database. – Full: all rows of specified tables. – Incremental: rows that have changed since the last full backup. Journalize: A DBMS software utility provides an audit trail of changes to the database. – Transaction log: contains all data used to process changes against the database. – Database change log: contains a before-image and an after-image of each row modified by a database transaction. Checkpoint: A DBMS software utility that periodically suspends all transaction processing and synchronizes files within the database. – Some databases, such as Oracle, do not actually halt processing. They simply write checkpoint information to files. – The purpose of a checkpoint is to minimize the amount of time it takes to restore a system. 16

Recovery methods A DBMS has a utility to recover the database. Usually referred to as the Recovery Manager. The method of recovery depends on the type of failure. Recovery Manager usually has the following options: – Switch: Switches to a replica of the database on a different storage device. Requires that a mirror image of the database is stored. Can be expensive. Assumption is a storage failure, not a failure in transaction integrity, occurred. – Restore/Rerun: Reprocesses the transactions for a given time period against a correct version of the database. Assumption is that a failure in transaction integrity has occurred. Can be very time-consuming. 17

Two common methods of restore/rerun Backward recovery. Also called “rollback” recovery. Used to undo unwanted changes to the database. – Imagine that the current database is inaccurate. – Before-images are applied to the current database to return it to a prior state of consistency. – Used to back out changes that are unwanted. Forward recovery. Also called “rollforward” recovery. Used to recover accurate transactions and apply them to the database. – Imagine that the current database is inaccurate. This database must be replaced with a prior, consistent version of the database before forward recovery can begin. – After-images are applied to a past version of the database. Does not require that all transactions are applied - just takes the most recent after-images. 18

Issues in database backup and recovery Cost. – Media. – Computer overhead (processor, memory, disk) to create journalizing files, control files, checkpoint files, etc. – Personnel to supervise and tune. Time. – Can result in regularly scheduled downtime. – Can make the system slower. 19

Potential problems with shared databases Concurrency control is the process of managing concurrent operations against a database in order to maintain data integrity. Potential problems with shared databases are: – Lost Update. – Uncommitted Dependency. “Dirty Read” – Incorrect Summary. 20

Lost update 21 SR: Seats Remaining

Uncommitted dependency or “dirty read” 22

Incorrect summary 23

Methods of concurrency control Scheduler. The scheduler establishes the order in which the operations within concurrent transactions are executed. – The scheduler interleaves the execution of database operations to ensure serializability. – Some schedulers have the ability to analyze transaction content. Locking: Fundamental tool of concurrency control. Obtain lock before accessing an item. Wait if a conflicting lock is held. – Shared lock: conflicts with exclusive locks – Exclusive lock: conflicts with all other kinds of locks Concurrency control manager maintains the lock table 24

More about locking Locking. A lock guarantees exclusive use of a data item to a current transaction. – Locking can be performed programmatically or left to the DBMS. – Granularity of locking depends on the DBMS. Database level. Table level. Page level. Row level. Column level. – Can have shared or exclusive locks. 25

Problem in locking Deadlock: An impasse that occurs when two or more transactions have locked a common resource and each is waiting for the other to finish. 26

Database security Database Security: Protection of the data against accidental or intentional loss, destruction, or misuse. Threats to database security include the list below. Accidental losses attributable to: – Human error. – Software failure. – Hardware failure. Theft and fraud. Improper data access: – Loss of privacy (personal data). – Loss of confidentiality (corporate data). Loss of data integrity. Loss of availability. 27

DBMS security features Views (frequently referred to as subschemas). Integrity controls. Authorization rules. – Controls incorporated in the DBMS. – Restrict access to specific data. – Restrict actions that can be taken. User-defined procedures. – Trigger an authorization procedure which asks additional identification questions. – Written in a standard programming language or proprietary language. Encryption. Authentication schemes. – Biometric devices. 28

SQL Server’s approach to security Multi-user database systems, such as SQL Server, include security features that control how a database is accessed and used. For example, security mechanisms: – Prevent unauthorized database access. – Prevent unauthorized access to schema objects. – Control system resource usage (such as CPU time or disk usage). – Audit user actions. Associated with each database user is a schema. – A schema is a logical collection of database objects (tables, views, sequences, synonyms, indexes, clusters, procedures, functions, packages, and database links). – By default, each database user creates and has access to all objects in the corresponding schema. 29

SQL statements used for security

SQL Statements Used for Data Integrity SQL StatementDescription Create Domain Create custom data types with predefined CHECK constraints. Create Assertion Create constraints involving multiple tables and calculations. Similar to CHECK constraints, but allows access to multiple tables through a SELECT statement. Triggers and Stored Procedures Programmer can create customized integrity check through proprietary procedural language. Transact-SQL for SQL Server.

DBMS query optimization DBMS’s are differentiated by their query optimizers. A query optimizer is a component of a DBMS. You do not have the choice of how queries are implemented on the physical database, the query optimizer assumes this responsibility. 32

Query optimizer methods Rule based. – Looks at syntax. – Parses query and executes in the order written according to the rules pre- established by the person who wrote the query optimizer. Cost based. – Looks at syntax. – Looks at statistical data about the database. – Parses query and executes based on the written and the information about the current and historical data of the database. Choose. – Uses the rule based method for tables which have not been used/analyzed in the past. – Uses the cost based method for tables which have been previously analyzed. 33

Becoming a DBA Experience. – Application programming with a database. – Some DBA tasks. – Systems programming with a database. Education. – Training classes with a specific DBMS. – For example, Oracle offers a ten-class sequence for DBA’s. Most classes are one week (40 hours) in time. – Master’s degree? Certification. – Specific to DBMS. – Offered by DBMS vendor. – Formal programs offered for Oracle and SQL Server; informal programs for other DBMS types. 34