Re: Restoring a single table
Posted in 1997
bowman@uthscsa.edu wrote: > > I'm running Informix SE 7.01. I have a situation where I need to restore > a table into a working area, but not disturb the actual production table. > I've gotten the .dat and .idx files restored into a temp directory. Is > there any way to create a database and table in this working area and > have the data restored from the .dat file? I've restored data this way > before, but always into the original database. > > Any answers, even 'no, dummy, you can't' greatly appreciated. Yes. This is one of the cool tricks you can do with SE. I'd move the *.dat and *.idx files into somewhere other than /tmp first of all. There is actually nothing wrong with renaming them and putting them into your database.dbs directory. Then, use the schema for the original table, and use that to create a new table. Then query systables for the *new* table name, and update that record modifying systables.dirpath to point to the files you restored (not including the .dat extension). Include the full path if you didn't put these files into your database.dbs directory. Now you can access the data from your backed up files via this newly created table. When you're done, just drop the new table. I end up doing this from time to time when users overwrite information in the database. I pull the table off a backup, and extract the information they need out of these backup files by attaching them to a temporary table. -- ----------------------------------------------------------------------- Daniel James - Database Administrator djames@statsci.com DAPD Div of MathSoft (formerly StatSci) (206) 283-8802 x284