|
|
|
|
|
Re: Why I get ORA-01017 error with this database link? [message #439458 is a reply to message #439139] |
Sun, 17 January 2010 04:23 |
|
dariyoosh
Messages: 538 Registered: March 2009 Location: France
|
Senior Member |
|
|
Michel Cadot wrote on Thu, 14 January 2010 18:21
...
I tend to trust Oracle in its error message, prove us it is wrong and use the connection parameters in the database link definition to connect using connect SQL*Plus command.
Regards
Michel
Hello dear Michel
Thanks for your answer. As I said I already did some test directly with sqlplus in order to verify the correctness of the TNS parameters used for the USING clause during my database link creation. I can confirm that the parameters are just fine. The code in the USING clause is exactly related to the corresponding entry in my tnsnames.ora file. I can establish a connection within sqlplus shell to the specified server by the same schema = user
Yet, there is something strange that I cannot understand. I tried to create a link from serverA to serverB (schemaA is on the physical machine named serverA and schemaB on the physical machine named serverB), well it didn't work and it gave me the above mentioned ORA-01017 error message.
Later, just for see how it works, I tried to do the same thing in the reverse order, that is, to create a database link but this time from serverB to serverA. Surprisingly this time it worked pretty well.
I wonder whether this is related to some lack of privileges that causes error message when there is a link from serverA to serverB? why it works in the reverse order? I don't really understand, there is no firewall or any blocking process on non of the servers and the fact that I can create a database link shows that I have already been granted the required oracle privileges for database links.
Strange!
Kind Regards,
Dariyoosh
|
|
|
|
|
|
|
|
|
Re: Why I get ORA-01017 error with this database link? [message #439728 is a reply to message #439137] |
Tue, 19 January 2010 04:58 |
|
dariyoosh
Messages: 538 Registered: March 2009 Location: France
|
Senior Member |
|
|
Hello again,
As promised here are the detailed connection parameters used during the database link creation.
Just a remark, Actually for your ease of reading I had previously named my schemas as schemaA and schemaB, in fact the real names are db01 and A971DEVT. Any way, as you can see my tnsnames.ora file contains the necessary parameters for connection.
A971DEVT.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY = TCP)(PROTOCOL = TCP)
(HOST = 10.161.129.4)(PORT = 1521))
)
(CONNECT_DATA =
(SID = A971DEVT)
)
)
ccsaplinux0002_db01 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY = TCP)(PROTOCOL = TCP)
(HOST = 10.113.35.150)(PORT = 1521))
)
(CONNECT_DATA =
(SID = db01)
)
)
Therefore within a sqlplus shell, in order to connect to A971DEVT I run
$ sqlplus user1/password@A971DEVT.WORLD
Likewise in order to connect to db01 I run
$ sqlplus user2/password@ccsaplinux0002_db01
In both cases the connection is established without any problem. Now here is exactly what I did in order to create the database link from A971DEVT to db01.
While I was connected to A971DEVT I run the following:
$ sqlplus user1/password@A971DEVT.WORLD
SQL> CREATE DATABASE LINK mydblink01 CONNECT TO user2 IDENTIFIED BY password
USING '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =
(COMMUNITY = TCP)(PROTOCOL = TCP)(HOST = 10.113.35.150)
(PORT = 1521)))(CONNECT_DATA =(SID = db01)))';
Apparently the database link, was created without error or at least, without any syntax error (as Michel remarked)
But when I want to query any table I get the above mentioned error, for example:
SELECT * FROM employees@mydblink01
*
ERROR at line 1:
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from MYDBLINK01
But as I said, if I create a database link in the reverse order, that is, from db01 to A971DEVT, this works pretty well. First of all, here is what I have in tnsnames.ora file of the server where resides db01
ccsaplinux0002_db01 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY = TCP)(PROTOCOL = TCP)
(HOST = 10.113.35.150)(PORT = 1521))
)
(CONNECT_DATA =
(SID = db01)
)
)
A971DEVT.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY = TCP)(PROTOCOL = TCP)
(HOST = 10.161.129.4)(PORT = 1521))
)
(CONNECT_DATA =
(SID = A971DEVT)
)
)
So as you can see the A971DEVT.WORLD entry on ccsaplinux0002 server (which contains the schema db01)is exactly the same that I use for connecting to A971DEVT. And here is how I created the database link
sqlplus user2/password@ccsaplinux0002_db01
CREATE DATABASE LINK mydblink02 CONNECT TO user1 IDENTIFIED BY password
USING '(DESCRIPTION = (ADDRESS_LIST =
(ADDRESS = (COMMUNITY = TCP)(PROTOCOL = TCP) (HOST = 10.161.129.4)
(PORT = 1521))) (CONNECT_DATA = (SID = A971DEVT)))';
Then I queries with success several tables of A971DEVT by using mydblink02.
So:
- creating database link from A971DEVT to db01 doesn't work (login denied)
- creating database link from db01 to A971DEVT works pretty well.
Any idea?
Kind Regards,
Dariyooh
[Updated on: Tue, 19 January 2010 05:07] Report message to a moderator
|
|
|
|
Re: Why I get ORA-01017 error with this database link? [message #439975 is a reply to message #439736] |
Wed, 20 January 2010 07:37 |
|
dariyoosh
Messages: 538 Registered: March 2009 Location: France
|
Senior Member |
|
|
Michel Cadot wrote on Tue, 19 January 2010 12:11Quote:Do not tell us, show us: copy and paste the SQL*Plus session using the connection string that is in the database link, do not use the tnsnames entry.
Regards
Michel
Hello dear Michel,
Thanks for your answer. Excuse me but I'm a little confused, when you say
Quote:
...
the connection string that is in the database link, do not use the tnsnames entry
...
Well, I provided the connection string in the database link
...
USING '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =
(COMMUNITY = TCP)(PROTOCOL = TCP)(HOST = 10.113.35.150)
(PORT = 1521)))(CONNECT_DATA =(SID = db01)))';
I didn't use tns entry which is A971DEVT.WORLD, I just supplied directly as indicated above the connection parameters directly (host, SID, etc.)
Thanks again
Kind Regards,
Dariyoosh
|
|
|
|
|