Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Posts
    2

    Unanswered: db2 shutdown after calling a sequence

    hi,

    after i call this sql statement "values nextval for test", i get a return value, but right after my db2 shutdown.

    db: db2 v7.1
    os: redhat 8.0

    any solution for this? thx

  2. #2
    Join Date
    Feb 2003
    Location
    Germany
    Posts
    20
    Hi,
    have you upgraded to the latest fix-pack of your db2 version?

    I had the same problem, but it was gone after I upgraded to the latest fix-pack and then recreated the database with sequences. Converting the database after the upgrade doesn't seem to work (if I remembercorrectly).

    I don't know for which purpose you use the sequences, but if you are using them for automatic PK, try Identities.

    Jürgen

  3. #3
    Join Date
    Apr 2003
    Posts
    191
    Hi Jürgen,

    I had trouble with sequences in 7.1 on RedHat too. Did not try again after fixpacks came out. Are you positive they fixed the sequences? And is recreating the database necessary? Which fp are you on?

    Our shop has AIX boxes mostly, but lately they turned attention to DB2/Linux, and we are about to migrate a small installation of SAP/R2 to R3 on that platform.

    Personally, I don't like using sequences or identities for PK generation very much. Sequences are not bound to a table, so bugs in the db software or in applications may make them get out of synch and it was my impression you probably can't easily fix something like this. With identities there is the problem of data transfert, say for example you have a large table with identities generated always ... etc., then you extract a portion of that table to another table - say that accountant's work table - and delete the data from the large table. The accountant fixes his data and wants the rows transferred back. Basically, the identities should not get changed again.

    Did you encounter problems like that with identities?

    Johann

    Originally posted by hernst
    Hi,
    have you upgraded to the latest fix-pack of your db2 version?

    I had the same problem, but it was gone after I upgraded to the latest fix-pack and then recreated the database with sequences. Converting the database after the upgrade doesn't seem to work (if I remembercorrectly).

    I don't know for which purpose you use the sequences, but if you are using them for automatic PK, try Identities.

    Jürgen

  4. #4
    Join Date
    Feb 2003
    Location
    Germany
    Posts
    20
    I use fixpack 8 and there the sequences seem to work.

    I switched to identities, as the application we developp must run on various database (MySQL, Oracle, DB2, SQL-Server). And an autoincrement of PK is what we needed also for DB2 (best without any triggers)

    f you use generated by default (not always) the PK of that rows don't change and you can transfer the rows back to that original table, if no additional rows have been added by the accountant, else you must ensure that that PK does not exists and the PK is not lager than the current value of the identity.

    We use a pk definition like:
    "PK" int GENERATED BY DEFAULT AS IDENTITY ( START WITH 100000 ) not null

    So it is possible to set the PK by hand, or if PK is not set in the insert, the PK is automaticly added by the database.

  5. #5
    Join Date
    May 2003
    Posts
    2
    hi,

    we fixed the problem with updating to the latest fixpack.

    thx for helping!
    Last edited by igolla; 05-08-03 at 05:59.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •