งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

อ. ดร. ชุรี เตชะวุฒิ ระบบฐานข้อมูล บทที่ 2 CS (204)321 ระบบฐานข้อมูล 1 (Database System I)

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "อ. ดร. ชุรี เตชะวุฒิ ระบบฐานข้อมูล บทที่ 2 CS (204)321 ระบบฐานข้อมูล 1 (Database System I)"— ใบสำเนางานนำเสนอ:

1 อ. ดร. ชุรี เตชะวุฒิ ระบบฐานข้อมูล บทที่ 2 CS (204)321 ระบบฐานข้อมูล 1 (Database System I)

2 เนื้อหา 1) ลักษณะการประมวลผลของระบบฐานข้อมูล (Major characteristic of database approach) 2) สภาพแวดล้อมของระบบฐานข้อมูล (Database system environment) 3) ประเภทของการประยุกต์ฐานข้อมูล (The range of database application) 4) สถาปัตยกรรมแบบรับและให้บริการ (Client/Server Architecture) 5) ประโยชน์ของการใช้ระบบจัดการฐานข้อมูล 6) องค์ประกอบของระบบจัดการฐานข้อมูล 7) หน้าที่ของระบบจัดการฐานข้อมูล 8) หลักการของระบบฐานข้อมูลและสถาปัตยกรรม

3 Major Characteristics of Database Approach  Self-describing nature of a database system A DBMS catalog stores the description of the database. The description is called meta-data. This allows the DBMS software to work with different databases A traditional file processing can work with only one specific database. The description of the database is declared by data definition in the application program. For example, C and C++ program have “struct” or “class” declaration.  Insulation between program and data Allows changing data storage structures without having to change the DBMS access programs called program-data independence. Changing in the structure of data files, embedded in the access programs, requires to change all programs that access this file.

4 Major Characteristics of Database Approach  Data abstractions A data model is used to hide storage details and present the user with a conceptual view of the database. (data model – logical concepts – objects, properties, relationships) In traditional file processing, the representation of the structure of data files is very complicated. Details that are not of interest cannot be hidden.  Support of multiple views of data Each user may see a different view of the database, which describes only the data of interest to that user. A traditional file processing cannot provide a different view of the database.

5 Major Characteristics of Database Approach  Sharing of data and multiuser transaction processing DBMS allows multiple users to access the database at the same time. DBMS controls concurrent transactions from multiple users to operate correctly without interference so that data are updated correctly. A traditional file processing limits data sharing.

6 Database System Environment DATABASE SYSTEM Application Programs/Queries Users/Programmers DBMS SOFTWARE Software to Process Queries/Programs Software to Access Stored Data Stored Database Definition (Meta-Data) Stored Database Source: Elmasri R. & Navathe S.B. (1994) Fundamentals of database systems

7 Examples of Database  A UNIVERSITY database for maintaining information concerning students, courses, and grades in a university environment.  To define this database, we must specify 1)The structure of the records. For example, each STUDENT record includes data to represent the student’s Name, StudentNumber, Class (freshman or 1, sophomore or 2,…), and Major (MATH, computer science or COSC, …).

8 Examples of Database 2)A data type for each data element within record. e.g. Name of STUDENT is a string of alphabetic characters, StudentNumber of STUDENT is an integer, Grade of GRADE_REPORT is a single character from the set {A,B,C,D,F,I}, Class of a STUDENT as 1 for freshman, 2 for sophomore, 3 for junior, 4 for senior, and 5 for graduate student.

9 Examples of Database  To construct the UNIVERSITY database, we store data to represent each student, course, section, grade report, and prerequisite as a record in the appropriate file. Records in the various files may be related to one another.  Database manipulation involves querying and updating. Example of query is “retrieve all courses and grades of Smith”.

10 Examples of Database Source: Elmasri R. & Navathe S.B. (1994) Fundamentals of database systems STUDENTNameStudentNumberClassMajor Smith171COSC Brown82COSC COURSECourseNameCourseNumberCreditHoursDepartment Intro to Computer ScienceCOSC13104COSC Data StructuresCOSC33204COSC Discrete MathematicsMATH24103MATH DatabaseCOSC33803COSC PREREQUISITECourseNumberPrerequisiteNumber COSC3380COSC3320 COSC3380MATH2410 COSC3320COSC1310

11 Examples of Database Source: Elmasri R. & Navathe S.B. (1994) Fundamentals of database systems SECTIONSectionIdentifierCourseNumberSemesterYearInstructor 85MATH2410Fall91King 92COSC1310Fall91Anderson 102COSC3320Fall92Knuth 112MATH2410Fall92Chang 119COSC1310Fall92Anderson 135COSC3380Fall92Stone GRADE_REPORTStudentNumberSectionIdentifierGrade 17112B 17119C 885A 892A 8102B 8135A

