Subject Re: Restore problem
Author Maurice Ling
Hi Helen,

Thanks for the pointers. This works:

zmling2:~/MyProjects/Muscorian/BioDatabases mauriceling$ gbak -R -user
mouse -password mouse muscopedia.311005.1 muscopedia.311005.2
muscopedia.fdb 500000 muscopedia.fd2 500000 muscopedia.fd3 500000
muscopedia.fd4 500000 muscopedia.fd5 500000 muscopedia.fd6 500000
muscopedia.fd7 500000 muscopedia.fd8 500000 muscopedia.fd9

In my SQL that creates the database, I've specified the page size to
be 4096, so gbak somehow reads that page size and multiply it by
500000 to give a max file size of 2GB?

My database creation DDLs are as follows:
create database 'muscopedia.fdb'
user 'mouse' password 'mouse'
page_size 4096
length 500000;
alter database add file 'muscopedia.fb2' starting at page 500001
length 500000;
alter database add file 'muscopedia.fb3' starting at page 1000001
length 500000;
alter database add file 'muscopedia.fb4' starting at page 1500001
length 500000;
alter database add file 'muscopedia.fb5' starting at page 2000001
length 500000;
alter database add file 'muscopedia.fb6' starting at page 2500001
length 500000;
alter database add file 'muscopedia.fb7' starting at page 3000001
length 500000;
alter database add file 'muscopedia.fb8' starting at page 3500001
length 500000;
alter database add file 'muscopedia.fb9' starting at page 4000001
length 500000;
commit;

Also Helen, why is -C[reate database] more desirable than -R[estore]
switch?

Thanks
Maurice

--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
>
> At 02:33 AM 1/11/2005 +0800, Maurice Ling wrote:
> >Hi,
> >
> >Can someone please tell me what is wrong with this command, I
cannot get
> >it working but I don't see the problem....
> >
> >zmling2:~/MyProjects/Muscorian/BioDatabases mauriceling$ gbak -c -R
>
> Mutually exclusive switches - use either -c (preferable) or -R
> (undesirable) but not both. Still, it looks as though gbak is
ignoring one
> of them, though, since it's reporting a later error.
>
> >-user mouse -password mouse muscopedia.311005.1 muscopedia.311005.2
> >muscopedia.fdb 2G
>
> That's the wrong way to specify database file sizes - it's only
valid in
> -backup, for specifying backup file sizes. Needs to be an integer -
the
> number of PAGES. So, if you want to specify files with a 2 Gb limit,
> divide (2 * 1024 * 1024 * 1024) by the page size in bytes and round
DOWN to
> an integer.
>
> >muscopedia.fb2 2G muscopedia.fb3 2G muscopedia.fb4 2G
> >muscopedia.fb5 2G muscopedia.fb6 2G muscopedia.fb7 2G muscopedia.fb8 2G
> >muscopedia.fb9
> >gbak: ERROR: size specification either missing or incorrect for file
> >muscopedia.fdb
> >gbak: Exiting before completion due to errors
> >zmling2:~/MyProjects/Muscorian/BioDatabases mauriceling$
>
>
> Also, if you are planning to do this in a batchfile, put in full
path specs
> for all files (both backup files and database files).
>
> Tip: if you plan to do the wise thing and use the -c[reate_database]
> switch to restore to a temporary location, you can use Ivan Prenosil's
> glink tool to update the successfully recreated database's path
links when
> you copy it to the live location and replace the old db. Link for this
> tool is www.ibphoenix.com/downloads/glink.zip
>
> When doing this, remember that gbak runs inside a single snapshot
> transaction, so the restored database won't contain any changes that
were
> done since the backup was started.
>
> ./heLen
>