Nonstop Database, HiRDB Version 9 UAP Development Guide

[Contents][Index][Back][Next]

4.19.6 Notes

Depending on the order in which the sequence generator storage RDAREA and the RDAREA storing the table that uses the sequence generator are backed up, there might be duplicate or missing sequence numbers after the database has been recovered.

Organization of this subsection
(1) Case in which there are no duplicate or missing sequence numbers
(2) Case in which there are duplicated or missing sequence numbers

(1) Case in which there are no duplicate or missing sequence numbers

If you back up the sequence generator storage RDAREA and the RDAREA storing the table that uses the sequence generator at the same time, there will be no duplicated or missing sequence numbers.

Figure 4-76 Backing up the sequence generator storage RDAREA and the RDAREA storing the table that uses the sequence generator at the same time

[Figure]

(2) Case in which there are duplicated or missing sequence numbers

(a) When the sequence generator is backed up before the table that uses the sequence generator

There might be duplicated sequence numbers. The following figure provides an example.

Figure 4-77 When the sequence generator is backed up before the table that uses the sequence generator

[Figure]

(b) When the replication facility is used

Sequence numbers might be duplicated.

Sequence generators cannot be used with the replication facility (HiRDB Dataextractor and HiRDB Datareplicator). If sequence generators with the same name are used at the source and the target, sequence numbers might be duplicated because the source sequence generator's current value cannot be inherited to the target.

(c) When the table that uses the sequence generator is backed up before the sequence generator

There might be missing sequence numbers. The following figure provides an example.

Figure 4-78 When the table that uses the sequence generator is backed up before the sequence generator

[Figure]

(d) When logs are used for recovery

If you wish to restore the database to a desired synchronization point after a backup was made or to the most recent synchronization point before a failure, you must restore the backup files and system log files or unload log file. In this case, as many sequence numbers might be missing as the value you set for the log output interval when you defined the sequence generator. The following figure provides an example.

Figure 4-79 When logs are used for recovery

[Figure]

Explanation:
If the unload log file is used to recover sequence generator SEQ1 and the table, and then the NEXT VALUE expression is executed after recovery, the value 21 is obtained from sequence generator SEQ1. The values 17 through 20 are missing because they had not been acquired between the time the backup was made and time the failure occurred.