Re: Reducing Table Sizes
Posted in 1998
At 03:08 PM 6/15/98 -0400, you wrote: >Here's a thought...I wish to copy a database to a *test* instance, but I >don't need the tables to be as large as those in the production DB. >What I was thinking...and I could be way off base here...is that if I >did a DBEXPORT, then edited the <dbname>.sql file to reduce the number >of rows where the table is being created, and *also* edited the >corresponding <tabname>.unl file to remove all but the # of rows I want >to import - will the DBIMPORT work or not? > This would achieve what you want, but you run the risk of having an inconsistent database. For example, let's say you have two header tables which are unloaded ordered by the primary keys, and pne detail table which has a two columns (which are not members of it's composite primary key) which are foreign keys to each of these header tables. It is possible that the first few unloaded rows of the detail table would have values in the foreign key columns which reference the lower part of the unloaded header tables, and once you truncate your header tables' unload files, you lose the referential integrity. Just off the top of my head. You may need to write a 4GL program to pull out the data you need (which could be time consuming if you have a lot of tables). Does Informix support cascaded deletes? This would allow propagation of deletes to detail tables by deleting rows from header tables. If your database had this capability, then you could copy the entire database, and delete enough rows from your core group of header tables till your database size is down to the level you want. Unless you don't have the disk space to copy the database in the first place. In that case, better let someone else give you ideas before I confuse you further. Best regards, Nigel +-------------------------------------------------------------+ |Name : Edmund Nigel Gall Tel: (868) 636 3153 | |Title : Information Systems Specialist Fax: (868) 679 3770 | |Company: Process Plant Services Limited | |Address: Atlantic Avenue, Point Lisas Industrial Estate | | Point Lisas, Couva, Trinidad & Tobago, W.I. | +----- mailto:nigelg@ppsl.com ------ http://www.ppsl.com -----+