记不住,就写下呗!

管理 给我的留言

Guest 留言于2008-03-19 16:16:25
I appreciate your help, though those words are hard to understand. You are kind. I want to know
how the NLSXXX environmet values impact a pro*c program and how it happen. Can you give me some advice or reference articles, thanks

2008-03-29 21:55:44

以下答案来自metalink Note:405753.1
Subject:  Error ORA-03106 And ORA-12705 Occurs Running Oracle Pro*C On Different Environment
Applies to:
Precompilers - Version: 10.2.0.1
This problem can occur on any platform.
Oracle 10g 10.2.0.x Precompiler - Pro*C
Oracle 9i release 2 - 9.2.0.x Precompiler - Pro*C
Symptoms
Trying to connect to a table on a 9.2 database from a Pro*C application on Oracle 10g 10.2 on another machine receives

Error \'ORA-03106 Fatal 2-task communication protocol error\'

- Can access the same table via SQLPlus, but the Pro*C application errors.

Error \'ORA-12705: Cannot access NLS data files or invalid environment specified\' usually means, cannot interpret the NLS information on Client (eg: SQL*Plus or Oracle Client applications).

- This is mostly a configuration issue either in your environment or because Oracle client cannot interpret the NLS information received from the Server (eg: because of version mismatches between client and server). So please make sure that your NLS parameters are consistent with Server and Client.


Changes
- Running a precompiled program in a target machine with a different client version.
- Running a precompiled program from a different machine than the server but using a different characterset.

Problem can trigger for both of the above reasons.

Cause
If you are on 9.2.0.5 or less Oracle Client and then trying to connect Oracle 10g release 2 - 10.2.0.1 or later, vice versa, then this could be a problem.  

Having incorrect NLS_LANG setting can often lead to errors like \'ORA-03106\' and \'ORA-12705\'.
接上次的Solution
spinCC 留言于2008-03-13 16:30:55
想请教个问题
我用 proc*c连接数据库
环境变量
NLS_LANG=american_america.ZHS16GBK
时,proc*c连接数据库报错:
ORA-12705: invalid or unknown NLS parameter value specified
sqlplus 可以正常连接并显示数据库中的中文
如果我把
NLS_LANG环境变量中的 ZHS16GBK 换成其他的字符集,如US7ASCII,则proc*c连接正常,
sqlplus 登陆无法正常显示中文。
请问为何在 NLS_LANG=american_america.ZHS16GBK 时 pro*c 连接会报错,应如何解决?
其他环境变量:
LANG=en_US
NLS_LANG=american_america.ZHS16GBK
ORA_NLS33=/oracle/app/oracle/product/9.2.0.2.0/ocommon/nls/admin/data
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
数据库 nls_database_parameters
NLS_LANGUAGE                   AMERICAN
NLS_TERRITORY                  AMERICA
NLS_CURRENCY                   $
NLS_ISO_CURRENCY               AMERICA
NLS_NUMERIC_CHARACTERS         .,
NLS_CHARACTERSET               ZHS16GBK

2008-03-15 11:16:35

Solution
When it comes to Oracle Precompilers/Pro*C. The Oracle libraries/OS/Environment variables are all to be considered.  For Precompiler or OCI application code, you would need the correct libraries and environment.  

i.e., If you compile a Pro*C code on a 9.2.0.8 Client on Sun Solaris SPARC 32 bit, version 9 then you can only execute the code on the same OS or  on a different Sun Solaris Operating system with exact same configuration with similar client libraries.  

Apply the latest 9.2.0.8 patch to your existing Oracle 9.2 Clients and then recompile your application to connect to Oracle 10g release 2 - 10.2.0.1 or later.

Oracle 9.2.0.8 patchset can be obtained from Oracle Metalink.

If you are using any environment file like .profile:

Set NLS_LANG=null for the oracle and regular user .profile.  Then follow the steps as described in the README.txt $ORACLE_HOME/nls/data/old, the title of the document is: Oracle Database 10g: Updates to the Oracle Language and Territory Definition Files.

Below are the steps:

To revert to the Oracle9i language and territory behavior:

1. Shutdown the database
2. Run the script \'$ORACLE_HOME/nls/data/old/cr9idata.pl\' as the owner of the ORACLE_HOME directory
3. Set the ORA_NLS10 environment variable to the newly created $ORACLE_HOME/nls/data/9idata directory
4. Restart the database

2008-03-15 11:17:09

希望对你有帮助

2008-03-29 21:57:35

我没有用过PRO*C,不太清楚,只是上metalink找了一个情况与你所描述的最接近的文档.
给 xhailiang 留言

  

(可选)

数据统计

  • 访问量: 4816
  • 日志数: 893
  • 影音数: 1
  • 文件数: 2
  • 书签数: 3
  • 建立时间: 2008-02-17
  • 更新时间: 2008-07-07

RSS订阅

Open Toolbar