cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to start specified database: dblog.log is an invalid transaction log

0 Kudos

Hi,

I am working on SQL Anywhere 12.

I have created a new db and after several weeks of work when I try to start my db from Sybase Central I get following error:

[Sybase][ODBC Driver][SQL Anywhere]Unable to start specified database: baza1.log is an invalid transaction log

SQLCODE=-82

SQLSTATE=08001

When I am trying to start it from command line I get following logs:

I. 06/27 11:48:01. Starting database "baza1" (c:\baza\baza1.db) at Fri Jun 27 2014 11:48
I. 06/27 11:48:01. Database recovery in progress
I. 06/27 11:48:01.     Last checkpoint at Wed Jun 18 2014 21:15
I. 06/27 11:48:01.     Checkpoint log...
I. 06/27 11:48:02.     Transaction log: c:\baza\backup\baza1.log...
E. 06/27 11:48:03. Error: Database cannot be started -- c:\baza\backup\baza1.log is an invalid transaction log

E. 06/27 11:48:03. Database cannot be started -- c:\baza\backup\baza1.log is an invalid transaction log
I. 06/27 11:48:05. Database server shutdown due to startup error
I. 06/27 11:48:05. Database server stopped at Fri Jun 27 2014 11:48

It happened already 2nd time...

Can somebody tell me what could be the reason or how I can find out what is the reason myself?

Thanks,

ak

Accepted Solutions (1)

Accepted Solutions (1)

chris_keating
Advisor
Advisor
0 Kudos

Please make copies  of the database and transaction log.  The error being reported suggests that the transaction log is damaged. Can you run dbtran on the copied transaction log to see if it reports the same error or something different - if so, please post the error/message.

When you say this is the 2nd time, how did you correct the issue in the previous case?

What is the media that the database file is stored? And the transaction log?

0 Kudos

Hi,

I have copied db and logs.

I run following statement on logs directory:

C:\Users\ADMIN>dbtran -m C:\baza\restore -n c:\baza\restore\restore.sql

and got following messages:

SQL Anywhere Log Translation Utility Version 12.0.1.3994

Processing transaction logs from directory "C:\baza\restore"

Unexpected end of file

Transaction log "C:\baza\restore\baza1.log" starts at offset 0004374867

Transaction log "C:\baza\restore\140512AA.LOG" starts at offset 0000555605

Transaction log "C:\baza\restore\140512AA.LOG" starts at offset 0000555605

Processing transactions from transaction log "C:\baza\restore\140512AA.LOG"

26% complete

Transaction log ends at offset 0001610451

Transaction log "C:\baza\restore\140512AB.LOG" starts at offset 0001610451

Processing transactions from transaction log "C:\baza\restore\140512AB.LOG"

Transaction log ends at offset 0001618728

Transaction log "C:\baza\restore\140521AA.LOG" starts at offset 0001618728

Processing transactions from transaction log "C:\baza\restore\140521AA.LOG"

48% complete

Transaction log ends at offset 0002466045

Transaction log "C:\baza\restore\140528AA.LOG" starts at offset 0002466045

Processing transactions from transaction log "C:\baza\restore\140528AA.LOG"

55% complete

Transaction log ends at offset 0002769821

Transaction log "C:\baza\restore\140617AA.LOG" starts at offset 0002769821

Processing transactions from transaction log "C:\baza\restore\140617AA.LOG"

91% complete

Transaction log ends at offset 0004192045

Transaction log "C:\baza\restore\140617AB.LOG" starts at offset 0004192045

Processing transactions from transaction log "C:\baza\restore\140617AB.LOG"

92% complete

Transaction log ends at offset 0004200322

Transaction log "C:\baza\restore\140617AC.LOG" starts at offset 0004200322

Processing transactions from transaction log "C:\baza\restore\140617AC.LOG"

Transaction log ends at offset 0004208743

Transaction log "C:\baza\restore\140617AD.LOG" starts at offset 0004208743

Processing transactions from transaction log "C:\baza\restore\140617AD.LOG"

Transaction log ends at offset 0004217164

