Jan. 2014Dr. Yangjun Chen ACS-49021 Outline (Ch. 17, 3 rd ed. – Ch. 2, 4 th ed., 5 th ed., 6 th ed.) Database System Architectures System Catalog System.

Slides:



Advertisements
Similar presentations
Database System Concepts and Architecture
Advertisements

Database system concepts and architecture Sept. 2012Yangjun Chen ACS Outline: Concepts and Architecture (Chapter 2 – 3 rd, 4 th, 5 th, and 6 th ed.)
--What is a Database--1 What is a database What is a Database.
Database Systems Chapter 2
MSc IT UFIE8K-10-M Data Management Prakash Chatterjee Room 3P16
Chapter 2 Database Environment.
1 Chapter 2 Database System Concepts and Architecture.
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Teleprocessing.
Database system concepts and architecture Winter 2007Ron McFadyen ACS Database schema Database system architecture Data independence concept Database.
Jan. 2013Yangjun Chen ACS Database System Catalog Query Processing and Optimization, Transaction Management Concurrency Control Database System Architecture.
Chapter 19 Query Processing and Optimization
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Overview of Database Languages and Architectures.
Database System Concepts and Architecture Dr. Ali Obaidi.
Database Management Systems (DBMS)
Chapter 2 Database System Concepts and Architecture
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
Database Environment 1.  Purpose of three-level database architecture.  Contents of external, conceptual, and internal levels.  Purpose of external/conceptual.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 2 Database System Concepts and Architecture.
Database System Concepts and Architecture
Chapter 2 CIS Sungchul Hong
Announcements Read JDBC Project Step 5, due Monday.
Faculty of Information Science and Technology Mahanakorn University of Technology Topic 2 Database System Concepts and Architecture.
CSC271 Database Systems Lecture # 4.
Database System Concepts and Architecture Lecture # 2 21 June 2012 National University of Computer and Emerging Sciences.
Database Environment Chapter 2 AIT632 Sungchul Hong.
 DATABASE DATABASE  DATABASE ENVIRONMENT DATABASE ENVIRONMENT  WHY STUDY DATABASE WHY STUDY DATABASE  DBMS & ITS FUNCTIONS DBMS & ITS FUNCTIONS 
1 Introduction to Database Systems. 2 Database and Database System / A database is a shared collection of logically related data designed to meet the.
2. Database System Concepts and Architecture
1 Chapter 2 Database Environment Transparencies © Pearson Education Limited 1995, 2005.
Database system concepts and architecture Jan. 2008Yangjun Chen ACS Outline: Concepts and Architecture Database schema Working process with a database.
Database system concept and Architecture
What is a schema ? Schema is a collection of Database Objects. Schema Objects are logical structures created by users to contain, or reference, their data.
Database System Concepts and Architecture. Relational Model Concepts relational model represents the database as a collection of relations. Each relation.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Lesson Overview 3.1 Components of the DBMS 3.1 Components of the DBMS 3.2 Components of The Database Application 3.2 Components of The Database Application.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 2-1 Data Models Data Model: A set.
Database Environment Chapter 2. Data Independence Sometimes the way data are physically organized depends on the requirements of the application. Result:
CSCI DBMS Environment1 The Database System Environment Dr. Awad Khalil Computer Science Department AUC.
Chapter 2 Database System Concepts and Architecture Dr. Bernard Chen Ph.D. University of Central Arkansas.
1 Database Management Systems (DBMS). 2 Database Management Systems (DBMS) n Overview of: ä Database Management Components ä Database Systems Architecture.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
DBMS_Week 3-4 DBMS. Three-Schema Architecture – Internal schema (one view) describes physical storage structures access paths, indexes used Typically.
 Distributed Database Concepts  Parallel Vs Distributed Technology  Advantages  Additional Functions  Distribution Database Design  Data Fragmentation.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
Chapter 2 Database Environment.
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
Constraints and Views Chap. 3-5 continued (7 th ed. 5-7)
Database Environment Chapter 2. The Three-Level ANSI-SPARC Architecture External Level Conceptual Level Internal Level Physical Data.
1 Database Design Chapter-2- Database System Concepts and Architecture Reference: Prof. Mona Mursi Lecture notes.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Database Systems 主講人 : 陳建源 日期 :99/9/14 研究室 : 法 Chapter 2 Database System Concepts and Architecture.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe Chapter 2 Database System Concepts and Architecture.
Database System Architecture and System Catalog
Databases (CS507) CHAPTER 2.
Databases and DBMSs Todd S. Bacastow January 2005.
Chapter 2 Database System Concepts and Architecture
Database System Concepts and Architecture
Introduction What is a Database?.
Database System Concepts and Architecture
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Data, Databases, and DBMSs
Outline: Database Basics
Database System Architecture
Database System Concepts and Architecture
Presentation transcript:

