Data administration and database administration
This presentation is the property of its rightful owner.
Sponsored Links
1 / 67

Data Administration and Database Administration PowerPoint PPT Presentation


  • 111 Views
  • Uploaded on
  • Presentation posted in: General

Data Administration and Database Administration. University of California, Berkeley School of Information Management and Systems SIMS 257: Database Management. Final Project Requirements Review Fourth Generation Languages PHP implementation Object-Relational Extensions to SQL

Download Presentation

Data Administration and Database Administration

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Data administration and database administration

Data Administration and Database Administration

University of California, Berkeley

School of Information Management and Systems

SIMS 257: Database Management


Lecture outline

Final Project Requirements

Review

Fourth Generation Languages

PHP implementation

Object-Relational Extensions to SQL

Database Administration

Lecture Outline


Lecture outline1

Final Project Requirements

Review

Fourth Generation Languages

PHP implementation

Object-Relational Extensions to SQL

Database Administration

Lecture Outline


Final project requirements

Final Project Requirements

  • See WWW site:

    • http://sims.berkeley.edu/courses/is257/f04/index.html

  • Report on personal/group database including:

    • Database description and purpose

    • Data Dictionary

    • Relationships Diagram

    • Sample queries and results (Web or Access tools)

    • Sample forms (Web or Access tools)

    • Sample reports (Web or Access tools)

    • Application Screens (Web or Access tools)


Lecture outline2

Final Project Requirements

Review

Fourth Generation Languages

PHP implementation

Object-Relational Extensions to SQL

Database Administration

Lecture Outline


Fourth generation languages

Fourth Generation Languages

  • 1st Generation -- Machine Language

  • 2nd Generation -- Assembly Languages

  • 3rd Generation -- High-Level Languages

  • 4th Generation -- Non-Procedural Languages

  • 5th Generation -- ?? Knowledge-based ?? Natural Language ??

  • Where do Object-Oriented Languages fit??


Components of a 4gl

Components of a 4GL

for building routine applications…

Application

Parameters

Data

Specification

Report

Specification

Feedback

Screen

Specification

Rules

Specification

Procedural

facility

Testing

tools/debugger

Interpreter

Optimizing

compiler


Natural language

Natural Language

  • Advantages of using NL

    • It encourages untrained users to start

    • It encourages upper-management use of computers

    • It reduces the time taken learning complex syntax

    • It lessens the frustration, bewilderment and anger caused by BAD COMMAND responses

    • It is likely to extend greatly the usage of computers

James Martin, Fourth Generation Languages, 1985


Natural language1

It lacks precision

It is not good for expressing precise and complex logic

It is not good for expressing neat structures

It encourages semantic overshoot

It should be combined with other dialogue contructs that aid in the representation of precise logic and structures

Natural Language

Disadvantages of using NL

Appropriate response to the

disadvantage

James Martin, Fourth Generation Languages, 1985


Natural language2

It takes substantial time to key in sentences

Ambiguities are possible

Substantial processing is needed

Sentences and words can be abbreviated

Speech input as well as typed input will be used

The computer should detect and resolve ambiguities

The processing should be on PC workstations. Processing is dropping rapidly in cost.

Natural Language

Disadvantages of using NL

Appropriate response to the

disadvantage

James Martin, Fourth Generation Languages, 1985


Assumptions and issues

Assumptions and Issues

  • Why 4GLs?

    • Are they still appropriate?

    • Are they still useful?

  • Is Cold Fusion a 4GL?

  • What about PHP?

  • Who needs them?


Diveshop php

Diveshop PHP

  • The same interface (with minor differences) that we saw for ColdFusion has been implemented in PHP and MySQL

  • Address for the example is

    • http://dream.sims.berkeley.edu/~ray/Diveshop/index.php3

  • To setup your own MySQL database you will need to use the “my.sims” interface to request a MySQL account and PHP access


Lecture outline3

Final Project Requirements

Review

Fourth Generation Languages

PHP implementation

Object-Relational Extensions to SQL

Database Administration

Lecture Outline


Object relational databases

Object Relational Databases

  • Background

  • Object Definitions

    • inheritance

  • User-defined datatypes

  • User-defined functions


Object relational databases1

Object Relational Databases

  • Began with UniSQL/X unified object-oriented and relational system

  • Some systems (like OpenODB from HP) were Object systems built on top of Relational databases.

  • Miro/Montage/Illustra built on Postgres.

  • Informix Buys Illustra. (DataBlades)

  • Oracle Hires away Informix Programmers. (Cartridges)