Transaction log "C:\baza\restore\140617AE.LOG" starts at offset 0004217164

Processing transactions from transaction log "C:\baza\restore\140617AE.LOG"

Transaction log ends at offset 0004225441

Transaction log "C:\baza\restore\140618AA.LOG" starts at offset 0004225441

Processing transactions from transaction log "C:\baza\restore\140618AA.LOG"

96% complete

Transaction log ends at offset 0004374867

Transaction log "C:\baza\restore\baza1.log" starts at offset 0004374867

Processing transactions from transaction log "C:\baza\restore\baza1.log"

100% complete

Transaction log ends at offset 0004524313

I have recreated db structure manually previous time - it is my sandbox db and do not have much objects there but I have a batch job which loads data every day.

When it happened first time I thought it is because tran file became too big so I backup db and truncate tran log every week using:

dbbackup -c "DBF=C:\baza\baza1.db;UID=DBA;PWD=***" -y -r C:\baza\backup

It is on my laptop on Windows.

Regards,

ak

jeff_albion
Employee
Employee
0 Kudos

Hello,

Based on the paths mentioned, it seems that you are currently copying around files in a backup / recovery situation? Is that correct? Can you be more clear on what steps you have already performed with these files?


I. 06/27 11:48:01. Starting database "baza1" (c:\baza\baza1.db) at Fri Jun 27 2014 11:48
I. 06/27 11:48:01. Database recovery in progress
I. 06/27 11:48:01.     Last checkpoint at Wed Jun 18 2014 21:15
I. 06/27 11:48:01.     Checkpoint log...
I. 06/27 11:48:02.     Transaction log: c:\baza\backup\baza1.log...

The database is located at 'c:\baza\baza1.db', but the database has a reference to the 'c:\baza\backup' directory for the transaction log. Can you run 'dblog' on the 'baza1.db' file to check the path of the current transaction log? Do you still have the 'c:\baza\baza1.log' file present? Is the "c:\baza\backup\baza1.log" file

You may need to use 'dblog -t" against the database in order to properly locate the current transaction log for the database (if there's still a valid transaction log available). Can you run 'dbtran' against just the 'C:\baza\restore\baza1.log' file to confirm that it cannot be successfully translated?

If all of your copies of the transaction log are no longer translatable, point the database to a transaction log file that doesn't exist on the file system using dblog (or move the current transaction log to another location), and use "dbsrv12 baza1.db -f" to recover the database without the transaction log.

Regards,

Jeff Albion

SAP Active Global Support

0 Kudos

Hi,

when I run dblog I got info:

C:\Users\ADMIN>dblog C:\baza\baza1.db

SQL Anywhere Transaction Log Utility Version 12.0.1.3994

"C:\baza\baza1.db" is using log file "baza1.log"

Does it mean log is in the same directory as db? So: "C:\baza\baza1.log"

I managed to recover db using:

1. point the database to a transaction log file that doesn't exist on the file system using dblog (or move the current transaction log to another location)

2. "dbsrv12 baza1.db -f" to recover the database without the transaction log.

Thank you!

I remember I tried to use dbsrv12 -f before but did not point to non-existing log first and computer kept annoying me that baza1.log is invalid log file

Are there any tools to help find out what was the reason for db failure?

Regards,

Andrzej

jeff_albion
Employee
Employee
0 Kudos

Hi Andrzej,


Are there any tools to help find out what was the reason for db failure?

Both of the tools 'dbvalid' and 'dbtran' can help establish that there was a corruption of the database / transaction log (respectively), but not exactly how it occurred.

Database corruption can come from many sources - from both inside and outside of the database server:

  1. The database server software
  2. The file system
  3. The operating system
  4. The hardware (media / driver)

Taking a look at the actual file bytes would give us a better understanding of what happened.

From your problem description though, it sounds like one of your files might have been mixed up during your backup / restore process. We would then have to try and go back to figure out when the 'other' file was introduced into the process and where it originally came from.

Regards,

Jeff Albion

SAP Active Global Support

Answers (0)