Jan. 2014Dr. Yangjun Chen ACS Outline (Ch. 17, 3 rd ed. – Ch. 2, 4 th ed., 5 th ed., 6 th ed.) Database System Architectures System Catalog System Catalog in Oracle Database System Architecture and System Catalog

Jan. 2014Dr. Yangjun Chen ACS Database System Architectures Centralized DBMS Mainframe computer -DBMS functionality -Application program -User interfaces Computer terminals -Input -Output

Jan. 2014Dr. Yangjun Chen ACS Database System Architectures Client-Server Computer Architecture -Terminals are replaced with PCs and workstations -Mainframe computer is replaced with specialized servers (with specific functionalities). File server, DBMS server, mail server, print server, … Client Print serverFile serverDBMS server …... network

Jan. 2014Dr. Yangjun Chen ACS Database System Architectures client site1 client site2 server site3 client site n server Communication network …...

Jan. 2014Dr. Yangjun Chen ACS Database System Architectures Client-Server Database Architecture -database client user interface, application programs -database server SQL language, transaction management -database connection ODBC - open database connectivity API - application programming interface

Jan. 2014Dr. Yangjun Chen ACS Database System Architectures Client-Server Architecture in DBMSs -database client user interface, data dictionary functions, DBMS interaction with programming language compiler, global query optimization, structuring of complex objects from the data in the buffers,... -database server data storage on disk, local concurrency control and recovery, buffering and caching of disk storage,...

Jan. 2014Dr. Yangjun Chen ACS EXEC SQL DECLARE C1 CURSOR FOR SELECT au_fname, au_lname FROM authors FOR BROWSE; EXEC SQL OPEN C1; while (SQLCODE == 0) { EXEC SQL FETCH C1 INTO :fname, :lname; } Illustration for DBMS interaction with programming language compiler:

Jan. 2014Dr. Yangjun Chen ACS Catalog for Relational DBMSs Catalog - meta data for a relational schema -relation names, attribute names, attribute domains (data types) -description of constraints primary keys, secondary keys, foreign keys, NULL/NON-NULL, cardinality constraints, participation constraints,... -views, storage structure, indexes -security, authorization, owner of each relation

Jan. 2014Dr. Yangjun Chen ACS Catalog for Relational DBMSs Catalog is stored as relations. (It can then be queried, updated and managed using DBMS software - SQL.) REL_NAME ATTR_NAME ATTR_TYPE MEMBER_OF_PK MEMBER_OF_FK FK_RELATION EMPLOYEEFNAME VSTR15 no EMPLOYEESUPERSSN STR9 noyesEMPLOYEE DNO INTEGER noyesDEPARTMENT... REL_AND_ATTR_CATALOG

Jan. 2014Dr. Yangjun Chen ACS Catalog for Relational DBMSs Catalog is stored as relations. (It can then be queried, updated and managed using DBMS software - SQL.) REL_NAME KEY_NUM MEMBER_ATTR REL_NAME INDEX_NAME MEMBER_ATTR INDEX_TYPE ATTR_NO ASC_DESC RELATION_KEYS VIEW_NAME QUERY VIEW_QUERIES RELATION_INDEXES VIEW_NAME ATTR_NAME ATTR_NUM VIEW_ATTRIBUTES

Jan. 2014Dr. Yangjun Chen ACS REL_NAME INDEX_NAME MEMBER_ATTR INDEX_TYPE ATTR_NO ASC_DESC RELATION_INDEXES Works_onI1SSNPrimary1ASC Works_onI1PnoPrimary2ASC Works_onI2SSNClustering1ASC

Jan. 2014Dr. Yangjun Chen ACS Index file: I1 ( entries) Data file: Works_on SSNPnohours Primary index: , , 2 …

Jan. 2014Dr. Yangjun Chen ACS Index file: I2 ( entries) Data file: Works_on SSNPnohours Clustering index:

Jan. 2014Dr. Yangjun Chen ACS Create View Works_on1 AS Select FNAME, LNAME, PNAME, hours From EMPLOYEE, PROJECT, WORKS_ON Where ssn = essn and Pno. = PNUMBER QUERY VIEW_QUERIES Works_on1 Select FNAME, LNAME, PNAME, hour …... VIEW_NAME

