Skip to main content
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    Oracle error: io_sequence_next; ORA-02289: sequence does not exist

    • Article Type: General
    • Product: Aleph
    • Product Version: 20, 21, 22, 23

    In the pc_server log, these series of errors display:
    Oracle error: io_sequence_next
    ORA-02289: sequence does not exist
    Oracle error: io_znn_write
    ORA-00001: unique constraint (xxx50.Znn_ID) violated

    where "io_znn_write" is: io_z309_write, io_z31_write, io_z45_write, io_z601_write, or io_z71_write. And "xxx50" is your ADM library.
    What do we do about this error?

    This error indicates that the last_record_sequence is not defined in the $pw_library.
    This sequence is used by the five tables shown above as part of their record key (to make the key unique). (*See more in Additional Information below.)  The last_record_sequence is in the delivered ./aleph/tab/file_list.PW $pw_library file_list template and looks like this:
    SEQ last_record_sequence
    If you have a $pw_library file_list, you should add the above line to it.
    If your $pw_library file_list is blank and you are using the default ./aleph/tab/file_list.PW, it already has this line.
    What you *do* need to do in either case is:
    > dlib abcde <where "abcde" is your $pw_library>
    > util a, 17, 9 ("Sequences")
    > Enter sequence name to Create (all/sequence-name): all
    To verify that the sequence has been created successfully, do:
    > s+ abcde <where "abcde" is your $pw_library>
    abcde@ALEPH20> select SEQUENCE_OWNER, SEQUENCE_NAME from all_sequences where SEQUENCE_OWNER like 'ABC%';
    **** Hit return to continue ****
    ------------------------------ ------------------------------

    Note: The "Create/recreate all library sequences" is a standard step in the "How To Open a Library" procedures, but is sometimes overlooked.

    Additional Information

    In each case (io_z601, io_z309, etc.) the io_sequence_next routine is used to populate the last 7 bytes of the 15-byte Znnn-SEQUENCE component of the record key -- with the first 8 bytes being the date in yyyymmdd format.  Thus, the only thing which is important is that the sequence's last_number be unique within that particular day.  And if the last_record_sequence value is lost and the sequence needs to be recreated, it is fine for it to start at "1".

    • Article last edited: 24-May-2016