dbTalk Databases Forums  

How to do a restore.. please help

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


Discuss How to do a restore.. please help in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Yurov Ardyy
 
Posts: n/a

Default How to do a restore.. please help - 09-14-2009 , 03:26 AM






Hi, We have a sybase v6 database, and we use a small script
to backup each night.dbbackup -c "dsn=nma" -y -q
n:\nm_backupthis generates two files one is called
ptadata.edb and one called ptadata.log, i need to restore
the data back, as the database is corrupt. Could someone
please show me how to restore a backup, just the syntax
would be good.

Reply With Quote
  #2  
Old   
Jeff Albion [Sybase iAnywhere]
 
Posts: n/a

Default Re: How to do a restore.. please help - 09-14-2009 , 06:01 AM






Yurov,

Both files stored in "n:\nm_backup" are used for recovery. This is a
"full backup" which includes both files - these two files can be copied
over your original corrupt database.

Steps for restore:

1. Have you validated this backup database to make sure it's not corrupt
also?

copy n:\nm_backup\ptadata.edb c:\restore
copy n:\nm_backup\ptadata.log c:\restore
dbvalid -c "UID=MyUser;PWD=MyPwd;DBF=c:\restore\ptadata.e db"

** If this step fails with an error about the database being corrupted,
you may want to open a case with technical support.

Also, see if the online transaction log is still okay - if it is, you
can use this as part of a later step:

dbtran c:\origdatabase\ptadata.log

2. Make sure you have a *backup copy* of your corrupted database. You
may be able to use it for partial recovery later.

mkdir c:\restore\badcopy
copy c:\origdatabase\ptadata.edb c:\restore\badcopy
copy c:\origdatabase\ptadata.log c:\restore\badcopy

3. Try applying the online transaction log (if it translated okay in Step 1)

dbsrv6 c:\restore\ptadata.edb -a c:\restore\badcopy\ptadata.log

(See:
http://manuals.sybase.com/onlinebook...4577;pt=4577#X
)

4. Make another copy of the restored database - just in case:

mkdir c:\restore\restoreddb
copy c:\restore\ptadata.edb c:\restore\restoreddb
copy c:\restore\ptadata.log c:\restore\restoreddb

5. Try starting it up:

attrib -r c:\origdata\ptadata.edb
attrib -r c:\origdata\ptadata.log
copy /Y c:\restore\ptadata.edb c:\origdata\ptadata.edb
copy /Y c:\restore\ptadata.log c:\origdata\ptadata.log
dbisql -c "dsn=nma"

Regards,

Yurov Ardyy wrote:
Quote:
Hi, We have a sybase v6 database, and we use a small script
to backup each night.dbbackup -c "dsn=nma" -y -q
n:\nm_backupthis generates two files one is called
ptadata.edb and one called ptadata.log, i need to restore
the data back, as the database is corrupt. Could someone
please show me how to restore a backup, just the syntax
would be good.
--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/

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.