Jan. 2014Dr. Yangjun Chen ACS VIEW_NAME ATTR_NAME ATTR_NUM VIEW_ATTRIBUTES Works_on1 FNAME1 Works_on1 LNAME2 Works_on1 PNAME3 Works_on1 hours4

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE Meta data - data dictionary: Information about schema objects: tables, indexes, views, triggers,... Meta data are divided into three levels: -information for objects owned by a user - information for objects owned by a user as well as the objects that the user has been granted access to -information about all database objects

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE Meta data are divided into three levels - three kinds of views: -view name prefixed with USER - view name prefixed with ALL - view name prefixed with DBA Example SELECT * FROM ALL_CATALOG WHERE OWNER = ‘SMITH’ OwnerTABLETABLE_TYPE SMITHACCOUNTTABLE SMITHCUSTOMERSTABLE SMITHCUSTORDERVIEW SMITHORDERSTABLE

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE Example SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE FROM USER_TAB_COLUMNS WHERE TABLE_NAME = ‘ORDERS’ COLUMN_NAMEDATA_TYPE DATA_LENGTHNUM_DISTINCTLOW_VALUE HIGH_VALUE ORDERNONUMBER 224C102C105 CUSTNONUMBER 223C102C106 ORDERDATEDATE Change ‘database statistics’: ANALYZE TABLE ORDERS COMPUTE STATISTICS

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE Example SELECT PCT_FREE, INITIAL_EXTENT, NUM_ROWS, BLOCK, EMPTY_BLOCKS, AVG_ROW_LENGTH FROM USER_TABLES WHERE TABLE_NAME = ‘ORDERS’ PCT_FREEINITIAL_EXTENTNUM_ROWSBLOCK EMPTY_BLOCK AVG_ROW_LENGTH PCT_free: percertage of a block, which is left free Initial_extent: initial allocation of space for a new table

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE Example SELECT INDEX_NAME, UNIQUENESS, BLEVEL, LEAF_BLOCKS, DISTINCT_KEYS, AVG_LEAF_BLOCKS_PER_KEY, AVG_DATA_BLOCKS_PER_KEY FROM USER_INDEXES WHERE TABLE_NAME = ‘ORDERS’ INDEX_UNIQUENESSBLEVELLEAF_DISTINCT_AVG_LEAF_AVG_DATA_ NAMEBLOCKKEYSBLOCKS_BLOCK_PER_KEY ORD_NONUNIQUE01311 CUSTNO

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE Example SELECT * FROM USER_VIEWS VIEW_NAMETEXT_LENGTHTEXT CUSTORDER101select custname, city, orderno, orderdate from customers, orders where customers.custno = orders.custno

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE Example SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH FROM USER_TAB_COLUMN WHERE TABLE_NAME = ‘CUSTORDER’ COLUMN_NAMEDATA_TYPEDATA_LENGTH CITYCHAR20 ORDERNONUMBER22 ORDERDATEDATE7 CUSTNAMECHAR20

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE DBMS software modules accessing the mata data 1.DDL (SDL) compilers These DBMS modules process and check the specification of a database schema in the data definition language (DDL) and the specification in the storage definition language (SDL), and store these descriptions in the catalog. 2.Query and DML parser and verifier These modules parse queries, DML retrieval statements, and database update statements; they also check the catalog to verify whether all the schema names referenced in these statements are valid.

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE DBMS software modules accessing the mata data 3.Query and DML compilers These compilers convert high-level queries and DML commands into low-level file access commands. The mapping between the conceptual schema and the internal schema file structures is accessed from the catalog during this process. 4.Query and DML optimizer The query optimizer accesses the catalog for access path, implementation information, and data statistics to determine the best way to execute a query or a DML command.

Jan. 2014Dr. Yangjun Chen ACS System Catalog in ORACLE DBMS software modules accessing the mata data 5.Authorization and security checking The DBA has privileged commands to update the authorization and security portion of the catalog. All access by a user to a relation is checked by the DBMS for proper authorization by accessing the catalog. 6.External-to-conceptual mapping of queries and DML commands Queries and DML commands specified with reference to an external view or schema must be transformed to refer to the conceptual schema before they can be accessed by the DBMS. It needs to access the catalog description of the view.

Jan. 2014Dr. Yangjun Chen ACS Meta data DDL (SDL) compilers Query and DML parser and verifier Query and DML compilers Query and DML optimizer Authorization and security checking External-to-conceptual mapping Specification in DDL, SDL