Database Tuning Outline What Is a Transaction?1 ACID Properties

Total Page:16

File Type:pdf, Size:1020Kb

Database Tuning Outline What Is a Transaction?1 ACID Properties Concurrency Tuning Introduction to Transactions Outline Database Tuning Concurrency Tuning 1 Concurrency Tuning Nikolaus Augsten Introduction to Transactions Lock Tuning University of Salzburg Weaken Isolation Guarantees Department of Computer Science Database Group Transaction Chopping Unit 4 – WS 2015/16 Adapted from “Database Tuning” by Dennis Shasha and Philippe Bonnet. Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 1 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 2 / 74 Concurrency Tuning Introduction to Transactions Concurrency Tuning Introduction to Transactions What is a Transaction?1 ACID Properties A transaction is a unit of program execution that accesses and possibly updates various data items. Example: transfer $50 from account A to account B Database system must guarantee ACID for transactions: 1. R(A) Atomicity: either all operations of the transaction are executed or none 2. A A 50 Consistency: execution of a transaction in isolation preserves the ← − 3. W (A) consistency of the database 4. R(B) Isolation: although multiple transactions may execute concurrently, 5. B B + 50 each transaction must be unaware of the other concurrent transactions. ← 6. W (B) Durability: After a transaction completes successfully, changes to the Two main issues: database persist even in case of system failure. 1. concurrent execution of multiple transactions 2. failures of various kind (e.g., hardware failure, system crash) 1 Slides of section “Introduction to Transactions” are adapted from the slides “Database System Concepts”, 6th Ed., Silberschatz, Korth, and Sudarshan Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 3 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 4 / 74 Concurrency Tuning Introduction to Transactions Concurrency Tuning Introduction to Transactions Atomicity Consistency Example: transfer $50 from account A to account B Example: transfer $50 from account A to account B 1. R(A) 2. A A 50 1. R(A) ← − 2. A A 50 3. W (A) 3. W←(A) − 4. R(B) 5. B B + 50 4. R(B) ← 5. B B + 50 6. W (B) 6. W←(B) Consistency in example: sum A + B must be unchanged What if failure (hardware or software) after step 3? Consistency in general: money is lost explicit integrity constraints (e.g., foreign key) database is inconsistent implicit integrity constraints (e.g., sum of all account balances of a Atomicity: bank branch must be equal to branch balance) either all operations or none Transaction: updates of partially executed transactions not reflected in database must see consistent database during transaction inconsistent state allowed after completion database must be consistent again Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 5 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 6 / 74 Concurrency Tuning Introduction to Transactions Concurrency Tuning Introduction to Transactions Isolation – Motivating Example Isolation Trivial isolation: run transactions serially Example: transfer $50 from account A to account B Isolation for concurrent transactions: For every pair of transactions Ti 1. R(A) and Tj , it appears to Ti as if either Tj finished execution before Ti 2. A A 50 started or T started execution after T finished. 3. W←(A) − j i 4. R(B) Schedule: 5. B B + 50 specifies the chronological order of a sequence of instructions from 6. W←(B) various transactions Imagine second transaction T : equivalent schedules result in identical databases if they start with 2 identical databases T : R(A), R(B), print(A + B) 2 Serializable schedule: T2 is executed between steps 3 and 4 T2 sees an inconsistent database and gives wrong result equivalent to some serial schedule serializable schedule of T 1 and T 2 is either equivalent to T 1, T 2 or T 2, T 1 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 7 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 8 / 74 Concurrency Tuning Introduction to Transactions Concurrency Tuning Introduction to Transactions Durability Locks When a transaction is done it commits. Example: transaction commits too early A lock is a mechanism to control concurrency on a data item. transaction writes A, then commits Two types of locks on a data item A: A is written to the disk buffer exclusive– xL(A): data item A can be both read and written then system crashes shared– sL(A): data item A can only be read. value of A is lost Lock request are made to concurrency control manager. Durability: After a transaction has committed, the changes to the database persist even in case of system failure. Transaction is blocked until lock is granted. Commit only after all changes are permanent: Unlock A – uL(A): release the lock on a data item A either written to log file or directly to database database must recover in case of a crash Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 9 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 10 / 74 Concurrency Tuning Introduction to Transactions Concurrency Tuning Introduction to Transactions Lock Compatibility Locking Protocol Lock compatibility matrix: Example transaction T2 with locking: T1 T2 shared exclusive ↓ → 1. sL(A), R(A), uL(A) shared true false 2. sL(B), R(B), uL(B) exclusive false false 3. print(A + B) T1 holds shared lock on A: T2 uses locking, but is not serializable shared lock is granted to T2 A and/or B could be updated between steps 1 and 2 exclusive lock is not granted to T2 printed sum may be wrong T2 holds exclusive lock on A: Locking protocol: shared lock is not granted to T2 set of rules followed by all transactions while requesting/releasing locks exclusive lock is not granted to T2 locking protocol restricts the set of possible schedules Shared locks can be shared by any number of transactions. Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 11 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 12 / 74 Concurrency Tuning Introduction to Transactions Concurrency Tuning Introduction to Transactions Pitfalls of Locking Protocols – Deadlock Pitfalls of Locking Protocols – Starvation Example: two concurrent money transfers T : R(A), A A + 10, R(B), B B 10, W (A), W (B) 1 ← ← − Starvation: transaction continues to wait for lock T2: R(B), B B + 50, R(A), A A 50, W (A), W (B) possible concurrent← scenario with← locks:− Examples: T1.xL(A), T1.R(A), T2.xL(B), T2.R(B), T2.xL(A), T1.xL(B),... the same transaction is repeatedly rolled back due to deadlocks T1 and T2 block each other – no progress possible a transaction continues to wait for an exclusive lock on an item while a Deadlock: situation when transactions block each other sequence of other transactions are granted shared locks Handling deadlocks: Well-designed concurrency manager avoids starvation. one of the transactions must be rolled back (i.e., undone) rolled back transaction releases locks Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 13 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 14 / 74 Concurrency Tuning Introduction to Transactions Concurrency Tuning Introduction to Transactions Two-Phase Locking Two-Phase Locking – Example Example: two concurrent money transfers Protocol that guarantees serializability. T1: R(A), A A + 10, R(B), B B 10, W (A), W (B) Phase 1: growing phase T : R(A), A ← A 50, R(B), B ← B +− 50, W (A), W (B) 2 ← − ← transaction may obtain locks Possible two-phase locking schedule: transaction may not release locks 1. T : xL(A), xL(B), R(A), R(B), W (A A + 10), uL(A) 1 ← Phase 2: shrinking phase 2. T2 : xL(A), R(A), xL(B) (wait) transaction may release locks 3. T1 : W (B B 10), uL(B) 4. T : R(B),←W (A− A 50), W (B B + 50), uL(A), uL(B) transaction may not obtain locks 2 ← − ← Equivalent serial schedule: T1, T2 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 15 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 16 / 74 Concurrency Tuning Lock Tuning Concurrency Tuning Lock Tuning Outline Concurrency Tuning Goals Performance goals: reduce blocking (one transaction waits for another to release its locks) 1 Concurrency Tuning avoid deadlocks and rollbacks Introduction to Transactions Correctness goals: Lock Tuning serializability: each transaction appears to execute in isolation Weaken Isolation Guarantees note: correctness of serial execution must be ensured by the Transaction Chopping programmer! Trade-off between performance and correctness! Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 17 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 18 / 74 Concurrency Tuning Lock Tuning Concurrency Tuning Lock Tuning Ideal Transaction Lock Tuning Acquires few locks. Favors shared locks over exclusive locks. 1. Eliminate unnecessary locks only exclusive locks create conflicts 2. Control granularity of locking Acquires locks with fine granularity. 3. Circumvent hot spots granularities: table, page, row 4. Isolation guarantees and snapshot isolation reduces the scope of each conflict 5. Split long transactions Holds locks for a short time. reduce waiting time Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 19 / 74 Nikolaus Augsten (DIS) DBT – Concurrency Tuning Unit 4 – WS 2015/16 20 / 74 Concurrency Tuning Lock Tuning Concurrency Tuning Lock Tuning 1. Eliminate Unnecessary Locks 2. Control Granularity of Locking Locks can be defined at different granularities: row-level locking (also: record-level locking)
Recommended publications
  • Foreign(Key(Constraints(
    Foreign(Key(Constraints( ! Foreign(key:(a(rule(that(a(value(appearing(in(one(rela3on(must( appear(in(the(key(component(of(another(rela3on.( – aka(values(for(certain(a9ributes(must("make(sense."( – Po9er(example:(Every(professor(who(is(listed(as(teaching(a(course(in(the( Courses(rela3on(must(have(an(entry(in(the(Profs(rela3on.( ! How(do(we(express(such(constraints(in(rela3onal(algebra?( ! Consider(the(rela3ons(Courses(crn,(year,(name,(proflast,(…)(and( Profs(last,(first).( ! We(want(to(require(that(every(nonLNULL(value(of(proflast(in( Courses(must(be(a(valid(professor(last(name(in(Profs.( ! RA((πProfLast(Courses)((((((((⊆ π"last(Profs)( 23( Foreign(Key(Constraints(in(SQL( ! We(want(to(require(that(every(nonLNULL(value(of(proflast(in( Courses(must(be(a(valid(professor(last(name(in(Profs.( ! In(Courses,(declare(proflast(to(be(a(foreign(key.( ! CREATE&TABLE&Courses&(& &&&proflast&VARCHAR(8)&REFERENCES&Profs(last),...);& ! CREATE&TABLE&Courses&(& &&&proflast&VARCHAR(8),&...,&& &&&FOREIGN&KEY&proflast&REFERENCES&Profs(last));& 24( Requirements(for(FOREIGN(KEYs( ! If(a(rela3on(R(declares(that(some(of(its(a9ributes(refer( to(foreign(keys(in(another(rela3on(S,(then(these( a9ributes(must(be(declared(UNIQUE(or(PRIMARY(KEY(in( S.( ! Values(of(the(foreign(key(in(R(must(appear(in(the( referenced(a9ributes(of(some(tuple(in(S.( 25( Enforcing(Referen>al(Integrity( ! Three(policies(for(maintaining(referen3al(integrity.( ! Default(policy:(reject(viola3ng(modifica3ons.( ! Cascade(policy:(mimic(changes(to(the(referenced( a9ributes(at(the(foreign(key.( ! SetLNULL(policy:(set(appropriate(a9ributes(to(NULL.(
    [Show full text]
  • A Fast Implementation of Parallel Snapshot Isolation
    A FAST IMPLEMENTATION OF PARALLEL SNAPSHOT ISOLATION UNA IMPLEMENTACIÓN RÁPIDA DE PARALLEL SNAPSHOT ISOLATION Borja Arnau de Régil Basáñez Trabajo de Fin de Grado del Grado en Ingeniería Informática Facultad de Informática, Universidad Complutense de Madrid Junio 2020 Director: Maria Victoria López López Co-director: Alexey Gotsman Contents Acknowledgements iv Abstract v Resumen vi 1. Introduction1 1.1. Motivation . .1 1.2. Goals . .2 1.3. Work Plan . .3 1.4. Document Structure . .3 1.5. Sources and Repositories . .4 1.6. Related Program Courses . .4 2. Preliminaries5 2.1. Notation . .5 2.1.1. Objects and Replication . .5 2.1.2. Transactions . .5 2.1.3. Histories . .6 2.2. Consistency Models . .6 2.2.1. Read Committed (RC) . .7 2.2.2. Serialisability (SER) . .8 2.2.3. Snapshot Isolation (SI) . .9 2.2.4. Parallel Snapshot Isolation (PSI) . 10 2.2.5. Non-Monotonic Snapshot Isolation (NMSI) . 11 2.2.6. Anomaly Comparison . 11 3. The fastPSI protocol 12 3.1. Consistency Guarantees . 12 3.2. Overview and System Model . 13 3.3. Server data structures . 14 3.4. Protocol Description . 16 3.4.1. Transaction Execution . 16 3.4.2. Transaction Termination . 20 3.5. Consistency Tradeoffs and Read Aborts . 23 ii 4. Implementation and Evaluation 26 4.1. Implementation . 26 4.2. Evaluation . 27 4.2.1. Performance & Scalability Limits . 28 4.2.2. Abort Ratio . 31 5. Related Work 35 6. Conclusions and Future Work 37 6.1. Conclusions . 37 6.2. Future Work . 37 A. Serialisable and Read Committed Protocols 39 A.1.
    [Show full text]
  • Database Administrator
    Database Administrator Purpose: DGC is looking for a passionate Database Administrator to help support our platform, delivering the content of choice for casino operators and their players. You will be working in a small but high performing IT team to create something special. Online gaming is set to be one of the fastest growing industries in the US as regulation allows online gaming to expand into the various states. Our RGS platform is designed for fast and efficient deployments and seamless integration into a high performing library of online casino games. You will need to assist with the hosting, management and updating of this technology to ensure our success. As an DBA you will implement, design and improve processes relating to the administration of databases to ensure that they function correctly, perform optimally, preserve data and facilitate revenue generation. This role forms part of a rapidly expanding team which will require the ability to support a fast growing infrastructure and customer base. Duties include, but not limited to: • Set and maintain operational database standards on an ongoing basis • Develop and maintain OLAP environments • Develop and maintain OLTP environments • Develop and maintain ETL processes • Enforce and improve database integrity and performance using sound design principles and implementation of database design standards • Design and enforce data security policies to eliminate unauthorised access to data on managed data systems in accordance with IT Services technical specifications and business requirements • Ensure that effective data redundancy; archiving, backup and recovery mechanisms are in place to prevent the loss of data • Set up configurable pre-established jobs to automatically run daily in order to monitor and maintain the operational databases • Provide 24-hour standby support by being available on a 24/7 basis during specified periods This job description is not intended to be an exhaustive list of responsibilities.
    [Show full text]
  • One-Copy Serializability with Snapshot Isolation Under the Hood
    One-Copy Serializability with Snapshot Isolation under the Hood Mihaela A. Bornea 1, Orion Hodson 2, Sameh Elnikety 2, Alan Fekete 3 1Athens U. of Econ and Business, 2Microsoft Research, 3University of Sydney Abstract—This paper presents a method that allows a repli- With careful design and engineering, SI engines can be cated database system to provide a global isolation level stronger replicated to get even higher performance with a replicated than the isolation level provided on each individual database form of SI such as Generalized Snapshot Isolation (GSI) [13], replica. We propose a new multi-version concurrency control al- gorithm called, serializable generalized snapshot isolation (SGSI), which is also not serializable. The objective of this paper is that targets middleware replicated database systems. Each replica to provide a concurrency control algorithm for replicated SI runs snapshot isolation locally and the replication middleware databases that achieves almost the same performance as GSI guarantees global one-copy serializability. We introduce novel while providing global one-copy-serializability (1SR). techniques to provide a stronger global isolation level, namely To guarantee serializability, concurrency control algorithms readset extraction and enhanced certification that prevents read- write and write-write conflicts in a replicated setting. We prove typically require access to data read and written in update the correctness of the proposed algorithm, and build a proto- transactions. Accessing this data is especially difficult in a type replicated database system to evaluate SGSI performance replicated database system since built-in facilities inside a experimentally. Extensive experiments with an 8 replica database centralized DBMS, like the lock manager, are not available system under the TPC-W workload mixes demonstrate the at a global level.
    [Show full text]
  • Making Snapshot Isolation Serializable
    Making Snapshot Isolation Serializable ALAN FEKETE University of Sydney DIMITRIOS LIAROKAPIS, ELIZABETH O’NEIL, and PATRICK O’NEIL University of Massachusetts and DENNIS SHASHA Courant Institute Snapshot Isolation (SI) is a multiversion concurrency control algorithm, first described in Berenson et al. [1995]. SI is attractive because it provides an isolation level that avoids many of the com- mon concurrency anomalies, and has been implemented by Oracle and Microsoft SQL Server (with certain minor variations). SI does not guarantee serializability in all cases, but the TPC-C benchmark application [TPC-C], for example, executes under SI without serialization anoma- lies. All major database system products are delivered with default nonserializable isolation levels, often ones that encounter serialization anomalies more commonly than SI, and we sus- pect that numerous isolation errors occur each day at many large sites because of this, lead- ing to corrupt data sometimes noted in data warehouse applications. The classical justification for lower isolation levels is that applications can be run under such levels to improve efficiency when they can be shown not to result in serious errors, but little or no guidance has been of- fered to application programmers and DBAs by vendors as to how to avoid such errors. This article develops a theory that characterizes when nonserializable executions of applications can occur under SI. Near the end of the article, we apply this theory to demonstrate that the TPC-C benchmark application has no serialization anomalies under SI, and then discuss how this demon- stration can be generalized to other applications. We also present a discussion on how to modify the program logic of applications that are nonserializable under SI so that serializability will be guaranteed.
    [Show full text]
  • Firebird 3.0 Developer's Guide
    Firebird 3.0 Developer’s Guide Denis Simonov Version 1.1, 27 June 2020 Preface Author of the written material and creator of the sample project on five development platforms, originally as a series of magazine articles: Denis Simonov Translation of original Russian text to English: Dmitry Borodin (MegaTranslations Ltd) Editor of the translated text: Helen Borrie Copyright © 2017-2020 Firebird Project and all contributing authors, under the Public Documentation License Version 1.0. Please refer to the License Notice in the Appendix This volume consists of chapters that walk through the development of a simple application for several language platforms, notably Delphi, Microsoft Entity Framework and MVC.NET (“Model-View-Controller”) for web applications, PHP and Java with the Spring framework. It is hoped that the work will grow in time, with contributions from authors using other stacks with Firebird. 1 Table of Contents Table of Contents 1. About the Firebird Developer’s Guide: for Firebird 3.0 . 6 1.1. About the Author . 6 1.1.1. Translation… . 6 1.1.2. … and More Translation . 6 1.2. Acknowledgments . 6 2. The examples.fdb Database . 8 2.1. Database Creation Script. 8 2.1.1. Database Aliases . 9 2.2. Creating the Database Objects. 10 2.2.1. Domains . 10 2.2.2. Primary Tables. 11 2.2.3. Secondary Tables . 13 2.2.4. Stored Procedures. 17 2.2.5. Roles and Privileges for Users . 25 2.3. Saving and Running the Script . 26 2.4. Loading Test Data . 27 3. Developing Firebird Applications in Delphi . 28 3.1.
    [Show full text]
  • Ensuring Consistency Under the Snapshot Isolation
    World Academy of Science, Engineering and Technology International Journal of Computer and Information Engineering Vol:8, No:7, 2014 Ensuring Consistency under the Snapshot Isolation Carlos Roberto Valencio,ˆ Fabio´ Renato de Almeida, Thatiane Kawabata, Leandro Alves Neves, Julio Cesar Momente, Mario Luiz Tronco, Angelo Cesar Colombini Abstract—By running transactions under the SNAPSHOT isolation both transactions write the same data item, giving rise to we can achieve a good level of concurrency, specially in databases a write-write conflict. In turn, a temporal overlap occurs with high-intensive read workloads. However, SNAPSHOT is not < when Ti and Tj run concurrently, that is tsi tcj and immune to all the problems that arise from competing transactions < and therefore no serialization warranty exists. We propose in this tsj tci [2]. Thus, a transaction Ti under the SNAPSHOT paper a technique to obtain data consistency with SNAPSHOT by using isolation is allowed to commit only if no other transaction with δ <δ< some special triggers that we named DAEMON TRIGGERS. Besides commit-timestamp in the running time of Ti (tsi tci ) keeping the benefits of the SNAPSHOT isolation, the technique is wrote a data item also written by Ti [4]. specially useful for those database systems that do not have an Implementations of the SNAPSHOT isolation have the isolation level that ensures serializability, like Firebird and Oracle. We describe all the anomalies that might arise when using the SNAPSHOT advantage that writes of a transaction do not block the isolation and show how to preclude them with DAEMON TRIGGERS. reads of others.
    [Show full text]
  • Normalization Exercises
    DATABASE DESIGN: NORMALIZATION NOTE & EXERCISES (Up to 3NF) Tables that contain redundant data can suffer from update anomalies, which can introduce inconsistencies into a database. The rules associated with the most commonly used normal forms, namely first (1NF), second (2NF), and third (3NF). The identification of various types of update anomalies such as insertion, deletion, and modification anomalies can be found when tables that break the rules of 1NF, 2NF, and 3NF and they are likely to contain redundant data and suffer from update anomalies. Normalization is a technique for producing a set of tables with desirable properties that support the requirements of a user or company. Major aim of relational database design is to group columns into tables to minimize data redundancy and reduce file storage space required by base tables. Take a look at the following example: StdSSN StdCity StdClass OfferNo OffTerm OffYear EnrGrade CourseNo CrsDesc S1 SEATTLE JUN O1 FALL 2006 3.5 C1 DB S1 SEATTLE JUN O2 FALL 2006 3.3 C2 VB S2 BOTHELL JUN O3 SPRING 2007 3.1 C3 OO S2 BOTHELL JUN O2 FALL 2006 3.4 C2 VB The insertion anomaly: Occurs when extra data beyond the desired data must be added to the database. For example, to insert a course (CourseNo), it is necessary to know a student (StdSSN) and offering (OfferNo) because the combination of StdSSN and OfferNo is the primary key. Remember that a row cannot exist with NULL values for part of its primary key. The update anomaly: Occurs when it is necessary to change multiple rows to modify ONLY a single fact.
    [Show full text]
  • A Simple Database Supporting an Online Book Seller Tables About Books and Authors CREATE TABLE Book ( Isbn INTEGER, Title
    1 A simple database supporting an online book seller Tables about Books and Authors CREATE TABLE Book ( Isbn INTEGER, Title CHAR[120] NOT NULL, Synopsis CHAR[500], ListPrice CURRENCY NOT NULL, AmazonPrice CURRENCY NOT NULL, SavingsInPrice CURRENCY NOT NULL, /* redundant AveShipLag INTEGER, AveCustRating REAL, SalesRank INTEGER, CoverArt FILE, Format CHAR[4] NOT NULL, CopiesInStock INTEGER, PublisherName CHAR[120] NOT NULL, /*Remove NOT NULL if you want 0 or 1 PublicationDate DATE NOT NULL, PublisherComment CHAR[500], PublicationCommentDate DATE, PRIMARY KEY (Isbn), FOREIGN KEY (PublisherName) REFERENCES Publisher, ON DELETE NO ACTION, ON UPDATE CASCADE, CHECK (Format = ‘hard’ OR Format = ‘soft’ OR Format = ‘audi’ OR Format = ‘cd’ OR Format = ‘digital’) /* alternatively, CHECK (Format IN (‘hard’, ‘soft’, ‘audi’, ‘cd’, ‘digital’)) CHECK (AmazonPrice + SavingsInPrice = ListPrice) ) CREATE TABLE Author ( AuthorName CHAR[120], AuthorBirthDate DATE, AuthorAddress ADDRESS, AuthorBiography FILE, PRIMARY KEY (AuthorName, AuthorBirthDate) ) CREATE TABLE WrittenBy (/*Books are written by authors Isbn INTEGER, AuthorName CHAR[120], AuthorBirthDate DATE, OrderOfAuthorship INTEGER NOT NULL, AuthorComment FILE, AuthorCommentDate DATE, PRIMARY KEY (Isbn, AuthorName, AuthorBirthDate), FOREIGN KEY (Isbn) REFERENCES Book, ON DELETE CASCADE, ON UPDATE CASCADE, FOREIGN KEY (AuthorName, AuthorBirthDate) REFERENCES Author, ON DELETE CASCADE, ON UPDATE CASCADE) 1 2 CREATE TABLE Publisher ( PublisherName CHAR[120], PublisherAddress ADDRESS, PRIMARY KEY (PublisherName)
    [Show full text]
  • Database Administrator
    Contra Costa Community College District – Classification Specification DATABASE ADMINISTRATOR Class Code OT Status EEO Category Represented Salary Effective Date Status Pages Status Grade Non-Exempt Technical/Paraprofessional PEU Local 1 75 07/01/2017 Classified 1 of 2 DEFINITION To support the relational databases on the various computer platform environments; to assist in the development, creation and maintenance of relational databases for present and future requirements; and to recommend and maintain security measures for the database environment. DISTINGUISHING CHARACTERISTICS Database Administrator – This is the journey-level classification in the Database Administrator Series. Positions in this classification are responsible for moderately complex projects with general supervision provided by the appropriate manager. Knowledge of database management theory and practice is reasonably extensive, and understanding of moderately complex database concepts is critical. Database Administrator, Senior – This is the most advanced level in the Database Administrator series. Positions in this classification are responsible for highly complex projects with general direction provided by the appropriate manager. Knowledge of database management theory and practice is extensive, and understanding of complex database concepts is critical. SUPERVISION RECEIVED AND EXERCISED Receives supervision from a departmental supervisor or manager. May receive technical or functional supervision from higher-level departmental personnel. May provide training and direction to student assistants or other assigned staff. EXAMPLES OF DUTIES Duties may include, but are not limited to, the following: Documents, designs, develops, optimizes, and improves new and existing logical and physical databases for custom and commercial applications to meet the changing needs of the user community. Coordinates database development as part of project team and individually, applying knowledge of database design standards, configuration, tools and services, and database management system.
    [Show full text]
  • Junior Database Administrator
    JUNIOR DATABASE ADMINISTRATOR The National Association of Counties (NACo) is seeking a highly organized individual with great attention to detail for the position of Database Administrator (DBA). The DBA ensures data quality for the entire organization. This position is responsible for maintaining database applications, ensuring information is accurate and entered in a timely manner to support NACo departments and program requirements. The position is also responsible for data entry, data structure, report customization, and analysis and data quality control. The database administrator (DBA) is responsible for the performance, integrity and security of NACo’s database. The DBA will be involved in the planning and development of the database, as well as in troubleshooting any issues on behalf of the users. The DBA will ensure data remains consistent across the database, data is clearly defined, users access data concurrently and in a form that suits their needs, and ensure all data is retrievable in an emergency. RESPONSIBILITIES: • Establish the needs of users and monitor user access and security • Monitor performance and manage parameters in order to provide fast responses to front-end users • Map out the conceptual design for a planned database • Ensure all data is retrievable in an emergency • Consider both back-end organization of data and front-end accessibility for end-users • Refine the logical design so that it can be translated into a specific data model • Install and test new versions of the database management system (DBMS)
    [Show full text]
  • 3 Data Definition Language (DDL)
    Database Foundations 6-3 Data Definition Language (DDL) Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Roadmap You are here Data Transaction Introduction to Structured Data Definition Manipulation Control Oracle Query Language Language Language (TCL) Application Language (DDL) (DML) Express (SQL) Restricting Sorting Data Joining Tables Retrieving Data Using Using ORDER Using JOIN Data Using WHERE BY SELECT DFo 6-3 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 3 Data Definition Language (DDL) Objectives This lesson covers the following objectives: • Identify the steps needed to create database tables • Describe the purpose of the data definition language (DDL) • List the DDL operations needed to build and maintain a database's tables DFo 6-3 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 4 Data Definition Language (DDL) Database Objects Object Description Table Is the basic unit of storage; consists of rows View Logically represents subsets of data from one or more tables Sequence Generates numeric values Index Improves the performance of some queries Synonym Gives an alternative name to an object DFo 6-3 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 5 Data Definition Language (DDL) Naming Rules for Tables and Columns Table names and column names must: • Begin with a letter • Be 1–30 characters long • Contain only A–Z, a–z, 0–9, _, $, and # • Not duplicate the name of another object owned by the same user • Not be an Oracle server–reserved word DFo 6-3 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 6 Data Definition Language (DDL) CREATE TABLE Statement • To issue a CREATE TABLE statement, you must have: – The CREATE TABLE privilege – A storage area CREATE TABLE [schema.]table (column datatype [DEFAULT expr][, ...]); • Specify in the statement: – Table name – Column name, column data type, column size – Integrity constraints (optional) – Default values (optional) DFo 6-3 Copyright © 2015, Oracle and/or its affiliates.
    [Show full text]