[comp.databases] moving unify and file.db to different system

ric@Apple.COM (Ric Urrutia) (09/23/89)

Could someone please help me with a problem I'm having porting a unify 
database to a different hardware platform.  Here is the scenario:

1.  Existing file.db is on two raw partitions of 65 meg each
2.  I need to put file.db on a single raw partition on new system
3.  I tried backup and restore unify utitlities (BUDB and REDB) but
    the backup program apparently backs up the unify.db first including
    volume information.
4.  When I go to restore on target system, it restores unify.db first and
    attempts to restore to old partition names.  I really don't want or need
    two volumes for this database.

My question is this

1.	Can I dd file.db onto a cartridge tape and dd onto the new single
	raw partition on target system.

2.	Can I then restore unify.db from a cpio backup, modify volume 
	maintenance and tell set it to a single volume db.

3.	Do I have to modify anything in the file.db header to tell
	it there is only one volume.  If so, is there a UNIFY utility
	that will do this for me.

By the way, I'm running UNIFY 4.0


Any help would be greatly appreciated

Ric Urrutia

cpcahil@virtech.UUCP (Conor P. Cahill) (09/23/89)

In article <34964@apple.Apple.COM>, ric@Apple.COM (Ric Urrutia) writes:
> 
> Could someone please help me with a problem I'm having porting a unify 
> database to a different hardware platform.  Here is the scenario:
> 
> 1.  Existing file.db is on two raw partitions of 65 meg each
> 2.  I need to put file.db on a single raw partition on new system
> 3.  I tried backup and restore unify utitlities (BUDB and REDB) but
>     the backup program apparently backs up the unify.db first including
>     volume information.

The backup utility does backup unify.db, file.db, btrees, and any other 
data portions of the database, however the volume information used by
REDB is actually stored in the tape backup header not within any of the 
files on the backup itself.

> 4.  When I go to restore on target system, it restores unify.db first and
>     attempts to restore to old partition names.  I really don't want or need
>     two volumes for this database.

To solve this problem more information is need. 

	What is the true size of the current database?  Does it fill both
	of the volumes?

		If the database has not spread into the second volume (
		unify places data into the volumes with a first fit mechanism)
		you can just delete the second volume and reconfigure.

	How much free space do you have on the current system?

		If you have enough free space you should delete the raw
		partitions and reconfigure the database.  This will place
		all of the data into the file.db which you can then backup
		and restore.

> My question is this
> 
> 1.	Can I dd file.db onto a cartridge tape and dd onto the new single
> 	raw partition on target system.

the data for the database is not in the file.db.  It is in the two raw
partitions.  so the dd will not help.

> 2.	Can I then restore unify.db from a cpio backup, modify volume 
> 	maintenance and tell set it to a single volume db.

When you change the volume layout in the unify.db it does not take place
until you reconfigure.

> 3.	Do I have to modify anything in the file.db header to tell
> 	it there is only one volume.  If so, is there a UNIFY utility
> 	that will do this for me.

There is no direct unify utility that you can use to do this.  A
database reconfiguration does update the file.db header.


I once wrote a tool for one of my clients that took the place of REDB and
allowed the database administrator to change the volumes as the data
was read in (without having to reconfigure).  It also gave the db
administrator the capability to control which table segments was placed
into which volumes (so the i/o load in the disks could be evened out).



-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+

itkin@mrspoc.Transact.COM (Steven M. List) (10/04/89)

ric@Apple.COM (Ric Urrutia) writes:

>Could someone please help me with a problem I'm having porting a unify 
>database to a different hardware platform.  Here is the scenario:

>1.  Existing file.db is on two raw partitions of 65 meg each
>2.  I need to put file.db on a single raw partition on new system
>3.  I tried backup and restore unify utitlities (BUDB and REDB) but
>    the backup program apparently backs up the unify.db first including
>    volume information.
>4.  When I go to restore on target system, it restores unify.db first and
>    attempts to restore to old partition names.  I really don't want or need
>    two volumes for this database.

>My question is this

>1.	Can I dd file.db onto a cartridge tape and dd onto the new single
>	raw partition on target system.

Yup.  Just like cat, except you'll use tapes as the intermediate step.
Actually, you'll need to dd each part of the database separately, since
file.db will be a device node pointing to the first volume.  So you will
need to dd the entire contents of each disk partition (database volume)
onto a tape, set up the new database (see below) and then retrieve the
contents of each of the old volumes and put them into the new database.
The second tape will be restored with dd seek=nnnn.

>2.	Can I then restore unify.db from a cpio backup, modify volume 
>	maintenance and tell set it to a single volume db.

The trick here will be to set up the new database with two volumes that
correspond in size to the originals.  Since each volume (other than volume
zero) may start at an offset within its disk partition, the second volume
in the new database should be set to start immediately after the first.
Both volumes should be defined to be on the same disk partition.  Once
you've restored the database by copying in the tapes (remembering to
seek for the second volume), you can then change the volume information in
the database header to have only one volume.  Since the reconfiguration
process dumps and reloads the database, the change in volumes should work
fine.

>3.	Do I have to modify anything in the file.db header to tell
>	it there is only one volume.  If so, is there a UNIFY utility
>	that will do this for me.

No, and no.

Call me, Ric, if you need anything more.
-- 
 +----------------------------------------------------------------------------+
 :                Steven List @ Transact Software, Inc. :^>~                  :
 :           Chairman, Unify User Group of Northern California                :
 :     {apple,coherent,limbo,mips,pyramid,ubvax}!itkin@guinan.Transact.COM    :