开发者

Sybase: create a database from a backup file

开发者 https://www.devze.com 2023-01-19 06:59 出处:网络
Using SQL statements (sybase) how can I create or restore a full database given the conpressed backup file (myDatabase.cmp.bak).

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开发者_如何学JAVA 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消