# Re:  Data import

**URL:** <https://forums.toadworld.com/t/re-data-import/9967>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [October 25, 2010, 2:51am UTC](https://forums.toadworld.com/t/re-data-import/9967 "2010-10-25T02:51:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forums.toadworld.com/u/Guest)\
**Post date:** [October 25, 2010, 2:51am UTC](https://forums.toadworld.com/t/re-data-import/9967/1 "2010-10-25T02:51:59Z")

</div>

Hi Norman;

I have already tried the following command :

imp SYSTEM/XXX file=/oradata/ora48001/donnees/archive/hp\_ntced\_aa.dmp  
log=/oradata/ora48001/donnees/archive/hp\_ntced\_aa.log fromuser=hp\_ntced\_aa  
touser=HP\_NTCED\_AA rows=y constraints=n compile=n IGNORE=y indexes=n commit=y

But have Always the same error (in french) :

Ligne rejetée à cause de l’erreur ORACLE 1

IMP-00003 : Erreur Oracle 1 rencontrée

ORA-00001: violation de contrainte unique (HP\_NTCED\_AA.UK\_ADMISSION\_01)

…

Regards

— En date de : Lun 25.10.10, Norman Dunbar a écrit :

De: Norman Dunbar  
Objet: Re: [toad] Data import  
À: [toad@yahoogroups.com](mailto:toad@yahoogroups.com)  
Date: Lundi 25 octobre 2010, 8h58

Morning djamel,

```
> *imp SYSTEM/laposte+2
> file=/oradata/ora48001/donnees/archive/hp_ntced_aa.dmp
> log=/oradata/ora48001/donnees/archive/hp_ntced_aa.log
> fromuser=hp_ntced_aa touser=HP_NTCED_AA commit=y ignore=y*
> **
> *But I have of error messages on constraints and indexes !*
> *How realize the import procedure without know the schema of the
> database ? *
> *I would like just to import only the data from a dump file.*

add the following to your imp command:

indexes=no constraints=no

you may also decrease the import time by adding:

buffer=40960000

Adjust the value to suit your system, but the above works for me.

```

And, one last thing, please don’t hijack an existing thread to post a  
question. If you do, people like me with threaded email clients may not  
see it as it appears under a thread that we may not be watching. For a  
new query, alsways start a new thread please. Thanks.

Cheers,  
Norm. [TeamT]

```
--

Cheers,
Norm. [TeamT]
```

---

<div class="post-metadata">

**Author:** ![NormTeamT](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/normteamt/32/53_2.png) [@NormTeamT](https://forums.toadworld.com/u/NormTeamT)\
**Post date:** [October 25, 2010, 3:22am UTC](https://forums.toadworld.com/t/re-data-import/9967/2 "2010-10-25T03:22:33Z")

</div>

Morning Djamel,

> > Ligne rejetée à cause de l'erreur ORACLE 1  
> > IMP-00003 : Erreur Oracle 1 rencontrée  
> > ORA-00001: violation de contrainte unique  
> > (HP\_NTCED\_AA.UK\_ADMISSION\_01)  
> > Aha! My French is tes mal, but:

Unique constraint violated on constraint HP\_NTCED\_AA.UK\_ADMISSION\_01 seems to be your problem. This implies that the data you are importing already exists in the table that the constraint is protecting.

In order to do a clean import, you must get rid of existing data first.

Have you cleaned out all the tables you wish to import? Is this what you want to do? You need to be sure of what you wish to do before you run the import.

Imp allows you to:

- Add data to existing tables;
- Import data into empty tables;
- Import data into tables, creating them as necessary.

If you need to import into existing tables but leave existing data alone, then you must make sure that the data you are importing will not violate any constraints. This is your current problem.

Cheers,  
Norm. [TeamT]

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.  
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at [www.environment-agency.gov.uk](http://www.environment-agency.gov.uk)

---

<div class="post-metadata">

**Author:** ![dboussebha\_123807095](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@dboussebha\_123807095](https://forums.toadworld.com/u/dboussebha_123807095)\
**Post date:** [October 25, 2010, 5:05am UTC](https://forums.toadworld.com/t/re-data-import/9967/3 "2010-10-25T05:05:41Z")

</div>

Hi;

Have you cleaned out all the tables you wish to import?

No : how I realize this ?

I try try with Toad in specifying the follwing parameters for import file :

Content : All

If table exists : Replace

But I have the following error :

Import: Release 10.2.0.1.0 - Production on Lundi, 25 Octobre, 2010 12:03:35

Copyright © 2003, 2005, Oracle. All rights reserved.

Connecté à : Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit  
Production  
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring  
Engine options

ORA-39001: valeur d’argument non valide  
ORA-39000: spécification de fichier de vidage erronée  
ORA-39143: le fichier de vidage  
“/oradata/ora48001/donnees/archive/hp\_ntced\_aa.dmp” peut être un fichier de  
vidage d’export original

— En date de : Lun 25.10.10, Dunbar, Norman (Capgemini)  
a écrit :

De: Dunbar, Norman (Capgemini)  
Objet: RE: [toad] Data import  
À: [toad@yahoogroups.com](mailto:toad@yahoogroups.com)  
Date: Lundi 25 octobre 2010, 10h22

Morning Djamel,

```
>> Ligne rejetée à cause de l'erreur ORACLE 1
>> IMP-00003 : Erreur Oracle 1 rencontrée
>> ORA-00001: violation de contrainte unique
>> (HP_NTCED_AA.UK_ADMISSION_01)
Aha! My French is tes mal, but:

Unique constraint violated on constraint HP_NTCED_AA.UK_ADMISSION_01 seems
to be your problem. This implies that the data you are importing already
exists in the table that the constraint is protecting.

In order to do a clean import, you must get rid of existing data first.

Have you cleaned out all the tables you wish to import? Is this what you
want to do? You need to be sure of what you wish to do before you run the
import.

Imp allows you to:

* Add data to existing tables;
* Import data into empty tables;
* Import data into tables, creating them as necessary.

If you need to import into existing tables but leave existing data alone,
then you must make sure that the data you are importing will not violate any
constraints. This is your current problem.

```

Cheers,  
Norm. [TeamT]

Information in this message may be confidential and may be legally  
privileged. If you have received this message by mistake, please notify the  
sender immediately, delete it and do not copy it to anyone else.

```
We have checked this email and its attachments for viruses. But you should
still check any attachment before opening it.
We may have to make this message and any reply to it public if asked to
under the Freedom of Information Act, Data Protection Act or for litigation.
Email messages and attachments sent to or from any Environment Agency
address may also be accessed by someone other than the sender or recipient,
for business purposes.

If we have sent you information and you wish to use it please read our terms
and conditions which you can get by calling us on 08708 506 506. Find out
more about the Environment Agency at www.environment-agency.gov.uk
```

---

<div class="post-metadata">

**Author:** ![NormTeamT](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/normteamt/32/53_2.png) [@NormTeamT](https://forums.toadworld.com/u/NormTeamT)\
**Post date:** [October 25, 2010, 9:09am UTC](https://forums.toadworld.com/t/re-data-import/9967/4 "2010-10-25T09:09:49Z")

</div>

Hi Djamel,

> > Have you cleaned out all the tables you wish to import?  
> > No : how I realize this ?  
> > There are a couple of way, the simplest being:

- In Toad, open the SCHEMA BROWSER.
- Select the correct user in the list of users.
- Select TABLES in the list of objects.
- When the list of tables is displayed (on the left) select all of them  
(CTRL+A).
- Right-click and select TRUNCATE TABLE.
- In the following dialogue, check "REUSE STORAGE" as you will be  
importing the tables' data again.
- Click EXECUTE.
- Click OK when done.

The (list of) tables is not blank and ready to import the new data from.

You can then either run a command line "imp" session, or, use the Toad  
Database-\>import-\>Import Utility Wizard to bring the new data into the  
(now) empty tables.

Cheers,  
Norm. [TeamT]

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.  
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at [www.environment-agency.gov.uk](http://www.environment-agency.gov.uk)

---

<div class="post-metadata">

**Author:** ![NormTeamT](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/normteamt/32/53_2.png) [@NormTeamT](https://forums.toadworld.com/u/NormTeamT)\
**Post date:** [October 25, 2010, 9:24am UTC](https://forums.toadworld.com/t/re-data-import/9967/5 "2010-10-25T09:24:13Z")

</div>

Sorry, I forgot a bit:

> > I try try with Toad in specifying the follwing parameters  
> > for import file :  
> > ORA-39143: le fichier de vidage  
> > "/oradata/ora48001/donnees/archive/hp\_ntced\_aa.dmp" peut  
> > être un fichier de vidage d'export original  
> > This sounds like you have asked Toad to use IMPDMP rather than IMP. You need to use the Import Utility Wizard.

Cheers,  
Norm. [TeamT]

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.  
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at [www.environment-agency.gov.uk](http://www.environment-agency.gov.uk)

---

<div class="post-metadata">

**Author:** ![dboussebha\_123807095](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@dboussebha\_123807095](https://forums.toadworld.com/u/dboussebha_123807095)\
**Post date:** [October 27, 2010, 2:14pm UTC](https://forums.toadworld.com/t/re-data-import/9967/6 "2010-10-27T14:14:41Z")

</div>

Hi;

How use Toad to identify the SQL requests which cause the CPU/RAM performance  
and which execute with long time ?

Regards;

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forums.toadworld.com/u/Guest)\
**Post date:** [October 27, 2010, 4:18pm UTC](https://forums.toadworld.com/t/re-data-import/9967/7 "2010-10-27T16:18:00Z")

</div>

> > How use … the profiler in Toad

Note: These instructions are based on Toad 10.6.0.42

On the toolbar – if you haven’t modified it – there is a  
little clock image with a tooltip to toggle profiling. Note that your DBA has to  
make sure the DBMS\_PROFILER package is set up in the database and you have  
access to use it.

You can toggle the profiling on and off with that clock.

If you can’t find the button, you can always toggle using the menu item.  
Session -\> Toggle PL/SQL profiling

The basic use is:

Toggle profiling on

Activate your procedure

Toggle profiling off

The simplest way to run the procedure would be right-click in your browser and  
select run. With a package you’ll be given a popup listing the available  
procedures (of which you choose the one you want to run) and allowing you to set  
parameters and modify the “wrapper” code to your heart’s  
content.

After toggling the profiler off, you can view the profiler information through  
the menu selection Database -\> Optimize -\> Profiler Analysis

Suggestion: make sure you run the process through a number of records. The more  
records you process, the more clearly the heaviest cost sections of your code  
will be presented. I just ran through the process myself with 100 records and  
the single SQL statement causing the performance issue, in a rather large  
listing of code, was immediately apparent.

From a performance perspective, your issue may not be readily apparent and you  
may have to map through some complex data structure to find the real culprit.  
For example, I once had a piece of code to examine that was taking a half hour  
to run. The dev that wrote the code figured it should run faster but  
didn’t understand what was wrong. The profiler identified the loop itself  
to be the most time. However, upon examination of the statements inside the loop  
I concluded there was a lot more overhead in the loop then necessary.  
Specifically, there were some queries which only had a fraction of the records  
of the parent loop level. I moved the child statements outside the loop that  
could be moved and changed the runtime of the process from 30 minutes to less  
than 30 seconds. The key time was originally spent trying to look up children  
records which simply did not exist. That’s a lot of overhead.

Roger S.

---

<div class="post-metadata">

**Author:** ![dboussebha\_123807095](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@dboussebha\_123807095](https://forums.toadworld.com/u/dboussebha_123807095)\
**Post date:** [October 28, 2010, 2:51am UTC](https://forums.toadworld.com/t/re-data-import/9967/8 "2010-10-28T02:51:50Z")

</div>

Hi Roger;

I have the version 9.7 for Toad.

I can’t find the button for the SQL profiler and the menu item : Session -\>  
Toggle PL/SQL profiling is disabled ?

How enabled this menu item ?

Regards

--- En date de : Mer 27.10.10, Simoneau, Roger a  
écrit :

De: Simoneau, Roger  
Objet: RE: [toad] SQL Profiler with Toad  
À: "'toad@yahoogroups.com'"  
Date: Mercredi 27 octobre 2010, 23h18

> > How use … the profiler in Toad

Note: These instructions are based on Toad 10.6.0.42

On the toolbar – if you haven’t modified it – there is a little clock  
image with a tooltip to toggle profiling. Note that your DBA has to make sure  
the DBMS\_PROFILER package is set up in the database and you have access to use  
it.

You can toggle the profiling on and off with that clock.

If you can’t find the button, you can always toggle using the menu item.  
Session -\> Toggle PL/SQL profiling

The basic use is:

Toggle profiling on

Activate your procedure

Toggle profiling off

The simplest way to run the procedure would be right-click in your browser and  
select run. With a package you’ll be given a popup listing the available  
procedures (of which you choose the one you want to run) and allowing you to set  
parameters and modify the “wrapper” code to your heart’s content.

After toggling the profiler off, you can view the profiler information through  
the menu selection Database -\> Optimize -\> Profiler Analysis

Suggestion: make sure you run the process through a number of records. The more  
records you process, the more clearly the heaviest cost sections of your code  
will be presented. I just ran through the process myself with 100 records and  
the single SQL statement causing the performance issue, in a rather large  
listing of code, was immediately apparent.

From a performance perspective, your issue may not be readily apparent and you  
may have to map through some complex data structure to find the real culprit.  
For example, I once had a piece of code to examine that was taking a half hour  
to run. The dev that wrote the code figured it should run faster but didn’t  
understand what was wrong. The profiler identified the loop itself to be the  
most time. However, upon examination of the statements inside the loop I  
concluded there was a lot more overhead in the loop then necessary.  
Specifically, there were some queries which only had a fraction of the records  
of the parent loop level. I moved the child statements outside the loop that  
could be moved and changed the runtime of the process from 30 minutes to less  
than 30 seconds. The key time was originally spent trying to look up children  
records which simply did not exist. That’s a lot of overhead.

Roger S.

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forums.toadworld.com/u/Guest)\
**Post date:** [October 28, 2010, 11:19am UTC](https://forums.toadworld.com/t/re-data-import/9967/9 "2010-10-28T11:19:09Z")

</div>

> > version 9.7

> > …

> > I can’t find the button for the SQL profiler

> > and the menu item : Session -\> Toggle

> > PL/SQL profiling is disabled ?

Hey Djamel (I’m guessing that’s your first name);

It’s a good idea to keep such follow up questions on the list. Someone else  
would then have an opportunity of responding before I even wake up 😉

Additionally, It’s useful for others that might have the same question.

So… on to the answer:

Toad queries the database to see what you have access to and enables/disables  
certain features. One of those features is the profiling functionality.

The profiler functionality is Oracle created. Toad is simply a front-end GUI to  
access it and parse the information it generates.

This is the part where I mentioned the DBA needs to make sure the proper package  
(dbms\_profiler) is installed in the database. Additionally, the user you are  
logging in as needs to be able to access that package. I’m not sure what other  
access you might require. Perhaps Norm can outline the specifics beyond what  
I’ve covered.

You can verify the package and access so you know what you need to request from  
your DBA with the following as run in SQL Plus. I guide you to SQL Plus for one  
reason – you will know for sure that any error message produced is Oracle, not  
Toad, so you eliminate any issues with the Tool completely from the picture.

DESC dbms\_profiler;

If the package is not installed or you don’t have any access to it at all,  
you’ll see an error like:

ERROR:

ORA-04043: object dbms\_profiler does not exist

If you see a package described, you can test basic access with:

SELECT dbms\_profiler.stop\_profiler FROM DUAL;

Note: Don’t be surprised if the DBA refuses to enable the profiler on a  
production database. If that is where you are attempting to do your performance  
analysis, you will likely need the DBA involved in order to acquire the  
information you need. Production is supposed to be a very controlled environment  
and allowing a dev such access as to be able to run a 20-hour query in profiling  
is a very, very bad idea (and I’m a Developer, not a DBA). However, for a Dev  
environment, the DBA shouldn’t have any issues with setting up the profiler so  
you can use it.

Roger S.

---

<div class="post-metadata">

**Author:** ![dboussebha\_123807095](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@dboussebha\_123807095](https://forums.toadworld.com/u/dboussebha_123807095)\
**Post date:** [November 3, 2010, 11:28am UTC](https://forums.toadworld.com/t/re-data-import/9967/10 "2010-11-03T11:28:11Z")

</div>

Hi;

I have realize a import of a dump file and I have the following errors (Sorry is  
in french):

. . import : “HP\_NTCED\_AA”.“STATUT\_TRACE” 5.375 KB 4 lignes

. . import : “HP\_NTCED\_AA”.“TYPE\_INDICATEUR\_SUIVI” 5.437 KB 4 lignes  
…

Traitement du type d’objet SCHEMA\_EXPORT/TABLE/INDEX/INDEX  
ORA-39014: Un ou plusieurs processus esclave sont sortis prématurément.  
ORA-39029: le processus esclave 1 nommé “DW01” s’est arrêté prématurément  
ORA-31672: Le processus esclave DW01 a échoué de manière inattendue.  
Tâche “SYS”.“SYS\_IMPORT\_SCHEMA\_06” arrêtée en raison d’une erreur grave

Q: My import is good or not ? How resolve these errors ?

regards;
