Adding a GENERATED ALWAYS Column to a Table

You may also like...

7 Responses

  1. Isaac Munoz says:

    Excellent solution Ember.. thanks for sharing it.

    It would be good if later when you find out the root cause for the locking issue you also share it with us… I don’t have the full picture but would it be possible DB2_SKIPINSERTED, DB2_SKIPDELETED and DB2_EVALUNCOMMITTED make a difference ?.


  2. Chang-ho Song says:

    Hi ember !
    I’m newbie db2 engineer in South Korea
    I visit daily.
    All article on this site is excellent for me
    I want to post your article on my blog to share with db2 user in South Korea
    Can I do this ? : D

    • Ember Crooks says:

      Are you translating the article? If not, I’d prefer you just link to the article. If you are translating it, I’d be happy for you to re-post, and include a link to the original.

      • Chang-ho Song says:

        I will translate your article into Korean as much as possible and include a link to the original.
        Thank you for your kindness, Ember : )

  3. raju says:

    Hello Ember,

    how to migrate db2 database in different Operating systems..

    Here my task is..
    I have Linux based db2 db backup image ,I need to restore windows server..

    could you please provide me pre migaration and migration steps..

    db version is V9.7 .

    is there any tools, To migrate database in different platforms…?

    • Ember Crooks says:

      You cannot backup/restore across platforms. So the best option is generally to use db2look and db2move in a manner something like this:

      1. db2look on old database (use alternate delimiter if any triggers or stored procedures)
      2. db2move export on old database
      3. split db2look into 2 sections before foreign keys and everything after foreign keys
      4. create database on target and run first section of db2look
      5. db2move load on new database (or load data some other way – data conversion workbench may also be an option, or loads from cursor, manually scripted)
      6. run second section of db2look

      Keep a close eye on triggers and stored procedures to make sure they’re accurately re-created. Stored procedures written in anything other than SQL may be problematic, and require that the files for them be moved manually.

      All of this takes longer than backup/restore and is more risky – you have to be very detail oriented to make sure you get everything.

  1. March 5, 2015

    […] Adding a GENERATED ALWAYS Column to a Table […]

Leave a Reply

Your email address will not be published. Required fields are marked *