RE: importing ids 7.20.UC5 bkups to ids 9.40.UC3
Posted in 2006
Dirk suggested:
> One option would be to create the tables in version 9, but to create
>them as raw tables, not standard (you will have to edit the .sql files
>to add the word raw).
This is good advice, but you have to do more than add "RAW" to the CREATE TABLE statement.
A raw table cannot have indexes, referential constraints, or triggers. Therefore, you may have to do some significant editing of the XXX.sql file before you do the load, and may have to create a second sql file with alters,
If, for example, you have a foo.sql file that looks like this:
CREATE TABLE foo (
serial_col SERIAL PRIMARY KEY CONSTRAINT foo_pk,
char_col CHAR NOT NULL CONSTRAINT char_col_nn,
int_col INTEGER,
string_col VARCHAR(255,13) DEFAULT 'I Love c.d.i!',
CHECK (int_col > 0) CONSTRAINT int_col_positive
)
EXTENT SIZE 248
NEXT SIZE 248
LOCK MODE ROW
;
CREATE INDEX foo_comp_idx ON foo(char_col, int_col);
You would want to modify it to look like this:
CREATE RAW TABLE foo (
serial_col SERIAL ,-- PRIMARY KEY CONSTRAINT foo_pk,
char_col CHAR NOT NULL CONSTRAINT char_col_nn,
int_col INTEGER,
string_col VARCHAR(255,13) DEFAULT 'I Love c.d.i!',
CHECK (int_col > 0) CONSTRAINT int_col_positive
)
EXTENT SIZE 248
NEXT SIZE 248
LOCK MODE ROW
;
Note that constraints which do not require an index are acceptable, as are storage options, default values, etc.
Then do the load, then run a second sql file which would look like this:
ALTER TABLE foo TYPE (STANDARD);
ALTER TABLE foo ADD CONSTRAINT
PRIMARY KEY (serial_col) CONSTRAINT foo_pk;
CREATE INDEX foo_comp_idx ON foo(char_col, int_col);
While raw tables can significantly improve your load time, you may find that modifying all your files, especially if you have a large number, is not worth it.
Also, when you turn logging back on for your tables, you really need to do a level 0 backup.
Another option to consider is the High Performance Loader (HPL), which is much easier to use in 9.4 than in previous releases. It can be used, depending on your data and requirements, to bypass the logging without having to alter the schema files.
Documentation on using HPL can be found at:
http://publib.boulder.ibm.com/epubs/pdf/ct1t3na.pdf
You can find more info RAW tables by searching the history of this group:
http://groups.google.com/group/comp.databases.informix/search?group=comp.databases.informix&q=raw+table&qt_g=1
Sincerely,
Christopher Coleman
Steering Committee President
Kansas City Informix Users Group
www.iiug.org/kciug
Database Analyst
Pharmacy Division
Mediware Information Systems, Inc.