We have a dump file that we want to import to an Amazon rds server.
This is what I did:
Create a public db link and verify it works:
create public database link rdsdblink
connect to dbuser identified by dbpsw
using '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST='xxx')(PORT=1521)))(CONNECT_DATA=(SID=dbsid)))';
SQL> select * from dual @ rdsdblink;
D
-
X
Create a directory for the dump file:
CREATE OR REPLACE DIRECTORY DATA_PUMP_DIR AS 'G:\DB';
Import the dump file:
impdp dbuser/dbpsw@rdsdblink tablespaces=EMP directory=DATA_PUMP_DIR dumpfile=EMP_dump.DMP logfile=EMP_dump.log network_link=rdsdblink
I have also added rdsdblink connection string to tnsnames.ora file and restarted oracle service ("shutdown immediate", then "startup").
The following error occured:
Connected to: Oracle Database 11g Release 11.2.0.2.0 – 64bit Production
ORA-39001: invalid argument value
ORA-39200: Link name "rdsdblink" is invalid.
ORA-02019: connection description for remote database not found
My local oracle version:
Oracle Database 11g Express Edition Release 11.2.0.2.0 – Production
Remote oracle version:
Oracle Database 11g Release 11.2.0.2.0 – 64bit Production
Best Answer
You've connected to the remote database (via
dbuser/dbpsw@rdsdblink
), but your DB link is created in your local database. At the moment you're trying to run the import on the remote DB, with a network link also to the remote DB, and that network link is trying to use a DB link that doesn't exist on that remote DB.The
tnsnames.ora
entry and the DB link are completely separate things.You need to connect normally locally - using whichever credentials you used to create the DB link, probably. The
network_link
parameter will then make your local database session, that is started byimpdp
, act against the remote server; so your local directory can be used.Except... it doesn't work like that. The remote database identified by the
network_link
can be used as the source of the import, without a dump file at all; but it can't be the target for an import from a file.From the
impdp
documentation:If you really wanted to go down this route, I think you would need a link from remote to local, and to run the import against the remote (as you are now), but to be pulling directly from your schema - not from a previous export. You'd still need access to a
DIRECTORY
object on the remote server, as logs etc. would be written there, even if you weren't copying your dump file over. Even withnologfile
I believe it will error if you don't specify a directory or don't have permissions on it.The article you linked to in your previous question said the same thing: