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.

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.

  • 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

  • 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

  • To setup environment variables in Linux like sqlplus, emctl etc

    Hi,
    how can setup environment variable like sqlplus, emctl, etc in Linux.
    what i mean is from any directory i should be able to invoke sqplus, emctl etc
    is this posisble in linux.
    THanks,
    Philip.

    Hi Hunter,
    this one worked great. this is really cool man.
    i also have a http server running for my htmldb forms/reports.
    i created a environment variable saying
    "HTTP_HOME=/home/oracle/oracle/product/10.2.0/http_1"
    i need to go to $HTTP_HOME/Apaceh/Apache/bin"
    and i give the command "./apachetcl start" for the http server to start running.
    how can i make this apachectl variable to work so that form any directoy i should be able to give "apachectl start" comand and it runs.
    Can u help me please.
    i think if i do this also i can get some more understanding.
    the command u gave worked great, but i did not understand the
    LD_LIBRARY_PATH and CLASSPATH. what are they for.
    Philip.

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

  • Setting new environment variable on Linux

    {noformat}I need to set new environment variable on my linux machine from inside my code. I am using csh and the command works fine from command line:
    setenv IFConfigLocation4 /home/username/myfile.xml
    But when i try the same thing from Java code it does not seem to have any effect. here is my code:
    import java.util.*;
    import java.io.*;
    public class CDE_parser_methods{
    public static String fileParse(String inFile, String parserName, String outFile, String CMConfig_locale)
    String parsed = "SUCCESSFUL";
    System.out.println("Parsing file..." + "\nParser name: " + parserName +"\nInput file name: " + inFile + "\nOutput file name: " + outFile + "\nCMConfig file is: " + CMConfig_locale);
    System.out.println("Current Java version: " + System.getProperty("java.version"));
    try
              String cmd[]={"/bin/csh", "-c", "setenv IFConfigLocation4 " + CMConfig_locale};
              Process proc = Runtime.getRuntime().exec(cmd);
              int exitVal= proc.waitFor();
              System.out.println("Value of setenv command is: " + exitVal);
              String cmd2[]={"/bin/csh", "-c", "env"};
              Process proc2 = Runtime.getRuntime().exec(cmd2);
              InputStream instr = proc2.getInputStream();
              InputStreamReader inread = new InputStreamReader(instr);
              BufferedReader buf = new BufferedReader(inread);
              String line=null;
              while((line=buf.readLine()) != null)
                   System.out.println(line);
              int exitVal2= proc2.waitFor();
              }catch(CMException cme){
                   System.out.println("Issue when trying to executing parse command, details: " + cme.getMessage());
                   System.out.println("Description of the issue is: " + cme.getDescription());
                   parsed = "FAILURE: " + cme.getDescription();
              }catch(Exception e){
                   System.out.println("Uncought exception, details: " + e.getMessage());
                   parsed = "FAILURE: " + e.getMessage();
         return parsed;
    public static void main(String[] args) {
         String results=CDE_parser_methods.fileParse("/opt/itemfield/ServiceDB/Project2/Mapping_for_Account_Number_Structure_ITS_Input_File.xls","MappingforAccountNumberStructure","/opt/itemfield/ServiceDB/Project2/test_ws_44.xml","/home/rvenishe/CMConfig.xml");
         System.out.println("Result of fileParse call is: " + results);
         }The out put of my env command does NOT contain system variable "IFConfigLocation4". Any ideas? {noformat}

    Environment variables and their values set from within a user process has their scope and lifetime limited to the process and its subprocesses. See java.lang.ProcessBuilder class and its API documentation for setting env for a subprocess that will be started by a ProcessBuilder instance. Even in the C programming we have the same limitation for the environment.
    Since they are not globally set, system command like env or Java method like System.getenv() can't see them.

  • Environment Variables for Linux

    Hi All
    I am trying to set the Environement Variables on RHEL 5.2(64 Bit) for SM 7.0 Installation
    - I have installed the RPM "IBMJava2-AMD64-142-SDK-1.4.2-11.0.x86_64.rpm"
    - I have set the Environment Variable in .bash_profile file as below:
    export JAVA_HOME=/opt/IBMJava2-amd64-142
    expot PATH=$JAVA_HOME/bin:$PATH
    Logged out of root and logged in, but I am not able to see the correct JAVA -Version
    Its still showing the GNU version.
    Can you please let me know that was correct ?
    Thanks
    Sri

    You can simply use those commands in the shell that is open and in which you want to start the installation. There's no need to make this permanent for user "root".
    Sapinst will configure the new users correctly with the correct PATH.
    Markus

  • Oracle Application Server Environment Variables for Linux

    Hello All,
    I have installed Oracle As (infratructure & middlie tire) on same box.
    10g Release 2 (10.1.2)
    Now I need to do post installation steps as below.
    ORACLE_HOME
    1) How to set to the full path of the installation's Oracle home?
    2) Do I need to also set ORACLE_HOME for middle tier?
    ORACLE_SID
    (Infrastructure installations only)
    3) How to set the OracleAS Metadata Repository SID supplied during installation?
    cheers,
    DN

    Hello,
    I have installed Oracle AS Infrastructure (10.1.2) and BI & Forms on our Linux box.
    Now I am doing some post installtion steps .
    Per Oracle® Application Server Quick Administration Guide 10g Release 2 (10.1.2) B14126-02
    \http://download-west.oracle.com/docs/cd/B14099_10/core.1012/b14126/toc.htm
    **Set to the full path of the installation's Oracle home
    ORACLE_HOME=/opt/oracle/infra; export ORACLE_HOME
    ** Set to the OracleAS Metadata Repository SID you supplied during installation.
    ORACLE_SID=orcl; export ORACLE_SID
    Is it the correct way to setup ORACLE_HOME & ORACLE_SID?
    Actually I have setup as above on Last thursday. (09-15-05)
    But when I have checked today (09-19-05) as
    echo $ORACLE_HOME
    I got nothing.same with SID, now I need to set again.
    DN

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

  • Environment variables of Winnt winxp

    I wanna set Environment variables of Winnt or winxp thro' Java

    Actually, if you can get access to the registry, you can view/set the user's environment variables at
    HKEY_CURRENT_USER\Environment
    and the system environment variables at
    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Evironment
    Note that this is specific to Windows NT 4.0, there's no guarantee that they will be in the same location on other flavours of Windows. Note further that this will certainly work only on Windows machines... there is (AFAIK) no standard way to set environment variables for Linux, BSD or Solaris systems.
    For the particularly brave (or stupid, or both :-), there is a beta(/alpha) registry interface for Java
    http://www.algorekiss.com/wsnE682.html

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

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

  • Best practices for defining Environment Variables/User Accounts in Linux

    Hello,
    After reading throught the Quick Install guide for 10gR2 on x86_64 Linux, I see that it is not recommended to define ANY variables in .bash_profile.
    I'm hoping to get a Best practices approach for defining environment variables - right now we use the oracle linux account for administration including sql*plus. So, where should the myriad variables be defined? Is it important enough to create a user account in linux to support best practices?
    What variables, exactly, should be defined? It seems that LD_LIBRARY_PATH is no longer being used?
    Thanks in advance
    Doug

    Something that I've done for years on unix/linux boxes is to create a seperate environment variable setup file for each instance on the box. This would include things like ORACLE_HOME, ORACLE_SID, etc. Then I would create an alias in my .bash_profile that would execute this script. As an example, I would create a orcl.env file that would hold all of the environment variables for this instance. Then in my .bash_profile I would create a line like the following:
    alias orcl=". $HOME/orcl.env"
    Then from anywhere you could type orcl and you would set your environment to connect to that database.
    Also, if you are using 10g, something else that is really nice if you are using sqlplus, and you connect to different databases without starting a new sqlplus session is to set a parameter in your $ORACLE_HOME/sqlplus/admin/glogin.sql file:
    set sqlprompt "_user 'at' _connect_identifier >"
    This will automatically change your command prompt to look like this:
    RALPH at ORCL >
    if you connect as GEORGE, your prompt will immediately change to :
    GEORGE at ORCL >
    This way you can always know who and where you are connected to.
    Good luck!

