Accessing shell environment variables inside OMBPlus script

Hi,
I have a problem accessing an environment variable inside OMBPlus script. I can 'see' the env. var values when using tclsh, but when I use OMBPlus.sh it doesn't work?
Anybody has an example of how to do this?
For example: puts $::env(MYVAR)
Thanks,
Ed

Hello!
Issue the command:
puts [array names env];
this will print you the content of the env array which is definitely not the environment variables.
If you want your environment variable appear in the env tcl variable then you must edit the ombplus.bat file and pass it through a java option like this:
-DMYENV="%MYENV%" (on windows assuming you declared MYENV).
Now puts $env(MYENV) will work.
Regards,
Robert

Similar Messages

  • Apache Environment Variables inside PL/SQL

    How to access Apache Environment Variables inside HTMLDB (PL/SQL block)?

    Hi,
    You can use the owa_util.get_cgi_env packaged function -
    FUNCTION GET_CGI_ENV RETURNS VARCHAR2
    Argument Name                  Type                    In/Out Default?
    PARAM_NAME                     VARCHAR2                INSo, pass in the name of the Env var you want and it will give you back the value.

  • OMB PLUS - Problem passing Unix environment variables to OMBPlus

    Due to a requirement to encapsulate deployment of OWB applications, we currently start OMBPlus.sh from our own wrapper ksh script (deploy.ksh) in order to get the new / changed application into the target control center etc.
    We now have a new requirement that means we need to pass the content of the Unix environment across to OMBPlus.sh (and from thence into our deployment tcl scripts).
    No problem, if you believe the tcl documentation. The entire Unix environement gets dumped into a hash array called 'env', so you can get the variable's value out just by saying $env(unix_valraible).
    Sounds great, it should work a treat.
    Except OMBPlus only silghtly resembles tclsh.
    The 'env' that gets into OMBPlus bears practically no resemblance to the 'env' that existed before OMBPlus.sh got invoked.
    Does anyone have:
    a decent explanation for why the env gets scrambled (and how to avoid it) ?
    or an alternative method of getting the Unix environment varaible values into OMBPlus ?
    Please do not propose passing them all on the command line because (would you beleive it) the values are database passwords !
    Edited by: user10466244 on 23.10.2008 09:28

    Unfortunately, the java implementation of TCL that Oracle used as the basis for OMB+ is NOT a fully-featured implementation. Just try using packages...
    However, and understanding why you don't want to hard-code passwords into a file, you can always edit the setowbenv.sh file in your owb/bin/unix directory to grab your specific shell environment variables and propogate them to the java session.
    towards the bottom of this env file you will see a section that looks something like:
    JDK_HOME=../../../jdk
    OWB_HOME=/owb
    ORA_HOME=/owb
    OEM_HOME=/owb
    IAS_HOME=/owb
    ORACLE_HOME=/owb
    CLASSPATH=Personalties.jar:../admin:$MIMB_JAR:
    CLASSPATH_LAUNCHER="-classpath ../admin:../admin/launcher.jar:$CLASSPATH: -DOWB_HOME=$OWB_HOME -DJDK_HOME=$JDK_HOME -DORA_HOME=$ORA_HOME -DOEM_HOME=$OEM_HOME -DIAS_HOME=$IAS_HOME -Doracle.net.tns_admin=$ORA_HOME/network/admin Launcher ../admin/owb.classpath"
    export ORA_HOME
    export OWB_HOME
    export JDK_HOME
    export OEM_HOME
    export IAS_HOME
    export ORACLE_HOME
    You could add in the environment variables that you want propogated, include them into the CLASSPATH_LAUNCHER, and then they will turn up in your OMB+ session env array.
    e.g., to propgate an environment variable called MY_DATABASE_PASSWORD you would:
    JDK_HOME=../../../jdk
    OWB_HOME=/owb
    ORA_HOME=/owb
    OEM_HOME=/owb
    IAS_HOME=/owb
    ORACLE_HOME=/owb
    CLASSPATH=Personalties.jar:../admin:$MIMB_JAR:
    CLASSPATH_LAUNCHER="-classpath ../admin:../admin/launcher.jar:$CLASSPATH: -DOWB_HOME=$OWB_HOME -DMY_DATABASE_PASSWORD=${MY_DATABASE_PASSWORD} -DJDK_HOME=$JDK_HOME -DORA_HOME=$ORA_HOME -DOEM_HOME=$OEM_HOME -DIAS_HOME=$IAS_HOME -Doracle.net.tns_admin=$ORA_HOME/network/admin Launcher ../admin/owb.classpath"
    export ORA_HOME
    export OWB_HOME
    export JDK_HOME
    export OEM_HOME
    export IAS_HOME
    export ORACLE_HOME
    So now you have no protected data hardcoded, it will pick up your specific environment variables at runtime, and when you start OMB+ you will be able to:
    array get env MY_DATABASE_PASSWORD.
    cheers,
    Mike

  • Can i use a environment variable inside a *.sql file?

    Hello,
    I want to create a external table.
    So i am using the command
    create or replace directory abc as 'C:\folder'.... inside a sql file.
    Now i want the path "C:\folder" to be dynamic as i am using this path in many other places also inside the sql file.So i thought to create a environment variable and put this value there.I tried using as %PATH% but it gives error..... where %PATH%=C:\folder.
    Can i use a environment variable inside a *.sql file?
    But how to do that or is there any other way.
    Thanks
    Swapna
    Edited by: user11018268 on Feb 19, 2010 1:03 AM

    user11018268 wrote:
    Actually what i want is the path "C:\folder" is not fixed it can be anything which i may not know the user may decide it later. Not supported. A directory object refers to a specific physical location (directory/folder) on a file system. Not a path.
    You can work around it by (creating and) using a function (running under a super user schema with authid definer privs). The caller (e.g. schema scott ) calls it with a physical path. E.g. GetDirectoryObject( 'C:\folder\2010\feb\week4' ).
    This function determines if there is an existing directory object for the path. If not, it uses a wildcard search to determine if there are any directory objects for parents in the path (e.g. for C:\folder\2010\feb or C:\folder\2010 or C:\folder ).
    If it finds a directory object, it interrogates the data dictionary to determine if the caller, schema scott for example, has read/write access on that directory object. If it has, it creates a new directory object and grants the caller read/write access to it. The function then returns the name of the directory object to the caller.
    The caller thus do not deal directly with directory objects. The function returns the object name given a physical path as input. Also, only a single base directory needs to be created (e.g. for C:\folder ) and access granted to the schema on it. Any sub-directory in that base directory can now be dynamically accessed by the schema.

  • Error Setting Environment Variable inside Listner.ora

    Hi,
    I am trying to set an environment variable inside listner.ora as follows
    (ENVS="EXTPROC_DLLS=ANY,LD_LIBRARY_PATH=/opt/app/oracle/product/9.2/lib32:/opt/app/oracle/product/9.2/network/lib32:/usr/lib:/usr/X11R6:/usr/dt/lib,LIBPATH=/opt/app/oracle/product/9.2/lib32,MQSERVER=SYSTEM.DEF.SVRCONN/TCP/ashsou03.mcilink.com(4444)")
    but every time I try to start the listner it gives me the following error:
    TNS-01155: Incorrectly specified SID_LIST_LISTENER parameter in LISTENER.ORA
    NL-00303: syntax error in NV string
    I think that the parenthses, (4444), in the MQSERVER value is causing this. Any ideas on how I can configure it?

    Hi
    Very many thanks for ur solution.. i actually hadset the environment variables spacce..but when i execute the autoexec.bat file i dont get any error(out of env space)..but when i run the startup.bat file i get from the command prompt, i get the foll error.
    This is my Autoexec.bat
    SET JAVA_HOME=D:\Jkit\bin
    SET CATALINA_HOME=D:\tomcat\jakarta-tomcat-4.1.29\bin
    SET PATH=D:\Jkit\bin;C:\WINDOWS;C:\WINDOWS\COMMAND;
    SET PATH=%PATH%;C:\PROGRA~1\COMMON~1\AUTODE~1;
    THE FOLLOWING IS THE ERROR I GET WHEN I RUN STARTUP.BAT UNDER TOMCAT'S BIN UNDER THE COMMAND PROMPT
    D:\tomcat\jakarta-tomcat-4.1.29\bin>startup
    Syntax error
    Out of environment space
    Out of environment space
    Out of environment space
    Using CATALINA_BASE: D:\tomcat\jakarta-tomcat-4.1.29
    Using CATALINA_HOME: D:\tomcat\jakarta-tomcat-4.1.29
    Using CATALINA_TMPDIR: D:\tomcat\jakarta-tomcat-4.1.29\temp
    Using JAVA_HOME: D:\Jkit
    Out of environment space
    Out of environment space
    Invalid switch - -DJAVA.ENDORSED.DIRS=D:\TOMCAT\JAKARTA-TOMCAT-4.1.29\COMMON\ENDORSED
    I even set JAVA_HOME AND CATALINE_HOME to the \bin dir respectively..
    still i get the same error
    As given under the tomcat installation documentation (RUNNING.txt), i set the space for environment space under the Memory tab, for startup and shutdown.bat files, it creates a shortcut for running the resp .bat files, running startup.bat file i get,CATALINA_HOME VAR HAS NOT BEEN SET PROPERLY, THIS OCCURS FOR BOTH TOP LEVEL DIR SETTING AND /bin DIR SETTING of CATALINE_HOME IN autoexec.bat
    PLEASE HEL, I HAVE BEEN TRYING TO CONFIGURE IT FOR THE PAST DAYS BUT WITH NO SUCCESS, DONT KNOW WHERE I AM GOING WRONG..PLEASE HELP

  • Unix shell: Environment variable works for file system but not for ASM path

    We would like to switch from file system to ASM for data files of Oracle tablespaces. For the path of the data files, we have so far used environment variables, e.g.,
    CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
    This works just fine (from shell scripts, PL/SQL packages, etc.) if ORACLE_DB_DATA denotes a file system path, such as "/home/oracle", but doesn’t work if the environment variable denotes an ASM path like "\+DATA/rac/datafile". I assume that it has something to do with "+" being a special character in the shell. However, escaping "\+" didn’t work. I tried with both bash and ksh.
    Oracle managed files (e.g., set DB_CREATE_FILE_DEST to +DATA/rac/datafile) would be an option. However, this would require changing quite a few scripts and programs. Therefore, I am looking for a solution with the environment variable. Any suggestions?
    The example below is on a RAC Attack system (http://en.wikibooks.org/wiki/RAC_Attack_-OracleCluster_Database_at_Home). I get the same issues on Solaris/AIX/HP-UX on 11.2.0.3 also.
    Thanks,
    Martin
    ==== WORKS JUST FINE WITH ORACLE_DB_DATA DENOTING FILE SYSTEM PATH ====
    collabn1:/home/oracle[RAC1]$ export ORACLE_DB_DATA=/home/oracle
    collabn1:/home/oracle[RAC1]$ sqlplus "/ as sysdba"
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 24 20:57:09 2012
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    SQL> CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
    Tablespace created.
    SQL> !ls -l ${ORACLE_DB_DATA}/bma.dbf
    -rw-r----- 1 oracle asmadmin 2105344 Aug 24 20:57 /home/oracle/bma.dbf
    SQL> drop tablespace bma including contents and datafiles;
    ==== DOESN’T WORK WITH ORACLE_DB_DATA DENOTING ASM PATH ====
    collabn1:/home/oracle[RAC1]$ export ORACLE_DB_DATA="+DATA/rac/datafile"
    collabn1:/home/oracle[RAC1]$ sqlplus "/ as sysdba"
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 24 21:08:47 2012
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    SQL> CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
    CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON
    ERROR at line 1:
    ORA-01119: error in creating database file '${ORACLE_DB_DATA}/bma.dbf'
    ORA-27040: file create error, unable to create file
    Linux Error: 2: No such file or directory
    SQL> -- works if I substitute manually
    SQL> CREATE TABLESPACE BMA DATAFILE '+DATA/rac/datafile/bma.dbf' SIZE 2M AUTOEXTEND ON;
    Tablespace created.
    SQL> drop tablespace bma including contents and datafiles;

    My revised understanding is that it is not a shell issue with replacing +, but an Oracle problem. It appears that Oracle first checks whether the path starts with a "+" or not. If it does not (file system), it performs the normal environment variable resolution. If it does start with a "+" (ASM case), Oracle does not perform environment variable resolution. Escaping, such as "\+" instead of "+" doesn't work either.
    To be more specific regarding my use case: I need the substitution to work from SQL*Plus scripts started with @script, PL/SQL packages with execute immediate, and optionally entered interactively in SQL*Plus.
    Thanks,
    Martin

  • Can not create a environment variable from a script

    Hi I need to develop a script that allows me to create and set two environment variables in my system but I can�t get it ....
    This is what I got till now ...
    #!/sbin/sh
    SEISDB_HOME=/usr/local/
    export SEISDB_HOME
    LD_LIBRARY_PATH=/usr/local/lib
    export LD_LIBRARY_PATH
    If I run this commands directly in the shell it works Ok ... but calling the sentence from a script nothing happens ....
    Thanks ....
    Edited by: Jes_79 on Sep 18, 2007 1:58 PM

    do this
    create a script file
    vi /tmp/temp
    in /tmp/temp add
    GLOBAL_VARIABLE="Hello World"; export GLOBAL_VARIABLE
    save and quit vi
    fix the permissions and run /tmp/temp from a shell prompt
    then
    echo $GLOBAL_VARIABLE
    should show as empty
    from a shell window type
    . /tmp/temp
    period space /tmp/temp
    echo $GLOBAL_VARIABLE
    for you script, do the same.
    do not type the script name, but source it (add a period and space)
    alan

  • Access OS environment variable to be used in automatic application login

    I want users to login to an APEX application automatically using the username that is stored in an OS environment variable. I already tried owa_util.print_cgi_env, but that does not contain the values I need.

    Hello,
    Sounds like you're trying to do NTLM authentication? Take a look at the whitepaper -
    http://www.oracle.com/technology/products/database/application_express/pdf/apex_ntlm_authentication_wp.pdf
    John.
    http://jes.blogs.shellprompt.net
    http://www.apex-evangelists.com

  • How to access %programfiles% environment variable in XML

    Hi
    I am trying to install BEA JRockit 1.4.2 JVM silently and I need help in modifying the silent.xml file. Typically, in batch files, one would use the environment variable %programfiles% to install to the system's program files directory. However I want to do this within the silent install file that BEA recommends. The line that I want to modify is:
    <data-value name="USER_INSTALL_DIR" value="D:\Program Files\Java\jrockit-24.5.0-j2sdk1.4.2_08" />
    To something more like:
    <data-value name="USER_INSTALL_DIR" value="<b>${programfiles}</b>\Java\jrockit-24.5.0-j2sdk1.4.2_08" />
    However this does not work for me. Any help is greatly appreciated.
    Thanks,
    Jaaved

    Hi Jaared,
    You will have to create an additional wrapper that generates the silent.xml
    of your choice with a value of USER_INSTALL_DIR based on the value of the
    %PROGRAMFILES% environment variable. The value of USER_INSTALL_DIR is
    currently interpreted literally and there does not exist any support for
    expansion of environment variables in it. Based on your question we might
    consider this feature for a future release though.
    Regards
    /Robert
    <Jaaved Mohammed> wrote in message news:[email protected]..
    Hi
    I am trying to install BEA JRockit 1.4.2 JVM silently and I need help in
    modifying the silent.xml file. Typically, in batch files, one would use
    the environment variable %programfiles% to install to the system's program
    files directory. However I want to do this within the silent install file
    that BEA recommends. The line that I want to modify is:
    <data-value name="USER_INSTALL_DIR" value="D:\Program
    Files\Java\jrockit-24.5.0-j2sdk1.4.2_08" />
    To something more like:
    <data-value name="USER_INSTALL_DIR"
    value="<b>${programfiles}</b>\Java\jrockit-24.5.0-j2sdk1.4.2_08" />
    However this does not work for me. Any help is greatly appreciated.
    Thanks,
    Jaaved

  • A problem with accessing the public variable inside the function

    Hi,
    I have got this package and I get error 1120: 1120: Access of undefined property aa
    Could you explain why I get this error?
    package somepackage {
        import flash.display.DisplayObject;
        import mx.containers.Canvas;
        public class SoundPictureSigns extends Canvas {
            public var aa:int = 12;
            public function SoundPictureSigns():void {
            public static function setUpSignSizes():void {
                trace("aa="+aa); /// ERROR here: 1120: Access of undefined property aa
    Can you help?
    Regards

    When you write
    class C
        var v;
    you are defining a variable that lives inside each instance of C. In other words, you can write code like
    var c:C = new C();
    c.v = 1;
    If you don't have an instance, you can't access v.
    When you write
    class C
        static var v;
    you are defining a variable that lives inside the class itself, and you can access it without having an instance.
    Gordon Smith
    Adobe Flex SDK Team

  • Shell environment variables and apple apps

    Hi Does anyone know how to pass environmental variables to apple applications. For example I have an an app that will automatically execute a shell script on receipt of certain downloads but that script calls another script that has some embedded functions. The scripts all work from command line since I have all my paths and EVs defined in my .tchsrc but the app isn't run from the same shell.
    Any clues as to a work around.
    thanks
    Anna

    See
    http://developer.apple.com/qa/qa2001/qa1067.html
    or
    http://www.rubicode.com/Software/RCEnvironment/

  • Using JSP variable inside Java Script's alert function.

    Hi Gurus,
    We are trying to use alert function with one of the string variables populated inside JSP code, but its not working.
    Here is the code snippet, please advice.
         <%
         oracle.apps.qot.util.RequestCtx.log("qotcustom.jsp",AOLMessageManager.getMessageSt(QotUtil.QOT_APPS_CODE, "XDPYY_DISC"));
         %>
         var alert_text="<%=AOLMessageManager.getMessageSt(QotUtil.QOT_APPS_CODE, "XDPYY_DISC")%>";
         alert(alert_text);
         Here in the first line we are using API to get text message defined in database, the line is getting executed properly and we could see output text message in debug log file, after this in the 4th line, we are assiging this string output of API to java script variable alert_text and further using alert function with the variable alert_text as argument. But alert function is failing, no errors are thown in debug log file.
    Please advice whether we are doing any thing wrong.
    Thanks in advance.

    What pgeuens means is that you can't mix javascript and jsp/java code in this way.
    ALL of the jsp/java code gets executed at the server end.
    This produces an HTML page (with embedded javascript) which gets sent to the client.
    The client then runs javascript code in response to events (onLoad, onClick, onChange etc etc)
    So in this case, the jsp:forward will always be executed, because as far as the server is concerned, the javascript is just template text.
    If you WANT to do a conditional forwarding on the server side you do it in java ie (horribly using scriptlet)
    <%
    if (testCondition){
    %>
      <jsp:forward>
    %<
    %>Or if you want to test what the client has entered client side, all you can do is submit the form, or navigate to a URL
    <script>
    function test()
    if(document.f.htemp.value=="true")
    alert("jus");
    else
    var s=document.f.htemp.value;
    alert(s);
    document.f1.action="success.jsp";
    document.f.submit();
    </script>You cannot run JSP code based on your javascript code.
    Java. Javascript. Not the same thing.
    Hope this helps,
    evnafets

  • How to access environment variables from pluggable destination?

    Hi,
    I'm trying to create a java puggable destination for reports. Everything is working fine.
    I want to access reports environment variables from the java code (like REPORTS_PATH and other new variables that I want to create), but I can't find anything about this in the java API documentation.
    I want to use environment variables instead of destination properties (those I can easily access), because I want to be able to change context using env_id.
    Any ideas?
    Thanks,
    Luis

    I'm using Oracle Application Server Version 10.1.2.0.2
    Thanks

  • How do you get your environment variables seen in SS?

    I am trying out SS, we currently use gcc/Kdevelop. When I try to launch my program or debug inside Sun Studio I get an error about a missing .so. Since everything works fine from the command line I assume SS does see my shell environment variables. I don't see any option for this, what am I missing?

    First of all, you can check whether environment is inherited or not from dbx command line:
    - start debug session
    - go to "Dbx console" tab at the bottom
    - issue 'set' command and/or 'set | grep your_variable' to see if it is there
    If it's really missing or has value other that expected, use project properties to specify environment for the application. It can be done like this:
    - right-click project in Projects window, choose Properties
    - select "Running" node
    - and edit the "Environment" field

  • Setting environment variable CONFIGROOT

    Hi
    I want to find the msg store for a particular user account so i'm planning to use hashdir command utility and the requirement for the same is given
    below
    Requirements:
    Must be run locally on the Messaging Server. Make sure that the environment variable CONFIGROOT is set to msg_svr_base/config.
    My Ques..
    1. How i have to set CONFIGROOT and in which file ???
    Thanks in Advance

    Hi,
    CONFIGROOT is a shell environment variable. It needs to be set in the environment of the shell you are using for example for bash shell:
    export CONFIGROOT=<msg_base>/config
    Regards,
    Shane.

Maybe you are looking for

  • Can I use the guest network on a AE connected to a Cisco RV180?

    I have not been able to connect to the guest network on my AE with a Cisco RV180 as the gateway. I read in an older post that the guest network my not work on all equipment, that it must be connected to a "simple" modem. Just want to find out if the

  • Use of BAdi 'WorkOrder_update'(method in_update)

    Hi, I am using the badi 'WorkOrder_update' for an enhancement to iw32.I need to check whether new material has been added to order.How will i check that new material has been added to order. There are parameters in this badi which gives us the compon

  • Allowed GR reversal affecting the project costs

    Hi, We have just performed our month-end settlement but when we are tallying our project costs and project costs clearing accounts, we have noted discrepancies. The discrepancies were from the reversals of GR for projects costs that were already sett

  • Differences in sync method?

    I want to sync music and photos manually. The apple tech told me to leave all items in the Summary tab unchecked. What is the difference if I leave them all unchecked or just check the "Manually manage music..."?

  • Time limit on admin account?

    I was wondering if there is any way or any third party app which will allow me to set time limits on the admin account. I want this because if I make an other account or guest account it doesnt keep the icon dock customized and it doesnt show XBMC th