12 Database System Environment องค์ประกอบย่อย 5 ส่วน  ส่วนอุปกรณ์ (Hardware) ได้แก่ Personal computer Mainframe Computer network Printer และอื่นๆ  ส่วนชุดคำสั่ง (Software) ได้แก่ Operating system DBMS และ Application program  ระเบียบวิธีปฏิบัติ (Procedure) คือคำสั่งหรือกฎเกณฑ์ที่ใช้ ในการออกแบบและวิธีการใช้ระบบฐานข้อมูล  ข้อมูล คือ ข้อเท็จจริงที่จะนำไปบันทึกในฐานข้อมูล อาจ เป็นข้อมูลดิบที่จะถูกนำไปประมวลผลและสร้างเป็น สารสนเทศ  บุคลากร (People) คือ บุคคลที่เกี่ยวข้องกับการทำงาน ระบบฐานข้อมูล

13 Different Types of Database Users  Workers on the scene Persons whose job involves daily use of a large database. 1)Database administrators (DBA) Responsible for managing the database system – authorizing, coordinating and monitoring. 2)Database designers Responsible for designing the database – identifying and choosing appropriate structures. 3)End users The persons that use the database for querying, updating, generating reports, etc.

14 Different Types of Database Users 3)End users The persons that use the database for querying, updating, generating reports, etc. There are several categories of end users Casual end users: They occasionally access the database Naïve or parametric end users: They perform canned transaction. e.g. bank teller or reservation clerk Sophisticated end users: They familiarize with DBMS and implement complex applications Stand-alone users: They maintain personal database by using ready-made program packages. 4)System analysts and application programmers They determine requirements, design, and implement canned transactions for parametric user.

15 Different Types of Database Users  Workers behind the scene Persons whose job involves design, development, operation, and maintenance of the DBMS software and system environment. 1)DBMS designers and implementers Design and implement the DBMS modules and interfaces as a software package. 2)Tool developers Design and implement tools that facilitate the use of DBMS software. Tools include design tools, performance tools, special interfaces, etc. 3)Operators and maintenance personnel They responsible for the actual running and maintenance of the hardware and software environment for the database system.

16 Database Architectures|Client/Server Architecture user network Application Database system user Application client Application server Database system network client server Two-tier architectureThree-tier architecture Source: Silberschatz A., Korth, H.F. & Sudarshan S. (2006) Database system concepts.

17 Database Architectures|Client/Server Architecture  Two Tier Client-Server Architectures Application on client machine invokes database system functionality at the server machine through query language statements. Application program interface like ODBC (Open Database Connectivity) and JDBC (Java Database Connectivity) are used for interaction.  Three Tier Client-Server Architectures Client machine communicates with application server only which means it does not contain any direct database calls. Application server communicates with a database system to access data. Appropriate for large applications, and web applications.

18 ประโยชน์ของการใช้ระบบจัดการ ฐานข้อมูล มีดังนี้  การควบคุมความซ้ำซ้อนของข้อมูล (Controlling data redundancy)  การหลีกเลี่ยงความขัดแย้งของข้อมูล (Data inconsistency)  การใช้ข้อมูลร่วมกัน (Sharing of data)  การควบคุมมาตรฐาน (Enforcement of standard)  การบังคับใช้กฎความคงสภาพ (Enforcement of integrity constraints)  ความเป็นอิสระของข้อมูล (Program-data independence)  ความง่ายในการพัฒนา (Reduced application development time)  การสำรองข้อมูลและการฟื้นสภาพข้อมูล (Backup and recovery)  การเข้าถึงและเรียกใช้ข้อมูลได้หลากหลายวิธี (Multiple user interface)

19 องค์ประกอบของระบบจัดการ ฐานข้อมูล DATABASE SYSTEM Application Programs/Queries Users/Programmers DBMS SOFTWARE Report writer/Report generator Security system Stored Database Definition (Meta-Data) Stored Database Queries processor Database engine

20 หน้าที่ของระบบจัดการฐานข้อมูล มีดังนี้  การจัดการพจนานุกรมข้อมูล (Data dictionary management)  การจัดการหน่วยเก็บข้อมูล (Data storage management and transformation)  การจัดการความปลอดภัย (Security management)  การจัดการความคงสภาพของข้อมูล (Data integrity management)  การควบคุมภาวะการทำงานพร้อมกัน (Multi-user access control)  การสำรองข้อมูลและการฟื้นสภาพข้อมูล (Backup and recovery management)  ภาษาสำหรับเข้าถึงฐานข้อมูล (Database access language)  การติดต่อประสานกับฐานข้อมูล (Database communication interface)

21 หลักการของระบบฐานข้อมูลและ สถาปัตยกรรม

22 Data Models “Operations for specifying database retrievals and updates by referring to the concepts of the data model.” Operations on the data model may include basic operations and user-defined operations. (e.g. A user-defined operation is COMPUTE_GPA which can be applied to a STUDENT object.)  Data model operations  Data model “A set of concepts that can be used to describe the structure of a database (data types and relationships) and certain constraints that the database should obey.”

23 Data Models  Categories of data models 1) Conceptual (high-level, semantic) data models: Provide concepts that are close to the way many users perceive data. 2) Physical (low-level, internal) data models: Provide concepts that describe the details of how data is stored in the computer. 3) Implementation (representational) data models: Provide concepts that fall between above two, balancing user views with some computer storage details.