Object relational data model

Object Relational Data Model

  • Class, instance, attribute, method, and integrity constraints

  • OID per instance

  • Encapsulation

  • Multiple inheritance hierarchy of classes

  • Class references via OID object references

  • Set-Valued attributes

  • Abstract Data Types


Object relational extended sql illustra

Object Relational Extended SQL (Illustra)

  • CREATE TABLE tablename {OF TYPE Typename}|{OF NEW TYPE typename} (attr1 type1, attr2 type2,…,attrn typen) {UNDER parent_table_name};

  • CREATE TYPE typename (attribute_name type_desc, attribute2 type2, …, attrn typen);

  • CREATE FUNCTION functionname (type_name, type_name) RETURNS type_name AS sql_statement


Object relational sql in oracle

Object-Relational SQL in ORACLE

  • CREATE (OR REPLACE) TYPE typename AS OBJECT (attr_name, attr_type, …);

  • CREATE TABLE OF typename;


Example

Example

  • CREATE TYPE ANIMAL_TY AS OBJECT (Breed VARCHAR2(25), Name VARCHAR2(25), Birthdate DATE);

  • Creates a new type

  • CREATE TABLE Animal of Animal_ty;

  • Creates “Object Table”


Constructor functions

Constructor Functions

  • INSERT INTO Animal values (ANIMAL_TY(‘Mule’, ‘Frances’, TO_DATE(‘01-APR-1997’, ‘DD-MM-YYYY’)));

  • Insert a new ANIMAL_TY object into the table


Selecting from an object table

Selecting from an Object Table

  • Just use the columns in the object…

  • SELECT Name from Animal;


More complex objects

More Complex Objects

  • CREATE TYPE Address_TY as object (Street VARCHAR2(50), City VARCHAR2(25), State CHAR(2), zip NUMBER);

  • CREATE TYPE Person_TY as object (Name VARCHAR2(25), Address ADDRESS_TY);

  • CREATE TABLE CUSTOMER (Customer_ID NUMBER, Person PERSON_TY);


What does the table look like

What Does the Table Look like?

  • DESCRIBE CUSTOMER;

  • NAME TYPE

  • -----------------------------------------------------

  • CUSTOMER_ID NUMBER

  • PERSON NAMED TYPE


Inserting

Inserting

  • INSERT INTO CUSTOMER VALUES (1, PERSON_TY(‘John Smith’, ADDRESS_TY(‘57 Mt Pleasant St.’, ‘Finn’, ‘NH’, 111111)));


Selecting from abstract datatypes

Selecting from Abstract Datatypes

  • SELECT Customer_ID from CUSTOMER;

  • SELECT * from CUSTOMER;

CUSTOMER_ID PERSON(NAME, ADDRESS(STREET, CITY, STATE ZIP))

---------------------------------------------------------------------------------------------------

