Databases

Owners:

> organized in a form for easy retrieval.
 * What is a database**
 * A Database is a collection of interrelated data items, stored once and
 * Store and control large amounts of data
 * If properly designed it provides a consistent view of the data
 * All entities have a relationship between them




 * Why use a database?**
 * Reduces programming effort
 * Easier to create and modify data (compared to individual files)
 * Only need to update one location - one copy of all information


 * What is a database management system (DBMS)?**
 * Provides a method of storing and using data in a database
 * "Nothing more than a computerized data-keeping system"
 * Several types that can be used on z/OS: inverted list, hierarchic, network, and relational

> available to all application programs and users. > single database than in a collection of flat files. > to read, write, update, insert, or delete data can be restricted. > (sequentially or go directly to the desired data). > immediately available to other applications. Because the data > exists in only one place, data integrity is more easily ensured.
 * Why are DBMS useful?**
 * A database stores the data only once in one place and makes it
 * Data can also be backed up and recovered more easily in a
 * Databases provide security by limiting access to data. The ability
 * Database structures offer multiple strategies for data retrieval
 * Finally, an update performed on part of the database is

> multiple applications) to a single copy of the data > mechanism with ACID properties (ACID is an > acronym for atomicity, consistency, isolation, and > durability) so as to maintain integrity for all > updates > copy of the data
 * The role of a DBMS is to provide:**
 * 1) Enable concurrent access (I.e. multiple users,
 * 1) Control concurrent access via a locking
 * 1) Reduce data redundancy by maintaining only one
 * 1) Automated rollback, restart and recovery


 * ACID**

> not at all > Same amount of money debited and credited) > or after any other transaction > state (changes due to the transaction) will survive any > future failures
 * **Atomicity** - the transaction must execute completely, or
 * **Consistency** - Resources must remain consistent (ex.
 * **Isolation** - each transaction must appear to occur before
 * **Durability** - If the transaction completes successfully, the


 * What is the role of a DBA (Database Administrator)**
 * Provides standards for databases
 * Determines rules for accessing data and monitors its security
 * Approves the use of any programs that access production databases
 * Controls database integrity & availability; monitors activities for backup and recover
 * Guides, reviews and approves database designs


 * What is DB2?**
 * Short for database 2
 * A relational database produced in 1982 by IBM, was one of the first dbms to use sql
 * Relational database has no or little redundancy in data so it can efficiently store large volumes of data
 * Significantly slower than ims or idms databases


 * What Is IMS (Information Management System)**
 * A hierarchal database produced by IBM in 1972
 * Originally designed for the Apollo space program
 * Hierarchal system contains redundancy in data but is extremely fast


 * What Is IDMS**
 * Uses a network style architecture similar to hierarchal but is slightly more flexible


 * Database Comparison**


 * Hierarchical vs. Relational Databases**

Hierarchical Storage: -Parent/Child Relationship -Less Redundant Data -Data Duplication Example: Data Structure: -Data Connected in Tiers -Each tier’s next level up is its parent -That tier is the next tier’s child Relational: Storage: -Data stored within tables -Table consists of records and fields -Records: rows or ‘tuples’ -Fields: columns or ‘attributes’ -Tables are ‘related’ to each other -Relationships are shown using key constraints Example: -Much data duplication on databases in lower normal forms Differences between Hierarchy vs. Relational Database: -Operational Data(Relational): -Analytical Data(Hierarchy): Example including Object Oriented Programming: - Basically a Venn Diagram of using: Relational, Hierarchical, and Object Oriented. Differences with using Relational, Hierarchical, and Object Oriented: Price/Benefit Analysis: Hierarchical: Uses design and application logic. -Price: Hierarchical has a longer development cycle than other 2 -Benefit: Hierarchical has better performance Example: Relational: Uses ‘SQL’ for navigation run time. -Price: Price based on performance -Benefit: Short and to the point dev cycle Example: Object Oriented: Uses method calling to navigate database. -Price: Development is easier -Benefit: Constant reuse of methods Example:

– Data is relatively static (can not just "add a column") – Navigational : need to know the structure to get to the data – Faster & more efficient - once Segment Search Arguments (SSAs) are coded
 * Hierarchical (IMS):**

– Changeable info – Change in structure : no impact on existing application – Non-Navigational : no need to know the structure right data (just tablename and columnname(s))
 * Relational(DB2):**


 * Benefits Of Database On A Mainframe**
 * All data is kept on one system limiting io time


 * Benefits Of Database On A Distributed System**
 * Easier to manage on small scale projects


 * What is SQL?**
 * Stands for Structured Query Language
 * High level language used in programming database
 * Three categories
 * 1) DML: data manipulation language - read and modify data
 * 2) DDL: data definition language - define, change, or drop DB2 objects
 * 3) DCL: data control language - grant and revoke authorizations