ORA-12705: Cannot access NLS data files or invalid environme

Today,I encountered an issue, that report  ORA-12705: Cannot access NLS data files or invalid environme,

I am accessing the oracle database which install in unix ,by php under windowxp. also in my pc, I installed the oracle database due to TOAD, But I prefer to the instantclient to connect to oracle db in unix, so mask the NLS_LANG in regester,
yet It does not work, then add NLS_LANG = AMERICAN_AMERICA.AL32UTF8 in environment, restart pc,
Successfully connect oracle db.

DbPool.php

<?php
# Local Mysql

define("DBLOCUSER", "aaron");
define("DBLOCPWD", "121312");
#new db-machine
define("DBLOCSID", "localhost:3306");
#define("DBLOCSID", "10.40.64.219:3306");


#Suzhou Drive ODS
define("DBUSER", "G341451");
define("DBPWD", "readonly");
define("DBSID", "SUZ_ODS");
# WX Site ODS
define("WXDRUSER", "AMKENG046");
define("WXDRPWD", "janet");
define("WXDRSID", "ODS_WUXI.WORLD");

#Korat Drive ODS
define("KRDRUSER", "PPA");
define("KRDRPWD", "PPAFA2006");
define("KRDRSID", "ODS_KORAT.WORLD");

#UAT COTS_TAB_BENE_ADVICE
define("UATUSER", "RCOBRSR1");
define("UATPWD", "RCOBRSR1");
define("UATSID", "asotr.kemet.com");

class Dbcon{
    private $con;
    #Get Local MySQL connection
    function getConLoc(){
       $this->con=@mysql_connect(DBLOCSID,DBLOCUSER,DBLOCPWD);
     return $this->con; 
     }
    #Get SZ Drive ODS connection
    function getConSZD(){
     $this->con=oci_connect(DBUSER,DBPWD,DBSID);
     return $this->con; 
     }
    #Get WX Drive ODS connection
    function getConWXD(){
     $this->con=oci_connect(WXDRUSER,WXDRPWD,WXDRSID);
     return $this->con; 
     }
    #Get Korat Drive ODS database connection
    function getConKRD(){
     $this->con=oci_connect(KRDRUSER,KRDRPWD,KRDRSID);
     return $this->con; 
     }
    #Get UAT NCS_CITIBANK connection
    function getConUAT(){
     $this->con=oci_connect(UATUSER,UATPWD,UATSID);
     return $this->con; 
     }
    #Shutdown Oracle Connection
    function closeOracle(){
     oci_close($this->con);
     return 0;
    }
    #Shutdown MySQL Connection
    function closeMysql(){
       mysql_close($this->con);
     }
}
?>

query.php

<?php
# Generally use as get the family from WX site,Such as 9CC,9CY....
require_once("../include/DbPool.php");

$db=new Dbcon();
$conn=$db->getConUAT();
$sql="SELECT BRANCHNAME from COTS_TAB_BRANCH";
$s=oci_parse($conn,$sql);
oci_execute($s,OCI_DEFAULT);
echo "<table border='1' cellspacing='0' cellpadding='0' align='center'>
      <tr><td>No.</td><td>Branch</td>";
$i=0;
while(oci_fetch($s)){ 
       $i++;
       echo "<tr><td>".$i."</td><td>".ociresult($s,"BRANCHNAME")."</td></tr>";     
    }
    echo "</table>";

 $db->closeOracle();

?>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值