Why does Char (1) change to Char (3) when copying through Oracle DBLINK?

I have 2 databases and I want to transfer an existing table containing a CHAR column from database A to database B.

Database A is Oracle 9i, encoded WE8ISO8859P1, and contains a table "foo" with at least one CHAR (1 char) column. I cannot modify the table in database A because it is part of a third-party setup.

Database B is my own Oracle 10g database using AL32UTF8 encoding for all reasons, and I want to copy foo to this database.

I configure the database link from database B to database A. Then I issue the following command:

* create a table as a selection * from # link # .foo; *

The data is copied beautifully, but when I check the column types, I notice that CHAR (1 char) was converted to CHAR (3 char), and when querying the data in database B, they are all filled with spaces.

I think somewhere underwater, Oracle is embarrassing its own bytes and characters. CHAR (1 byte) is different from CHAR (1 char), etc. I read about all this.

Why does the data type change to the added CHAR (3 char) and how can I stop Oracle from doing this?

Edit: this seems to be related to transferring the CHAR between two specific levels of the Oracle 9 and 10 pattern. It seems like this is really a mistake. as soon as i find out i will post the update. Meanwhile: do not try to move the CHAR between the databases as I described. VARCHAR2 works fine (verified).

2: : CHAR (1) CHAR (3) Oracle DBLINK? , , .

+3
3
+3

NLS WE8ISO8859P1 ( ) AL32UTF8, . (NLS) . Oracle , .

SQL:

ALTER SESSION NLS_NCHAR WE8ISO8859P1 
create table bar as select * from #link#.foo;
+2

NOT CTAS, . , , ... , .

+1

Source: https://habr.com/ru/post/1698977/


All Articles