dbTalk Databases Forums  

Restoring db

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Restoring db in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Ashmore
 
Posts: n/a

Default Restoring db - 10-21-2009 , 06:55 AM






My db got corrupted yesterday. The problem is that when I
login to my ASP application, it stops the db. I tried
troubleshooting yesterday, but i can't figure this out.
I have a complete backup of a database from last week which
runs fine. If I take the backup db file and somehow
associate or apply the transaction file of the corrupted db,
can I recover all the transactions that have been going on
since last week?

If so, please let me know how to apply the latest
transaction file to the old backup copy of the db.

Thanks

Reply With Quote
  #2  
Old   
John Ashmore
 
Posts: n/a

Default Re: Restoring db - 10-21-2009 , 07:02 AM






Forgot to mention that I'm using Sybase SQL Anywhere 9.0.2

Quote:
My db got corrupted yesterday. The problem is that when I
login to my ASP application, it stops the db. I tried
troubleshooting yesterday, but i can't figure this out.
I have a complete backup of a database from last week
which runs fine. If I take the backup db file and somehow
associate or apply the transaction file of the corrupted
db, can I recover all the transactions that have been
going on since last week?

If so, please let me know how to apply the latest
transaction file to the old backup copy of the db.

Thanks

Reply With Quote
  #3  
Old   
Chris Keating (Sybase iAnywhere)
 
Posts: n/a

Default Re: Restoring db - 10-21-2009 , 07:31 AM



You will use the -a engine switch to apply the transaction log. You must
start with a copy of the backup that has not be started since the backup
(otherwise the transaction log offsets would have changed)

From the product docs:

ASA Database Administration Guide
Backup and Data Recovery
Backup and recovery tasks
Recovering from media failure on the database file

You may want to revisit your backup and recovery plan, once you get past
this issue, and address any deficiencies discovered.

-chris




John Ashmore wrote:
Quote:
My db got corrupted yesterday. The problem is that when I
login to my ASP application, it stops the db. I tried
troubleshooting yesterday, but i can't figure this out.
I have a complete backup of a database from last week which
runs fine. If I take the backup db file and somehow
associate or apply the transaction file of the corrupted db,
can I recover all the transactions that have been going on
since last week?

If so, please let me know how to apply the latest
transaction file to the old backup copy of the db.

Thanks

Reply With Quote
  #4  
Old   
John Ashmore
 
Posts: n/a

Default Re: Restoring db - 10-21-2009 , 07:49 AM



OK, thanks.
Can you please give me the whole command line to do this?

Let's say the backup db is here:
D:\backup\dbfile.db
The latest and corrupted db file and transaction log are
here:
d:\latest\dbfilenew.db + dbfilenew.log
The sql anywhere program is installed here:
c:\sybase9

I suppose I first need to copy the dbfilenew.log to
d:\backup and then run the command line, right?

Thanks.

Quote:
You will use the -a engine switch to apply the transaction
log. You must start with a copy of the backup that has
not be started since the backup (otherwise the
transaction log offsets would have changed)

From the product docs:

ASA Database Administration Guide
Backup and Data Recovery
Backup and recovery tasks
Recovering from media failure on the database
file

You may want to revisit your backup and recovery plan,
once you get past this issue, and address any
deficiencies discovered.

-chris




John Ashmore wrote:
My db got corrupted yesterday. The problem is that when
I login to my ASP application, it stops the db. I tried
troubleshooting yesterday, but i can't figure this out.
I have a complete backup of a database from last week
which runs fine. If I take the backup db file and
somehow associate or apply the transaction file of the
corrupted db, can I recover all the transactions that
have been going on since last week?

If so, please let me know how to apply the latest
transaction file to the old backup copy of the db.

Thanks

Reply With Quote
  #5  
Old   
Chris Keating (Sybase iAnywhere)
 
Posts: n/a

Default Re: Restoring db - 10-21-2009 , 08:28 AM



Assuming that you have only one transaction log, the process is:

1. Create a recovery directory
2. Copy the backup database to that directory
3. Copy the current transaction log (the one that was in use by the
damaged database.
4. Run the following command:

dbeng9 -n RecoveryEng dbfile.db -a dbfilenew.log

John Ashmore wrote:
Quote:
OK, thanks.
Can you please give me the whole command line to do this?

Let's say the backup db is here:
D:\backup\dbfile.db
The latest and corrupted db file and transaction log are
here:
d:\latest\dbfilenew.db + dbfilenew.log
The sql anywhere program is installed here:
c:\sybase9

I suppose I first need to copy the dbfilenew.log to
d:\backup and then run the command line, right?

Thanks.

You will use the -a engine switch to apply the transaction
log. You must start with a copy of the backup that has
not be started since the backup (otherwise the
transaction log offsets would have changed)

From the product docs:

ASA Database Administration Guide
Backup and Data Recovery
Backup and recovery tasks
Recovering from media failure on the database
file

You may want to revisit your backup and recovery plan,
once you get past this issue, and address any
deficiencies discovered.

-chris




John Ashmore wrote:
My db got corrupted yesterday. The problem is that when
I login to my ASP application, it stops the db. I tried
troubleshooting yesterday, but i can't figure this out.
I have a complete backup of a database from last week
which runs fine. If I take the backup db file and
somehow associate or apply the transaction file of the
corrupted db, can I recover all the transactions that
have been going on since last week?

If so, please let me know how to apply the latest
transaction file to the old backup copy of the db.

Thanks

Reply With Quote
  #6  
Old   
John Ashmore
 
Posts: n/a

Default Re: Restoring db - 10-21-2009 , 12:08 PM



Great, it worked!

Thanks!

Quote:
Assuming that you have only one transaction log, the
process is:

1. Create a recovery directory
2. Copy the backup database to that directory
3. Copy the current transaction log (the one that was in
use by the damaged database.
4. Run the following command:

dbeng9 -n RecoveryEng dbfile.db -a dbfilenew.log

John Ashmore wrote:
OK, thanks.
Can you please give me the whole command line to do
this?
Let's say the backup db is here:
D:\backup\dbfile.db
The latest and corrupted db file and transaction log are
here:
d:\latest\dbfilenew.db + dbfilenew.log
The sql anywhere program is installed here:
c:\sybase9

I suppose I first need to copy the dbfilenew.log to
d:\backup and then run the command line, right?

Thanks.

You will use the -a engine switch to apply the
transaction >> log. You must start with a copy of the
backup that has >> not be started since the backup
(otherwise the >> transaction log offsets would have
changed)
From the product docs:

ASA Database Administration Guide
Backup and Data Recovery
Backup and recovery tasks
Recovering from media failure on the database
file

You may want to revisit your backup and recovery plan,
once you get past this issue, and address any
deficiencies discovered.

-chris




John Ashmore wrote:
My db got corrupted yesterday. The problem is that
when >>> I login to my ASP application, it stops the db.
I tried >>> troubleshooting yesterday, but i can't figure
this out. >>> I have a complete backup of a database from
last week >>> which runs fine. If I take the backup db
file and >>> somehow associate or apply the transaction
file of the >>> corrupted db, can I recover all the
transactions that >>> have been going on since last week?

If so, please let me know how to apply the latest
transaction file to the old backup copy of the db.

Thanks

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.