Information About

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, 29 June 2007

Implicitly Created Database Objects [DB2 9 for z/OS]

Posted on 13:06 by Unknown
Today we continue our series on new features in DB2 V9 with a quick discussion of implicitly created database objects. To understand what this is, let’s first review the way DB2 works today (pre-V9). If you issue a CREATE TABLE statement and do not specify the database and table space into which the table is to be created, DB2 will automagically create a new table space in the default database (DSNDB04).

Not being content with that, DB2 9 extends this capability with the ability to implicitly create additional types of database objects. By coding your CREATE TABLE statement with the proper options you can implicitly create any or all of the following:
  • Database
  • Table space
  • Index to enforce Primary Key uniqueness
  • Index to enforce unique constraint
  • ROWID index (if the ROWID is defined as GENERATED BY DEFAULT)
  • LOB structures (LOB table space, auxiliary table, auxiliary index)

  • OK, so how does this happen? Let’s go down the list. If you fail to specify the IN clause on a CREATE TABLE, DB2 works a bit differently. In the past, DB2 would simply create an implicit table space in DSNDB04. As of DB2 9, the database is involved as well. DB2 will either create an implicit database or use a previously implicitly created database. The names of these implicitly created databases will range from DSN00001 to DSN60000. The first time, DB2 will create DSN00001, the second DSN00002, and so on until we reach DSN60000. The next time, DB2 will wrap around and start again from the beginning, using existing implicitly created databases. For the implicitly created databases, the STOGROUP will be set to SYSDEFLT; buffer pool values are determined via DSNZPARMs.

    Next up is the table space. Although DB2 has supported implicitly created table spaces forever, there are some twists in DB2 9. First of all, you cannot create simple table spaces any longer, so all implicitly created table spaces will be segmented. In compatibility mode (CM), a implicitly created table spaces will be defined as SEGSIZE 4 and LOCKSIZE ROW. After migrating to new function mode (NFM) your implicitly created table spaces will be created as partition by growth table spaces. The options uses will be SEGSIZE 4, DSSIZE 4G, MAXPARTITIONS 256, LOCKSIZE ROW, and LOCKMAX SYSTEM.

    As for the rest of the objects in the list, these system-required objects will always be implicitly created if the table space is created implicitly. For indexes that support the primary key or unique constraints, the names will be generated using a combination of the table name and randomly generated characters.

    OK, so now that you know about the ability of DB2 9 to implicitly create objects, let me give you some advice. Whenever possible, don’t rely on it. It is much better, if at all feasible, for your DBAs to explicitly create and name all database objects as needed. Yes, it takes more time, but it gives you more control. You can explicitly decide which objects go into which database; you can explicitly set paramters; etc.

    So, this is a nice new feature and it can enable DB2 to do some definitional things for you automatically. But most DBAs will want to continue to do things the traditional way, that is, building their DDL themselves without relying on implicitly
    Email ThisBlogThis!Share to XShare to Facebook
    Posted in DB2 9, DDL | No comments
    Newer Post Older Post Home

    0 comments:

    Post a Comment

    Subscribe to: Post Comments (Atom)

    Popular Posts

    • Index on Expressions [DB2 9 for z/OS]
      DB2 9 for z/OS offers, for the first time, the ability to create an index on data that is not technically in the table. At this point, you m...
    • DB2 for z/OS Version 9 Beta Announcement
      On May 2, 2006 IBM announced the beta for the next version of mainframe DB2: namely, DB2 V9.1 for z/OS. You can view the announcement here ....
    • When Not to Index
      Answering a question I got via e-mail on indexing... Every now and then I take the opportunity to blog about a question I get through e-...
    • DBA Rules of Thumb - Part 8 (Being Business Savvy)
      Understand the Business, Not Just the Technology Remember that being technologically adept is just a part of being a good DBA. Although tech...
    • DB2 Locking, Part 8: LOBs and Locking
      When a row is read or modified in a table containing LOB columns, the application will obtain a normal transaction lock on the base table. T...
    • DBA Rules of Thumb - Part 1
      Over the years I have gathered, written, and assimilated multiple collections of general rules of the road that apply to the management disc...
    • Adding Column Names to an Unload File
      I received an e-mail from a reader asking an interesting question. She wanted to know if any of the DB2 unload utilities are able to include...
    • DB2 11 for z/OS: Coming Soon!
      Today, October 3, 2012, IBM announced the Early Support Program for the next version of DB2. Heretofore code-named Sequoia, the DB2 11 ESP i...
    • Can You Write a Redbook?
      If you've been working with mainframes for any period of time you have almost certainly become familiar with the IBM redbook. These are ...
    • INTERSECT and EXCEPT [DB2 9 for z/OS]
      With this blog entry I am introducing a new series in which I will briefly blog about the new feature of DB2 9 for z/OS. Today's entry w...

    Categories

    • .NET
    • ACID
    • ALTER
    • analytics
    • articles
    • automation
    • award
    • backup
    • best practices
    • BETWEEN
    • BI
    • Big Data
    • BIND
    • blogging
    • book review
    • bufferpool
    • buffers
    • CASE
    • change management
    • claim
    • Cognos
    • COMMIT
    • compliance
    • compression
    • conference
    • constraints
    • COPY
    • data
    • data breaches
    • data quality
    • data security
    • Data Sharing
    • data types
    • data warehouse
    • database archiving
    • database auditing
    • database design
    • date
    • DB2
    • DB2 10
    • DB2 11
    • DB2 9
    • DB2 Analystics Accelerator
    • DB2 Catalog
    • DB2 conversion
    • DB2 Developer's Guide
    • DB2 X
    • DB2-L
    • DBA
    • DDL
    • developerWorks
    • dirty read
    • DISPLAY
    • DL/1
    • drain
    • DSNZPARM
    • Dynamic SQL
    • eBook
    • education
    • enclave SRB
    • encryption
    • ERP
    • FETCH FIRST
    • Freakonomics
    • functions
    • generosity factor
    • Happy Holidays
    • Happy New Year
    • Hibernate
    • HIPAA
    • history
    • IBM
    • ICF
    • IDUG
    • IFL
    • IMS
    • index
    • Information Agenda
    • Informix
    • InfoSphere
    • infrastructure
    • integrity
    • IOD
    • IOD11
    • IOD2009
    • IOD2011
    • IODGC
    • IRLM
    • ISOLATION
    • Java
    • JDBC
    • load balancing
    • LOBs
    • locking
    • LUW
    • mainframe
    • Malcolm Gladwell
    • manuals
    • memory
    • middleware
    • migration
    • misc
    • monitoring
    • natural key
    • Netezza
    • new blog location
    • NoSQL
    • nulls
    • OLAP
    • optimization
    • Oracle versus DB2
    • packages
    • PCI-DSS
    • performance
    • PIECESIZE
    • poll
    • primary key
    • production data
    • programming
    • Q+A
    • QMF
    • REBIND
    • recovery
    • RedBook
    • regulatory compliance
    • reliability
    • REORG
    • research
    • RI
    • RTO
    • salaries
    • SAP
    • scalability
    • security
    • smarter planet
    • SoftwareOnZ
    • sort
    • SOX
    • specialty processors
    • SPUFI
    • SQL
    • Stage 1
    • Stage 2
    • standards
    • Steelers
    • storage
    • stored procedures
    • stream computing
    • surrogate key
    • SYSADM
    • Sysadmin
    • table expressions
    • table space
    • TechDoc
    • tips and tricks
    • Top Ten
    • trace
    • training
    • triggers
    • Twitter
    • UDFs
    • UNION
    • unstructured data
    • user groups
    • utilities
    • V1
    • V10
    • V2
    • V3
    • V4
    • V5
    • V6
    • V7
    • V8
    • V9
    • variables
    • views
    • VOLATILE
    • Web 2.0
    • webinar
    • Wordle
    • XML
    • z/OS
    • zAAP
    • zIIP

    Blog Archive

    • ►  2014 (2)
      • ►  January (2)
    • ►  2013 (50)
      • ►  December (6)
      • ►  November (6)
      • ►  October (5)
      • ►  September (5)
      • ►  August (3)
      • ►  July (7)
      • ►  June (4)
      • ►  May (4)
      • ►  April (5)
      • ►  March (1)
      • ►  February (2)
      • ►  January (2)
    • ►  2012 (17)
      • ►  December (1)
      • ►  November (2)
      • ►  October (3)
      • ►  August (2)
      • ►  July (1)
      • ►  May (1)
      • ►  April (1)
      • ►  March (2)
      • ►  February (2)
      • ►  January (2)
    • ►  2011 (27)
      • ►  December (1)
      • ►  November (1)
      • ►  October (6)
      • ►  September (2)
      • ►  August (3)
      • ►  July (2)
      • ►  June (3)
      • ►  May (2)
      • ►  April (3)
      • ►  March (1)
      • ►  February (3)
    • ►  2010 (29)
      • ►  December (1)
      • ►  October (6)
      • ►  September (1)
      • ►  August (2)
      • ►  July (2)
      • ►  June (1)
      • ►  May (3)
      • ►  April (3)
      • ►  March (3)
      • ►  February (4)
      • ►  January (3)
    • ►  2009 (43)
      • ►  December (5)
      • ►  November (4)
      • ►  October (6)
      • ►  September (2)
      • ►  August (1)
      • ►  July (3)
      • ►  June (2)
      • ►  May (3)
      • ►  April (2)
      • ►  March (4)
      • ►  February (5)
      • ►  January (6)
    • ►  2008 (44)
      • ►  December (1)
      • ►  November (4)
      • ►  October (4)
      • ►  September (6)
      • ►  August (1)
      • ►  July (4)
      • ►  June (3)
      • ►  May (5)
      • ►  April (4)
      • ►  March (4)
      • ►  February (2)
      • ►  January (6)
    • ▼  2007 (51)
      • ►  December (2)
      • ►  November (3)
      • ►  October (5)
      • ►  September (3)
      • ►  August (6)
      • ►  July (4)
      • ▼  June (4)
        • Implicitly Created Database Objects [DB2 9 for z/OS]
        • Skipping Locked Rows [DB2 9 for z/OS]
        • Do You Want to Ignore Clustering? [DB2 9 for z/OS]
        • Reordered Row Format [DB2 9 for z/OS]
      • ►  May (5)
      • ►  April (8)
      • ►  March (5)
      • ►  February (4)
      • ►  January (2)
    • ►  2006 (60)
      • ►  November (4)
      • ►  October (8)
      • ►  September (4)
      • ►  August (11)
      • ►  July (7)
      • ►  June (2)
      • ►  May (7)
      • ►  April (3)
      • ►  March (6)
      • ►  February (4)
      • ►  January (4)
    • ►  2005 (11)
      • ►  December (3)
      • ►  November (6)
      • ►  October (2)
    Powered by Blogger.

    About Me

    Unknown
    View my complete profile