1 PERSON_TY(‘JOHN SMITH’, ADDRESS_TY(‘57...


Selecting from abstract datatypes1

Selecting from Abstract Datatypes

  • SELECT Customer_id, person.name from Customer;

  • SELECT Customer_id, person.address.street from Customer;


Updating

Updating

  • UPDATE Customer SET person.address.city = ‘HART’ where person.address.city = ‘Briant’;


Functions

Functions

  • CREATE [OR REPLACE] FUNCTION funcname (argname [IN | OUT | IN OUT] datatype …) RETURN datatype (IS | AS) {block | external body}


Example1

Example

Create Function BALANCE_CHECK (Person_name IN Varchar2) RETURN NUMBER is BALANCE NUMBER(10,2) BEGIN

SELECT sum(decode(Action, ‘BOUGHT’, Amount, 0)) - sum(decode(Action, ‘SOLD’, amount, 0)) INTO BALANCE FROM LEDGER where Person = PERSON_NAME;

RETURN BALANCE;

END;


Example2

Example

  • Select NAME, BALANCE_CHECK(NAME) from Worker;


Triggers

TRIGGERS

  • Create TRIGGER UPDATE_LODGING INSTEAD OF UPDATE on WORKER_LODGING for each row BEGIN

  • if :old.name <> :new.name then update worker set name = :new.name where name = :old.name;

  • end if;

  • if :old.lodging <> … etc...


Lecture outline4

Final Project Requirements

Review

Fourth Generation Languages

PHP implementation

Object-Relational Extensions to SQL

Database Administration

Lecture Outline


Today

Today

  • Traditional and Current Data Administration

  • Traditional and Current Database Administration

  • Review of Security, Integrity, etc.


Changes in traditional roles

Changes in Traditional Roles

  • This is being driven by rapid changes in

    • Technology

    • Platforms (e.g., Micro vs. Mainframe vs. Server)

    • Organizational Structure

  • We will focus on the core functions and tasks of these roles (traditional or current)


Terms and concepts trad

Terms and Concepts (trad)

  • Data Administration

    • Responsibility for the overall management of data resources within an organization

  • Database Administration

    • Responsibility for physical database design and technical issues in database management

  • These roles are often combined or overlapping in some organizations


Terms and concepts trad1

Terms and Concepts (trad)

  • DA

    • Data adminstrator - person responsible for the Data Administration function in an organization

    • Sometimes may be the CIO -- Chief Information Officer

  • DBA

    • Database Administrator - person responsible for the Database Administration Function


Database system life cycle

Database System Life Cycle

Database

Planning

Database

Analysis

Growth &

Change

Operation &

Maintenance

Database

Design

Database

Implementation

Note: this is a different version of this

life cycle than discussed previously


Database planning

Database Planning

  • Development of a strategic plan for database development that supports the overall organization’s business plan

  • DA supports top management in development of this plan

  • The result of this stage is an enterprise data model


Database planning da dba functions

Database Planning: DA & DBA functions

  • Develop corporate database strategy (DA)

  • Develop enterprise model (DA)

  • Develop cost/benefit models (DA)

  • Design database environment (DA)

  • Develop data administration plan (DA)


Database analysis

Database Analysis

  • This is the process (discussed previously) of identifying data entities currently used by the organization, precisely defining those entities and their relationships, and documenting the results in a form that can support the follow-on design phase

  • Must also identify new data elements or changes to data elements that will be required in the future

  • The result of this phase is the Conceptual Data Model -- usually represented as an ER diagram


Database analysis da dba functions

Database Analysis: DA & DBA functions

  • Define and model data requirements (DA)

  • Define and model business rules (DA)

  • Define operational requirements (DA)

  • Maintain corporate Data Dictionary (DA)


Database design

Database Design

  • Purpose of the design phase is the development of the logical database design that will serve the needs of the organization and the physical design implementing the logical design

  • In relational systems the outcome is normalized relations, and the data definition for a particular database systems (including indexes, etc.)


Design 2 physical creation

Design 2: Physical Creation

  • Development of the Physical Model of the Database

    • data formats and types

    • determination of indexes, etc.

  • Load a prototype database and test

  • Determine and implement security, privacy and access controls

  • Determine and implement integrity constraints


Database design da dba functions

Database Design: DA &DBA functions

  • Perform logical database design (DA)

  • Design external models (subschemas) (DBA)

  • Design internal model (Physical design) (DBA)

  • Design integrity controls (DBA)


Database implementation

Database Implementation

  • Database design gives you an empty database

  • Load data into the database structure

  • Convert existing data sets and applications to use the new database

    • May need programs, conversion utilities to convert old data to new formats.

  • Outcome is the actual database with its data


Database implementation da dba functions

Database Implementation DA & DBA functions

  • Specify database access policies (DA & DBA)

  • Establish Security controls (DBA)

  • Supervise Database loading (DBA)

  • Specify test procedures (DBA)

  • Develop application programming standards (DBA)

  • Establish procedures for backup and recovery (DBA)

  • Conduct User training (DA & DBA)


Operation and maintenance 1 operations

Operation and Maintenance 1: Operations

  • Users are responsible for updating the database, DA and DBA are responsible for developing procedures that ensure the integrity and security of the database during the update process.

  • Specific responsibility for data collection, editing and verification must be assigned

  • Quality assurance must be practiced to protect and audit the database quality.


Operation and maintenance 2 maintenance

Operation and Maintenance 2: Maintenance

  • The ongoing process of updating the database to keep it current

    • adding new records

    • deleting obsolete records

    • changing data values in particular records

    • modifying relation structures (e.g. adding new fields)

  • Privacy, security, access control must be in place.

  • Recovery and Backup procedures must be established and used


Operation and maintenance da dba functions

Operation and Maintenance: DA & DBA functions

  • Monitor database performance (DBA)

  • Tune and reorganize databases (DBA)

  • Enforce standards and procedures (DBA)

  • Support users (DA & DBA)


Growth change

Growth & Change

  • Change is a way of life

    • Applications, data requirements, reports, etc. will all change as new needs and requirements are found

    • The Database and applications and will need to be modified to meet the needs of changes to the organization and the environment

    • Database performance should be monitored to maintain a high level of system performance


Growth change da dba functions

Growth & Change: DA & DBA functions

  • Implement change control procedures (DA & DBA)

  • Plan for growth and change (DA & DBA)

  • Evaluate new technology (DA & DBA)


Functions in database administration

Functions in Database Administration

  • Planning and Design (we have already looked at theses processes in detail)

  • REVIEW

    • Data Integrity

    • Backup and Recovery

    • Security Management


Data integrity

Data Integrity

  • Intrarecord integrity (enforcing constraints on contents of fields, etc.)

  • Referential Integrity (enforcing the validity of references between records in the database)

  • Concurrency control (ensuring the validity of database updates in a shared multiuser environment)


No concurrency control lost updates

Read account balance (balance = $1000)

Withdraw $200 (balance = $800)

Write account balance (balance = $800)

Read account balance (balance = $1000)

Withdraw $300 (balance = $700)

Write account balance (balance = $700)

No Concurrency Control: Lost updates

John

Marsha

ERROR!


Concurrency control locking

Concurrency Control: Locking

  • Locking levels

    • Database

    • Table

    • Block or page

    • Record

    • Field

  • Types

    • Shared (S locks)

    • Exclusive (X locks)


Concurrency control updates with x locking

Lock account balance

Read account balance (balance = $1000)

Withdraw $200 (balance = $800)

Write account balance (balance = $800)

Unlock account balance

Read account balance (DENIED)

Lock account balance

Read account balance (balance = $800)

etc...

Concurrency Control: Updates with X locking

John

Marsha


Concurrency control deadlocks

Place S lock

Read account balance (balance = $1000)

Request X lock (denied)

wait ...

Place S lock

Read account balance (balance = $1000)

Request X lock (denied)

wait...

Concurrency Control: Deadlocks

John

Marsha

Deadlock!


Concurrency control

Concurrency Control

  • Avoiding deadlocks by maintaining tables of potential deadlocks and “backing out” one side of a conflicting transaction


Database security

Database Security

  • Views or restricted subschemas

  • Authorization rules to identify users and the actions they can perform

  • User-defined procedures (and rule systems) to define additional constraints or limitations in using the database

  • Encryption to encode sensitive data

  • Authentication schemes to positively identify a person attempting to gain access to the database


Views

Views

  • A subset of the database presented to some set of users

    • SQL:

      CREATE VIEW viewname AS SELECT field1, field2, field3,…, FROM table1, table2 WHERE <where clause>;

    • Note: “queries” in Access function as views


Authorization rules

Authorization Rules

  • Most current DBMS permit the DBA to define “access permissions” on a table by table basis (at least) using the GRANT and REVOKE SQL commands

  • Some systems permit finer grained authorization (most use GRANT and REVOKE on variant views


Database backup and recovery

Database Backup and Recovery

  • Backup

  • Journaling (audit trail)

  • Checkpoint facility

  • Recovery manager


Disaster recovery planning

Disaster Recovery Planning

Risk

Analysis

Recovery

Strategies

Plan

Maintenance

Testing and

Training

Budget &

Implement

Procedures

Development

From Toigo “Disaster Recovery Planning”


Threats to assets and functions

Threats to Assets and Functions

  • Water

  • Fire

  • Power Failure

  • Mechanical breakdown or software failure

  • Accidental or deliberate destruction of hardware or software

    • By hackers, disgruntled employees, industrial saboteurs, terrorists, or others


Threats

Threats

  • Between 1967 and 1978 fire and water damage accounted for 62% of all data processing disasters in the U.S.

  • The water damage was sometimes caused by fighting fires

  • More recently improvements in fire suppression (e.g., Halon) for DP centers has meant that water is the primary danger to DP centers


Kinds of records

Kinds of Records

  • Class I: VITAL

    • Essential, irreplaceable or necessary to recovery

  • Class II: IMPORTANT

    • Essential or important, but reproducible with difficulty or at extra expense

  • Class III: USEFUL

    • Records whose loss would be inconvenient, but which are replaceable

  • Class IV: NONESSENTIAL

    • Records which upon examination are found to be no longer necessary


Offsite storage of data

Offsite Storage of Data

  • Early offsite storage facilities were often intended to survive atomic explosions

  • PRISM International directory

  • Mirror sites (Hot sites)


  • Login