Maybe you are looking for

  • Picking from interim area for outbound delivery

    Hi experts,     When we receive goods from production to our interim area (901), we sometimes want to pick the goods from here for the delivery, The system is allowing us to pick form 901 ,but the TR is still open ,Is there a way of picking for Deliv

  • Printing document in jsp

    Hello, I'm developing a web app which deals with invoices, delivery notes and that sort of things and i need to print the documents i create and show in the screen but just a part of the jsp page as i don't want the menu of the app to appear in the d

  • Code to write syntax for JOB submit ( Please answer ASAP)

    Hi, I need sytax to submit a job Right now I am using this code to send 4 parameters. I need to send these 4 in a structure. submit Ztestjob USER sy-uname via job p_jobnm number p_jobcount with afko-rsnum eq afko-rsnum with aufnr_d eq aufnr_d with se

  • Recon account ready for Input-Not possible to change during MIRO

    Hello We are on ECC 6.0 System does not allow users to change Vendor Recon A/c during invoice verification through MIRO. Recon A/c field is greyed out under Details tab in MIRO. Recon Account has been declared as Ready for Input and Alternative Recon

  • How do I delete an unwanted toolbar? Not just hide, delete (fuze toolbar).

    I want to remove a toolbar from my computer, a fuze toolbar that I already did a search of then removed it but it didn't work so I uninstalled the fuze software but it is still there...