cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot open transaction log file -- Can't use log file "database.log" since the offsets don't match

Former Member
20,384

My database will not start due to the specified error, what can i try to fix this or start a new transaction log? I am using Sybase anywhere 9m also I am a sybase noob! any help would be greatly apprecaited. Thanks

Cannot open transaction log file -- Can't use log file "database.log" since the offsets don't match the offsets in the database file

Accepted Solutions (1)

Accepted Solutions (1)

jeff_albion
Advisor
Advisor

The database file (e.g. 'database.db') is paired with a secondary file, known as the transaction log (e.g. 'database.log'). The transaction log records all SQL operations that change data in the database. It is expected that this file is maintained concurrently with the database.

The error you are reporting is suggesting that these files are out of synch. To check the current offsets, you can use the 'transaction log (dblog)' utility:

C:\\>dblog demo.db
Adaptive Server Anywhere Transaction Log Utility Version 9.0.2.3951
"demo.db" is using log file "demo.log"
"demo.db" is using no log mirror file
Transaction log starting offset is 0000430509
Transaction log current relative offset is 0000086674

C:\\>dblog demo.log
Adaptive Server Anywhere Transaction Log Utility Version 9.0.2.3951
File "demo.log" is a transaction log file
File version is 41
Log starts at offset 0000430509
Log ends at offset 0000517183
Log contains 64 pages with a page size of 2048 bytes
86674 bytes in use (66.13%), 44398 bytes free (33.87%)

These two offsets in this output should match.


In the event that they don't match, you should move the transaction log to a different location and allow the database to generate a new one, by starting the database with the '-f' recovery option.

VolkerBarth
Contributor

Just a warning:

Note that some technologies (SQL Remote, MobiLink clients) rely on the current transaction log. In such cases, forcing the database server to generate a new transaction log could break the functionality. Cf. the following doc...

Former Member
0 Kudos

Thanks for the input, now i have to learn how I can automate my transaction log file size. My DB is 4gig and my transaction log is 65gigs.

VolkerBarth
Contributor
0 Kudos

Cf. this question...

Former Member
0 Kudos

Thanks again!

Former Member
0 Kudos

I ended up using:

dbbackup -c "uid=dba;pwd=sql;eng=database;dbn=database" -xo

Worked like a charm!

Answers (3)

Answers (3)

0 Kudos

I found the solution:

In Sybase Central exist the option "Translate log File". This process pass the info into sql file.

justin_willey
Participant
0 Kudos

Glad you were able to solve it - the command line utility dbtran.exe can be a useful way of doing that.

0 Kudos

I'm using Adaptative Server Anywhere9 Ver. 9.0.2.3951

I'm trying to read information from the file. Log generated by the database, but not as open or program can do this.

0 Kudos

How i read this file, o how program i cant open this?.

justin_willey
Participant
0 Kudos

You'll need to provide a bit more information for someone to help you. What file? What are you trying to read it with?

Are you sure its a SQLAnywhere database - if it is you can't "read it", you have to start a database engine and then talk to it with a client application. If you are using SQLAnywhere, be sure to mention which version.

You are probably better off to ask a new question - its more likely to get noticed than as an addition to an already answered one.