Home » RDBMS Server » Server Administration » dblink and characterset
dblink and characterset [message #274978] Thu, 18 October 2007 00:22 Go to next message
alantany
Messages: 115
Registered: July 2007
Senior Member
Hello:
I have a quesiton abort dblink and characterset.
For: DB 1 DB 2
there is a dblink on db 1 connect to db 2;
When I issue:
select * from t@dblink on DB 1,which characterset will db 1 use to create the session to db 2? is the characterset of database of db 1 or the NLS parameter in .profile of os on DB 1?how can I confirm it?
Regards!
Alan
Re: dblink and characterset [message #275000 is a reply to message #274978] Thu, 18 October 2007 01:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68732
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
You don't have to worry about this, Oracle internally transform data across the different characters and finally return the result in your own (session) one.

Regards
Michel
Re: dblink and characterset [message #275003 is a reply to message #275000] Thu, 18 October 2007 01:35 Go to previous messageGo to next message
alantany
Messages: 115
Registered: July 2007
Senior Member
Dear Michel:
Maybe you are correct,but if have I to change DB 1 characterset in order to make the characterset convert correctly,how shall I do?
Regards!
Alan
Re: dblink and characterset [message #275021 is a reply to message #275003] Thu, 18 October 2007 02:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68732
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
What do you exactly want?
Changing database character set or getting data from another place with another character set?

Regards
Michel
Re: dblink and characterset [message #275031 is a reply to message #275021] Thu, 18 October 2007 02:35 Go to previous messageGo to next message
alantany
Messages: 115
Registered: July 2007
Senior Member
Hi,Michel:
I mean ,when we connect to a db from a client such as using sqlplus ,we will use a client characterset(windows at regisry,linux at .profile),this will tell oracle what characterset the client use,so that oracle know if there need a characterset convert between the client and server when communicate.
In this case,when db 1 connect to db 2 using dblink,what characterset db 1 will use to communicate with db 2?does db 1 act as a client role,choose characterset form .profile or act as a server role and use it own characterset?
Regards
Alan
Re: dblink and characterset [message #275034 is a reply to message #275000] Thu, 18 October 2007 02:37 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Michel Cadot wrote on Thu, 18 October 2007 12:30

You don't have to worry about this.

Regards
Michel


Re: dblink and characterset [message #275037 is a reply to message #275034] Thu, 18 October 2007 02:46 Go to previous messageGo to next message
alantany
Messages: 115
Registered: July 2007
Senior Member

ok,thanks,Michel.


Regards
Alan
Re: dblink and characterset [message #275043 is a reply to message #275031] Thu, 18 October 2007 02:55 Go to previous messageGo to next message
Michel Cadot
Messages: 68732
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Well, does Oracle use the session character set or the database character set? This is a good question but is worth to ask if you have different and not compatible character set.
I don't know the answer (I always kept compatible environments where I worked).

You can make an easy test:
- create a database 1 with a character set that doesn't support a known character but that you are able to see on your client
- create a database 2 that supports this character
- create a table on database 2 and insert this character
- create a database link on database 1 to database 2
- connect to database 1 and select the data through the database link

Do you see the character?
If yes, client character set is used for opening the database link
If no, database character set is used.

Thank to post the result.

Regards
Michel

[Updated on: Thu, 18 October 2007 03:28]

Report message to a moderator

Re: dblink and characterset [message #275052 is a reply to message #275043] Thu, 18 October 2007 03:16 Go to previous messageGo to next message
alantany
Messages: 115
Registered: July 2007
Senior Member
Hi,MIchel:
Thanks for your plan,I will test it and post it later.
Regards!
Alan
Re: dblink and characterset [message #275220 is a reply to message #275052] Thu, 18 October 2007 18:58 Go to previous messageGo to next message
alantany
Messages: 115
Registered: July 2007
Senior Member
I have ased Tom and I posted the reply:
Quote:


from any client to any server (db1 is a client to db2 in this case), if the characterset of the client is different from the characterset of the server - then the data will be converted into the clients characterset as they retrieve it, and into the servers characterset as the client sends it.

So, in your case, you have sqlplus client, connecting to db1, connecting to db2.


the sqlplus client will get data converted into their characterset from db1.

when db1 retrieves from db2, it'll get the data in the characterset db1 is expecting and then if needed, db1 would convert that for the sqlplus client.


http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/ds_concepts.htm#sthref4077


Regards!
Alan

[Updated on: Fri, 19 October 2007 01:55] by Moderator

Report message to a moderator

Re: dblink and characterset [message #275264 is a reply to message #275220] Fri, 19 October 2007 01:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68732
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Thanks for the feedback, I thought this was the case but I always prefer to make a test to be sure.
Remember every one can be wrong, even Oracle documentation, even Tom Kyte. You can't disprove a good test.

Regards
Michel
Re: dblink and characterset [message #275425 is a reply to message #275264] Fri, 19 October 2007 23:49 Go to previous message
alantany
Messages: 115
Registered: July 2007
Senior Member
Thanks Michel,

I will test and post it later.

Regards!
Alan
Previous Topic: OLTP template and license
Next Topic: Password file and sysdba
Goto Forum:
  


Current Time: Sun Jan 26 18:28:12 CST 2025