There's a database called FOO
in an Oracle XE 10g server that's due to be decommissioned (old.example.com
). I've been asked to migrate it to some other Oracle XE 11g server (new.example.com
). Both servers are on the same LAN. I don't know anything about the database (it isn't a project of mine). There isn't a DBA in the room. My random Google searches suggest it's a terribly complicated task. I can use SQL Developer or SQL*Plus.
I've figured out that using impdp over a network link might be a reasonably straightforward method. But docs take most stuff for granted and I can't make it work.
So far:
I've assigned
EXP_FULL_DATABASE
to userFOO
in source server (roleDATAPUMP_EXP_FULL_DATABASE
does not seem to exist in 10g).I've created a temporary user called
tmp_imp
in target server withCREATE DATABASE LINK
andDATAPUMP_IMP_FULL_DATABASE
roles.I'm stuck in the create database link part. I've logged into
new.example.com
astmp_imp
and tried all possible combinations of the CREATE DATABASE LINK statement. They either triggerORA-00933: SQL command not properly ended
or are accepted but produce a non-working link (ORA-39001: invalid argument value
,ORA-39200: Link name "OLD_FOO" is invalid.
,ORA-12154: TNS:could not resolve the connect identifier specified
).
This is one of my attempts:
CREATE DATABASE LINK OLD_FOO
CONNECT TO FOO IDENTIFIED BY 'pa$$w0rD'
USING '//old.example.com:1521/xe';
What am I doing wrong? Is there a simpler tool to migrate the database?
1 Answer 1
The USING
clause expects a valid TNS entry or alias. Use this:
CREATE DATABASE LINK OLD_FOO
CONNECT TO FOO IDENTIFIED BY "pa$$w0rD"
USING '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = old.example.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))';
-
Thank you, that's exactly what I meant with docs taking stuff for granted. Do you have any idea why I get
ORA-00933: SQL command not properly ended
when I run a verbatin copy of your command? SQL*Plus reports it in the first quote of ´'pa$$w0rD'´, but removing quotes altogether doesn't fix it.Álvaro González– Álvaro González2017年10月09日 12:22:27 +00:00Commented Oct 9, 2017 at 12:22 -
@Álvaro González You should use double quotes for the password because of the special characters, I edited my answer.Balazs Papp– Balazs Papp2017年10月09日 12:31:33 +00:00Commented Oct 9, 2017 at 12:31
Explore related questions
See similar questions with these tags.