cancel
Showing results for 
Search instead for 
Did you mean: 

undo reorganizing transaction log files (DBREMOTE -X)

Baron
Participant
0 Kudos
2,987

We are using SQL-Remote for replicating 2 databases.

DBREMOTE -X had for any reason reorganized transaction log files, which are not replicated to server.

In other words, sysremoteusers on remote has (log_send = 40k, log_sent=38k, confirm_sent=30K), and the main transaction log file starts from offset 40k.

Error message of DBremote:

I. 2017-06-20 09:53:38. Scanning logs starting at offset 0038180596 
E. 2017-06-20 09:53:38. No log operation at offset of 0038180596 in the current transaction log
E. 2017-06-20 09:53:38. Sending messages failed.
the looking for offset is no more in the main transaction log file, but it is existing in the reorganized transaction log file.

Question: what is the reason that the DBremote has reorganized offset which are not confirmed from consolidated?

Question: is it possible to undo this reorganization, (i.e. merge the two transaction log files together).

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

regdomaratzki
Product and Topic Expert
Product and Topic Expert

The is no operation at offset 38180596 in the log, and there is no other transaction log in this directory that contains this log offset. The only possible explanation is that at some point, dbremote scanned a transaction log for this remote database that contained a transaction log that did have an operation that began at offset 38180596. It will have been a commit, and would have been the last thing scanned by dbremote in that run. dbremote will have sent a message to the consolidated database with this operation. Before dbremote ran again, the remote database will have been incorrectly restored from a backup, and after the restore, the current log offset will have been less than 38180596. dbremote will have then run, and picked up a confirmation message from the consolidated confirming that offset 38180596 had been applied at the consolidated. However, different operations will now be in the transaction log, and this remote database is now hopelessly broken. Operations have been sent and applied at the consolidated database that no longer exist at the remote database. While it is theoretically possible to fix the offsets so that messages can be applied again, the data between these two database is no longer in synch, so a re-extraction of the remote database is likely your easiest option.

Breck_Carter
Participant

> a re-extraction of the remote database is likely your easiest option

To all: There are decades of experience behind that wise advice.

Baron
Participant
0 Kudos

one small question: Is this expression correct? online transaction log file = the main transaction log file. offline transaction log file = the renamed transaction lof files.

VolkerBarth
Contributor
0 Kudos

Basically yes.

This is seen from a DBREMOTE point of view: As SQL Remote must have connected to the database in order to apply messages and scan the active log, the database must be running, and therefore the active transaction log is "online". "Offline" logs are renamed older logs, either renamed via DBREMOTE -x or via a backup or simply by renaming the log when the database is not running (the latter not necessarily recommended:)).