How to Exclude Some Data From dbexport

If you use the dbexport utility to prepare some test or development instances of a database, you’ve probably come to conclusion that you don’t need the data from all the tables in a database. There are often some tables used for logging, images and such, which must exists in schema but could be empty in a non-production environment.

The idea is that there should be a way to instruct dbexport to omit exporting the data from particular tables. So I was pleased to see the new usage message of this utility:

 dbexport  <database> [-X] [-c] [-q] [-d] [-ss [-si]]
  [{ -o  <dir> | -t  <tapedev> -b  <blksz> -s  <tapesz> [-f  <sql-command-file>] }] [-nw]
  [-no-data-tables[=table name{,table name}]]
  [-no-data-tables-accessmethods[=access method name{,access method name}]]

  NOTE: arguments to dbexport are order independent.
        By default, -no-data-tables=tsinstancetable
        By default, -no-data-tables-accessmethods=ts_rtl_vtam,ts_vtam

Note the options -no-data-tables and -no-data-tables-accessmethods. Usage message is the same in actual versions 11.50FC9 and 11.70FC3. I’m not sure in which versions were these two new options introduced, but in time of writing this post, those were not yet mentioned in official Informix documentation for 11.50 nor 11.70. Haven’t tested the -no-data-tables-accessmethods option, but the other one, -no-data-tables, works exactly as expected – provides the whole schema without the data for the specified table(s).


, ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: