Guidelines for Export and Import •
Procedures, Functions, Packages, Views and Synonyms are not exported along with tables, we need to create them manually.
•
Triggers are exported automatically(by default), but they are not fired when the table is imported for the first time. They are only fired for the consecutive imports.
•
Constraints are exported automatically(by default), but they are not checked when the table is imported for the first time. They are only checked for the consecutive imports.
•
Possible type conversion are automatically done during export and import.
1. 2. 3.
Check whether the table exists in the target database. If the table exists then check whether both the source and target table are structurally same. If the target table has a primary key constraint, then simply import the table, otherwise truncate the table first, and then import. Referential Integrity check:
4.
4.1. If the table you are trying to import is a child table(say emp_ch), i.e if the table refers some master table, then follow these steps: 1. 2. 3.
First synchronize the master table. Truncate the table(emp_ch). Import the table(emp_ch).
Likewise if the table has more than one master reference, then all the master table needs to be synchronized. 4.2. If the table you are trying to import is a master table(emp_mast), i.e if the table is referenced by any child table, then follow these steps: 1. 2. 3. 4.
Disable all the referential constraints in the child table. Truncate the table(emp_mast). Import the table(emp_mast). Enable all the referential constraints in the child table.
Likewise if the table is referenced by more than one child, then the referential integrity of all the child table needs to be disabled, before the master table is truncated. (or) Just simply import the master table(using ignore=y option). But this might a long time, when compared to the above truncation method.