Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL imp command in Oracle 11g

Posted on 2007-12-03
5
Medium Priority
?
18,472 Views
Last Modified: 2013-12-07
Hi, can someone give me the correct syntax for using the SQL imp command in Oracle? I am following several work cases in the newly released book Pro Oracle Spatial. They instruct to execute the following;

imp spatial/spatial file=gc.dmp ignore=y full=y
imp spatial/spatial file=map_large.dmp tables=us_interstates

Do I need to configure a jdbc connection or other type, to point to the source directory for these files? They were to be downloaded to the O/S harddrive that hosts the DB, but at present they are not in Oracle (as far as I know)
0
Comment
Question by:BlueSkyTelematicsInc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:sonicefu
ID: 20400939
Hello BlueSky !

1) imp  is not an SQL command, it is oracle import utility command to import data from a dump file (fileName.dmp), created by oracle export utility (exp command).

2) Now you need a dump file to import (using imp command)

3) imp spatial/spatial file=gc.dmp ignore=y full=y
    In this case spatial is a username and spatial after / is password and dump file name is gc.dmp, you  should write it with full path, if you are using windows then file=c:\gc.dmp otherwise file=/u02/dump/gc.dmp. full=y means import all contents of this (gc.dmp) file.

*** Clarify your complete scenario where you want to use this

0
 

Author Comment

by:BlueSkyTelematicsInc
ID: 20400985
I have 11g on RHEL5
The DB and the .dmp file are on the same drive, (but the .dmp is in the o/s env;not Oracle_HOme directories..../opt/dwnlds/NAVTEQ to be specific)
So, If I understand, from anywhere in linux command line can I run the "imp" utlility? Do I need to set my path or be in the ORACLE_HOME/bin directory to run it? (I was thinking I would run it from SQL> ; but no?)
Lastly, do I have to specify anything beyond  the ignore-y and full=y options? Or will the .dmp file include the required meta for the destination tables?
0
 
LVL 13

Accepted Solution

by:
sonicefu earned 1000 total points
ID: 20401036
--> from anywhere in linux command line can I run the "imp" utlility?
Yes, you can ! you have to write it as
imp userName/PaswordOfUser file=/pathWhereDmpFilePlaced/dmpFileName.dmp full=y

--> I was thinking I would run it from SQL> ; but no?
no, you were thinking wrong, its not SQL command

at linux command line

--> Do I need to set my path or be in the ORACLE_HOME/bin directory to run it?
it is not necessary

--> Lastly, do I have to specify anything beyond  the ignore-y and full=y options?
read following for details

**Help for Export/Import (exp/imp)
http://www.orafaq.com/wiki/Export
http://www.orafaq.com/wiki/Import

***Oracle data pump (expdp/impdp) is replacing simple exp/imp, read following for information about Data Pump
http://www.orafaq.com/wiki/Datapump
0
 

Author Comment

by:BlueSkyTelematicsInc
ID: 20401147
Hey sonicefu.....thank you for being sonice2me!
I will give this a shot and let you know. It will likely be tomorrow evening though, it is late here. I'll drop you a confimation if it works. I have just reviewed the "impdp help=yes" results, and they are very thorough; I should be able to take it from there. One small detail for your reference, it apears it is necessary to have the ORACLE_HOME  variable set in order to execute. The reading also states you can invoke from PL/SQL as outlined below, but I am with you in that it is a lot easier via Linux command line. Here is an excerpt from the "Datapump" url you referenced, just for your future info....

Thanks Again!

One can invoke datapump from PL/SQL -- this might be handy for scheduling a daily or weekly export with DBMS_SCHEDULER.

DECLARE
  hand NUMBER;
BEGIN
  hand := Dbms_DataPump.Open(operation => 'EXPORT',
                              job_mode => 'FULL',
                              job_name => 'FULLEXPJOB',
                               version => 'COMPATIBLE');
  Dbms_DataPump.Add_File(handle => hand,
                       filename => 'expdp_plsql.log',
                      directory => 'DMPDIR',
                       filetype => 3);
  Dbms_DataPump.Add_File(handle => hand,
                       filename => 'expdp_plsql.dmp',
                      directory => 'DMPDIR',
                       filetype => 1);
  -- Dbms_DataPump.Set_Parameter(handle => hand,
  --                               name => 'ESTIMATE',
  --                              value => 'STATISTICS');
  Dbms_DataPump.Start_Job(hand);
END;
/
0
 

Author Closing Comment

by:BlueSkyTelematicsInc
ID: 31412502
Excellent Help, and very very timely!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question