Re: Restoring a single table
Posted in 1997
Hi Sheila!
I believe the following may help:
1: Using DB-schema, create the SQL statement to recreate the table; I'm
presuming
that this table is a replica of one currently in your production database,
otherwise you may have to write the statement yourself from scratch/memory.
2: Using I-SQL or DB-access, create a test database (worktemp or some other
name)
and run the SQL statement from 1: above to recreate an empty new table
with the
same structure of the table you're gonna be restoring the data from.
3: Using the following SQL statement, determine the name of the .dat and
.idx files
associated with the newly created table:
select * from systables where tabname = "<new_table_name>"
I can't remember the column name for this info, dirname or something else.
4: Using the cp command (UNIX is presumed to be the OS), copy your .dat
file you're
restoring from (hereafter called the SOURCE) to the worktemp.dbs
directory; then
use the mv command to rename it to the filename you got in step 3: above
(hereafter called the DEST).
5: Use the rm command to delete the associated .idx file of DEST.
6: Using DB-access or I-SQL again, recreate and index on any of the
columns, or
run the Informix script to check indexes (secheck?); this would recreate
a new
.idx for your newly created table.
7: You should now be able to query your newly created table.
If this doesn't work, then step 4: above would ensure that your original
SOURCE .dat file would remain intact, since you are working with a copy in
subsequent steps.
Hope this helps!
At 02:09 PM 7/16/97 EDT, you 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.
>
>Thanks,
>
>Sheila Bowman
>Programmer/Analyst
>UTHSCSA
>bowman@uthscsa.edu
>
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
>
Best regards,
Nigel
+--------------------------------------------------------------------+
|Name : Edmund Nigel Gall Atlantic Avenue |
|Title : Information Systems Specialist Pt. Lisas Industrial Estate|
|Company: Process Plant Services Ltd. Pt. Lisas, Couva |
| Trinidad & Tobago, W.I. |
| Business Personal |
| mailto:nigelg@ppsl.com mailto:nigelg@ppsl.com |
| Phone : (868) 636 3153/2878/3195 Phone : (868) 662 6611 |
| Fax : (868) 679 3770 Fax : (868) 662 6611 |
+------------------------ http://www.ppsl.com -----------------------+