Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!wuarchive!gem.mps.ohio-state.edu!usc!ucsd!ucbvax!hplabs!pyramid!infmx!aland
From: aland@infmx.UUCP (Dr. Scump)
Newsgroups: comp.databases
Subject: Re: Duplicating Informix SQL Database
Summary: check systable.dirpath entries for explicit pathnames beforehand
Keywords: Informix SQL SCO Xenix [ugh!]
Message-ID: <2404@infmx.UUCP>
Date: 23 Sep 89 20:52:30 GMT
References:
Reply-To: aland@infmx.UUCP (alan denney)
Organization: INFORMIX Professional Services ("Peace thru Normalization")
Lines: 45
In article emuleomo@yes.rutgers.edu (Emuleomo) writes:
>
>Can anybody please tell me how I can *completely* duplicate an entire
>Informix Sql database.???
>
>I tried copying the contents of the ".dbs" directory to another directory
>and the changing DBPATH so that I pick up the copy. That seemed to work
>fine, until I DROPPED the copy, and LO and BEHOLD, it dropped some tables
>in the original database!. However, the entire 'copy' database was dropped
>as expected!
>Any help will be GREATLY appreciated!
>Thanx
>--Emuleomo O.O. (emuleomo@yes.rutgers.edu)
Sounds like you had some tables which had explicit pathnames in the systables
catalog table. Since you copied the catalog contents along with the data
table contents, the systables catalog still points to the same physical C-ISAM
file (in the old database). When you drop the table, the engine checks
systables to locate the physical file, and away it goes!
To duplicate a database in the standard engine, you can recopy the whole .dbs
directory structure to your new location. HOWEVER, you must make the following
safety checks:
1) did the .dbs and files come out as owner=creating DBA, group=informix
permissions 660 (770 on the directory itself)? If not, fix using
chgrp (as root) and chmod.
2) check all values for systables.dirpath. If any contain explicit full
pathnames, they will probably need to be changed. (You will also need
to recopy those files from their given location, since they weren't in the
.dbs; or if they were in the same .dbs directory and they were copied to
your new .dbs, just strip out the pathname.) Change carefully (as
creating DBA) using regular UPDATE statement:
UPDATE systables set dirpath = ""
WHERE tabname = ""
To duplicate a database in the TURBO engine, use the DBEXPORT and DBIMPORT
utilities to copy to / load from flat files.
--
Alan S. Denney @ Informix Software, Inc.
{pyramid|uunet}!infmx!aland "I want to live!
-------------------------------------------- as an honest man,
Disclaimer: These opinions are mine alone. to get all I deserve
If I am caught or killed, the secretary and to give all I can."
will disavow any knowledge of my actions. - S. Vega