views:

36

answers:

2

Hi there,

Using SQL statements (sybase) how can I create or restore a full database given the conpressed backup file (myDatabase.cmp.bak).

The reason i'm saying create or restore is that the DB already exists but I can drop it before creating it if that's easier.

Do I need to worry about Device files? For example if the backup file used 3 database files each a certain size do I need to create the empty device files first or will that be taken care of during the restore?

I'm doing this from a C# app

Cheers Damien

A: 

Google is a good friend

SaeedAlg
Thanks for the intelligent input SaeedAlg. I believe Stackoverflow is also a good friend
Bob
ur question is clear (is nothing else) u can find it in google in a minute, no one answered ur question because if u read any question answer site agreements u shouldn't ask a question which u can find it in forums or google.
SaeedAlg
A: 

First, a word of warning. You are attempting DBA tasks without reasonable understanding, and without a decent connection to the server.

1 Forget your C# app, and use isql or DBSQL or SQL Advantage (comes with the CD). You will find it much easier.

2 Second, read up on the commands you expect to use. You need a handle on the task, not just command syntax.

--

No, you do not have to change the Device files at all.

Yes, you do need to know the copression and the database allocations of the source (dumped) database. Usually when we transfer dump_files, we know to send the database create statement and the compression ratio with it. The no of stripes are also required but that is easy to ascertain.

If your target db is reasonably similar to the source db, as in, it was once synchronised, you do not need to DROP/CREATE DB , just add the new allocations. But if it isn't, you will need to. The target db must be created with the exact same CREATE/ALTER DB sequence as the source db. Otherwise, you will end up with mixed data/log segments, which prevents log dumps, and deems the db unrecoverable (from the log). That sequence can be gleaned from the dump_file, but the compression has to be known. Hence much easier for the target DBA, if the source DBA shipped the CREATE/ALTER DB and dump commands.

PerformanceDBA