Try   HackMD

Day 22: Informix(3)

Concept

  • StackOverflow-Dirty Read
    Transaction isolation levels relation with locks on table

  • RDBMS - 錯誤讀取現象及交易隔離層級原理介紹與舉例

    當有兩個交易 (TX) 進行的時候,其中一個 TX 可以讀取另一個還未 committ 的 TX 在這段時期做的資料改動。

  • Use case
    IBM-Using the Dirty Read Isolation Level

    When you use High Availability Data Replication,
    the database server effectively uses Dirty Read isolation on the HDR Secondary Server,
    regardless of the specified SET ISOLATION or SET TRANSACTION isolation level,
    unless the UPDATABLE_SECONDARY configuration parameter is enabled.
    For more information about this topic,
    see Isolation Levels for Secondary Data Replication Servers.

  • Performance Guide
    Dirty Read isolation

  • Summary

    • Dirty Read 現象:

      Image Not Showing Possible Reasons
      • The image file may be corrupted
      • The server hosting the image is unavailable
      • The image path is incorrect
      • The image format is not supported
      Learn More →

      Source: Dirty Read isolation

    • 既然會造成問題,那為什還要使用?

      • 如果每次讀last commit,會造成負擔(效能不佳)
      • 建表: create 不需所有資料即可進行

資料庫異動

新增/刪除(Create/Drop)
Note 刪除 年月

Example:

  • 新增:

    • 使用 dbschema 查看之前建的Table定義

      ​​​​​​​​dbschema -d [dbname] -t [tablename]
      
    • Java - SQLgen

      ​​​​​​​​java SQLgen yyyyMM
      

      PS: generate SQL 的程式是由謝師傅所開發,超讚!

  • 刪除:

    • Notice

      • Drop 的 Table 通常不是最近的月份(避免誤刪!)
    • SQL

      ​​​​​​​​database dbName@serverName;
      ​​​​​​​​-- database [db name]@[instance];
      ​​​​​​​​drop table tableName;
      
師承謝門