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
Similar Messages
-
Oracle environment variable setting for mulit instances
Dear experts,
I am doing CRM_ABAP, CRM_JAVA,ERP installation based on Oracle in a laptop for SAP Best Practise.
The CRM_ABAP installation have done, and start to install CRM_JAVA named CRJ.
In CRM_ABAP installation, I set Oracle environment variable as below:(/etc/profile.d/oracle.sh)
・CRACLE_SID=u201DCRMu201D
・CRACLE_HOME=u201Doracle/CRMu201D
・PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/bin/oPatch:$PATH:
・export CRACLE_SID CRACLE_HOME PATH
My question is that how do I set environment variable for CRM_JAVA(CRJ) in oracle.sh,?
I tried e.g. CRACLE_SID=u201DCRMu201D:u201DCRJu201D, CRACLE_HOME=u201Doracle/CRMu201D:u201Doracle/CRJ/102_64u201D
or CRACLE_SID=u201DCRJu201D CRACLE_HOME=oracle/CRJ/102_64u201D export CRACLE_SID CRACLE_HOME
in addition
but got an error message in SAPinst (Task Progress: configure Oracle server network)
said u201CAssertion failed:lsnrctl:Parameter dbHOME has to be a valid ORACLE_HOME).u201D
kindly help me to reslove the issue.
Thanks.
regards.
Li.etsuhinSetting a Linux environment variable like ORACLE_SID to multiple values will not work.
Use another oracle.sh, and maybe also another Linux user.
I am not familiar with the details, but what does your installation guide say?
Or you may have to use the same values for Java. The installation guide will tell you. -
How to read a non-oracle environment variable?
I have been trying to read a non-oracle environment variable using TOOL_ENV.GETVAR, and have come to understand that it doesn't work. Is there another function that can do what I want? I don't want to hardcode the directory the forms and reports must reside in, but can't find anyway to make this value flexible.
can anyone help ?
thx
adamI figured out a way. I put a String in the registry in the oracle home area, and can read it with TOOL_ENV.GETVAR now. It appears that it reads from the registry, not the environment variables. Except for unix apparently, where it reads environment variables.
adam -
Getting oracle environment variables using plsql code
Hi Geeks,
Can anyone tell me how to get an Oracle environment variable (eg db_cache_size) from inside a plsql block of code or through a sql query?
Thanks,
PrabhuIs it possible to update the values via SQL?That's indicated by:
ISSES_MODIFIABLE VARCHAR2(5) Indicates whether the parameter can be changed with ALTER SESSION (TRUE) or not (FALSE)
ISSYS_MODIFIABLE VARCHAR2(9) Indicates whether the parameter can be changed with ALTER SYSTEM and when the change takes effect:
See the docs:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2012.htm#REFRN30176 -
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
GaetanoThe 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}"; -
APPLLCSP Environment Variable Problem
Gurus-
How do I resolve this issue? I checked the Tk2Motif_UTF8.rgb file and I don't detect any errors. This btw, was generated as a result of a seeded report.
Thanks
APPLLCSP Environment Variable set to :
XML_REPORTS_XENVIRONMENT is :
/apps1/applmgr/11i/devora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
XENVIRONMENT is set to: /apps1/applmgr/11i/devora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
AMERICAN_AMERICA.UTF8
Report Builder: Release 6.0.8.27.0 - Production on Mon Jan 19 13:54:05 2009
(c) Copyright 1999 Oracle Corporation. All rights reserved.Here is the error message portion from a different user/report.
Enter Username:
Start of log messages from FND_FILE
End of log messages from FND_FILE
Executing request completion options...
------------- 1) PUBLISH -------------
Beginning post-processing of request 1474734 on node VALAP at 20-JAN-2009 11:54:15.
Post-processing of request 1474734 failed at 20-JAN-2009 11:54:16 with the error message:
One or more post-processing actions failed. Consult the OPP service log for details.
------------- 2) PRINT -------------
Not printing the output of this request because post-processing failed.
Finished executing request completion options. -
Oracle environment variable tns_admin instead tnsnames.ora
Hi, I have a big trouble with the tns_name file. First of all I am working oracle with visual studio .net. I have the file tns_name in the following route C:\oracle\ora92\network\ADMIN\tnsnames.ora. If I delete this file, visual studio .net can still work properly. Then I figured out that it is taking the tnsnames from tns_admin in environment variables. It means visual studio .net is taking the tnsnames from tns_admin instead of C:\oracle\ora92\network\ADMIN\tnsnames.ora.
Can someone explain me why and how is the way to configure which file is used? Where can I configure it?
Thanks in advance.it throws the following error: ora-12154 tns could not resolveORA-12154 ALWAYS only occurs on SQL Client & no SQL*Net packets ever leave client system
ORA-12154 occurs when client requests a connection to some DB server system using some connection string.
The lookup operation fails because the name provided can NOT be resolved to any remote DB.
The analogous operation would be when you wanted to call somebody, but could not find their name in any phonebook.
The most frequent cause for the ORA-12154 error is when the connection alias can not be found in tnsnames.ora.
The lookup operation of the alias can be impacted by the contents of the sqlnet.ora file; specifically DOMAIN entry. -
PERL5LIB environment variable problem
Greetings.
Oracle 10.1.0.3 apparently creates an environment variable named PERL5LIB. The pathing is causing a CGI application we're running to fail. Is there a way to get Oracle to work successfully without creating the variable or specifying the path another way ?
Thanks.
alanHave you tried adding your previous PERL5LIB path to the new on created by the install? I recently had to modify my PERL5LIB to run OPatch and updated it with the current and previous entries and all worked fine for me.
-shawn -
Setting Oracle environment variable using batch (.bat) file in windows
Hi,
Oracle 9i db
Windows OS
I am in process to create the database (Considered that Oracle9i software is already installed) by running one batch file which consist of all the scripts for the database creation.
But i also want to set the environment variables at MyComputer(right click)>properties>advance>environment, permenently by running the batch (.bat) file
ORACLE_HOME
ORACLE_BASE
ORACLE_SID
So, how can it be done ?
With RegardsHi,
*@echo off*
set ORACLE_SID=iprsdb
set ORACLE_BASE=C:\oracle
set ORACLE_HOME=C:\oracle\ora92
call C:\install_bkp\test_env_var.bat
echo Test Successfull.
Above mentioned is the code written in the batch (.bat) file
In that i have also called another .bat file which test the env. variable values which is as below:
c:\>test_env.bat
===================
Testing oracle sid
===================
iprsdb
=====================
Testing oracle base
===================
C:\oracle
=====================
Testing oracle home
=====================
C:\oracle\ora92
Test Successfull.
But when i checked at MyComputer(right click)>properties>advance>environment variables
there, I saw none of the entries from the above, why so ?
how to set env. variables permanently using the DOS commands. ?
With Regards -
Oracle Environment Variables on Linux
Hi,
First, I'll admit that I'm very, very new to Linux. I'm running Oracle Database XE 11g R2 on a virtual machine (Virtualbox) that is running Oracle Enterprise Linux 6. Whenever I open a terminal window and set ORACLE_HOME, PATH, and ORACLE_SID, I can easily access SQLPlus, simply by typing "SQLPlus". However, if I close that window and then open another terminal window, I cannot access SQLPlus, simply by typing "SQLPlus". I have to re-specify the environment variables first.
I'm sure that this is something simple but my lack of Linux experience is keeping me from finding the issue. Also, I've not found any documentation that helps but please point me to it if I've missed it.
Thanks,
BrianYou can also set your environment by using a shell script that comes with the XE default installation:
# source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
There's also a backup script.
# /u01/app/oracle/product/11.2.0/xe/config/scripts/backup.sh
assuming that you've installed the XE instance in the default path /u01
C. -
am getting the following error
exception in main thread noclassdeffounderror: org.apache.avalon.framework.configuration.Configuration;
I guess I havent set the path properly can tell me all the paths that i need to set.
JAVA_HOME i have set
PATH i have set to JAVA_HOME/bin
besides this what else do i need to set to do away with the error.You should put your avalon container jar file avalon.jar (and any other jars you'll use) in your classpath.
BTW, you know that the Avalon project has been closed, right?
http://avalon.apache.org/closed.html -
Complete checklist for oracle 11.2.0.4 environment variables on AIX 6
Hi,
Can anyone give me the Doc ID for complete checklist for oracle environment variable 11.2.0.4 on IBM AIX 6 platform (64 bit).
Because we get the following from IBM website, we wonder if any other oracle variable need to make a change, or will impact upgrade correctly on AIX.
“AIX 5.1 uses an environment variable LIBPATH when loading shared libraries. AIX 5.3 uses LD_LIBRARY_PATH
instead. For backward compatibility, AIX5.3 still uses LIBPATH if it is defined.”
URL: http://www-01.ibm.com/support/docview.wss?uid=isg3T1015835
So we can actually define both -
LIBPATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LIBPATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; /usr/local/lib export LD_LIBRARY_PATH
there are less companies use AIX to run oracle database than those use Unix/Linux; we are planning upgrade oracle database 11.2.0.3 to 11.2.0.4 on IBM AIX (64bit) os level 6, so we need to double-confirm this. FYI.
thank you very much!Hi Abhi: the Doc URL you give me (<e48740>) it doesn't help much. It doesn't tell much about environment variables for oracle. I have the following sample for oracle .profile at IBM AIX 6.1, is it Ok enough for us as basic setting?
vi /home/oracle/.profile
# Oracle variables
umask 022
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_SID=meps; export ORACLE_SID
ORACLE_BASE=/ora_bin01/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME
TNS_ADMIN=$ORACLE_HOME/network/admin export TNS_ADMIN
PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/sbin:/usr/ccs/bin; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib;/usr/local/lib export LD_LIBRARY_PATH
LIBPATH=$LD_LIBRARY_PATH export LIBPATH
CLASSPATH=$CLASSPATH:$ORACLE_HOME/jdbc/lib:$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/network/jlib:$ORACLE_HOME/oui/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
Note:
there are optional environment variables: TNS_ADMIN(optional), NLS_LANG (optional), TWO_TASK (optional)
thank you! -
Getting a Unix environment variable
Hi, everyone.
I need to use a Unix enviroment variable from a form. This form
is gonna use this variable in order to be the path of another
form who is gonna be called.
In other words:
CALL_FORM( $unix_var + '/forms/myform_name' );
unix_var is what I want to get.
Thanks a lot in advance,
EduardoIt worked, Michael. Thanks a lot!
To the documentation guys at Oracle... This is how you define
the TOOL_ENV package in the Forms' help:
"The TOOL_ENV package allows you to interact with Oracle
environment variables by retrieving their values for use in
subprograms."
Suggestion: ...with Oracle environment variables AND OTHER
SYSTEM OPERATION ENVIRONMENT VARIABLES...
because this narrow definition can prevent people for trying to
use it to retrieve other NON-ORACLE environment variable via
this package. Thanks. -
Environment Variables length in W2K
Hello All,
I am using Windows 2000 , sp2. while developing java applications If I try to put many jars in the classpath, I get an error message "The input line is too long."
Is there any way to increase the capacity of the windows shell to allow more jars to be added to the classpath.
Any help would be highly appriciated.
regards,
Abhishek.This may not fix your original problem, but it might help Scott and others with Win2K environment variable problems. M$ knowledge base article Q158141 explains how to allow more size for an environment variable. See http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q158141&.
Basically it says edit the System environment variable ComSpec to add a parameter /e:nnnn, so if you change
ComSpec C:\WINNT\system32\cmd.exe
to
ComSpec C:\WINNT\system32\cmd.exe /e:4096
it will let you have environment variables up to 4096 characters. It's good up to 32768. -
Environment variable path failed in oracle 11g installation
hi all,
i am reinstalling oracel 11g in my window 7 64 bit machine after i uninstalled it. however, i got an issue that is environment variable path failed in the installation process. this didn't happen when i firstly successfully installed oracle. how can i fix the issue? thanks in advance.
regards,
honguser571093 wrote:
hi,
the problem is i uninstalled oracle 11g in my windows 7 64 bit machine and then try to install it on my machine. during the prerequisite check stage, an error message popped up like this:
environment variable: "PATH" failed
This test checks whether the length of the environment variable "PATH" does not exceed the recommended length. (more details)
Expected Value
: 1023
Actual Value
: 1433
so, what is the reason caused this problem and how to fix it. thanks in advance.
hongI believe the error message is self-explanatory - assuming you you using a supported database and OS combination (which are unknown)
environment variable: "PATH" failed+
This test checks whether the length of the environment variable "PATH" does not exceed the recommended length.+
Expected Value+
*: 1023*
Actual Value+
*: 1433*
Your PATH variable exceeds the limit of 1023 characters
HTH
Srini
Maybe you are looking for
-
Error while assigning source system to SAP Remote cube
I need to do a query using remote cube and the source sys is flat file. it wont let me assign the source system to the remote cube. the r/3 system icon is seen next to the remote cube technical name... I can't see my flatfile source system can some
-
Campaign Automation - marketing lead update
Hi experts, we need to make automatic the execution of the 2 following steps: 1 - target group creation 2 - update of standard/custom field of Leads through BAPI (lead update) Is "Campaign Automation" the right tool to do that? What are the issues I
-
How much will it cost to get a cracked screen to get replaced or just to switch in a ipad 5th gen broken iPod
-
Just loaded CS4 Standard. All of the brushes in the flyout menu are greyed out. Similarly the Filter>Brush Strokes option is also greyed out. What am I missing?
-
Copying Attributes ...
Hello All, Sorry for such a basic question but I can't see the wood for the trees, so to speak ... I've got a movement plotted out in FCP using keyframes and I really don't fancy re-inputting all the info each time I want to use it. I can find 'remov