Ch6 - Data and Database Administration
Ch6 - Data and Database Administration
1
Objectives
• Definition of terms
3
Traditional Data
Administration Functions
• Data policies, procedures, standards
• Planning
• Data conflict (ownership) resolution
• Internal marketing of DA concepts
• Managing the data repository
4
Traditional Database
Administration Functions
• Selection of hardware and software
• Installing/upgrading DBMS
• Tuning database performance
• Improving query processing performance
• Managing data security, privacy, and integrity
8
Data Modeling Responsibilities
9
Database Security
• Database Security: Protection of the
data against accidental or intentional
loss, destruction, or misuse
10
Possible locations of data security threats
11
Threats to Data Security
• 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 (through, e.g. sabotage)
12
Data Management Software
Security Features
• Views or subschemas
• Integrity controls
• Authorization rules
• User-defined procedures
• Encryption
• Authentication schemes
• Integrity Controls
– Protect data from unauthorized use
– Domains – set allowable values
– Assertions – enforce database conditions 14
Authorization Rules
• Controls incorporated in the data
management system
• Restrict:
– Access to data
– Actions that people can take on data
16
Authorization table for subjects
Oracle9i privileges
18
Authentication Schemes (1)
• Goal – obtain a positive identification of the
user
• Passwords: First line of defense
– Should be at least 8 characters long
– Should combine alphabetic and numeric
data
– Should not be complete words or personal
information
– Should be changed frequently
19
Authentication Schemes (2)
• Strong Authentication
– Passwords are flawed:
• Users share them with each other
20
Authentication Schemes (3)
• Possible solutions:
– Two factor – e.g. smart card plus PIN
− Backup Facilities
− Journalizing Facilities
− Checkpoint Facility
− Recovery Manager
23
Backup Facilities
• Automatic dump facility that produces
backup copy of the entire database
• Periodic backup (e.g. nightly, weekly)
• Cold backup – database is shut down
during backup
• Hot backup – selected portion is shut down
and backed up at a given time
• Backups stored in secure, off-site location
24
Journalizing Facilities
• Audit trail of transactions and database
updates
• Transaction log – record of essential data for
each transaction processed against the
database
• Database change log – images of updated
data
– Before-image – copy before modification
– After-image – copy after modification
27
Recovery and Restart Procedures
• Switch - Mirrored databases
• Restore/Rerun - Reprocess transactions
against the backup
• Transaction Integrity - Commit or abort all
transaction changes
• Backward Recovery (Rollback) - Apply before
images
• Forward Recovery (Roll Forward) - Apply after
images (preferable to restore/rerun)
28
Basic recovery techniques Rollback
29
Rollforward
30
Database Failure Responses
• Aborted transactions
– Preferred recovery: rollback
– Alternative: Rollforward to state just prior to abort
• Incorrect data
– Preferred recovery: rollback
– Alternative 1: rerun transactions not including inaccurate data
updates
– Alternative 2: compensating transactions
• System failure (database intact)
– Preferred recovery: switch to duplicate database
– Alternative 1: rollback
– Alternative 2: restart from checkpoint
• Database destruction
– Preferred recovery: switch to duplicate database
– Alternative 1: rollforward
– Alternative 2: reprocess transactions 31
Concurrency Control
• Problem – in a multiuser environment,
simultaneous access to data can result in
interference and data loss
32
Lost Update
• Locking Mechanisms
– The most common way of achieving serialization
– Data that is retrieved for the purpose of updating is
locked for the updater
– No other user can perform update until unlocked
34
Updates with locking for concurrency control
35
This prevents the lost update problem
Locking Mechanisms
• Locking level:
– Database – used during database updates
– Table – used for bulk updates
– Block or page – very commonly used
– Record – only requested row; fairly commonly
used
– Field – requires significant overhead; impractical
• Types of locks:
– Shared lock - Read but no update permitted.
Used when just reading to prevent another user
from placing an exclusive lock on the record
– Exclusive lock - No access permitted. Used when
preparing to update 36
Deadlock
An impasse that results when two or more transactions have
locked common resources, and each waits for the other to unlock
their resources
A deadlock situation
40
Better performance than locking
Managing Data Quality
• Data Steward - Liaisons between IT and business
units
• Five Data Quality Issues:
Security policy and disaster recovery
Personnel controls
Where repository
objects are stored
43
Database Performance Tuning
• DBMS Installation
– Setting installation parameters
• Memory Usage
– Set cache levels
– Choose background processes
• Input/Output Contention
– Use striping
– Distribution of heavily accessed files
• CPU Usage
– Monitor CPU load
• Application tuning
– Modification of SQL code in applications
44