Module 02 Database Architecture

Total Page:16

File Type:pdf, Size:1020Kb

Module 02 Database Architecture Module 2: Database Architecture Overview Schema and Data Structure (Objects) Storage Architecture Data Blocks, Extents, and Segments Storage Allocation Managing Extents and Pages Tablespaces and Datafiles SQL Server Data Files Mapping of Tablespaces and Filegroups Logging Model Data Dictionary Schema and Data Structures (Objects) Schema – a collection of objects owned by a database user Schemas in SQL Server provide logical separation of objects, similar to Oracle’s schema Comparison of Core Schema and Data Structures (Objects) Oracle SQL Server Table Table Index Index View View Synonym Synonym Sequence Sequence Procedure Stored Procedure Function Function Package N/A Queue in Streams Advanced Queuing Service Broker Queue Object Type Type XML DB XML Schema Collection & data type Storage Architecture Database storage architecture includes physical and logical structures Physical structures are data files, log files, and operating system blocks Logical structures are subdivisions of data files used to manage storage space Data File Data File Data File Data File Data File Data File Temporary Tablespace Groups Tablespace Tablespace Filegroup Filegroup Segment Segment Heap/Index Heap/Index Extent Extent Extent Extent Extent Extent Extent Blocks Blocks Blocks Blocks Pages Pages Pages Data Blocks, Extents, and Segments Structure Oracle SQL Server 2012 Smallest unit of Block Page logical storage Block size Variable 8 KB fixed Performed in multiple Performed in multiple Storage allocation blocks; are ‘extents’ pages; are ‘extents’ Extent size Variable 64 KB fixed Any logical structure Segment that is allocated Allocation unit storage Storage Allocation 2K 2K 2K 2K 8K 8K 8K 2K block block block 6 x 2bKlo =c k12K block block block block 2K 2K 2K EXT2EKNT 8K 8K 8K 8 x 8K2 K= 64K block block block block 12K + 16K = 28K block block block EXbTloEcNkT 2K 2K 2K 2K SEGMENT 8K 8K 8K 2K 64K + 64K = block block block block (Table/Index) block block block block 128K HEAP/INDEX 2K 2K 2K 2K 8K 8K 8K 2K block block block block block block block block 2K 2K 2K 2K 8K 8K 8K 2K block block block block block block block block 2K 2K 8 x 2K2K = 16K 2K 8K 8K 8K 8 x 8K2 K= 64K block block EXbTloEcNk T block block block block EXbTloEcNkT 2K 2K 2K 2K 8K 8K 8K 2K block block block block block block block block 2K 2K 2K 2K 8K 8K 8K 2K block block block block block block block block Oracle SQL Server Fundamental difference in storage allocation between Oracle and SQL Server Managing Extents and Pages In Oracle, each extent is dedicated to an allocated object. In SQL Server, the equivalent is a uniform extent. SQL Server uses mixed extents: pages are allocated to objects with less than 8 blocks of data Similar to the Oracle bitmap functionality used to manage free space and extent allocation, SQL Server uses the Global Allocation Map (GAM) and Shared Global Allocation Map (SGAM) Oracle keeps track of extents using extent allocation maps Managing Extents and Pages (Continued) File Header Extent Extents in SQL Server GAM Bit SGAM Bit Current Use of Extent Setting Setting Free, not being used 1 0 Uniform extent, or full mixed GAMs and SGAMs 0 0 extent Mixed extent with free pages 0 1 Tablespaces and Datafiles Oracle and SQL Server store data in datafiles The largest logical storage structure in Oracle is a tablespace The largest logical storage structure in SQL Server is a filegroup Tablespaces/filegroups are used to group application objects Tablespaces/filegroups optimize administration of datafiles SQL Server Data Files Three file types supported by SQL Server: Primary Data Files Secondary Data Files Log Data Files Demonstration: Working with Filegroups and Data Structures Demonstration: Working with Filegroups and Data Structures Mapping of Tablespaces and Filegroups System Tablespace Data file Data file Data file Log file Master DB Resource DB SysAux Tablespace Data file Data file Data file Log file Tablespace Group Temporary Tablespace Data file Log file TempDB Data file Data file Data file Log file Model DB Data file Data file Data file Log file MSDB BigFile Tablespace Data file User Data Tablespace Data file Data file User Database User DB User Index Tablespace Data file Data file Data file Data file Data FG Undo Tablespace Data file Data file Data file Data file Index FG Redo Log Files Redo Log Log file Log File(s) Redo Log Redo Log Oracle Database Instance SQL Server Instance Demonstration: Viewing an Instance’s System Databases Demonstration: Viewing an Instance’s System Databases Logging Model Oracle uses online redo logs to record changes made to the database by transactions and undo segments to capture the ‘before image’ of data SQL Server implements both of these functions using transaction logs. Each transaction record contains the undo and redo image of the transaction. Data Dictionary In Oracle the data dictionary is stored under the SYS schema in the SYSTEM tablespace In SQL Server the data dictionary consists of: Catalog View—the best way to access system metadata Backward Compatibility Views—All system tables from previous releases are provided as backward compatibility views Dynamic Management Views—to view the current state of the SQL Server system. Provide real-time snapshots of internal memory structures indicating the server state. INFORMATION_SCHEMA views—SQL-99 method to view system metadata SQL Server’s Resource database contains the metadata for system stored procedures Demonstration: View the Data Dictionary Demonstration: View the Data Dictionary Review Defined schema and identified core schema objects Examined the storage architecture and its physical (datafiles, logfiles, and so on) and logical structures (blocks, extents, segments, and tablespaces) Defined the hierarchy in the logical structures Compared Oracle and SQL Server in terms of schema vs. databases, and tablespaces vs. filegroups Examined the structures used in the implementation of the logging model (redo logs and rollback segments in Oracle vs. transaction logs in SQL Server) Brief look at the location and composition of the data dictionary/system catalog .
Recommended publications
  • CA SQL-Ease for DB2 for Z/OS User Guide
    CA SQL-Ease® for DB2 for z/OS User Guide Version 17.0.00, Second Edition This Documentation, which includes embedded help systems and electronically distributed materials, (hereinafter referred to as the “Documentation”) is for your informational purposes only and is subject to change or withdrawal by CA at any time. This Documentation is proprietary information of CA and may not be copied, transferred, reproduced, disclosed, modified or duplicated, in whole or in part, without the prior written consent of CA. If you are a licensed user of the software product(s) addressed in the Documentation, you may print or otherwise make available a reasonable number of copies of the Documentation for internal use by you and your employees in connection with that software, provided that all CA copyright notices and legends are affixed to each reproduced copy. The right to print or otherwise make available copies of the Documentation is limited to the period during which the applicable license for such software remains in full force and effect. Should the license terminate for any reason, it is your responsibility to certify in writing to CA that all copies and partial copies of the Documentation have been returned to CA or destroyed. TO THE EXTENT PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS DOCUMENTATION “AS IS” WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT WILL CA BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, LOST INVESTMENT, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
    [Show full text]
  • Server New Features Webfocus Server Release 8207 Datamigrator Server Release 8207
    Server New Features WebFOCUS Server Release 8207 DataMigrator Server Release 8207 February 26, 2021 Active Technologies, FOCUS, Hyperstage, Information Builders, the Information Builders logo, iWay, iWay Software, Omni- Gen, Omni-HealthData, Parlay, RStat, Table Talk, WebFOCUS, WebFOCUS Active Technologies, and WebFOCUS Magnify are registered trademarks, and DataMigrator, and ibi are trademarks of Information Builders, Inc. Adobe, the Adobe logo, Acrobat, Adobe Reader, Flash, Adobe Flash Builder, Flex, and PostScript are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Due to the nature of this material, this document refers to numerous hardware and software products by their trademarks. In most, if not all cases, these designations are claimed as trademarks or registered trademarks by their respective companies. It is not this publisher's intent to use any of these names generically. The reader is therefore cautioned to investigate all claimed trademark rights before using any of these names other than to refer to the product described. Copyright © 2021. TIBCO Software Inc. All Rights Reserved. Contents 1. Server Enhancements ........................................................ 11 Global WebFOCUS Server Monitoring Console ........................................... 11 Server Text Editor Supports Jump to Next or Previous Difference in Compare and Merge .......14 Upload Message Added in the Edaprint Log ............................................. 15 Displaying the
    [Show full text]
  • Oracle, IBM DB2, and SQL RDBMS’
    Enterprise Architecture Technical Brief Oracle, IBM DB2, and SQL RDBMS’ Robert Kowalke November 2017 Enterprise Architecture Oracle, IBM DB2, and SQL RDBMS Contents Database Recommendation ............................................................................................................. 3 Relational Database Management Systems (RDBMS) ................................................................... 5 Oracle v12c-r2 ............................................................................................................................ 5 IBM DB2 for Linux, Unix, Windows (LUW) ............................................................................ 6 Microsoft SQL Server (Database Engine) v2017 ...................................................................... 7 Additional Background Information ............................................................................................... 9 VITA Reference Information (To be removed) ......................... Error! Bookmark not defined. Page 2 of 15 [email protected] Enterprise Architecture Oracle, IBM DB2, and SQL RDBMS Database Recommendation Oracle, SQL Server, and DB2 are powerful RDBMS options. There are a number of differences in how they work “under the hood,” and in various situations, one may be more favorable than the other. 1 There is no easy answer, nor is there a silver-bullet for choosing one of these three (3) databases for your specific business requirements. Oracle is a very popular choice with the Fortune 100 list of companies and
    [Show full text]
  • Adapting a Synonym Database to Specific Domains Davide Turcato Fred Popowich Janine Toole Dan Pass Devlan Nicholson Gordon Tisher Gavagai Technology Inc
    Adapting a synonym database to specific domains Davide Turcato Fred Popowich Janine Toole Dan Pass Devlan Nicholson Gordon Tisher gavagai Technology Inc. P.O. 374, 3495 Ca~abie Street, Vancouver, British Columbia, V5Z 4R3, Canada and Natural Language Laboratory, School of Computing Science, Simon Fraser University 8888 University Drive, Burnaby, British Columbia, V5A 1S6, Canada {turk, popowich ,toole, lass, devl an, gt i sher}@{gavagai, net, as, sfu. ca} Abstract valid for English, would be detrimental in a specific domain like weather reports, where This paper describes a method for both snow and C (for Celsius) occur very fre- adapting a general purpose synonym quently, but never as synonyms of each other. database, like WordNet, to a spe- We describe a method for creating a do- cific domain, where only a sub- main specific synonym database from a gen- set of the synonymy relations de- eral purpose one. We use WordNet (Fell- fined in the general database hold. baum, 1998) as our initial database, and we The method adopts an eliminative draw evidence from a domain specific corpus approach, based on incrementally about what synonymy relations hold in the pruning the original database. The domain. method is based on a preliminary Our task has obvious relations to word manual pruning phase and an algo- sense disambiguation (Sanderson, 1997) (Lea- rithm for automatically pruning the cock et al., 1998), since both tasks are based database. This method has been im- on identifying senses of ambiguous words in plemented and used for an Informa- a text. However, the two tasks are quite dis- tion Retrieval system in the aviation tinct.
    [Show full text]
  • An Approach to Deriving Global Authorizations in Federated Database Systems
    5 An Approach To Deriving Global Authorizations in Federated Database Systems Silvana Castano Universita di Milano Dipartimento di Scienze dell'lnformazione, Universita di Milano Via Comelico 99/41, Milano, Italy. Email: castano @ds i. unimi. it Abstract Global authorizations in federated database systems can be derived from local authorizations exported by component databases. This paper addresses problems related to the development of techniques for the analysis of local authorizations and for the construction of global authorizations where semantic correspondences between subjects in different component databases are identified on the basis of authorization compatibility. Abstraction of compatible authorizations is discussed to semi-automatically derive global authorizations that are consistent with the local ones. Keywords Federated database systems, Discretionary access control, Authorization compati­ bility, Authorization abstraction. 1 INTRODUCTION A federated database system (or federation) is characterized by a number of com­ ponent databases (CDB) which share part of their data, while preserving their local autonomy. In particular, in the so-called tightly coupled systems [She90], a feder­ ation administrator (FDBA) is responsible for managing the federation and for defining a federated schema. A federated schema is an integrated description of all data exported by CDBs of the federation, obtained by resolving possible semantic conflicts among data descriptions [Bri94,Ham93,Sie91]. A basic security requirement of federated systems is that the autonomy of CDBs must be taken into account for access control [Mor92]. This means that global accesses to objects of a federated schema must be authorized also by the involved CDBs, according to their local security policies. Two levels of authorization can be distinguished: a global level, where global requests of federated users are evaluated P.
    [Show full text]
  • Nosql – Factors Supporting the Adoption of Non-Relational Databases
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Trepo - Institutional Repository of Tampere University NoSQL – Factors Supporting the Adoption of Non-Relational Databases Olli Sutinen University of Tampere Department of Computer Sciences Computer Science M.Sc. thesis Supervisor: Marko Junkkari December 2010 University of Tampere Department of Computer Sciences Computer science Olli Sutinen: NoSQL – Factors Supporting the Adoption of Non-Relational Databases M.Sc. thesis November 2010 Relational databases have been around for decades and are still in use for general data storage needs. The web has created usage patterns for data storage and querying where current implementations of relational databases fit poorly. NoSQL is an umbrella term for various new data stores which emerged virtually simultaneously at the time when relational databases were the de facto standard for data storage. It is claimed that the new data stores address the changed needs better than the relational databases. The simple reason behind this phenomenon is the cost. If the systems are too slow or can't handle the load, the users will go to a competing site, and continue spending their time there watching 'wrong' advertisements. On the other hand, scaling relational databases is hard. It can be done and commercial RDBMS vendors have such systems available but it is out of reach of a startup because of the price tag included. This study reveals the reasons why many companies have found existing data storage solutions inadequate and developed new data stores. Keywords: databases, database scalability, data models, nosql Contents 1.
    [Show full text]
  • Incorporating Trustiness and Collective Synonym/Contrastive Evidence Into Taxonomy Construction
    Incorporating Trustiness and Collective Synonym/Contrastive Evidence into Taxonomy Construction #1 #2 3 Luu Anh Tuan , Jung-jae Kim , Ng See Kiong ∗ #School of Computer Engineering, Nanyang Technological University, Singapore [email protected], [email protected] ∗Institute for Infocomm Research, Agency for Science, Technology and Research, Singapore [email protected] Abstract Previous works on the task of taxonomy con- struction capture information about potential tax- Taxonomy plays an important role in many onomic relations between concepts, rank the can- applications by organizing domain knowl- didate relations based on the captured information, edge into a hierarchy of is-a relations be- and integrate the highly ranked relations into a tax- tween terms. Previous works on the taxo- onomic structure. They utilize such information nomic relation identification from text cor- as hypernym patterns (e.g. A is a B, A such as pora lack in two aspects: 1) They do not B) (Kozareva et al., 2008), syntactic dependency consider the trustiness of individual source (Drumond and Girardi, 2010), definition sentences texts, which is important to filter out in- (Navigli et al., 2011), co-occurrence (Zhu et al., correct relations from unreliable sources. 2013), syntactic contextual similarity (Tuan et al., 2) They also do not consider collective 2014), and sibling relations (Bansal et al., 2014). evidence from synonyms and contrastive terms, where synonyms may provide ad- They, however, lack in the three following as- ditional supports to taxonomic relations, pects: 1) Trustiness: Not all sources are trust- while contrastive terms may contradict worthy (e.g. gossip, forum posts written by them.
    [Show full text]
  • A Dictionary of DBMS Terms
    A Dictionary of DBMS Terms Access Plan Access plans are generated by the optimization component to implement queries submitted by users. ACID Properties ACID properties are transaction properties supported by DBMSs. ACID is an acronym for atomic, consistent, isolated, and durable. Address A location in memory where data are stored and can be retrieved. Aggregation Aggregation is the process of compiling information on an object, thereby abstracting a higher-level object. Aggregate Function A function that produces a single result based on the contents of an entire set of table rows. Alias Alias refers to the process of renaming a record. It is alternative name used for an attribute. 700 A Dictionary of DBMS Terms Anomaly The inconsistency that may result when a user attempts to update a table that contains redundant data. ANSI American National Standards Institute, one of the groups responsible for SQL standards. Application Program Interface (API) A set of functions in a particular programming language is used by a client that interfaces to a software system. ARIES ARIES is a recovery algorithm used by the recovery manager which is invoked after a crash. Armstrong’s Axioms Set of inference rules based on set of axioms that permit the algebraic mani- pulation of dependencies. Armstrong’s axioms enable the discovery of minimal cover of a set of functional dependencies. Associative Entity Type A weak entity type that depends on two or more entity types for its primary key. Attribute The differing data items within a relation. An attribute is a named column of a relation. Authorization The operation that verifies the permissions and access rights granted to a user.
    [Show full text]
  • DB2 Federated Systems Guide Step 6: Create the Nicknames for Tables Chapter 11
    ® ™ IBM DB2 Universal Database Federated Systems Guide Ve r s i o n 8 GC27-1224-00 ® ™ IBM DB2 Universal Database Federated Systems Guide Ve r s i o n 8 GC27-1224-00 Before using this information and the product it supports, be sure to read the general information under Notices. This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. You can order IBM publications online or through your local IBM representative. v To order publications online, go to the IBM Publications Center at www.ibm.com/shop/publications/order v To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at www.ibm.com/planetwide To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-4YOU (426-4968). When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1998 - 2002. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Figures .............ix Application programs ........30 Tables ..............xi Chapter 2. Business Solutions with federated systems .........31 About this book ..........xiii Leverage the federated functionality to solve Who should read this book.......xiv your business needs .........31 Conventions and terminology used in this Replication with a federated system ....31 book ..............xiv Spatial analysis with a federated system .
    [Show full text]
  • Designing and Architecting for Internet Scale: Sharding
    Designing and Architecting for Internet Scale: Sharding Article based on The Cloud at Your Service EARLY ACCESS EDITION The when, how, and why of enterprise cloud computing Jothy Rosenberg and Arthur Mateos MEAP Release: February 2010 Softbound print: Summer 2010 | 200 pages ISBN: 9781935182528 This article is taken from the book The Cloud at Your Service. The authors discuss the concept of sharding, a term invented by and a concept heavily employed by Google that is about how to partition databases so they scale infinitely. They show how Yahoo!, Flickr, Facebook, and many other sites that deal with huge user communities have been using this method of database partitioning to enable a good user experience concurrently with rapid growth. Get 35% off any version of The Cloud at Your Service, with the checkout code fcc35. Offer is only valid through http://www.manning.com. When you think Internet scale—by which we mean exposure to the enormous population of entities (human and machine) any number of which could potentially access our application—any number of very popular services might appropriately come to mind. Google is the obvious king of the realm, but Facebook, Flickr, Yahoo!, and many others have had to face the issues of dealing with scaling to hundreds of millions of users. In every case, each of these services was throttled at some point by the way they used the database where information about their users was being accessed. These problems were so severe that major reengineering was required, sometimes many times over. That’s a good lesson to learn early as you are thinking about how your Internet scale applications should be designed in the first place.
    [Show full text]
  • Oracle Interview Questions Oracle Concepts and Architecture Database Structures
    Oracle Interview questions Oracle Concepts and Architecture Database Structures 1. What are the components of physical database structure of Oracle database? Oracle database is comprised of three types of files. One or more datafiles, two or more redo log files, and one or more control files. 2. What are the components of logical database structure of Oracle database? There are tablespaces and database's schema objects. 3. What is a tablespace? A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical structures together. 4. What is SYSTEM tablespace and when is it created? Every Oracle database contains a tablespace named SYSTEM, which is automatically created when the database is created. The SYSTEM tablespace always contains the data dictionary tables for the entire database. 5. Explain the relationship among database, tablespace and data file. Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace. 6. What is schema? A schema is collection of database objects of a user. 7. What are Schema Objects? Schema objects are the logical structures that directly refer to the database's data. Schema objects include tables, views, sequences, synonyms, indexes, clusters, database triggers, procedures, functions packages and database links. 8. Can objects of the same schema reside in different tablespaces? Yes. 9. Can a tablespace hold objects from different schemes? Yes. 10. What is Oracle table? A table is the basic unit of data storage in an Oracle database. The tables of a database hold all of the user accessible data.
    [Show full text]
  • Federated Database Systems for Managing Distributed, Heterogeneous, and Autonomous Databases’
    Federated Database Systems for Managing Distributed, Heterogeneous, and Autonomous Databases’ AMIT P. SHETH Bellcore, lJ-210, 444 Hoes Lane, Piscataway, New Jersey 08854 JAMES A. LARSON Intel Corp., HF3-02, 5200 NE Elam Young Pkwy., Hillsboro, Oregon 97124 A federated database system (FDBS) is a collection of cooperating database systems that are autonomous and possibly heterogeneous. In this paper, we define a reference architecture for distributed database management systems from system and schema viewpoints and show how various FDBS architectures can be developed. We then define a methodology for developing one of the popular architectures of an FDBS. Finally, we discuss critical issues related to developing and operating an FDBS. Categories and Subject Descriptors: D.2.1 [Software Engineering]: Requirements/ Specifications-methodologies; D.2.10 [Software Engineering]: Design; H.0 [Information Systems]: General; H.2.0 [Database Management]: General; H.2.1 [Database Management]: Logical Design--data models, schema and subs&ma; H.2.4 [Database Management]: Systems; H.2.5 [Database Management]: Heterogeneous Databases; H.2.7 [Database Management]: Database Administration General Terms: Design, Management Additional Key Words and Phrases: Access control, database administrator, database design and integration, distributed DBMS, federated database system, heterogeneous DBMS, multidatabase language, negotiation, operation transformation, query processing and optimization, reference architecture, schema integration, schema translation, system evolution methodology, system/schema/processor architecture, transaction management INTRODUCTION tern (DBMS), and one or more databases that it manages. A federated database sys- Federated Database System tem (FDBS) is a collection of cooperating A database system (DBS) consists of soft- but autonomous component database sys- ware, called a database management sys- tems (DBSs).
    [Show full text]