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
adam

I 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

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.etsuhin

    Setting 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.

  • 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

  • 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,
    Prabhu

    Is 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

  • 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 Regards

    Hi,
    *@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 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.

  • How to use a non-Oracle database?

    Oracle Lite is used as the database per default. Technical
    notes describe how to use Oracle 9i. I'm more interested in using more light-weight RDBMSes like HSQLDB for example. It is been said that Oracle BPEL supports Oracle, Oracle Lite, DB2, SQL Server and Pointbase. Now how to configure Oracle BPEL to use each of the non-Oracle datbases listed above?

    I've managed to setup the PM to use Pointbase rather than the default Oracle Lite. Along the way, several questions came up:
    1. Since the directory system\database\scripts already provides DDL scripts for Pointbase, creating the tables of a Pointbase database was easy. However, I wonder why you don't support HSQL. After all, OC4J supports HSQL data sources (see database-schemas\hypersonic.xml). Are there any features required by Oracle BPEL that are not provided by HSQL? If not, can we just use the Pointbase DDL scripts for HSQL?
    2. Editing the data-sources.xml file also wasn't a big deal although templates for Pointbase were missing. BTW, my XML editor reports the data-sources.xml file to be invalid: "Document cannot be stand-alone because default-value attribute 'connection-retry-interval' is not explicitly assigned.
    3. The changes in StartOraBPEL.bat were:
    - Comment out running kill_olite.bat and start_olite.bat
    - Start the Pointbase server (rather than Oracle Lite)
    4. The needed changes in obsetenv.bat were not that obvious: It was required to add the Pointbase libs to the BOOT_LIB classpath. Otherwise the Pointbase driver cannot be loaded. To be on the safe side, I've also added the Pointbase libs to the MY_CLASSPATH classpath but I'm not sure if that is really required. Is it?
    5. Finally, it would be good if shutting down the Pointbase server could be done in a similar fashion as that is configured for Oracle Lite. Apparently, some sort of hooking is used. Now how to setup a shutdown hook for a Pointbase server?

  • How to Get the Client's Environment Variables?

    I have a page which need inputing account of the intranet then send a mail upon the intranet.So,it is important for me to verify if the account is legal or if this account is the user himself or herself in order to refuse any bad sending.
    Of course I can get Environment Variables of "user.name" of my own PC.But How can I get Others before they can send mail?

    You can't read with an applet some system properties, including the "user.name" property. Not even with a signed applet.
    Here you have some links:
    http://java.sun.com/docs/books/tutorial/applet/practical/properties.html
    http://java.sun.com/docs/books/tutorial/applet/practical/security.html
    http://java.sun.com/sfaq/#getProps
    So you should find another way, for instance authentication.

  • 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,
    Brian

    You 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.

  • How do I check the Oracle enviornment variables for a connection?

    I am using Oracle JDBC 10.2.0.4 and trying to output the Oracle enviornment variables for a connection.
    I am trying to determine if the values output from sqlplus from the following two SQL select statements are different in the connection object:
    SELECT * from NLS_SESSION_PARAMETERS order by 1;
    NLS_CALENDAR GREGORIAN
    NLS_COMP BINARY
    NLS_CURRENCY $
    NLS_DATE_FORMAT MM/DD/YYYY HH24:MI:SS
    NLS_DATE_LANGUAGE AMERICAN
    NLS_DUAL_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_LANGUAGE AMERICAN
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NUMERIC_CHARACTERS .,
    NLS_SORT BINARY
    NLS_TERRITORY AMERICA
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    SELECT sys_context('userenv','language') from dual;
    AMERICAN_AMERICA.WE8ISO8859P1
    Is there a way to do this in the API or do I just need to run the SQL statements in a Class and output the values to a log?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

    So try it.
    Create a connection with no settings.
    Alter all of the (session only)
    Query again and see.
    Either the query will return the altered values or it won't.

  • How do I use a UNIX environment variable for the path of a file name

    We are running Forms 6i over the web. The forms server runs on a UNIX (HP-UX) machine.
    I want to read the contents of a file, which is simple enough, using the TEXT_IO package. However, I want to reference a UNIX environment variable that specifies the file path i.e
    PROCEDURE get_file IS
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    filename VARCHAR2(200);
    BEGIN
    filename:= '$LOG_DIR/RCAS181.log';
    in_file := Text_IO.Fopen(filename, 'r');
    .....other stuff
    Notice the filename string references my unix env variable '$LOG_DIR'. However, this doesnt work. If I put the full pathname it works fine.
    Any suggestions ?

    Have a look at TOOL_ENV.GETVAR()

  • Servlets: how do I get client's environment variables

    Hi everybody
    I make various servlets, and like to get the client's environment variables (such as used by the SET command under Windows). Especially username which is set in Windows-NT.
    Are there any straight forward way to get these?
    .. or can I get them and return them via a javaScript?
    Arne

    The servlet runs on the server. The browser and JavaScript run on the client. If you wanted to use JavaScript to pass them back, you would have to pass them back to the server through another servlet.
    Or you could use an applet and get at the standard Java properties. Nobody should use environment variables anyway, as you can't guarantee a computer even has them. :-)

  • How do i get value of Environment variables from a java program?

    Hai,
    I have a setup file wherein i set the path for the root directory , in the following way.
    setenv TPEROOT "/home/systpe/khurram/changes"
    when i give echo $TPEROOT
    the path , home/systpe/khurram/changes , is displayed on the console
    If i want to assign the $TPEROOT to a string variable str in my java program , then how can i do it.
    I want to use the value of the environment variable in my program.
    Any help in this regard would be very useful
    Thanks
    khurram

    java -DTPEROOT=$TPEROOT myőackage.myclass myargs

  • How does java access user specific environment variables ?

    Hi,
    I'm running a java application on a W2K o/s. My application needs to be able to access the user environment variables in Windows but I don't know how to do this. Can anyone help ?
    Thanks.

    http://www.rgagnon.com/javadetails/java-0150.html

  • How to Set a machine level Environment variable in remote machines

    Hi,
    I have to set a List($ProjectName) as the value of an environment variable($PROJECTS).
    The cmdlet which I tried is :
    $remoteMachineList = 'machA', 'machB'
    $ProjectName = 'ProjA', 'ProjB', 'ProjC'
    foreach($remoteMachine in $remoteMachineList){ icm -comp $remoteMachine {
    [Environment]::SetEnvironmentVariable("PROJECTS",$ProjectName,"Machine")
    This doesn't throw any errors but it's not setting the value of it. If I give a string or an integer value directly instead of the $ProjectName in the above code, it's working fine.
    PLease Help, Thanks in advance !

    You have to do a little more work when supplying outside variables into a PSSession (using Invoke-Command in this case) by using the -ArgumentList parameter and supplying a Param() statement in the scriptblock.
    $remoteMachineList = 'machA', 'machB'
    $ProjectName = 'ProjA', 'ProjB', 'ProjC'
    foreach($remoteMachine in $remoteMachineList){
    icm -comp $remoteMachine {
    Param ($ProjectName)
    [Environment]::SetEnvironmentVariable("PROJECTS",$ProjectName,"Machine")
    } -ArgumentList $ProjectName
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

Maybe you are looking for