Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 453 -- DBMS Environment1 The Database System Environment Dr. Awad Khalil Computer Science Department AUC.

Similar presentations


Presentation on theme: "CSCI 453 -- DBMS Environment1 The Database System Environment Dr. Awad Khalil Computer Science Department AUC."— Presentation transcript:

1 CSCI 453 -- DBMS Environment1 The Database System Environment Dr. Awad Khalil Computer Science Department AUC

2 CSCI 453 -- DBMS Environment2 Content  DBMS Environment  DBMS Utilities  The System Catalog  The Data Dictionary  The System Catalog for Relational DBMS  Accessing Catalog Information

3 CSCI 453 -- DBMS Environment3 Database System

4 CSCI 453 -- DBMS Environment4 DBMS Components

5 CSCI 453 -- DBMS Environment5 A Database Schema in SQL - DDL CREATE TABLE EMPLOYEE (FNAMEVARCHAR(15) NOT NULL, MINITCHAR, LNAMEVARCHAR(15) NOT NULL, SSNSSN_TYPE NOT NULL, BDATEDATE ADDRESSVARCHAR(30), SEXCHAR, SALARYDECIMAL(10,2), SUPERSSNSSN_TYPE, DNOINT NOT NULL, PRIMARY KEY (SSN), FOREIGN KEY (SUPERSSN) REFERENCES EMPLOYEE(SSN), FOREIGN KEY (DNO) REFERENCES DEPARTMENT(DNUMBER)); CREATE TABLE DEPARTMENT (DNAMEVARCHAR(15) NOT NULL, DNUMBERINT, NOT NULL, MGRSSNSSN_TYPE NOT NULL, MGRSTARTDATEDATE PRIMARY KEY (DNUMBER), UNIQUE (DNAME) FOREIGN KEY (MGRSSN) REFERENCES EMPLOYEE(SSN)); CREATE TABLE DEPT_LOCATIONS (DNUMBERINT NOT NULL, DLOCATIONVARCHAR(15) NOT NULL, PRIMARY KEY (DNUMBER, DLOCATION), FOREIGN KEY (DNUMBER) REFERENCES DEPARTMENT(DNUMBER)); CREATE TABLE PROJECT (PNAMEVARCHAR(15) NOT NULL, PNUMBERINT NOT NULL, PLOCATIONVARCHAR(15) DNUMINT NOT NULL, PRIMARY KEY (PNUMBER), UNIQUE (PNAME) FOREIGN KEY (DNUM) REFERENCES DEPARTMENT(DNUMBER)); CREATE TABLE WORKS_ON (ESSNSSN_TYPE NOT NULL, PNOINT NOT NULL, HOURSDECIMAL(3,1) NOT NULL, PRIMARY KEY (ESSN, PNO), FOREIGN KEY (ESSN) REFERENCES EMPLOYEE(SSN), FOREIGN KEY (PNO) REFERENCES PROJECT(PNUMBER)); CREATE TABLE DEPENDENT (ESSNSSN_TYPE NOT NULL, DEPENDENT_NAME VARCHAR(15) NOT NULL, SEXCHAR, BDATE DATE, RELATIONSHIP VARCHAR(8) PRIMARY KEY (ESSN, DEPENDENT_NAME), FOREIGN KEY (ESSN) REFERENCES EMPLOYEE(SSN));

6 CSCI 453 -- DBMS Environment6 DBMS Components (Cont’d)   A DBMS is a complex software system.   The database and the system catalog are usually stored on disk.   Access to the disk is controlled primarily by the operating system (OS), which schedules disk input/output..   A higher-level stored data manager module of the DBMS controls access to DBMS information stored on disk.   The precompiler extracts DML commands from an application program written in a host language. These commands are sent to the DML compiler for compilation into object code for database access.

7 CSCI 453 -- DBMS Environment7 DBMS Components (Cont’d)   The DDL compiler processes schema definitions and stores descriptions of the schemas (meta- data) in the DBMS catalog.   The run-time database processor handles database accesses at run time.   The query compiler handles high-level queries that are entered interactively.

8 CSCI 453 -- DBMS Environment8 DBMS Components (Cont’d)  DBMS Engine  Interface Subsystem (DDL, DML, DCL, Graphical User Interface, Forms Interface, Natural Language Interface  System Catalog  Concurrency Control Subsystem  Backup and Recovery Subsystem  Query Optimization Subsystem  Performance Management Subsystem  Data Integrity Management Subsystem  Application Development Subsystem  Security Management Subsystem

9 CSCI 453 -- DBMS Environment9 DBMS Utilities   Loading: A loading utility is used to load existing data files - such as text files or sequential files - into the database.   Backup: A backup utility creates a backup copy of the database, usually by dumping the entire database onto tape.   File reorganization: This utility can be used to reorganize a database file into a different file organization to improve performance.   Performance monitoring: Such a utility monitors database usage and provides statistics to the DBA.

10 CSCI 453 -- DBMS Environment10 The System Catalog  The System Catalog is at the heart of any general- purpose DBMS.  It is a “ minidatabase ” itself, and its function is to store the schemas, or descriptions, of the databases that the DBMS maintains.  The catalog stores data that describes each database; such data is often called meta-data. It includes a description of the conceptual database schema, the internal schema, any external schemas, and the mappings between the schemas at different levels.

11 CSCI 453 -- DBMS Environment11 Data Dictionary versus System Catalog  The term data dictionary is often used to indicate a more general software utility than a catalog.  A catalog is closely coupled with the DBMS software; it provides the information stored in it to users and the DBA, but it is mainly accessed by the various software modules of the DBMS itself, such as DDL, and DML compilers, the query optimizer, the transaction processor, report generators, and the constraint enforcer.  A data dictionary software package may interact with the software modules of the DBMS but is mainly used by the designers, users, and administrators of a computer system for information management.

12 CSCI 453 -- DBMS Environment12 Data Dictionary

13 CSCI 453 -- DBMS Environment13 Catalogs for Relational DBMSs   The information stored in a catalog of a relational DBMS includes description of the following:  Relation names,  Attribute names,  Attribute domains (data types),  Primary keys,  Secondary key attributes,  Foreign keys,  Other types of constraints.  Descriptions of views.  Internal-level description,  Security/authorization information.

14 CSCI 453 -- DBMS Environment14 Catalogs for Relational DBMSs (Cont’d)  In relational DBMSs it is common practice to store the catalog itself as relations and to use the DBMS software for querying, updating, and maintaining the catalog.

15 CSCI 453 -- DBMS Environment15 Catalogs for Relational DBMSs (Cont’d)

16 CSCI 453 -- DBMS Environment16 Catalogs for Relational DBMSs (Cont’d)

17 CSCI 453 -- DBMS Environment17 Accessing Catalog Information  The following DBMS modules use and access a catalog very frequently; that is why it is important to implement access to the catalog as efficiently as possible.  DDL compilers.  Query and DML parser and verifier.  Query and DML compiler.  Query and DML optimizer.  Authorization and security checking.  External-to-conceptual mapping of queries and DML commands.

18 CSCI 453 -- DBMS Environment18 Thank you


Download ppt "CSCI 453 -- DBMS Environment1 The Database System Environment Dr. Awad Khalil Computer Science Department AUC."

Similar presentations


Ads by Google