Re: How to copy a database
Posted in 1996
Valery Fouques wrote:
>
> Kevin Brand wrote:
> >
> Do NOT use onload or onunload, since it's not reliable.
> Don't even use 4MM DAT, because it's even less reliable.
> A good method to unload a table (or tables for a database) is this :
> mkfifo fifo
> dd if=fifo|compress|of=table.unl.Z &
> echo "unload to fifo select * from table"|dbaccess database
> After the completion of the unload, you have an unl file in compressed
> format...Since unl files are text files, the compression rate can rise
> up to 10:1 (depends on the contents of your columns).
>
> If you have online 7.20, try and use the ipload, which loads and unloads
> table at a terrific speed....
>
Did I miss the point? I believe the fastest way to copy a database is
as follows.
(1) dbschema to get the database schema
(2) edit the schema file any way you want
(3) create the new database using the new schema file
(4) access the old database and do the following for each table (or put
all of them into an sql file).
insert into _new_database_:table
select * from table;
Chao