© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective.

Slides:



Advertisements
Similar presentations
Data Definition and Integrity Constraints
Advertisements

CIT 613: Relational Database Development using SQL Revision of Tables and Data Types.
9 Creating and Managing Tables. Objectives After completing this lesson, you should be able to do the following: Describe the main database objects Create.
Data Definition Language (DDL)
Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
1 SQL Server Management Studio SQL DDL CREATE TABLE Constraints ALTER TABLE DROP TABLE The GUI way Steen Jensen, autumn 2013.
The Online Schema (R)evolution Ken McDonald BMC Software Written by Steven Thomas.
Database Basics I101 Summer 2006 Copyright 2004, Matt Hottell.
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
Sanjay Goel, School of Business, University at Albany, SUNY 1 SQL- Data Definition Language ITM 692 Sanjay Goel.
Introduction to Structured Query Language (SQL)
SQL components In Oracle. SQL in Oracle SQL is made up of 4 components: –DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE. Creates / Alters.
Introduction to Structured Query Language (SQL)
Database Management System LICT 3011 Eyad H. Elshami.
Unicenter NSM r11 Windows -SNMP Polling Analysis.
Database Constraints. Database constraints are restrictions on the contents of the database or on database operations Database constraints provide a way.
Oracle Data Definition Language (DDL)
Oracle Database Administration Database files Logical database structures.
CHAPTER 11 Large Objects. Need for Large Objects Data type to store objects that contain large amount of text, log, image, video, or audio data. Most.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Database Administration TableSpace & Data File Management
Database Design lecture 3_1 1 Database Design Lecture 3_1 Data definition in SQL.
Configuring Identity Manager 2 (formerly DirXML ® ) for JDBC (w/DirXML) Jason Elsberry Software Engineer
Oracle Data Definition Language (DDL) Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
M1G Introduction to Database Development 2. Creating a Database.
© Copyright 2014 BMC Software, Inc.1 — Chief Architect for DB2, BMC IBM Information Champion 2015 May / 2015 Jim Dee Stop Wasting Time With Utilities!
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
SCUHolliday - coen 1788–1 Schedule Today u Modifications, Schemas, Views. u Read Sections (except and 6.6.6) Next u Constraints. u Read.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
SQL Server 2005 Implementation and Maintenance Chapter 3: Tables and Views.
Best Practices for Implementing Unicenter Asset Portfolio Management r11.2 in an HA MSCS Environment -Part I: Installing UAPM Optional Components Draft.
Sql DDL queries CS 260 Database Systems.
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
Session 1 Module 1: Introduction to Data Integrity
© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective.
Creating Indexes on Tables An index provides quick access to data in a table, based on the values in specified columns. A table can have more than one.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
Federated MDBs with Multiple SQL Instances Last Revision Date: September 6, 2006.
Table Structures and Indexing. The concept of indexing If you were asked to search for the name “Adam Wilbert” in a phonebook, you would go directly to.
Chapter 3 Table Creation and Management Oracle 10g: SQL.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
Physical Model Lecture 11. Physical Data Model The last step is the physical design phase, In this phase data is – Store – Organized and – Access.
Views / Session 3/ 1 of 40 Session 3 Module 5: Implementing Views Module 6: Managing Views.
Database Constraints Ashima Wadhwa. Database Constraints Database constraints are restrictions on the contents of the database or on database operations.
Web Systems & Technologies
Fundamental of Database Systems
Chapter 5 Introduction to SQL.
Managing Tables, Data Integrity, Constraints by Adrienne Watt
Data Definition and Data Types
Insert, Update and the rest…
SQL Creating and Managing Tables
DB2 Partitioning Choices, choices, choices
ISC440: Web Programming 2 Server-side Scripting PHP 3
SQL Creating and Managing Tables
SQL Creating and Managing Tables
Managing Objects with Data Dictionary Views
Microsoft SQL Server 2014 for Oracle DBAs Module 7
Oracle Data Definition Language (DDL)
Managing Tables.
Clustered Columnstore Indexes (SQL Server 2014)
Chapter 2: Creating And Modifying Database Tables
Data Definition Language
-Transactions in SQL -Constraints and Triggers
SQL (Structured Query Language)
Presentation transcript:

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. 1 DB2 Version 8 for z/OS On-Line Schema Evolution Phil Grainger Computer Associates

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Agenda  What is On-Line Schema Evolution?  What can you ALTER?  How does it work?  What is not yet supported?  Discussion

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Disclaimer This presentation has been written from documentation from IBM that existed in May 2003 and also takes some examples from early experiences with Version 8 itself Neither of these sources of information is guaranteed to be consistent with the final Generally Available version of Version 8 To quote IBM “this information will …..become progressively less correct as time goes by”! And there are already changes in DB2 that differ from this presentation!

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Disclaimer (2) Also…. At the time this presentation was written, not all of the promised functionality had yet been delivered So, some of the examples have NOT actually been tried against a real Version 8 subsystem (And those that have been tried didn’t all work!)

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Online schema changes  Ultimate aim – to reduce the outage necessary when making schema changes  Make everything possible with an ALTER  The next few pages show what is possible new in Version 8

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Online schema changes  Extension of CHAR(n) column lengths  Changing within character datatypes (CHAR/VARCHAR)  Changing within numeric datatypes (SMALLINT/INTEGER/FLOAT/REAL/FLOAT DOUBLE/DECIMAL)  Changing within graphic datatypes (GRAPHIC/VARGRAPHIC)  Including support for datatype changes of columns referenced in views and indexes

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Online schema changes  Add column(s) to existing indexes  Drop a partitioning index  Alter the clustering index  Change variable indexes PADDED/NONPADDED  Alter of identity columns  Add partition to table  Rotate partitions  Automatic partition rebalancing during REORG  Ease restrictions on indexes in restrictive states

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Datatype Changes  ALTER TABLE table-name ALTER COLUMN column-name SET DATATYPE new-data-type  There is no impact on table availability –Tablespace is in Advisory REORg Pending (AREORP)  New data is stored in the new format –Old data is converted when it is referenced  So there will be a performance penalty –Consider a REORG as soon as possible

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Datatype Changes  BUT when an indexed column is altered and the altered column is a numeric datatype:  Availability of the index is delayed –The sequencing of the data may be affected –The performance overhead would be too great  Index(es) are placed in ReBuilD Pending (RBDP)  However, for dynamic SQL –Deletes are allowed against the base table –Updates/Inserts are allowed provided all RBDP indexes are non- unique –Selects will not consider RBDP indexes for access paths

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Datatype Changes  Plans/Packages and cached dynamic statements are all invalidated  All views are regenerated immediately –All plans/packages/cached dynamic statements on regenerated views are invalidated

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Index Changes  Columns can now be added TO THE END of an existing index  However, there may be availability implications –If the column is added to the table and the index in the SAME unit of work, only AREOP is set –Otherwise RBDP is set to force a rebuild of the index –UNLESS the index is not yet defined (DEFINE NO) in which case no restrictive state is EVER set

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Index Changes  Varying length columns in indexes can now be PADDED or NOT PADDED  For new V8 installations, the default is NOT PADDED –For migrations from V7 the default is PADDED –This is defined in ZPARM (DEFIXPD)  This alter always places the index in a pending state if there are varying columns in the index

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Index Changes  Indexes can now have the CLUSTER attribute altered  When a new CLUSTERING index is defined with an alter, new rows are immediately ‘placed’ accordingly  Obviously old rows will not be relocated until a REORG happens

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Versioning  All of this on-line schema stuff is handled internally by ‘versioning’  Each ALTER that requires new data storage for an object creates a new version –However all ALTERs in the same unit of work can be amalgamated into the same new version  A tablespace can have up to 256 active versions –An index can only have 16  Active includes all those versions currently in use AND all those in image copies in SYSCOPY –Exceeding the maximum number of versions will result in a –4702

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Versioning  Version information is contained in the DB2 catalog  As well as in the pagesets themselves –New COPY keyword SYSTEMPAGES YES will force this information to be copied for incrementals  Be VERY careful of versions if using DSN1COPY to move data between objects/subsystems

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Versioning  Versions can be ‘reclaimed’ in one of two ways  REORG/REBUILD/LOAD of a non-copyable index reclaims ALL versions  Otherwise MODIFY will reclaim all versions NOT currently being used by the object OR any of it’s image copies in SYSCOPY

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Restrictions  So far so good, but none of this works for:  ROWID, DATE, TIME, TIMESTAMP or BIT DATA columns  Columns included in referential constraints  Columns with EDITPROCs ot VALIDPROCs  The column is in a table referenced in a Materialised Query Table  The column is an IDENTITY column

© 2003 Computer Associates International, Inc. (CA). All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. Bibliography  Keep up to date with the IBM web site  Also the Version 8 Technical Preview (SG )