DBLink Creation - ORA-12154 [message #242963] |
Tue, 05 June 2007 11:08 |
michael.mazuk
Messages: 14 Registered: June 2007
|
Junior Member |
|
|
Hello, I'm trying to create a DBLink between 2 databases.
Distant database = baseD
Local database = baseL
To do, I created this DBLINK :
CREATE DATABASE LINK sourceID connect to login identified by pwd using 'alias1';
Extract of TNS_NAMES.ora :
alias1.world=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = oratoto1)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = sourceID)
)
)
I use this alias for others connections without any problems. These informations are OK.
But when I try to request data in the Distant DB, Oracle can't resolve service name (error ORA-12154)
select * from table1@sourceID;
ORA-12154 TNS : could not resolve service name
I'm working with Toad.
Can you help me ?
|
|
|
|
|
|
|
Re: DBLink Creation - ORA-12154 [message #242977 is a reply to message #242969] |
Tue, 05 June 2007 11:31 |
michael.mazuk
Messages: 14 Registered: June 2007
|
Junior Member |
|
|
like this ?
CREATE DATABASE LINK sourceID connect to login identified by pwd using sourceID;
alias1.world=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = oratoto1)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = sourceID)
)
)
|
|
|
Re: DBLink Creation - ORA-12154 [message #242981 is a reply to message #242977] |
Tue, 05 June 2007 11:35 |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
SQL> show parameter service_names
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string mydb.xxxx.xxxx.com
CREATE DATABASE LINK DEV01_mydb
CONNECT TO oracle
IDENTIFIED BY alrmoracle
USING 'mydb.xxxx.xxxx.com';
[Updated on: Tue, 05 June 2007 11:36] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: DBLink Creation - ORA-12154 [message #243026 is a reply to message #243013] |
Tue, 05 June 2007 14:03 |
michael.mazuk
Messages: 14 Registered: June 2007
|
Junior Member |
|
|
baseDistant.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = oracle04)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = TOTO21)
)
)
baseLocal.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = oradev01)
(Port = 1521)
)
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = oradev01)
(Port = 1526)
)
)
(CONNECT_DATA = (SID = TITI30)
)
)
thank you for your help
|
|
|
|
Re: DBLink Creation - ORA-12154 [message #243030 is a reply to message #243026] |
Tue, 05 June 2007 14:14 |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = oradev01)
(Port = 1521)
)
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = oradev01)
(Port = 1526)
)
)
(CONNECT_DATA = (SID = TITI30)
)
)
use this code
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = oradev01)
(Port = 1521)
)
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(CONNECT_DATA = (SID = TITI30)
)
)
|
|
|
|
|
|
|
Re: DBLink Creation - ORA-12154 [message #274667 is a reply to message #243240] |
Tue, 16 October 2007 14:46 |
gnbc
Messages: 1 Registered: October 2007
|
Junior Member |
|
|
I register just to reply this.
The solution for this folows:
****INSTEAD OF:
CREATE DATABASE LINK prod
CONNECT TO scott IDENTIFIED BY tiger
USING 'prod';
****TRY THIS:
CREATE DATABASE LINK prod
CONNECT TO scott IDENTIFIED BY tiger
USING '(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=....)(PORT=1521))
)
(CONNECT_DATA=
(SID=prod)
)
)';
The las was get on TNSNAMES.ORA. Just put your host and your sid. Works fine to me.
I hope this help you
Gabriel Novy B. Chaves
[Updated on: Tue, 16 October 2007 14:47] Report message to a moderator
|
|
|
|
|