OCIEnvNlsCreate()

Hi,
I am wondering if anyone can help with this OCIEnvNlsCreate() error. I installed Oracle Client, PHP 5.1.4 into Linux with OCI8 enabled. However, I cannot connect PHP with Oracle, I got OCIEnvNlsCreate() error.
I tried a couple of workaround, but it doesn't work:
1) Put apache into oinstall group and putting oinstall in apache group, it doesn't work.
2) Checked that $ORACLE_HOME path is set
3) Changed all the folder under $ORACLE_HOME to 755
Can anyone help me with this issue.
Help is really appreciated.
Thanks!

If PHP is configured to use an ORACLE_HOME install, set ORACLE_HOME and then run apachectl. If you use the bash shell, try something like:
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
apachectl start
The environment variable must be set in the shell that starts Apache.
If PHP was configured with Oracle Instant Client then you do not need to set ORACLE_HOME.
-- cj

Similar Messages

  • OCIEnvNlsCreate():Oracle Instant Client libraries

    Pls help solve this error:
    [Mon Feb 18 13:45:14 2008] [error] [client 0.0.0.0] PHP Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in C:\\EID_Web\\test.php on line 3
    [Mon Feb 18 13:45:14 2008] [error] [client 0.0.0.0] PHP Warning: oci_close() expects parameter 1 to be resource, boolean given in C:\\EID_Web\\test.php on line 14
    [Mon Feb 18 13:45:18 2008] [error] [client 0.0.0.0] PHP Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in C:\\EID_Web\\test.php on line 3
    [Mon Feb 18 13:45:18 2008] [error] [client 0.0.0.0] PHP Warning: oci_close() expects parameter 1 to be resource, boolean given in C:\\EID_Web\\test.php on line 14.
    tried to change the path but still no changes.
    this is what i use:
    apache 2.2,oracle server 10g ,instant client 10g, windows 2000,php 5.2
    Message was edited by:
    tamse

    Make sure that you have only one Oracle Client on the client machine.
    Delete/uninstall all others. Best uninstall all Oracle Software on that machine and reinstall one client.
    Before you try to connect from a PHP script, try to connect with sqlplus. If that works, proceed.
    The PHP you use must compiled and linked against the Oracle client version you use, else it won't work.
    Now try again. If you still get the same errors, post the error messages and relevant parts of the PHP script.
    Be aware that this forum is for Instant Client, so there might be better forums for PHP questions.
    Yours,
    Laurenz Albe

  • OCIEnvNlsCreate() failed: OCI8+PHP+Linux+Oracle 11g

    Hi All,
    I've been struggling with this since 3 days. I'm getting the following error while using oci_connect:
    Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries
    My system configuration:
    PHP : 5.3.3
    OS: Red Hat Enterprise Linux Server release 6.1
    Oracle: 11g
    OCI8: 1.4.9
    My phpInfo() shows that OCI8 is configured with PHP. I did set the LD_LIBRARY_PATH to Instantclient in httpd conf file itself and gave permission 777 just to make sure it's not permission issue. I did not set any ORACLE_HOME because my Oracle database is on a different server.
    Please help!!

    Your post doesn't contain enough detail to identify a cause.
    See Unable load  library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.11.1 It is an example of a post that has good detail.

  • OCIEnvNlsCreate failed with return code -1

    Hi, we're getting this error when running SQL Server 2005 Reporting Services to connect to an Oracle 9i database. The report works fine locally but breaks on the web. Another user has posted about this same exact issue to Microsoft's SSRS forum, but with no answer: http://tinyurl.com/ynqv7o
    Your help is much appreciated. Thank you.

    Check Re: OCIEnvNlsCreate failed with return code -1

  • Error while creating ORS V2.1.0 Database - ERROR OCIEnvNlsCreate.

    When I run the CdxDBI.exe under ORS-V2.1.0-Database\FW\Install-Upgrade, I get the following error. Any help will be appreciated.
    Couldn't connect to database Oracle DEMO system: ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permissions, etc.
    Error Occured, Process being aborted ...
    Running CdxDBI.exe from Windows 7 with the Oracle Database 11g R2 client. Target Oracle Database 11g R2 Server is running in OEL 5.
    Full output below
    ==============================
    D:\ORS\MWFM\Setup\ORS-V2.1.0-Database\FW\Install-Upgrade>CdxDBI.exe
    Enter the name of the target database: DEMO
    Enter the password for the SYSTEM user account in the database:
    Enter the name of the owner of Database Schema: CISADM
    Enter the loction for Java Home(e.g. C:\Java\jdk1.6.0_18): C:\Oracle\Middleware\jdk160_24
    Enter the TUGBU jarfiles location (e.g.C:\Database-Install\Jarfiles): D:\ORS\MWFM\Setup\ORS-V2.1.0-Database\ORS\jarfiles
    Enter the password for CISADM schema (or hit ENTER to quit):
    Re-enter the password:
    Enter the Oracle user with read-write privileges to Database Schema: CISUSER
    Enter the Oracle user with read-only privileges to Database Schema: CISREAD
    Enter the database role with read-write privileges to Database Schema: CIS_USER
    Enter the database role with read-only privileges to Database Schema: CIS_READ
    Connecting to the Target Database as user system
    User Name : system
    Database Name : DEMO
    Couldn't connect to database Oracle DEMO system: ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permissions, etc.
    Error Occured, Process being aborted ...
    Press Enter to Continue ...
    ==============================

    Wierd. Used Oracle XE as the database client and it worked fine.
    Not sure why it is not working with Oracle Database 11g client.
    Thanks.

  • Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed.

    Right now I am getting the following error when I try to connect to any of my Oracle databases:
    Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in /var/apache2/htdocs/test2.php on line 17
    I tried connecting to three separate databases with the same result, 10.2.0.2 [Windows Sever 2003], 9.2.0.7 [Solaris 10], 10.2.0.3 [Redhat].
    On my app server [Sun V20z] which is a x86-64 Bit server has the following installed: Solaris 10, Oracle 10.2 Client [Admin option] and PHP 5.2 using Apache2 that installed with Solaris.
    I done quite a bit of reading and can't quite figure out what I'm doing wrong. So if anyone can help me out I would greatly appreciate it.
    Below is how I setup Apache and PHP and how some of my setting are showing up.
    # uname -a
    SunOS sesapp 5.10 Generic_118855-36 i86pc i386 i86pc
    Install libiconv.
    # gunzip -c libiconv-1.9.2.tar | tar -xvf -
    # cd libiconv-1.9.2
    # ./configure
    # make
    # make install
    Install libxml2.
    # gunzip -c libxml2-2.6.26.tar.gz | tar -xvf -
    # cd libxml2-2.6.26
    # ./configure
    # make
    Copy the sample Apache2 configuration file.
    # cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf
    # make install
    Install PHP 5.2
    # gunzip -c cd php-5.2.0.tar.gz | tar -xvf -
    # cd php-5.2.0
    # ./configure with-apxs2=/usr/apache2/bin/apxs with-libxml-dir=/usr/local with-config-file-path=/etc/apache2 with-zlib with-oracle=/apps/oracle/product/10.2.0/client with-oci8=/apps/oracle/product/10.2.0/client
    # make
    # make install
    Setup the PHP configuration file.
    # cp php.ini-dist /etc/apache2/php.ini
    Add the following lines to the PHP /etc/apache2/httpd.conf configuration file.
    AddType application/x-httpd-php .php
    Created file /usr/apache2/bin/oraenv [This is for environment paths when apache starts]
    ORACLE_BASE=/apps/oracle
    export ORACLE_BASE
    ORACLE_HOME=/apps/oracle/product/10.2.0/client
    export ORACLE_HOME
    LD_LIBARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME
    export LD_LIBARY_PATH
    LD_LIBRARY_PATH=/usr/apache2/lib:$ORACLE_HOME/lib:$ORACLE_HOME
    export LD_LIBRARY_PATH
    TNS_ADMIN=/apps/oracle/product/10.2.0/client/network/admin
    export TNS_ADMIN
    NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
    export NLS_LANG
    I then modified /usr/apache2/bin/apachectl and in the "CONFIGURATION SECTION" added:
    if [ -f /usr/apache2/bin/oraenv ] ;
    then
    . /usr/apache2/bin/oraenv
    fi
    Enable Apache2 using the Solaris Management Facility (SMF).
    # svcadm enable apache2
    When I do phpinfo() I get the following bits:
    oci8
    OCI8 Support enabled
    Version 1.2.2
    Revision $Revision: 1.269.2.16.2.25 $
    Active Persistent Connections 0
    Active Connections 0
    Oracle Version 10.1
    Compile-time ORACLE_HOME /apps/oracle/product/10.2.0/client
    Libraries Used no value
    Temporary Lob support enabled
    Collections support enabled
    Directive Local Value Master Value
    oci8.default_prefetch 10 10
    oci8.max_persistent -1 -1
    oci8.old_oci_close_semantics 0 0
    oci8.persistent_timeout -1 -1
    oci8.ping_interval 60 60
    oci8.privileged_connect Off Off
    oci8.statement_cache_size 20 20
    Environment
    Variable Value
    LANG C
    LD_LIBARY_PATH /apps/oracle/product/10.2.0/client/lib:/lib:/usr/lib:/apps/oracle/product/10.2.0/client
    LD_LIBRARY_PATH /usr/apache2/lib:/apps/oracle/product/10.2.0/client/lib:/apps/oracle/product/10.2.0/client
    NLS_LANG AMERICAN_AMERICA.WE8MSWIN1252
    ORACLE_BASE /apps/oracle
    ORACLE_HOME /apps/oracle/product/10.2.0/client
    PATH /usr/sbin:/usr/bin
    SMF_FMRI svc:/network/http:apache2
    SMF_METHOD /lib/svc/method/http-apache2 start
    SMF_RESTARTER svc:/system/svc/restarter:default
    TNS_ADMIN /apps/oracle/product/10.2.0/client/network/admin
    TZ Canada/Mountain
    If there is anything that you can think of that I should try or see something that I screwed up in my conf, please let me know as I am stumped.
    Clayton

    I can confirm that this is an Oracle Client permissions problem. I got frustrated and chmod -R 777 /apps/oracle and sure enough I could connect to all the databases. I know that this isn't a solution so I'll undo this and try and figure out which directories PHP is having a hard time accessing. If I am able to narrow it down I'll post it here. And if someone has done this already can you please post your finding's here.
    Cheers,
    Clayton

  • Oracle oci8 problem: OCIEnvNlsCreate() failed

    Hi to all,
    I have installed Apache 2.4.3, PHP 5.3.21 and Oracle Database 10gR2 on a Windows 2003 server. Please that is installed the complete Oracle DB* and not the only Oracle Client.
    When I run phpinfo This is the result:
    OCI8 Support      enabled
    Version      1.4.9
    Revision      $Id: 44bfa713983a99b3e59477f6532e5fb51b6dee94 $
    Active Persistent Connections      0
    Active Connections      0
    Oracle Run-time Client Library Version      0.0.0.0.0
    Oracle Instant Client Version      10.2
    Temporary Lob support      enabled
    Collections support      enabled
    Directive     Local Value     Master Value
    oci8.connection_class     no value     no value
    oci8.default_prefetch     100     100
    oci8.events     Off     Off
    oci8.max_persistent     -1     -1
    oci8.old_oci_close_semantics     Off     Off
    oci8.persistent_timeout     -1     -1
    oci8.ping_interval     60     60
    oci8.privileged_connect     Off     Off
    oci8.statement_cache_size     20     20I have create a file connect.php in order to test my connection:
    <?php
    $dbHost = "win2003vm";
    $dbHostPort="1521";
    $dbServiceName = "myservice";
    $usr = "myuser";
    $pswd = "mypwd";
    $dbConnStr = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
                (HOST=".$dbHost.")(PORT=".$dbHostPort."))
                (CONNECT_DATA=(SERVICE_NAME=".$dbServiceName.")))";
    if(!$dbConn = oci_connect($usr,$pswd,$dbConnStr)){
    $err = oci_error();
    trigger_error('connection failed: ' . $err['message'], E_USER_ERROR);
    $strSQL = "SELECT SYSDATE FROM DUAL";
    $stmt = oci_parse($dbConn,$strSQL);
    if ( ! oci_execute($stmt) ){
    $err = oci_error($stmt);
    trigger_error('Query failed: ' . $err['message'], E_USER_ERROR);
    while(oci_fetch($stmt)){
        $rslt = oci_result($stmt, 1); print "<h3>Query result: ".$rslt."</h3>";
    ?>But when I run the php file, this error is displayed:
    Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that PATH includes the directory with Oracle Instant Client libraries in C:\www\win2003vm\connect.php on line 13 Fatal errorCan someone help me ?
    Thank You and best regards
    Gaetano

    The reason the error mentions Instant Client is because this text was
    compiled into the DLL when it was built using Instant Client. You can
    ignore this message phrasing quirk and focus on why OCIEnvNlsCreate()
    failed. Seeing the C code might help explain why the 'wrong' text is
    shown:
         errstatus = OCIEnvNlsCreate(&OCI_G(env), PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, 0, 0);
         if (errstatus == OCI_ERROR) {
    #ifdef HAVE_OCI_INSTANT_CLIENT
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries");
    #else
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories");
    #endifDo you have other Oracle libraries that are causing a library clash?
    Did you reboot after installing? Is there some permission issue with
    the web server environment? Are you using Apache or ISS. Does this
    help:
    https://blogs.oracle.com/opal/entry/how_to_use_iis_php_and_oracle
    Also see "Commonly Seen Connection and Environment Errors" on p 107 of
    http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html
    You may be interested that your $dbConnStr can be simplified. See
    "Easy Connect String" on p 104 of the above book. The variable can be:
    $dbConnStr = "${dbHost}:${dbHostPort}/${dbServiceName}";In fact, since you are using the default port, it could even be just:
    $dbConnStr = "${dbHost}/${dbServiceName}";

  • OCIEnvNlsCreate failed

    I have an asp.net application talking to an Oracle 9.2 Database. It works fine on my local machine but when I copy it to our Windows 2003 webserver I get the "OCIEnvNlsCreate failed with return code -1" error. I have checked that the asp.net user has read and write permissions to the entire Oracle Home directory on the server. any other suggestions would be appreciated.

    I am also facing the Same issue when I am tring to connect to Oracle 9i Database from Asp.net 2.0 web application below is error log if any can help me it will really good.
    OCIEnvNlsCreate failed with return code -1 but error message text was not available.
    Exception: OCIEnvNlsCreate failed with return code -1 but error message text was not available.]
    System.Data.OracleClient.OciHandle..ctor(OciHandle parentHandle, HTYPE handleType, MODE ocimode, HANDLEFLAG handleflags) +262
    System.Data.OracleClient.OCI.DetermineClientVersion() +247
    System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +30
    System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +135
    System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +37
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +510
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +102
    System.Data.OracleClient.OracleConnection.Open() +34
    Rbc.Gpb.Cap.Cees.Dal.UtilityDao.GetChsPmtUserDetails(Int64 p_ChsProfileId) in D:\SourceControl\DEV\Cees\Rbc.Gpb.Cap.Cees.Dal\UtilityDao.cs:216
    Rbc.Gpb.PlanManagement.BusinessLogic.PMTUtilManager.GetChsUserDetails(Int64 lngChsProfileID) in D:\SourceControl\DEV\Rbc.Gpb.PlanManagement\BusinessLogic\PMTUtilManager.cs:53
    Rbc.Gpb.PlanManagement.Web.Util.PMTUtility.GetChsUserInfo(Int64 p_ChsProfileId) in D:\SourceControl\DEV\Rbc.Gpb.Cap.GpbOnline.Web\PlanManagement\Util\PMTUtility.cs:50
    Rbc.Gpb.PlanManagement.Web.Util.PMTUtility.SetUserInfo(String p_UserId) in D:\SourceControl\DEV\Rbc.Gpb.Cap.GpbOnline.Web\PlanManagement\Util\PMTUtility.cs:91
    Rbc.Gpb.PlanManagement.Web.Default.SetPlanManagementBaseValues(String userID) in D:\SourceControl\DEV\Rbc.Gpb.Cap.GpbOnline.Web\PlanManagement\Default.aspx.cs:223
    Rbc.Gpb.PlanManagement.Web.Default.Page_Load(Object sender, EventArgs e) in D:\SourceControl\DEV\Rbc.Gpb.Cap.GpbOnline.Web\PlanManagement\Default.aspx.cs:60
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
    System.EventHandler.Invoke(Object sender, EventArgs e) +0
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +47
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

  • Oracle Environment Variable Problem - OCIEnvNlsCreate() failed

    We are using PHP 5.2.3 with oci8 version 1.2.3 in CentOS 5.0.
    We have installed Oracle 10g in the same machine where Apache (2.2.3) is running.
    First we tried to set the Oracle environment variable in httpd.conf as
    SetEnv ORACLE_HOME u01/app/..../db_1
    SetEnv ORACLE_SID oratest.
    But we were unable to connect and got the message 'OCIEnvNlsCreate() failed'.
    Then we tried to set the environment variables in root's bash profile.
    Then it did work in PHP command line interface. But it didn't work in browser. Interestingly, getenv function shows the environment variables correctly (even in the browser).
    We also given the read and execute permissions for all users in all directories of oracle. But still it gives the same error.
    Please help.

    While trying to get new oci8 php extension to work I remember trying to set parameters using SetEnv inside apache httpd.conf or inside .htaccess file. However this is not recommended and I remember seeing some suggestions as not to use SetEnv for Oracle environment variables. I also had issues with that before. I went and added bash
    export ORACLE_HOME=... to the Apache startup script in /etc/init.d and this has resolved the problem for me.
    I hope this helps.
    Gena01

  • What is the difference between OCIEnvCreate and OCIEnvNlsCreate with utf16

    because i find a oci sample code cdemouni.c,in this sample,use OCIEnvCreate with mode set OCI_UTF16,but OCIEnvNlsCreate also can set charset and ncharset OCI_UTF16ID,what is the difference between OCIEnvCreate and OCIEnvNlsCreate with UTF16?

    First, OCIEnvNlsCreate() is recommended way of switching to UTF-16 mode.
    Second, OCIEnvNlsCreate() uses new semantics for bind and define buffer lengths. With new semantics all lengths are in bytes. With old semantics,
    UTF-16 string lengths are in codepoints, while other character sets use bytes.
    You can get new length semantics with OCIEnvCreate() as well, by
    adding OCI_NEW_LENGTH_SEMANTICS to the 'mode' flags.
    -- Sergiusz

  • What is the difference between OCIEnvCreate and OCIEnvNlsCreate?

    because i find a oci sample code cdemouni.c,in this sample,use OCIEnvCreate with mode set OCI_UTF16,but OCIEnvNlsCreate also can set charset and ncharset OCI_UTF16ID,what is the difference between OCIEnvCreate and OCIEnvNlsCreate with UTF16?

    First, OCIEnvNlsCreate() is recommended way of switching to UTF-16 mode.
    Second, OCIEnvNlsCreate() uses new semantics for bind and define buffer lengths. With new semantics all lengths are in bytes. With old semantics,
    UTF-16 string lengths are in codepoints, while other character sets use bytes.
    You can get new length semantics with OCIEnvCreate() as well, by
    adding OCI_NEW_LENGTH_SEMANTICS to the 'mode' flags.
    -- Sergiusz

  • OCIEnvNLSCreate using Cygwin and Perl

    Hi
    I have Cygwin 1.5.25 installed with Oracle 10g Client on Windows XP Professional. I have installed DBD::Oracle (1.21) and Perl 5.8
    Here is my environment
    ORACLE_HOME C:\oracle\product\10.2.0\client_2
    LD_LIBRARY_PATH %ORACLE_HOME%\bin
    TNS_ADMIN %ORACLE_HOME%\NETWORK\ADMIN\tnsnames.ora
    NLS_LANG AMERICA_AMERICA.WE8DEC
    ORACLE_SID CBDEV
    TWO_TASK CBDEV (available in tnsnames.ora)
    ORA_NLS10 C:\oracle\product\10.2.0\client_2\nls\data
    SQLPLUS %ORACLE_HOME%\BIN
    Cygwin picks up all the above variables at startup
    sqlplus <uname/passwd>@CBDEV also works from the cygwin shell
    However below script, which uses Perl DBI to connect to same database to retrieve data fails with error posted below.
    I googled for this error and from all posted threads, changed permissions on ORACLE_HOME/BIN and ORACLE_HOME/LIB. Also did the same for entire ORACLE_HOME directory
    ANY input would be appreciated. I did not find a separate forum for Perl, hence posted on this forum!!
    Thanks
    #!/usr/bin/perl
    use strict;
    use DBI;
    print "Getting Data\n";
    my $RefHash = &getData();
    $ENV{ORACLE_SID} = "CBDEV";
    $ENV{ORACLE_HOME} = "/oracle/product/10.2.0/client_2";
    $ENV{NLS_LANG} = "AMERICAN_AMERICA.WE8DEC";
    $ENV{ORA_NLS} = $ENV{ORACLE_HOME}."/ocommon/nls/admin/data";
    $ENV{LD_LIBRARY_PATH} = $ENV{ORACLE_HOME}."/lib";
    $ENV{ORA_NLS10} = '/oracle/product/10.2.0/client_2/nls/data';
    sub getData() {
    my($name, $id, $phylocId);
    my %RefHash;
    my $dbh = DBI->connect('DBI:Oracle:CBDEV', '<uname>', '<passwd>') || die "Error ".DBI->errstr;
    my $sql = qq(SELECT 'name' from DUAL);
    my $sth = $dbh->prepare($sql);
    $sth->execute();
    $sth->bind_columns(\$name);
    while($sth->fetch()) {
    $name=~s/\s+//g;
    $RefHash{$name}='1';
         print "Name : $name ", $RefHash{$name}, "\n";
    return \%RefHash;
    exit;
    Output of Perl -V
    Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
    Platform:
    osname=cygwin, osvers=1.5.24(0.15642), archname=cygwin-thread-multi-64int
    uname='cygwin_nt-5.1 reini 1.5.24(0.15642) 2007-01-31 10:57 i686 cygwin '
    config_args='-de -Dmksymlinks -Duse64bitint -Dusethreads -Uusemymalloc -Doptimize=-O3 -Dman3ext=3pm -Dusesitecustomize -Dusedevel'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    Compiler:
    cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -Wdeclaration-after-statement',
    optimize='-O3',
    cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -Wdeclaration-after-statement'
    ccversion='', gccversion='3.4.4 (cygming special, gdc 0.12, using dmd 0.125)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
    Linker and Libraries:
    ld='ld2', ldflags =' -s -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib /lib
    libs=-lgdbm -ldb -ldl -lcrypt -lgdbm_compat
    perllibs=-ldl -lcrypt -lgdbm_compat
    libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl.a
    gnulibc_version=''
    Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' -s'
    cccdlflags=' ', lddlflags=' -s -L/usr/local/lib'
    Characteristics of this binary (from libperl):
    Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
    PERL_MALLOC_WRAP PERL_USE_SAFE_PUTENV
    USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
    USE_PERLIO USE_REENTRANT_API USE_SITECUSTOMIZE
    Locally applied patches:
    CYG01 - hints.cygwin.sh ldflags -s
    CYG02 - lib-ExtUtils-Embed insensitive against leading \s
    CYG03 - lib-Test-Harness-Straps $ENV{PERL5LIB} = ''
    CYG04 - major.version.cygwin.sh cygperl-5_8.dll and not cygperl-5_8_x.dll
    CYG05 - add Win32CORE to core
    CYG07 - File-Spec-Cygwin-TMPDIR.patch
    Bug#38628 - allow legacy Cwd->cwd()
    Bug#40103 - File-Spec-case_tolerant.patch from 5.9.5
    Built under cygwin
    Compiled at Jul 8 2007 19:12:08
    %ENV:
    PERL5LIB=
    /usr/lib/perl5/5.8/cygwin
    /usr/lib/perl5/5.8
    /usr/lib/perl5/site_perl/5.8/cygwin
    /usr/lib/perl5/site_perl/5.8
    /usr/lib/perl5/site_perl/5.8
    /usr/lib/perl5/vendor_perl/5.8/cygwin
    /usr/lib/perl5/vendor_perl/5.8
    /usr/lib/perl5/vendor_perl/5.8

    Thanks for those 2 tips.
    I set TNS_ADMIN accordingly and removed calls to set the environment variables in the script.
    I still continue to encounter the OCIEnvNlsCreate error as before
    Here's the modified script and the output
    #!/usr/bin/perl
    use strict;
    use DBI;
    print "Testing DBD::Oracle \n";
    my @driver_names = DBI->available_drivers;
    foreach my $driver_name (@driver_names) {
    print $driver_name,"\n";
    foreach (DBI->data_sources($driver_name)) {
    print "*****",$_,"\n";
    my $cHash = &getCytoband();
    sub getCytoband() {
    my($name, $id, $phylocId);
    my %cytobHash;
    my $dbh = DBI->connect('DBI:Oracle:CBDEV', 'dunston', 'rocks') || die "Error ".DBI->errstr;
    my $sql = qq(SELECT distinct ID, NAME,PHYSICAL_LOCATION_ID from CYTOBAND where PHYSICAL_LOCATION_ID is NOT NULL);
    my $sth = $dbh->prepare($sql);
    $sth->execute();
    $sth->bind_columns(\$id, \$name, \$phylocId);
    while($sth->fetch()) {
    $name=~s/\s+//g;
    $id=~s/\s+//g;
    $phylocId=~s/\s+//g;
    $cytobHash{$name}=$id."|".$phylocId;
    print "Name : $name ", $cytobHash{$name}, "\n";
    return \%cytobHash;
    exit;
    ************ OUTPUT *************
    Getting Cytoband
    DBM
    *****DBI:DBM:f_dir=.cpan
    *****DBI:DBM:f_dir=.texmf
    *****DBI:DBM:f_dir=acroread
    *****DBI:DBM:f_dir=apache-ant-1.6.5
    *****DBI:DBM:f_dir=apache-ant-1.7.0-bin
    *****DBI:DBM:f_dir=AppName
    *****DBI:DBM:f_dir=autorun
    *****DBI:DBM:f_dir=caBIO
    *****DBI:DBM:f_dir=cabioApp
    *****DBI:DBM:f_dir=cygwin
    *****DBI:DBM:f_dir=dell
    *****DBI:DBM:f_dir=Documents and Settings
    *****DBI:DBM:f_dir=Downloads
    *****DBI:DBM:f_dir=drivers
    *****DBI:DBM:f_dir=httpd-2.2.8
    *****DBI:DBM:f_dir=i386
    *****DBI:DBM:f_dir=indexes
    *****DBI:DBM:f_dir=jboss-4.0.4.GA
    *****DBI:DBM:f_dir=jboss-4.0.5.GA
    *****DBI:DBM:f_dir=MSOCache
    *****DBI:DBM:f_dir=MyApp
    *****DBI:DBM:f_dir=NALCache
    *****DBI:DBM:f_dir=NOVELL
    *****DBI:DBM:f_dir=oracle
    *****DBI:DBM:f_dir=Perl
    *****DBI:DBM:f_dir=Perl-Critic-1.082
    *****DBI:DBM:f_dir=Perl-Tidy-20071205
    *****DBI:DBM:f_dir=Program Files
    *****DBI:DBM:f_dir=RECYCLER
    *****DBI:DBM:f_dir=ruby
    *****DBI:DBM:f_dir=System Volume Information
    *****DBI:DBM:f_dir=Tcl
    *****DBI:DBM:f_dir=Temp
    *****DBI:DBM:f_dir=WINDOWS
    *****DBI:DBM:f_dir=.
    ExampleP
    *****dbi:ExampleP:dir=.
    File
    *****DBI:File:f_dir=.cpan
    *****DBI:File:f_dir=.texmf
    *****DBI:File:f_dir=acroread
    *****DBI:File:f_dir=apache-ant-1.6.5
    *****DBI:File:f_dir=apache-ant-1.7.0-bin
    *****DBI:File:f_dir=AppName
    *****DBI:File:f_dir=autorun
    *****DBI:File:f_dir=caBIO
    *****DBI:File:f_dir=cabioApp
    *****DBI:File:f_dir=cygwin
    *****DBI:File:f_dir=dell
    *****DBI:File:f_dir=Documents and Settings
    *****DBI:File:f_dir=Downloads
    *****DBI:File:f_dir=drivers
    *****DBI:File:f_dir=httpd-2.2.8
    *****DBI:File:f_dir=i386
    *****DBI:File:f_dir=indexes
    *****DBI:File:f_dir=jboss-4.0.4.GA
    *****DBI:File:f_dir=jboss-4.0.5.GA
    *****DBI:File:f_dir=MSOCache
    *****DBI:File:f_dir=MyApp
    *****DBI:File:f_dir=NALCache
    *****DBI:File:f_dir=NOVELL
    *****DBI:File:f_dir=oracle
    *****DBI:File:f_dir=Perl
    *****DBI:File:f_dir=Perl-Critic-1.082
    *****DBI:File:f_dir=Perl-Tidy-20071205
    *****DBI:File:f_dir=Program Files
    *****DBI:File:f_dir=RECYCLER
    *****DBI:File:f_dir=ruby
    *****DBI:File:f_dir=System Volume Information
    *****DBI:File:f_dir=Tcl
    *****DBI:File:f_dir=Temp
    *****DBI:File:f_dir=WINDOWS
    *****DBI:File:f_dir=.
    Gofer
    Oracle
    *****dbi:Oracle:BIODEV
    *****dbi:Oracle:CADEV
    *****dbi:Oracle:CBDEV
    *****dbi:Oracle:CBTEST
    *****dbi:Oracle:CGPROD
    *****dbi:Oracle:EXTPROC_CONNECTION_DATA
    *****dbi:Oracle:LPGDEV
    *****dbi:Oracle:LPGPROD
    *****dbi:Oracle:LPG_DEV
    *****dbi:Oracle:LPG_PROD
    Proxy
    Sponge
    DBI connect('CBDEV','dunston',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permissions, etc. at tmp.pl line 25
    Error ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permissions, etc. at tmp.pl line 25.

  • Error in begining a session when using UTF16 mode in OCIEnvNlsCtreate

    I wrote this code :
    OCIEnv* envhp;
    OCIError* errhp;
    OCIServer* srvhp;
    OCISvcCtx* svchp;
    OCISession* usrhp;
    envhp = (OCIEnv *) 0;
    errhp = (OCIError *) 0;
    srvhp = (OCIServer *) 0;
    svchp = (OCISvcCtx *) 0;
    usrhp = (OCISession *) 0;
    int mode = OCI_DEFAULT;
    char* dblink=/* DBLINK */;
         sword status;
    OCIEnvNlsCreate ( &envhp, (ub4) mode, (dvoid *)0,(dvoid*(*)(dvoid ctxp, size_t size))0,(dvoid(*)(dvoid ctxp, dvoid memptr, size_t newsize))0,(dvoid (*)(dvoid ctxp, dvoid memptr))0,(size_t)0, (void **)0, (ub2)OCI_UTF16ID, (ub2)OCI_UTF16ID);
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&errhp, (ub4)OCI_HTYPE_ERROR,(size_t)0, (dvoid**)0);
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&srvhp, (ub4)OCI_HTYPE_SERVER,(size_t)0, (dvoid**)0);
    status = OCIServerAttach(srvhp, errhp, (text*)dblink,(sb4)strlen(dblink), (ub4)OCI_DEFAULT);
    if (status != OCI_SUCCESS)
    return 0;
    char username = /username*/;
    char password = /password*/;
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&svchp, (ub4)OCI_HTYPE_SVCCTX,(size_t)0, (dvoid**)0);
    OCIAttrSet((dvoid*)svchp, (ub4)OCI_HTYPE_SVCCTX, (dvoid*)srvhp, (ub4)0,(ub4)OCI_ATTR_SERVER, errhp);
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&usrhp, (ub4)OCI_HTYPE_SESSION,(size_t)0, (dvoid**)0);
    OCIAttrSet((dvoid*)usrhp, (ub4)OCI_HTYPE_SESSION, (dvoid*)username,(ub4)strlen(username), (ub4)OCI_ATTR_USERNAME, errhp);
    OCIAttrSet((dvoid*)usrhp, (ub4)OCI_HTYPE_SESSION, (dvoid*)password,(ub4)strlen(password), (ub4)OCI_ATTR_PASSWORD, errhp);
    status = OCISessionBegin(svchp, errhp, usrhp, OCI_CRED_RDBMS, (ub4)OCI_DEFAULT);
    When I use OCI_UTF16ID in OCIEnvNlsCreate it gives me an error in OCISessionBegin. But when I use 871(utf8) instead it works properly. Why does this happen? How can I work whit OCI_UTF16ID?

    Re: OCIObjectSetAttr() and UTF16 environnement might be of interest, even though it's a little different. Still relates to UTF16 though. --DD                                                                                                                                                                                                                                                                                                                                           

  • Inserting and retrieving data from a al32UTF8 database USING SQL Developer

    hi guys,
    Before i post my questions , i think its better for me to provide you guys with my understandings first so that it easier to understand where/if i have gone wrong..
    I am using Window XP and Oracle 10g
    Non-unicode client - a client program that need to use the OS code page for mapping of the retrieved unicode data from the database as well as the support of displaying/inserting the characters from that code page to the database.
    E.G sqlplusw.exe
    Therefore, when using a non-unicode client
    1) we have to set the OS code page (Control panel - regional and language setting - advance - language for non unicode program ) to the code page that contain the characters we are going to display/insert.
    2) we will also have to set the NLS_LANG characterset to the character set of the code page we are going to insert so that when we do a insert (for e.g in thai ) , oracle will know, and auto conversion to UNICODE can take place. This is also true when we retrieve unicode data from the database so that conversion to the correct character set can take place.
    INSERTING
    THAI ---> conversion ----> UNICODE
    RETRIEVING
    THAI <---- conversion <---- UNICODE
    I hope my basic understanding is correct up till this point.
    Unicode client - a client program that supports the displaying/inserting of unicode characters without the need of setting the OS code page (Control panel - regional and language setting - advance - language for non unicode program )
    E.G isqlplus http or SQL developer
    However,
    1) There is still a need to set the NLS_LANG so that correct conversion can take place between the client and the database.
    For e.g, when retrieving if we set the NLS_LANG character set to ZHS16GBK (chinese) and the data store in unicode in database is E.G (THAI) , then the conversion would be wrong .
    Since it is a unicode supported client, then the NLS_LANG character set should be set to UNICODE as well.
    Here come my questions
    *Important - please help if you are busy and have no other time to answer the rest of the questions
    *Q1) If i were to use a unicode client, what should i set my NLS_LANG character set to ?
    AMERICAN_AMERICA.UTF8 ?
    *Q2) Where do i set the NLS_LANG character set information in SQL Developer, i know there is a metalink for setting NLS_LANG using isqlplus but i cant seems to google any result for SQL developer.
    Q3) Is my basic understanding right until this point ? If not, please explain in a more generalised term as i am really not familiar with character sets, code page, unicode , glyphs and fonts..
    Q4) If a unicode client does not need to refer to the OS code page (set in regional and language) , is there a UNICODE code page for the client to refer to , or is there any Window API available ?
    Q5)
    There is still a need to set the NLS_LANG so that correct conversion can take place between the client and the >>database.
    For e.g, when retrieving if we set the NLS_LANG character set to ZHS16GBK (chinese) and the data store in >>unicode in database is E.G (THAI) , then the conversion would be wrong .am i right on this point for UNICODE supported client ?
    Thanks for spending time to read my questions and i hope to hear advices from you guys soon.
    Million thanks again for sharing.
    Best Regards,
    Noob but willing to learn

    The requirement to always set NLS_LANG is not true for JDBC, which ignores NLS_LANG altogether. Java programs fetch text data into String variables, which use Unicode UTF-16 by design. JDBC sets character set conversion so that data is converted between UTF-16 and the database or national character set.
    The requirement to set NLS_LANG is not generally true for OCI, either. The first call in an OCI problem can be OCIEnvNlsCreate(). This call has two parameters that allow the caller to define the character set to use for VARCHAR2/CHAR/LONG/CLOB/statement text and the character set to use for NVARCHAR2/NCHAR/NCLOB. Only if these character sets are specified as 0, NLS_LANG character set is used. Also, OCI programs can specify different character sets for each bind or define variable (i.e. input/output buffer). Note: OCI programs always use NLS_LANG to initialize the language and territory settings for the client program and the database session. Only the character set can be specified is OCIEnvNlsCreate().
    OCIEnvNlsCreate() can specify the client character set as UTF-16 (in platform endianess). This is not possible with NLS_LANG.
    Various interfaces building on OCI, such as Oracle ODBC and ODP .NET, explicitly initialize OCI with Unicode character set, and thus ignore the NLS_LANG character set as well.
    Thnx,
    Sergiusz

  • OCI error In using UTF16 mode in begining a session

    I wrote this code :
    OCIEnv* envhp;
    OCIError* errhp;
    OCIServer* srvhp;
    OCISvcCtx* svchp;
    OCISession* usrhp;
    envhp = (OCIEnv *) 0;
    errhp = (OCIError *) 0;
    srvhp = (OCIServer *) 0;
    svchp = (OCISvcCtx *) 0;
    usrhp = (OCISession *) 0;
    int mode = OCI_DEFAULT;
    char* dblink=/* DBLINK */;
         sword status;
    OCIEnvNlsCreate ( &envhp, (ub4) mode, (dvoid *)0,(dvoid*(*)(dvoid ctxp, size_t size))0,(dvoid(*)(dvoid ctxp, dvoid memptr, size_t newsize))0,(dvoid (*)(dvoid ctxp, dvoid memptr))0,(size_t)0, (void **)0, (ub2)OCI_UTF16ID, (ub2)OCI_UTF16ID);
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&errhp, (ub4)OCI_HTYPE_ERROR,(size_t)0, (dvoid**)0);
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&srvhp, (ub4)OCI_HTYPE_SERVER,(size_t)0, (dvoid**)0);
    status = OCIServerAttach(srvhp, errhp, (text*)dblink,(sb4)strlen(dblink), (ub4)OCI_DEFAULT);
    if (status != OCI_SUCCESS)
    return 0;
    char username = /username*/;
    char password = /password*/;
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&svchp, (ub4)OCI_HTYPE_SVCCTX,(size_t)0, (dvoid**)0);
    OCIAttrSet((dvoid*)svchp, (ub4)OCI_HTYPE_SVCCTX, (dvoid*)srvhp, (ub4)0,(ub4)OCI_ATTR_SERVER, errhp);
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&usrhp, (ub4)OCI_HTYPE_SESSION,(size_t)0, (dvoid**)0);
    OCIAttrSet((dvoid*)usrhp, (ub4)OCI_HTYPE_SESSION, (dvoid*)username,(ub4)strlen(username), (ub4)OCI_ATTR_USERNAME, errhp);
    OCIAttrSet((dvoid*)usrhp, (ub4)OCI_HTYPE_SESSION, (dvoid*)password,(ub4)strlen(password), (ub4)OCI_ATTR_PASSWORD, errhp);
    status = OCISessionBegin(svchp, errhp, usrhp, OCI_CRED_RDBMS, (ub4)OCI_DEFAULT);
    When I use OCI_UTF16ID in OCIEnvNlsCreate it gives me an error in OCISessionBegin. But when I use 871(utf8) instead it works properly. Why does this happen? How can I work whit OCI_UTF16ID?

    You will likely get a better response if you post your question in a more appropriate group.
    Might I suggest "C++ Call Interface (OCCI)."

