Subject Re: [firebird-support] Re: Reorder RDB$Relations for backup
Author Milan Babuskov
binaryseti wrote:
> A bit of background:
> I have a fdb with payment history tables dating back to 1999
> containing between 1.5 and 4 million transactions per year. These
> payment tables do not change (At least the ones less than 2005).
> I cannot move the payment tables to a second fdb
> I have split the fdb into 2GB files on a linux box.
>
> My reasoning:
> I want to restore as many of the payment tables to one mount and the
> other tables to a second mount. I am trying to have one mount that
> does not change and does not need to be defragmented. To do this I
> need the payment tables and transaction logs to be restored first,
> where by restoring them to the first few fdb's. I can then relocate
> them to a separate mount.

I believe you could resolve this problem with FBCopy tool:

1. Do a metadata-only backup of your database

gbak -b -m -v old.fdb meta.fbk

2. Restore it to some new.fdb

gbak -c -v meta.fbk new.fdb

3. Use FBCopy with D option to list tables:

fbcopy d old.fdb new.fdb > 1.txt

4. Edit the 1.txt file and move tables up/down the list, remove those
you don't need, add where clauses if needed, etc.

5. Run the copy job:

fbcopy c old.fdb new.fdb < 1.txt

It will copy the data to new database using the order of tables you
specified in 1.txt file. I think you'll get exactly what you need.
FBCopy is here:

http://fbexport.sourceforge.net/fbcopy.html

HTH

--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org