24 Schemas VS. Instances  In any data model it is important to distinguish between the description of the database and the database itself. “The description of database. It includes description of database structure and the constraints that should hold on the database.” The database schema is specified during database design and is not expected to change frequently. e.g. Name: string StudentNumber: string Class: integer Major: string  Database schema (or meta-data)

25 Schemas VS. Instances  Schema diagram “A diagrammatic display of a database schema – structure of each record type (not the actual instances of a record).” NameStudentNumberClassMajor STUDENT CourseNameCourseNumberCreditHoursDepartment COURSE CourseNumberPrerequisiteNumber PREREQUITSITE SectionIdentifierCourseNumberSemesterYearInstructor SECTION StudentNumberSectionIdentifierGrade GRADE_REPORT

26 Schemas VS. Instances  Schema construct “An object within the schema.” e.g. STUDENT, COURSE.  Database instances “The actual data stored in a database at a particular moment in time. Also called database state or occurrence.” Many database instances can be constructed to correspond to a particular database schema.

27 Schemas VS. Instances DBMS catalog empty state Database initial state Data firstly loaded Database Update operation Database DBMS ensures valid state Define a new DB Specify DB schema

28 Schemas VS. Instances  Distinction The database schema does not frequently change, but the database state changes every time the database is updated. Schema is also called intension, whereas state is called extension.

29 Three-Schema Architecture  The goal of the three-schema architecture is to separate the user applications and the physical database.  The three-schema architecture was proposed to support DBMS characteristics of : Program-data independence. Supporting multiple views of the data.

30 Three-Schema Architecture  Schema can be defined at the following three level. 1) Internal schema at the internal level Describes physical storage structures and access paths. Typically uses a physical data model. 2) Conceptual schema at the conceptual level Describes the structure (such as entities, data type, relationship) and constraints for the whole database. Uses a conceptual or implementation data model. 3) External schemas at the external level Describes the various user views. Usually uses the same data model as the conceptual level.

31 Three-Schema Architecture Source: Elmasri R. & Navathe S.B. (1994) Fundamentals of database systems. External level Conceptual level Internal level EXTERNAL VIEW 1 EXTERNAL VIEW n END USERS CONCEPTUAL SCHEMA INTERNAL SCHEMA STORED DATABASE

32 Three-Schema Architecture  Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution.  Mappings among schema levels are needed to transform requests and data.  Notice that the three schemas are only descriptions of data; the only data that actually exists is at the physical level. If the request is a database retrieval, the data extracted from the stored database must be reformatted to match the user’s external view.

33 Data Independence  Two types of data independence: 1)Logical data independence The capacity to change the conceptual schema without having to change the external schemas and their application programs. 2)Physical data independence The capacity to change the internal schema without having to change the conceptual (or external) schema.

34 Data Independence  When a schema at a lower level is changed, only the mappings between this schema and higher-level schemas need to be changed in a DBMS that fully supports data independence.  The higher-level schemas themselves are unchanged. Therefore, the application programs need not be changed since they refer to the external schemas.

35 Three-Schema Architecture Source: Elmasri R. & Navathe S.B. (1994) Fundamentals of database systems. External level Conceptual level Internal level EXTERNAL VIEW 1 EXTERNAL VIEW n END USERS CONCEPTUAL SCHEMA INTERNAL SCHEMA STORED DATABASE Logical data independence Physical data independence

36 DBMS Language  Data Definition Language (DDL) is used by the DBA and by database designers to define the conceptual schema for the database and any mapping between the two.  Storage Definition Language (SDL) is used to specify the internal schema. Once the design of a database is completed and a DBMS is chosen to implement the database:  View Definition Language (VDL) are used to specify external schema - user views and their mappings to the conceptual schema.

37 DBMS Language Once the database schemas are compiled and the database is populated with data:  Data Manipulation Language (DML) are used to specify database retrievals and updates.  DML commands (data sublanguage) can be embedded in a general- purpose programming language (host language), such as COBOL, C or an Assembly Language.  In object-oriented systems, the host and data sublanguages typically form one integrated language such as C++.  Alternatively, a high-level DML used in stand-alone interactive manner is called a query language.

38 DBMS Language  Types of DML 1) Procedural DML (record-at-a-time or low-level DML) Must be embedded in a programming language. Typically retrieve individual records from the database, and use looping and other constructs of the host programming language to retrieve multiple records. Specify how to retrieve data. e.g. COBOL, C, etc.

39 DBMS Language 2) Declarative or Non-procedural DML (set-at-a-time or high-level DML) Use as a stand-alone query language or embedded in a programming language. Typically retrieves information from multiple related database records in a single command. Specify what data to retrieve than how to retrieve. Also called declarative languages. e.g. SQL


ดาวน์โหลด ppt อ. ดร. ชุรี เตชะวุฒิ ระบบฐานข้อมูล บทที่ 2 CS (204)321 ระบบฐานข้อมูล 1 (Database System I)

งานนำเสนอที่คล้ายกัน


Ads by Google