Administração e Optimização de Bases de Dados

of 31 /31
AOBD07/08 AOBD07/08 Administração e Administração e Optimização de Bases de Optimização de Bases de Dados Dados Enquadramento Enquadramento Programa Programa Bibliografia Bibliografia Planeamento teóricas e Planeamento teóricas e laboratórios laboratórios Avaliação Avaliação Corpo docente Corpo docente

Embed Size (px)

description

Administração e Optimização de Bases de Dados. Enquadramento Programa Bibliografia Planeamento teóricas e laboratórios Avaliação Corpo docente. Enquadramento. Cadeiras de gestão de dados e tratamento de informação DEI 2007/08 : BD (3º ano LEIC e LERCI) GTI (1º ano MEIC/SIE) - PowerPoint PPT Presentation

Transcript of Administração e Optimização de Bases de Dados

  • Administrao e Optimizao de Bases de DadosEnquadramento ProgramaBibliografiaPlaneamento tericas e laboratriosAvaliaoCorpo docente

  • EnquadramentoCadeiras de gesto de dados e tratamento de informao DEI 2007/08 :BD (3 ano LEIC e LERCI)GTI (1 ano MEIC/SIE)SAD (1 ano MEIC e MERC)AOBD (1 ano MEIC/TSI e MERC)

  • BibliografiaDatabase System Concepts, Silberchatz, Korth, Sudarshan 5 edio, McGraw Hill, 2005Database Management Systems, Raghu Ramakrishnan, Johannes Gehrke 3 edio, Mc Graw Hill, 2002Database Tuning: Principles, Experiments, and Troubleshooting Techniques, Dennis Shasha & Philippe Bonnet, Morgan Kaufmann, 2003.

  • Programa (1)Armazenamento e Sistema de Ficheiros: cap 11 (Silb), 9 (Raghu)Tcnicas de indexao (B+tree e hash-based) cap 12 (Silb), 10 e 11 (Raghu)Processamento de interrogaes cap 13(Silb), 12 e 13 (Raghu), Optimizao de interrogaes cap 14 (Silb), 15 (Raghu)Gesto de Transaes cap 15 (Silb), 16 (Raghu)Controlo de Concorrncia cap 16(Silb), 17 (Raghu)Gesto de Recuperao cap 17(Silb), 18 (Raghu)

  • Programa (2)Principios de tuningLock tuningLog tuningStorage tuningOS tuningIndex tuningQuery processing tuningAPI tuning

    (Shasha & Bonnet e alguns captulos do Raghu e/ou Silberchatz)

  • PlaneamentoAulas tericas: 1H30Matria (slides baseados no livro e artigos)

    Aulas laboratro: 1H30SQLServer 2005Material de apoio adicional: livros on-line e guias de laboratrio

  • AvaliaoExame (52%):Nota mnima: 9,5vMini-projectos (48%):Grupos de 3 pessoasExerccios de papel e lpis e/ou com SQLServer 2005.Nota mnima: 9,5v

  • Corpo docenteHelena Galhardas (responsvel)Pvel Calado

    Bruno Martins (laboratrios)

  • Chapter 1: IntroductionPurpose of database systemsData abstraction levelsData models SQL :Data Definition Language and Data Manipulation LanguageTransaction management Database usersDBMS structureTypical database architectures

  • Database management systems (DBMS)Collection of interrelated data and a set of programs to access the data DBMS contains relevant information about a particular enterpriseDBMS provides an environment that is both convenient and efficient to use.Database applications:Banking: all transactionsAirlines: reservations, schedulesUniversities: registration, gradesSales: customers, products, purchasesManufacturing: production, inventory, orders, supply chainHuman resources: employee records, salaries, tax deductions

  • DBMS vs File Systems (1)In the early days, database applications were built on top of file systemsDrawbacks of using file systems to store data:Data redundancy and inconsistency: Multiple file formats, duplication of information in different filesDifficulty in accessing data: Need to write a new program to carry out each new taskData isolation: Multiple files and formatsIntegrity problems: Integrity constraints (e.g. account balance > 0) become part of program code; Hard to add new constraints or change existing ones

  • DBMS vs File Systems (2)Drawbacks of using file systems (cont.) Atomicity of updatesFailures may leave database in an inconsistent state with partial updates carried outE.g. transfer of funds from one account to another should either complete or not happen at allConcurrent access by multiple usersConcurrent access needed for performanceUncontrolled concurrent accesses can lead to inconsistenciesE.g. two people reading a balance and updating it at the same timeSecurity problems. DBMS offer solutions to all the above problems!

  • Why use a DBMS?Data independence and efficient access

    Reduced application development time.

    Data integrity and security.

    Uniform data administration.

    Concurrent access, recovery from crashes.

  • Levels of data abstraction (1)Physical level: describes how data are stored.Logical level: describes data stored in the database, and the relationships among the data.View level: application programs hide details of data types. Views can also hide information (e.g., salary) for security purposes.

  • Levels of data abstraction (2)

  • Data ModelsA collection of conceptual tools for describing:data data relationshipsdata semanticsdata constraintsEx:Entity-Relationship model, UML class diagramRelational modelOther models: semi-structured data models (XML used to represent sstr. data)older models: network model and hierarchical model

  • Entity-Relationship ModelExample of schema in the entity-relationship model

  • A Sample Relational Database

  • Data Independence Applications insulated from how data is structured and stored.Logical data independence: Protection from changes in the logical structure of data.CustomerPublic(customer-id, customer-name)CustomerPrivate(customer-id, salary)Physical data independence: Protection from changes in the physical structure of data. One of the most important benefits of using a DBMS!

  • Instances and Schemas Schema: the logical structure of the database, a description of a particular collection of data, using a given data modelAnalogous to type information of a variable in a programPhysical schema: database design at the physical levelLogical schema: database design at the logical level

    Instance: the actual content of the database at a particular point in time Analogous to the value of a variable

  • ExampleExternal schema (View): CustomerPublic (customer-id, customer-name)Logical schema: Customer(customer-id, customer-name, customer-street, customer-age) Account(account-number, balance) Depositor(account-number, customer-id)Physical schema:Relations stored as unordered files. Index on first column of Customer.

  • SQL: Structured Query LanguageA DBMS provides:a Data Definition Language (DDL)a Data Manipulation Language (DML) as part of a single DB language: SQL

    Most widely used declarative query languageProcedural user specifies what data is required and how to get those data Declarative user specifies what data is required without specifying how to get those data

  • SQL: Data Definition Language (DDL)DDL: Specification notation for defining the databaseEx: create table account( account-number char(10), balance integer)DDL compiler generates a set of tables stored in a data dictionaryData dictionary contains metadata (i.e., data about data)Ex: Database schema, consistency constraints, access methods

  • SQL: Data Manipulation Language (DML)Language for accessing and manipulating data Ex: find the name of the customer with customer-id 192-83-7465 select customer.customer-name from customer where customer.customer-id = 192-83-7465

  • Transaction ManagementA transaction is a collection of operations that performs a single logical function in a database applicationEx: funds transfer includes withdraw from account A and deposit into account B

    Transaction management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures.

    Transactions must be atomic, consistent, isolated and durable/persistent

  • Database Users (1)Users are differentiated by the way they expect to interact with the systemApplication programmers: interact with system through DML calls Sophisticated users: form requests in a database query languageNave/End users: invoke one of the permanent application programs that have been written previouslyE.g. people accessing database over the web, bank tellers, clerical staff

  • Database Users (2)Database administrators Coordinates all the activities of the database system; has a good understanding of the enterprises information resources and needs. Duties include:Schema definitionStorage structure and access method definitionSchema and physical organization modificationGranting user authority to access the databaseSpecifying integrity constraintsActing as liaison with usersMonitoring performance, tuning the system and responding to changes in requirements

  • Overall DBMS Structure

  • Database TuningDatabase Tuning is the activity of making a database application run more quickly. More quickly usually means higher throughput, though it may mean lower response time for time-critical applications.

  • Application Programmer (e.g., business analyst,Data architect)Sophisticated Application Programmer (e.g., SAP admin)DBA, TunerHardware [Processor(s), Disk(s), Memory]Operating SystemConcurrency ControlRecoveryStorage SubsystemIndexesQuery ProcessorApplication

  • Next lectureCh 11: Storage and File Structure

    7