DB2 Questions   «Prev  Next»

DB2 Lock Contention Questions

  1. What is lock contention?

    Answer: To maintain the integrity of DB2 objects the DBD permits access to only on object at a time.
    Lock contention happens if several objects are required by contending application processes simultaneously. To maintain the integrity of DB2 objects the DBD permits access to only on object at a time. Lock contention happens if several objects are required by contending application processes simultaneously.

  2. What is the DBD within the context of DB2?

    Answer: In the context of DB2, DBD stands for Database Descriptor. It is an internal object that contains information about a specific database in the DB2 subsystem. Think of it as a blueprint or a map of the database. It stores details about the database's structure and objects, including:
    • Tablespaces: Storage areas where the database's data resides.
    • Tables: The actual tables within the database and their columns.
    • Indexes: Structures that speed up data retrieval.
    • Table Check Constraints: Rules that ensure data integrity.
    • Referential Integrity Constraints: Rules that define relationships between tables.

    Key points about DBDs:
    • Unique per database: Each database within the DB2 system has exactly one corresponding DBD.
    • Internal object: DBDs are not directly accessible to users; DB2 manages them internally.
    • Critical for operations: DB2 uses DBDs for various operations, including data access, query optimization, and utilities.
    • Dynamic updates: DB2 automatically updates the DBD whenever the corresponding database is created or modified.

    Why are DBDs important?DBDs play a crucial role in DB2's operation:
    • Efficiency: They help DB2 quickly locate and access database objects, improving performance.
    • Data integrity: They store information about constraints, ensuring that data remains consistent and valid.
    • Concurrency: They help manage concurrent access to the database, preventing conflicts between different users or applications.

    Managing DBDs:
    While users don't directly interact with DBDs, it's important to be aware of them, especially for large databases. Large DBDs can potentially impact performance. DB2 provides utilities to monitor and manage DBD size, such as the `MODIFY RECOVERY` utility, which can reclaim storage in the DBD. In summary, the DBD is a fundamental component of DB2 that stores essential information about a database's structure and objects. It plays a vital role in ensuring efficient data access, maintaining data integrity, and managing concurrency.
  3. What is SPUFI?

    Answer: SPUFI stands for SQL processing using file input.
    It is the DB2 interactive menu-driven tool used by developers to create database objects.

  4. What is the significance of DB2 free space and what parameters control it?

    Answer: The two parameters used in the CREATE statement are the PCTFREE which specifies the percentage of free space for each page and FREEPAGE which indicates the number of pages to be loaded with data between each free page.
    Free space allows room for the insertion of new rows.

  5. What is a NULL value? What are the pros and cons of using NULLS?

    Answer: A NULL value takes up one byte of storage and indicates that a value is not present as opposed to a space or zero value. It is the DB2 equivalent of TBD on an organizational chart and often correctly portrays a business situation.
    Unfortunately, it requires extra coding for an application program to handle this situation.

  6. What is a synonym? How is it used?

    Answer: A synonym is used to reference a table or view by another name. The other name can then be written in the application code pointing to test tables in the development stage and to production entities when the code is migrated. The synonym is linked to the AUTHID that created it.

  7. What is an alias and how does it differ from a synonym?

    Answer: An alias is an alternative to a synonym, designed for a distributed environment to avoid having to use the location qualifier of a table or view. The alias is not dropped when the table is dropped.

  8. What is a LIKE table and how is it created?

    Answer: A LIKE table is created by using the LIKE parameter in a CREATE table statement. LIKE tables are typically created for a test environment from the production environment.

  9. If the base table underlying a view is restructured, eg. attributes are added, does the application code accessing the view need to be redone?

    Answer: No. The table and its view are created anew, but the programs accessing the view do not need to be changed if the view and attributes accessed remain the same.

  10. Under what circumstances will DB2 allow an SQL statement to update more than one primary key value at a time?

    Answer: Never. Such processing could produce duplicate values violating entity integrity.Primary keys must be updated one at a time.

  11. What is the cascade rule and how does it relate to deletions made with a subselect.

    Answer: The cascade rule will not allow deletions based on a subselect that references the same table from whichthe deletions are being made.

SEMrush Software 3 SEMrush Banner 3