Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Sys and System

Re: Sys and System

From: Charles Hooper <hooperc2000_at_yahoo.com>
Date: 15 Jul 2006 17:25:32 -0700
Message-ID: <1153009532.331378.240940@s13g2000cwa.googlegroups.com>


ianal Vista wrote:
> ujangmz_at_gmail.com wrote in news:1152996187.907149.163630
> @b28g2000cwb.googlegroups.com:
> <nitpick>
> IMP does NOT (re)create any database.
> First the database needs to be created "manually".
> Next IMP can be used to populate the database.
> </nitpick>
>
> IMP is a marginally acceptable tool to clone an Oracle database.
> When PK/FK constraints exists, the order in which tables are imported
> MATTERS!
> Other caveats/problems exist when using IMP.

Does imp behave differently on your Oracle version? The last time I ran imp, I recall in the log file seeing: Importing T1
Importing T2
Importing T3
Importing T4
...
About to enable contraints...

It would seem that the tables are imported first and then the constraints are enabled. 10g offers impdp and expdp, which should be used instead of imp and exp. The files of the exp and expdp utilities are not binary compatible. It appears that the Clone Database command in the 10g Enterprise Manager uses expdp and impdp during the clone.

>From the Oracle 8i documentation (Oracle8i Utilities Release 2):



In the normal import order, referential constraints are imported only after all tables are imported. This sequence prevents errors that could occur if a referential integrity constraint existed for data that has not yet been imported.

These errors can still occur when data is loaded into existing tables. For example, if table EMP has a referential integrity constraint on the MGR column that verifies that the manager number exists in EMP, a perfectly legitimate employee row might fail the referential integrity constraint if the manager's row has not yet been imported.

When such an error occurs, Import generates an error message, bypasses the failed row, and continues importing other rows in the table. You can disable constraints manually to avoid this.

Referential constraints between tables can also cause problems. For example, if the EMP table appears before the DEPT table in the export file, but a referential check exists from the EMP table into the DEPT table, some of the rows from the EMP table may not be imported due to a referential constraint violation.

To prevent errors like these, you should disable referential integrity constraints when importing data into existing tables.


There are most definitely potential problems with the imp tool. It is not a good idea to run a full exp, blow away the database, create a blank database, and then run imp to recreate the database. A couple months ago I attended a short Oracle training seminar that was specific to the ERP package that we run. Among other things, the instructor recommended doing just this twice a year to keep the database in good shape. He also recommended putting the database on a RAID 5 array. During the seminar I tried to help the instructor understand that maybe many of his suggestions needed to be revised.

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc. Received on Sat Jul 15 2006 - 19:25:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US