Skip to Main Content
  • Questions
  • Do the export and import utilities require a tnsnames.ora to connect to a remote database?

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Jamie.

Asked: January 24, 2005 - 6:15 pm UTC

Last updated: February 16, 2005 - 9:11 am UTC

Version: 9.2.0

Viewed 1000+ times

You Asked

With SQL*Plus, I'm able to connect to a remote database by specifying the connection information at the connect prompt. For example:

sqlplus username/password@'(description=(address=(protocol=tcp)(host=oracle-server.domain.name) (port=1521))(connect_data=(sid=ORCL)))'

However, I'm apparently unable to export and import data from a remote database using this connection method:

exp userid=username/password@'(description=(address=(protocol=tcp)(host=oracle-server.domain.name) (port=1521))(connect_data=(sid=ORCL)))' owner=username file=username.dmp

Am I doing something wrong? If not, is there another way to use the export and import utilities without the use of tnsnames or an Oracle names server?

A search of MetaLink (doc ID 513040.994) suggests that this might be possible, but does not provide a working example. The SQL*Net and Utilities manuals did not enlighten me.

Thanks for taking a look at this!

Jamie Kinney




and Tom said...

export TWO_TASK='(DESCRIPTION=(ADDRESS_LIST=(AD....com)))'
exp userid=scott/tiger

seems to work well. (use "SET" on windows)

Rating

  (4 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thank you!

Jamie Kinney, January 24, 2005 - 7:50 pm UTC

While I'm still curious about the difference between exp/imp and SQL*Plus connection methods, I'm happy to have TWO_TASK.

Thanks Tom!

connectivelty

Quintin, January 25, 2005 - 7:24 am UTC

Great, I've learnt something new today.

Question, if in theory (not that it may be practical) can this method of connectively be used to connect dynamically to a remote database say for example with in a Oracle forms or reports and application environment.

Tom Kyte
January 25, 2005 - 9:34 am UTC

yes, the two_task thing (which has bitten me more than once :) happens way down in the connect code, the application (which is why it bit me more than once) doesn't have to specify anything...

(more than once I'm sitting there - "but I am connected to my LOCAL database" i say... -- but no, no i wasn't :) two_task was connecting me elsewhere.

about log on into sqlplus

Larry, February 16, 2005 - 8:49 am UTC

Hi i have managed to install the oracle 10 database onto my machine but i cant seem to get into sqlplus because of the username and password which where not even asked during the install pleas help

Tom Kyte
February 16, 2005 - 9:11 am UTC

they were there during the install. definitely, you have to pick sys, system passwords.

In any case, try:

sqlplus "/ as sysdba"

if you are logged in as the oracle software owner.

LOCAL in windows

Trygvi, October 21, 2005 - 8:40 am UTC

Thanks - it works. In windows it is LOCAL in stead of TWO_TASK.