Maybe you are looking for

  • Print driver for HP Designjet 5500 (Model Q1251A)

    Looking for print driver for HP Designjet 5500 (Model Q1251A), non-PS (post script) printer for MacBook Pro, OS X 10.7.5.  Current drivers on HP web support does not have driver for the non-PS printer and directs me to Apple's support site, but can't

  • Recovering files from a dead HD?

    Hey all... Yesterday I tried burning an Audio CD with cdrecord, and since it was a 90min CD-R I had a lot of songs there. cdrecord failed the burning and said I could use -ignsize if I'm sure my drive is capable to burn this kind of CD. I guess it wa

  • Dv6 recovery disc

    Hello! I have been on the phone with HP (2+ Hours) with no success. I purchased a HP DV6 in Dubai: Product #A7M81EA#ABV. I wiped my conputer clean and need a recovery disc, they will not ship me a recovery disc from HP US because I bought it in Dubai

  • I have problems connecting to wifi with my mac book pro

    I cant connect to my house wifi network. The network status says: Wifi: green Wifi settings: green Network Settings; yellow ISP: green Internet: red (failed) Server: red (failed) I dont know what the problem is.

  • F.81 Reference

    Hi Guys, When I am doing the Accrual Reversal in F.81 I am getting the following error " VL 476: Item 'Official Doc. Number' is not copied from the reference document ". I have maintained the number ranges also. I am not able to understand why the sy