Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- From: Cris Carampa <cris119@xxxxxxxxxxxxx>
- Date: Thu, 06 Jul 2006 09:34:19 +0200
Sybrand Bakker wrote:
You are spreading fairy tales.
#
# loads the Oracle environment for a 9.2.0.5.0 US7ASCII database
#
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9ir2
export ORACLE_SID=bol1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
#
# sets the NLS_LANG environment value to the same value as the database
# charset
#
$ export NLS_LANG=american_america.US7ASCII
#
# inserts a 8-bit character into a 7-bit database
#
$ sqlplus scott/tiger
SQL*Plus: Release 9.2.0.5.0 - Production on Thu Jul 6 09:29:32 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Release 9.2.0.5.0 - Production
JServer Release 9.2.0.5.0 - Production
SQL> select value from nls_database_parameters where parameter='NLS_CHARACTERSET';
VALUE
----------------------------------------
US7ASCII
SQL> create table z ( z varchar2(4000) ) ;
Table created.
SQL> insert into z values ('città');
1 row created.
#
# dumps the 8-bit character into a text file
#
SQL> spool z.txt
SQL> select z from z ;
Z
--------------------------------------------------------------------------------
città
SQL> spool off
SQL> exit
#
# shows that the text file is an ISO-8859 file and contains the correct
# character
#
$ file z.txt
z.txt: ISO-8859 text
$ cat z.txt
città
#
# loads the Oracle environment for a second database, 10.1.0.4.0 - UTF8
#
export ORACLE_HOME=$ORACLE_BASE/product/10gr1
export ORACLE_SID=bol3
export TNS_ADMIN=$ORACLE_HOME/network/admin
unset ORA_NLS33
export ORA_NLS10=$ORACLE_HOME/nls/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
#
# sets the NLS_LANG environment value according to the text file charset
#
$ export NLS_LANG=american_america.WE8ISO8859P1
#
# creates a z.ctl file
#
load data
infile "z.txt"
append
into table z
(
z position (1:80)
)
#
# loads z.txt into UTF8 database
#
$ sqlldr scott/tiger z.ctl
SQL*Loader: Release 10.1.0.4.0 - Production on Thu Jul 6 09:27:10 2006
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Commit point reached - logical record count 1
#
# shows the 8-bit character was correctly loaded
#
$ sqlplus scott/tiger
SQL*Plus: Release 10.1.0.4.0 - Production on Thu Jul 6 09:28:13 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Release 10.1.0.4.0 - Production
SQL> select value from nls_database_parameters where parameter='NLS_CHARACTERSET';
VALUE
--------------------------------------------------------------------------------
UTF8
SQL> select z from z ;
Z
--------------------------------------------------------------------------------
città
--
Cris Carampa (spamto:cris119@xxxxxxxxxxxxx)
blind faith in your leaders or
in anything will get you killed
.
- Follow-Ups:
- Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- From: Sybrand Bakker
- Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- References:
- Characters losts during Import (8.1.6) -> (9.2.0.6)
- From: Guitarator
- Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- From: Markku Uttula
- Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- From: Cris Carampa
- Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- From: sybrandb
- Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- From: Cris Carampa
- Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- From: Sybrand Bakker
- Characters losts during Import (8.1.6) -> (9.2.0.6)
- Prev by Date: Re: SQL tuning nightmare - db file sequential reads
- Next by Date: performance database oracle
- Previous by thread: Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- Next by thread: Re: Characters losts during Import (8.1.6) -> (9.2.0.6)
- Index(es):
Relevant Pages
|