Oracle variables

Hi:
I want to run a statement similar to this
DEFINE MaxDate;
MaxDate := SELECT Max(dtDateField) FROM myTable;
SELECT * FROM myTable2 WHERE dtDateField < MaxDate;
This is not correct obviously--how do I set a variable to the value of a SELECT statement? I've tried different ways and what I've read just seems to talk about using a variable to set a constant value.
Thanks,
Kayda

> So you are saying there is no way of doing this with
variables? I want to reuse the variables in many
statements (actually using in UPDATES) so it makes
sense to do this calculation once only. Any way to do
this?
In what language? The SQL language does not support normal variables like Delphi, Visual Basic, C#, Java, etc.
The variables supported in SQL is called bind variables. These are position/place holders for values that you (the caller of the SQL) must supply at run-time.
For example, the following is a SQL "program" (aka statement) that is parsed and compiled by the SQL Engine, and stored for re-use:
SELECT SUM(amount) FROM invoice_lines WHERE invoice_id = :0
The :0 is a bind variable. This SQL "program" can be used by you and me and others repeatedly - for different invoices. We (the callers) simply need to supply a value for the invoice id bind variable.
If you want to store the amount returned by the SQL "program" as a variable.. that is your problem. Not the SQL Engine's problem. It does not deal with variables that way.
You need to define a variable. You need to fetch the value (result) from the SQL "program" and store it.
In PL/SQL (a formal procedural programming language like Delphi and C), you can do it as follows:
declare
invAmount number;
invID number := 1234;
begin
select SUM(amount) into invAmount from invoice_lines
where invoice_id = invID;
end;There is thus no such thing as Oracle Variables.

Similar Messages

  • Problem to pass Oracle variable to Unix

    11gr2
    Problem to pass Oracle variable to Unix
    refer to echo $x
    in korn shell
    $cat /tmp/x.sh
    "/tmp/x.sh" 11 lines, 208 characters
    #!/bin/ksh
    x=`sqlplus -s myacc/myacc <<endl
    set echo off verify off feed off termout off pages 0
    SELECT p.spid
    FROM v$session s, v$process p
    WHERE s.paddr = p.addr
    AND s.sid =2;
    exit
    endl`
    . /tmp/x.sh
    $ echo $x   
    FROM v s, v p check_logfiles._var_adm_kernlog.seek csn.16 myspid.sh pw_management ssh-BbLO7942 x.sh ERROR at line 2: ORA-04044: procedure, function, package, or type is not allowed hereuse sqlplus
    sql> select p.spid
      2  FROM v$session s, v$process p
      3  WHERE s.paddr = p.addr
      4  AND s.sid =2;
    SERVER
    PID
    22965Edited by: jmft2012 on Mar 23, 2013 9:23 PM

    jmft2012 wrote:
    $cat /tmp/x.sh
    "/tmp/x.sh" 11 lines, 208 characters
    #!/bin/ksh
    x=`sqlplus -s myacc/myacc <<endl
    set echo off verify off feed off termout off pages 0
    SELECT p.spid
    FROM v$session s, v$process p
    WHERE s.paddr = p.addr
    AND s.sid =2;
    exit
    endl`
    . /tmp/x.sh
    $ echo $x   
    FROM v s, v p check_logfiles._var_adm_kernlog.seek csn.16 myspid.sh pw_management ssh-BbLO7942 x.sh ERROR at line 2: ORA-04044: procedure, function, package, or type is not allowed hereuse sqlplus
    sql> select p.spid
    2  FROM v$session s, v$process p
    3  WHERE s.paddr = p.addr
    4  AND s.sid =2;
    SERVER
    PID
    22965
    since the here script is being processed by the command line interpreter, it resolves "$session" & "$process" to be null values.
    You need to be smarter than the tools you are (ab)using.
    Handle:     jmft2012
    Status Level:     Explorer (65)
    Registered:     Nov 13, 2009
    Total Posts:     355
    Total Questions:     74 (32 unresolved)
    I extend my condolences to you since you rarely get answers to your questions here.

  • Upload a file in a BLOB Oracle variable

    Hello all,
    i am developing a web application to upload a binary file in an Oracle database (9i) in a BLOB variable.
    the input is stored in a FILE object wich is temporary stored in a folder (C:\\APP). after the upload in the BLOB the file should be deleted. I get the following error
    java.lang.NullPointerException
         at com.merck.cdm.BlobOracle.insertBLOB(BlobOracle.java:98)
    when I try to get the file for the FileInputStream. It seems I am not able to acces the FILE object once defined.
    any help is welcome
    thanks
    claudio
    this is the code:
    package com.merck.cdm;
    import java.sql.*;
    import java.io.*;
    import java.sql.PreparedStatement;
    import java.util.*;
    import com.oreilly.servlet.MultipartRequest;
    import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;
    import javax.servlet.http.HttpServletRequest;
    import oracle.jdbc.driver.*;
    import oracle.sql.BLOB;
    * Insert record in the MEDIA table
    * MEDIA (file_name varchar2(256), file_content BLOB);
    public class BlobOracle
    private final static String hostname = "itpo0002.merck.com";
    private final static String port = "1521";
    private final static String sid = "TIRWEB";
    private final static String username = "test_blob";
    private final static String password = "password";
    private static String fileLocation;
    private static Connection connection;
    public BlobOracle()
    public boolean processAddRequest(HttpServletRequest request, String sAbsolutePath)
    throws IOException, SQLException, Exception
         boolean bParamsOk = true;
    boolean bAttachOk = true;
    //Acquire request parameters we need .
    //5 MB's limit
    //the work directory will be "TOMCAT_HOME\bin, and the user can provide another one like C:\workDir
    //the file will be deleted as soon as the message will be sent
    //m_mpReq = new MultipartRequest(request, ".", 5 * 1024 * 1024);
    //m_mpReq = new MultipartRequest(request, "/opt/www/corp/ats-crf/java/ats-crf/attachment/", 5 * 1024 * 1024);
    //String sWorkDir = File.separator + sAbsolutePath + "attachment" + File.separator;
    MultipartRequest mpRequest = new MultipartRequest(request, "C:\\app", 8 * 1024 * 1024);
    // upload file in a temp dir
              //il form � di tipo enctype="multipart/form-data" e quindi il metodo getParameter di java.lang.string non funziona
              //bisogna quindi usare l'analogo metodo di MultipartRequest
              String fileName = mpRequest.getFilesystemName("upload_file");
    System.out.println("fileName is " + fileName);
    File file; //creo un oggetto di tipo "file" dal file nella cartella temporanea
    file = mpRequest.getFile("C:\\app");
    //String fileName = file.getName();
    //Connection;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@"+hostname+ ":"+ port +":"+ sid , username , password);
    con.setAutoCommit(false);// we must control the commit SE METTO TRUE FUNZIONA MA DA UN ALTRO ERRORE;
    insertBLOB(fileName, file, con);//passo il nome del file e l'oggetto file
    return (bAttachOk && bParamsOk);
    public void insertBLOB(String strFileName, File AttachedFile, Connection connection) throws SQLException, Exception
    long ts1 = System.currentTimeMillis();
    ResultSet rs = null;
    Statement stmt = null;
    //Create a statement.
    StringBuffer sbSql = new StringBuffer();
    sbSql.append("INSERT INTO media\n");
    sbSql.append("(file_name, file_content)\n");
    sbSql.append("values ('" + strFileName + "', empty_blob())");
    connection.setAutoCommit(false);
    stmt = connection.createStatement();
    stmt.execute(sbSql.toString());
    System.out.println(sbSql);
    //Take back the record for update (we will insert the blob)
    StringBuffer sbSqlBody = new StringBuffer();
    sbSqlBody.append("SELECT file_content FROM media\n");
    sbSqlBody.append("WHERE file_name = '" + strFileName + "' for update");
    //Execute the query, and we must have one record so take it
    rs = stmt.executeQuery(sbSqlBody.toString());
    rs.next();
    System.out.println(sbSqlBody);
    //Use the OracleDriver resultset, we take the blob locator
    BLOB blob = ((OracleResultSet)(rs)).getBLOB("file_content");
    //copyFileIntoBlob(AttachedFile, blob);
    System.out.println("Start copyFileIntoBlob");
    System.out.println("attached length = " + AttachedFile.length()); <-GOT THE ERROR HERE
    FileInputStream instream = new FileInputStream(AttachedFile);
    System.out.println("before getBinaryOutputStream");
    OutputStream outstream = blob.getBinaryOutputStream();
    System.out.println("after getBinaryOutputStream");
    //Call getChunkSize() to determine the ideal chunk size to write to the BLOB,
    //then create the buffer byte array.
    int chunk = blob.getChunkSize();
    byte[] buffer = new byte[chunk];
    int length = -1;
    while ((length = instream.read(buffer)) != -1)
    outstream.write(buffer, 0, length);
    instream.close();
    outstream.close();
    System.out.println("End copyFileIntoBlob");
    long ts2 = System.currentTimeMillis();
    connection.commit();
    connection.close();
    //cancella il file
    AttachedFile.delete();
    //cancella il file
    System.out.println("\n"+ (ts2 - ts1) +" ms" );
    ******************************************************

    You are getting NullPointerException because the input parameter AttachedFile to the function
    public void insertBLOB(String strFileName, File AttachedFile, Connection connection)is null.
    First check if the file object is null here: before passing it on to the function.
    File file; //creo un oggetto di tipo "file" dal file nella cartella temporanea
    file = mpRequest.getFile("C:\\app");I don't think file = mpRequest.getFile("C:\\app"); will work if
    app is just a directory, try specifying a file name there.
    Message was edited by:
    appy77

  • Java and oracle variable type

    I write a oracle procedure like this:
    Type retstring is Record
    a varchar2(6),
    b varchar(10)
    type retstr is table of retstring index by BINARY_INTEGER;
    procedure getStr( ret out retstr )is
    begin
    loop
    ret(i).a := a1;
    ret(i).b := b1;
    end loop;
    end;
    I want to call the procedure in my java program.How do i define the variable? Give me an example please!!

    hightech wrote:
    is bug!?!!?!to the original poster, this answer is not only incorrect but it is quite possibly deliberately misleading from a known forum troll. Please ignore it.

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

  • Connecting Oracle 9i Server via a C++ application written using the OTL lib

    I am looking for somebody has experience writing client applications for Oracle 9 using the OTL framework: http://otl.sourceforge.net/
    I am using this free open source software to write my client, but the first stopper was to having my client application to connect to the Oracle Server. (Oracle version 9.2.0.4)
    Using the sqlplus client I am able to connect to the user SYSTEM with the following command line: sqlplus "SYSTEM/manager as SYSDBA".
    But, if I set in my C++ client the connect string for otl_connect::rlogon() to "SYSTEM/manager as SYSDBA" I get the following error.
    ORA-01017: invalid user/password; logon denied;
    Below, I have attached the simple program I wrote:
    #include <iostream>
    using namespace std;
    #include <stdio.h>
    // Compile OTL 4.0 for OCI9
    #define OTL_ORA9I
    #define OTL_EXCEPTION_STM_TEXT_SIZE 4096
    #include <otlv4.h>
    otl_connect db;
    int main()
    // Initialise the OCI enviroment
    otl_connect::otl_initialize();
    try
    cout << "--- Executing the rlogon ---" << endl;
    // Connect to Oracle to user SYSTEM
    db.rlogon("SYS/parc123 as SYSDBA");
    cout << "Done" << endl;
    cout << "--- Executing the drop table ---" << endl;
    // Drop the table created in the previous run
    otl_cursor::direct_exec(db, "drop table test_tab", otl_exception::disabled);
    cout << "--- Executing the create table ---" << endl;
    // Create the table test
    otl_cursor::direct_exec(db,
    "create table test_tab (num1 NUMBER(10), longnum1 NUMBER(20), longnum2 NUMBER(20), shortnum NUMBER(4), binfield BLOB, PRIMARY KEY(longnum1,num1,shortnum))");
    catch(otl_exception& p)
    cerr << "Oracle Error Message : " << p.msg << endl;
    cerr << "SQL Statement executed: " << p.stm_text << endl;
    cerr << "Oracle Variable Info : " << p.var_info << endl;
    cerr << "Exception Code : " << p.code << endl;
    // Disconnect from Oracle
    db.logoff();
    return 0;
    }

    otl_connect:
    void session_begin
    (const char* username, // user name, e.g. "scott"
    const char* password, // password, e.g. "tiger"
    const int auto_commit=0, // session auto-commit mode
    const int session_mode=OCI_DEFAULT
    // OCI_SYSDBA -- in this mode, the user is authenticated for SYSDBA
    // access.
    // OCI_SYSOPER -- in this mode, the user is authenticated
    // for SYSOPER access.
    Instead of otl_connect::rlogon(), use a combination of otl_connect::server_attach() + otl_connect::session_begin()
    Cheers,
    Sergei

  • Error not send data a database of oracle please

    I cannot send data from a variable a the database of oracle.
    variables they are = unot,dost,trest but it does not recognize its values......
    it does not insert anything in the fields of the data base
    this code:
    con = DriverManager.getConnection(url,"ora1", "oracle");
    stmt = con.createStatement();
    String uprs = "insert into anexo (cod_ane,codigo,desc_anexo)
    values(" + unot + "," + dost + "," + trest +")";
    stmt.executeUpdate(uprs);
    this error:
    SQLException: ORA-00936: missing expression

    Are they text fields? Try surrounding them with quotes:
    String uprs = "insert into anexo (cod_ane,codigo,desc_anexo)
    values('" + unot + "','" + dost + "','" + trest +"')";Try displaying uprs before the executeUpdate() and make sure it's really valid SQL.

  • Unable to get the  Oracle.DataAccess namespace

    I'm trying to connect to remote 11g Oracle database using Oracle.DataAccess; working on Visual Studio 2008 installed on Windows XP.
    I have downloaded and installed Oracle 11g ODAC and Oracle Developer Tools for Visual Studio 11.1.0.7.20 .
    I have also installed OracleXEClient.
    I have successfully connected to the database in the Server Explored -> Data connection.
    I have successfully connected using the Sql data source. The connection String Provider is providerName="Oracle.DataAccess.Client".
    But I cant import - use the Oracle.DataAccess;
    using Oracle.DataAccess;
    I get this error
    Error     1     The type or namespace name 'Oracle' could not be found (are you missing a using directive or an assembly reference?)     
    How can I solve this problem?
    Edited by: Daniel Dimov on Apr 29, 2010 10:26 PM

    Hi Ershad,
    Check the value of the ORACLE_HOME variable.
    Also check other oracle variables.
    Please check this link:
    /community [original link is broken];jsessionid=8d92200630d63622db0ec9a0476182d4ea3eddad1206.e34Tb34Lb34PbO0Lb3eTahiPc3yNe0?messageID=1104338&#1104338
    Regards,
    Siddhesh

  • Oracle R12 Clone failing with RC-00118 Error occurred during creation of...

    Im encountering the above error message i have seen the below thread which looks like the same issue, i was wondering if someone could confirm if the clone process requires an off-line backup on the source system for the clone process to work. Currently i'm using a tape backup which runs overnight, the system is up at the time of backup.
    RC-00118: Error occurred during creation of database
    Thanks

    thanks for quick response, its a hot backup.
    the steps ive followed are
    1. adpreclone on source
    2. apps,db,inst directories deleted on destination. (after services have of course been shutdown)
    3. oracle variables removed from path
    4. backup restored from tape
    5. deleted program files/oracle/inventory directory
    6. on cmd window run set PERL5LIB=
    followed by perl adcfgclone.pl dbTier
    is there anything ive missed?

  • Problem setting up user ids to use the Oracle password file.

    I want to set up my database users so that a password file is used for connecting to the database.  I have completed these steps successfully.
      BTW - DB is 11.2.0.3 on AIX power 64
    1.  Created the password file for the database using the orapwd command.  Allowing 20 entries.  Confirmed the file was created in the $ORACLE_HOME/dbs directory
    2.  Created a database user, sbrower
    CREATE USER SBROWER IDENTIFIED BY <password> DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK ;
    GRANT DBA TO SBROWER;
    ALTER USER SBROWER DEFAULT ROLE ALL;
    GRANT UNLIMITED TABLESPACE TO SBROWER;
    ALTER USER SBROWER QUOTA UNLIMITED ON USERS;
    3.  Connected to the database as SYS and granted sysoper to SBROWER
    4.  Using putty, ssh'ed into the server where the database resides.
    5.  Set the oracle variables (ORACLE_HOME, ORACLE_BASE, etc.) and PATH
    6.  Was able to connect to the database using sqlplus / as syoper
    THE PROBLEM
      For another user, EA_RDX_ORACLE1, I follow the same steps (2-6) bu when I execute step 6, it does not allow the connection
    ERROR:
    ORA-01031: insufficient privileges
       but, if I use sqlplus ea_rdx_oracle1/thepassword as sysoper it works
    Looking at v$pwfile_users on the database:
    USERNAME SYSDBA   SYSOPER      SYSASM
    SYS      TRUE      TRUE      FALSE
    SBROWER  FALSE     TRUE      FALSE
    EA_RDX_ORACLE1 FALSE TRUE FALSE
    3 rows selected.
    There is one thing that is different for the ea_rdx_oracle1 id's:
    - The users who use this id, use a took called CyberVault to check out the id.  The password for the id changes each time the id is checked out; however, the way the id is set up on the DB servers, us user does not have to enter the password when they log in (ssh).
    I have sent an email to our unix admin asking his how the id was set up so that it can ssh into the server.  It is not included in the list of users in any group in the /etc/ogroup file and it is not included in the /etc/opassword file.

    The OS authentication ( sqlplus / as sysdba ) does not require the password file.
    The problem may be related to the OS user you are connecting to that server - it is not a member of OSDBA group ( usually DBA ).

  • Oracle 10g Client R2 Install

    Hi,
    I have recently installed the Oracle 10g Database release 2 and now want to install the client. I would like to install the client on the same pc as one of my standard users so I can write scripts(using sqlplus) and run them as this user, but the original oracle home was installed as oracle:oinstall. How should I proceed?
    Thanks,
    Chris.

    You don't need client for this. You could use binaries from existing database installation.
    Just setup the enviroment (ORACLE_HOME, LD_LIBRARY_PATH and other oracle variables except ORACLE_SID) and PATH for other user and it is done.

  • Oracle 11g on Windows Srv 2003

    I just installed fine on a notebook on a clear installation of w2003. In my desktop computer, I installed also, but when is creating sample schemas, it show's some errors in EM. It tolds me, that after installation I could run ecma.bat from console to repair EM..... but....
    Finally... Oracle is running, but there isn't EM any place. I run ecma, and there was an error with repository, about SYSMAN (key in LOCALMACHINE\SOFTWARE\Oracle).
    Any ideas?
    I could access to hr.employees, etc, throught sqlplus, but... and my EM?
    I installed 5 o 8 times, Oracle in that desktop.

    HI user648940
    Consult the following document in metalink in order to clean up your installations on the server.
    Doc ID:      Note:124353.1
    Subject:      WIN: Manually Removing all Oracle Components on Microsoft Windows Platforms
    PURPOSE
    This article describes the procedure how to manually perform the actions to
    create a "clean machine" on Microsoft Windows 95/98/NT/2000/XP and how to
    manually remove all Oracle components (e.g.: oracle RDBMS database server,
    IAS, OEM, client installations, etc) and services from your computer.
    SCOPE & APPLICATION
    This article is intended for DBA's on the Microsoft Windows platform.
    WARNING:
    1. Remove all Oracle components from your computer only as a last resort,
    and only if you want to remove ALL Oracle components from your system.
    2. These instructions remove all Oracle components, services, and registry
    entries from your computer. In addition, any database files in the
    subdirectories under ORACLE_BASE\ORADATA\ are also removed.
    3. These procedures will also remove Oracle network configuration files,
    user written scripts and any other user generated files that may be stored
    in Oracle_Base directories.
    4. Exercise extreme care when removing registry entries. Removing incorrect
    entries can severely compromise your computer.
    MANUALLY REMOVING ALL ORACLE COMPONENTS AND SERVICES FROM YOUR COMPUTER
    Section A (steps 1-6) describes the removal of all Oracle components on
    Windows NT,2000 and XP.
    Section B (steps 1-4) describes the removal of all Oracle components on
    Windows 95 and Windows 98.
    A. Removing Components on Windows NT/2000/XP.
    To remove all Oracle components from a computer on Windows NT/2000/XP:
    1. Check privileges:
    1.a. Ensure you are logged in as a user with Administrator privileges.
    2. Stop all Oracle services (if any are running):
    2.a. NT: Choose Start > Settings > Control Panel > Services.
    2000,XP: Right click My Computer > Manage > Services and Applications >
    > Services
    2.b. If any Oracle services (their names begin with Oracle) exist and have
    the status Started, select the service and click Stop.
    2.c. Click Close to exit the Services window.
    2.d. Close the Control Panel/Computer Management window.
    3. Remove the entries in the Windows registry:
    3.a. Start the registry editor:
    Choose Start > Run > regedit
    Note: On Windows NT you can use regedt32 instead. The searching
    capabilities of regedt32 is limited compared to regedit. It will be
    needed to be able to edit 32-bit entries in the registry. Since we
    are not going to update any 32-bit entry it is not needed.
    3.b. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    Note the value of the key INST_LOC, this is the location of the
    Oracle Universal Installer (OUI). The default location is
    C:\Program Files\Oracle\Inventory. If this value is different, make
    note of it, so we can delete these files later.
    Delete this ORACLE key.
    3.c. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC and expand all subkeys and
    remove all keys under here which are related with the
    "Oracle ODBC Driver"
    3.d. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and remove
    all keys under here that begin with ORACLE or ORAWEB.
    3.e. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\...
    ...\Application and remove all keys under here that begin with ORACLE.
    3.f. Go to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\...
    ...\Uninstall and remove any entries related to Oracle.      
    3.g. Go to HKEY_CLASSES_ROOT, remove all keys that begin with Ora or ORCL
    (e.g. Oracle..., ORADC..., ORAMMC..., OraOLE..., OraPerf... and ORCL...).
    3.h. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Classes, remove all keys that begin
    with Ora or ORCL
    (e.g. Oracle..., ORADC..., ORAMMC..., OraOLE..., OraPerf... and ORCL...).
    3.i. Go to HKEY_CURRENT_USER\Software\Oracle, delete this ORACLE key.
    3.j. Go to HKEY_USERS\…\Software\Oracle, delete this ORACLE key.
    3.k. Close the registry.
    4. Clean up the environment settings:
    4.a. NT: Choose Start > Settings > Control Panel > System > Environment tab
    2000,XP: Choose Start > Settings > Control Panel > System >
    Advanced tab > Environment variables.
    4.b. At "System Variables" click on the variable PATH in order to modify
    the value. For example, you may see a path similar to this one:
    C:\ORACLE\ORA81\BIN;C:\PROGRAM FILES\ORACLE\JRE\1.1.7\BIN
    4.c. If an %ORACLE_HOME% was installed, remove this %ORACLE_HOME%\BIN path.
    4.d. If JRE was installed by Oracle, remove the JRE path.
    4.e. If there is a CLASSPATH variable under "System Variables", first make
    note of the path defined, then delete it. This variable can be added
    back at a later date if needed.
    4.f. Check if there are any other Oracle variables set in "System Variables",
    ORACLE_HOME, ORACLE_SID, TNS_ADMIN, JSERV or WV_GATEWAY_CFG. If these
    exist, delete them also.
    4.g. Click on APPLY and OK.
    4.h. Close the Control Panel window.
    5. Delete the software and icons:
    5.a. NT: Choose Start > Programs > Windows NT Explorer.
    2000,XP: Choose Start > Programs > Accessories > Windows Explorer.
    5.b. NT: Go to %SystemDrive%\WINNT\PROFILES\ALL USERS\START MENU\PROGRAMS
    2000,XP: Go to %SystemDrive%\DOCUMENTS AND SETTINGS\ALL USERS\...
    ...\START MENU\PROGRAMS
    Note 1: These locations depend on whether OS was upgraded from NT, or
    this was a fresh install of 2000/XP.
    Note 2: To locate your System Drive, type in DOS-box: echo %SystemDrive%
    and delete the following icons:
    - Oracle Installation Products
    - PRODUCT_NAME - HOME_NAME e.g.
    Oracle for Windows NT - Dev6i
    Oracle Reports 6i - Dev6i
    Oracle Olap Client 2.2 - Dev6i
    Oracle9i Lite
    Oracle - OraHome92
    5.c. Go to %SystemDrive%\Program Files\Oracle or the location of INST_LOC as
    noted earlier in step 3.b. and delete this directory.
    Note: In order to successfully delete all files, you may have to reboot
    your computer first, in order to clear Operating System locks
    on those files.
    5.d. Go to the temporary directory and delete all files and directories in
    here (see note in 5.c.).
    NT: %SystemDrive%\Temp
    2000,XP:
    %SystemDrive%\Documents and Settings\<username>\Local Settings\Temp\
    5.e. Go to the drive where the Oracle software is installed on your machine
    and delete all ORACLE_BASE directories on your hard drive (see note in
    5.c.).
    5.f. Close the Windows Explorer / Windows NT Explorer.
    6. Finish the removal:
    6.a. Empty the recycle bin
    Right click on recycle bin > Empty Recycle Bin.
    6.b. Reboot your computer.
    6.c. Optionally: If you are on Windows 2000 or XP run the System Defragmenter
    utility:
    - from Control Panel, select Administrative Tools > Computer Management
    - expand Storage, then select Disk Defragmenter
    - highlight each virtual drive, in turn, and click Defragment
    - reboot your computer when finished.
    B. Removing Components on Windows 95 or Windows 98.
    To remove all Oracle components from a computer on Windows 95/Windows 98:
    1. Remove the entries in the Windows registry:
    1.a. Start the registry editor at the MS-DOS command prompt:
    C:\> REGEDIT
    1.b. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    Note the value of the key INST_LOC, this is the location of the Oracle
    Universal Installer. The default location is
    C:\Program Files\Oracle\Inventory
    If this value is different, make note of it, so we can delete these files
    later. Delete this ORACLE key.
    1.c. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC and expand all subkeys and
    remove all keys under here which are related with the
    "Oracle ODBC Driver".
    1.d. Go to:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
    and remove any entries related to Oracle.      
    1.e. Go to HKEY_CLASSES_ROOT, remove all keys that begin with Ora or ORCL
    (e.g. Oracle..., ORADC..., ORAMMC..., OraOLE..., OraPerf... and ORCL...).
    1.f. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Classes, remove all keys that begin
    with Ora or ORCL
    (e.g. Oracle..., ORADC..., ORAMMC..., OraOLE..., OraPerf... and ORCL...).
    1.g. Go to HKEY_CURRENT_USER\Software\Oracle, delete this ORACLE key.
    1.h. Go to HKEY_USERS\…\Software\Oracle, delete this ORACLE key.
    1.i. Close the registry.
    2. Clean up the environment settings:
    2.a. Open your AUTOEXEC.BAT with an editor to modify the PATH variable.
    For example, you may see a path similar to this one:
    C:\ORACLE\ORA81\BIN;G:\PROGRAM FILES\ORACLE\JRE\1.1.7\BIN .
    2.b. If an %ORACLE_HOME% was installed, remove this %ORACLE_HOME%\BIN path.
    2.c. If there is a CLASSPATH variable set in the AUTOEXEC.BAT, first make note
    of the path defined, then delete it. This variable can be added back at
    a later date if needed.
    2.d. If JRE was installed by Oracle, remove the JRE path.
    2.e. Save the AUTOEXEC.BAT file and close the edit.
    3. Delete the software and icons:
    3.a. Choose Start > Programs > Windows Explorer.
    3.b. Go to SYSTEM_DRIVE:\WINDOWS\START MENU\PROGRAMS
    and delete the following icons:
    - Oracle - HOME_NAME
    where HOME_NAME is the previous Oracle home name.
    - Oracle Installation Products
    3.c. Go to SYSTEM_DRIVE:\Program Files\Oracle or the location of INST_LOC as
    noted earlier in step 1.b and delete this directory.
    3.d Go to SYSTEM_DRIVE:\Temp and delete all files and directories in here.
    3.e. Go to the drive where the Oracle software is installed on your machine
    and delete all ORACLE_BASE directories on your hard drive.
    3.f. Remove any Oracle-related .INI files that may exist in the Windows
    directory. The Windows directory may be found by entering
    "echo %WINDIR%" from a command prompt.
    Typical Oracle .INI files include ORADIM73.INI, ORADIM80.INI,
    ORACLE.INI, ORAODBC.INI
    3.g. Close the Windows Explorer.
    4. Finish the removal:
    4.a. Empty the recycle bin
    Right click on recycle bin > Empty Recycle Bin
    4.b. Reboot your computer.
    RELATED DOCUMENTS
    Oracle Installation Guides for Windows.
    SEARCH WORDS
    WIN95, WIN98, WINNT, WIN2000, Windows95, Windows98, WindowsNT, Windows2000,
    de-install, deinstall, re-install, reinstall

  • Oracle with php

    i am new to oracle and i want to know how would i access (read / write) to a oracle database using php.
    if someone can point me into the direction to look.
    thanks

    before you get your feet wet with using oci functions in PHP, run a script with just one line :-
    <?phpinfo()?>
    save it as, say TEST.PHP and then view it in your browser. this generates a page, which lists out all the compiled environments. if you dont see a section called OCI8, then i guess you havent compiled your PHP properly.
    cheerio!! Hi
    I did that and everything is ok. I get php infos and oci8 is well installed.
    But, when i try to connect (oracle 8.0.5), like this :
    $connection = OCILogon ("scott","tiger");
    I get : "Warning: _oci_open_server. Error while trying to retrieve
    text for error ORA-12546 in /var/www/..."
    I tried too with :
    $connection = OCILogon ("scott","tiger","ora8");
    In this case, i get an error ORA-12154.
    My tnsnames.ora is ok (i can connect from sqlplus without problems.
    I tried to add to my script instructions done for inializing the environnement (with "putenv") for the main oracle variables necessary to connect (ORACLE_HOME, TNS_ADMIN, etc).
    I don't see anything else.
    Does anybody know this problem? Or (better) could help?
    Thanks
    Rosaire AMORE

  • Remove Oracle

    Hi ,
    How can I remove Oracle S/W and Database completely from Windows and Linux machines.
    Thanx in advance.

    WARNING:
    1. Remove all Oracle components from your computer only as a last resort,
    and only if you want to remove ALL Oracle components from your system.
    2. These instructions remove all Oracle components, services, and registry
    entries from your computer. In addition, any database files in the
    subdirectories under ORACLE_BASE\ORADATA\ are also removed.
    3. These procedures will also remove Oracle network configuration files,
    user written scripts and any other user generated files that may be stored
    in Oracle_Base directories.
    4. Exercise extreme care when removing registry entries. Removing incorrect
    entries can severely compromise your computer.
    MANUALLY REMOVING ALL ORACLE COMPONENTS AND SERVICES FROM YOUR COMPUTER
    A. Removing Components on Windows NT/2000.
    To remove all Oracle components from a computer on Windows NT/Windows 2000:
    1. Check privileges:
    1.a. Ensure you are logged in as a user with Administrator privileges.
    2. Stop all Oracle services (if any are running):
    2.a. NT: Choose Start > Settings > Control Panel > Services.
    2000: Right click My Computer > Manage > Services and Applications > Services
    2.b. If any Oracle services (their names begin with Oracle) exist and have
    the status Started, select the service and click Stop.
    2.c. Click Close to exit the Services window.
    2.d. Close the Control Panel/Computer Management window.
    3. Remove the entries in the Windows registry:
    3.a. Start the registry editor:
    Choose Start > Run > regedt32
    3.b. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    Note the value of the key INST_LOC, this is the location of the Oracle Universal
    Installer. The default location is C:\Program Files\Oracle\Inventory. If this
    value is different, make note of it, so we can delete these files later.
    Delete this ORACLE key.
    3.c. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC and expand all subkeys and
    remove all keys under here which are related with the
    "Oracle ODBC Driver"
    3.d. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and remove
    all keys under here that begin with ORACLE or ORAWEB.
    3.e. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\...
    \Application and remove all keys under here that begin with ORACLE.
    3.f. Go to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
    and remove any entries related to Oracle.
    3.g. Go to HKEY_CLASSES_ROOT, remove all keys that begin with Oracle, OraPerf or
    OraOLEDB
    3.h. Close the registry.
    4. Clean up the environment settings:
    4.a. NT: Choose Start > Settings > Control Panel > System > Environment tab
    2000: Choose Start > Settings > Control Panel > System > Advanced tab >
    Environment variables.
    4.b. At "System Variables" click on the variable PATH in order to modify
    the value. For example, you may see a path similar to this one:
    C:\ORACLE\ORA81\BIN;C:\PROGRAM FILES\ORACLE\JRE\1.1.7\BIN
    4.c. If an %ORACLE_HOME% was installed, remove this %ORACLE_HOME%\BIN path.
    4.d. If JRE was installed by Oracle, remove the JRE path.
    4.e. If there is a CLASSPATH variable under "System Variables", first make note
    of the path defined, then delete it. This variable can be added back at
    a later date if needed.
    4.f. Check if there are any other Oracle variables set in "System Variables",
    ORACLE_HOME, ORACLE_SID or TNS_ADMIN. If these exist, delete them also.
    4.g. Click on APPLY and OK.
    4.h. Close the Control Panel window.
    5. Delete the software and icons:
    5.a. NT: Choose Start > Programs > Windows NT Explorer.
    2000: Choose Start > Programs > Accessories > Windows NT Explorer.
    5.b. NT: Go to SYSTEM_DRIVE:\WINNT\PROFILES\ALL USERS\START MENU\PROGRAMS
    2000: Go to SYSTEM_DRIVE:\DOCUMENTS AND SETTINGS\ALL USERS\START MENU\PROGRAMS
    (Note: These locations depend on whether OS was upgraded from NT,
    or this was a fresh install of 2000)
    and delete the following icons:
    - Oracle - HOME_NAME
    where HOME_NAME is the previous Oracle home name.
    - Oracle Installation Products
    5.c. Go to SYSTEM_DRIVE:\Program Files\Oracle or the location of INST_LOC as
    noted earlier in step 3.b and delete this directory.
    5.d Go to SYSTEM_DRIVE:\Temp and delete all files and directories in here.
    5.e. Go to the drive where the Oracle software is installed on your machine
    and delete all ORACLE_BASE directories on your hard drive.
    5.f. Close the Windows NT Explorer.
    6. Finish the removal:
    6.a. Empty the recycle bin
    Right click on recycle bin > Empty Recycle Bin.
    6.b. Reboot your computer.

  • Problem PHP Oracle - Instant Client

    Hi,
    i have been trying to resolve this issue but im not really sure what i need to do, could someone help me?
    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
    Im getting this error when i try to connect to a Oracle database via PHP.
    My host is Windows, Oracle instant client is on C:\instantclient_11_2 and added on PATH Variables.
    I think there are missing some oracle variables on my phpinfo(), below:
    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
    11.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
    20
    Environment
    Variable
    Value
    REDIRECT_HANDLER
    application/x-httpd-php
    REDIRECT_STATUS
    200
    HTTP_HOST
    marcelb01v
    HTTP_USER_AGENT
    Mozilla/5.0 (Windows NT 6.1; rv:28.0) Gecko/20100101 Firefox/28.0
    HTTP_ACCEPT
    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    HTTP_ACCEPT_LANGUAGE
    en-US,en;q=0.5
    HTTP_ACCEPT_ENCODING
    gzip, deflate
    HTTP_CONNECTION
    keep-alive
    PATH
    C:\instantclient_11_2;O:\ora11202w\BIN;C:\PHP\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;
    SystemRoot
    C:\windows
    COMSPEC
    C:\windows\system32\cmd.exe
    PATHEXT
    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    WINDIR
    C:\windows
    SERVER_SIGNATURE
    no value
    SERVER_SOFTWARE
    Apache/2.2.25 (Win32) mod_fcgid/2.3.6
    SERVER_NAME
    marcelb01v
    SERVER_ADDR
    10.26.213.195
    SERVER_PORT
    80
    REMOTE_ADDR
    10.45.112.152
    DOCUMENT_ROOT
    C:/htdocs
    SERVER_ADMIN
    SCRIPT_FILENAME
    C:\htdocs\stuffs\test.php
    REMOTE_PORT
    51461
    REDIRECT_URL
    /stuffs/test.php
    GATEWAY_INTERFACE
    CGI/1.1
    SERVER_PROTOCOL
    HTTP/1.1
    REQUEST_METHOD
    GET
    QUERY_STRING
    no value
    REQUEST_URI
    /stuffs/test.php
    SCRIPT_NAME
    /stuffs/test.php
    ORIG_SCRIPT_FILENAME
    C:/PHP/php-cgi.exe
    ORIG_PATH_INFO
    /stuffs/teste.php
    ORIG_PATH_TRANSLATED
    C:\htdocs\stuffs\test.php
    ORIG_SCRIPT_NAME
    /php/php-cgi.exe
    PHP Variables
    Variable
    Value
    _SERVER["REDIRECT_HANDLER"]
    application/x-httpd-php
    _SERVER["REDIRECT_STATUS"]
    200
    _SERVER["HTTP_HOST"]
    marcelb01v
    _SERVER["HTTP_USER_AGENT"]
    Mozilla/5.0 (Windows NT 6.1; rv:28.0) Gecko/20100101 Firefox/28.0
    _SERVER["HTTP_ACCEPT"]
    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    _SERVER["HTTP_ACCEPT_LANGUAGE"]
    en-US,en;q=0.5
    _SERVER["HTTP_ACCEPT_ENCODING"]
    gzip, deflate
    _SERVER["HTTP_CONNECTION"]
    keep-alive
    _SERVER["PATH"]
    C:\instantclient_11_2;O:\ora11202w\BIN;C:\PHP\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;
    _SERVER["SystemRoot"]
    C:\windows
    _SERVER["COMSPEC"]
    C:\windows\system32\cmd.exe
    _SERVER["PATHEXT"]
    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    _SERVER["WINDIR"]
    C:\windows
    _SERVER["SERVER_SIGNATURE"]
    no value
    _SERVER["SERVER_SOFTWARE"]
    Apache/2.2.25 (Win32) mod_fcgid/2.3.6
    _SERVER["SERVER_NAME"]
    marcelb01v
    _SERVER["SERVER_ADDR"]
    10.26.213.195
    _SERVER["SERVER_PORT"]
    80
    _SERVER["REMOTE_ADDR"]
    10.45.112.152
    _SERVER["DOCUMENT_ROOT"]
    C:/htdocs
    _SERVER["SERVER_ADMIN"]
    _SERVER["SCRIPT_FILENAME"]
    C:\htdocs\stuffs\test.php
    _SERVER["REMOTE_PORT"]
    51461
    _SERVER["REDIRECT_URL"]
    /stuffs/test.php
    _SERVER["GATEWAY_INTERFACE"]
    CGI/1.1
    _SERVER["SERVER_PROTOCOL"]
    HTTP/1.1
    _SERVER["REQUEST_METHOD"]
    GET
    _SERVER["QUERY_STRING"]
    no value
    _SERVER["REQUEST_URI"]
    /stuffs/test.php
    _SERVER["SCRIPT_NAME"]
    /stuffs/test.php
    _SERVER["ORIG_SCRIPT_FILENAME"]
    C:/PHP/php-cgi.exe
    _SERVER["ORIG_PATH_INFO"]
    /stuffs/test.php
    _SERVER["ORIG_PATH_TRANSLATED"]
    C:\htdocs\stuffs\test.php
    _SERVER["ORIG_SCRIPT_NAME"]
    /php/php-cgi.exe
    _SERVER["PHP_SELF"]
    /stuffs/test.php
    _SERVER["REQUEST_TIME"]
    1399483024

    Your PATH includes "C:\instantclient_11_2;O:\ora11202". This hints that you have multiple versions of Oracle installed, which is common cause of issues.
    Do you need Instant Client?  If you already have an Oracle DB you don't really need Instant Client unless you have a particular version requirement.

Maybe you are looking for

  • DSC - OPC Connection - Can't read or write to tags

    I am working on controlling some motors over an OPC server. The PLC is an M258, and the OPC server is CoDeSyS OPC DA. When I use MatrikonExplorer, I can read the value of tags, and change their values as needed. Using an evaluation version of NI OPC

  • Can Premiere 5.1 be installed on a 64-bit system?

    I upgraded a Vista 32-bit to Win 7 64-bit and now cannot seem to install. A message indicates I should check the 32-bit or 64-bit compatability. Thanks for any assistance.

  • Find My iPhone not compatible with iPhone 4

    when  I try to buy find my iPhone, I get a message that says  "this app requires iOS 8.0 or later. you must update to iOS 8.0 in order to download and use this app." and is not compatible with iPhone 4.

  • Registering Repsvr8 control in oracle 8i Lite

    hi, I'm developing an application wherein I've to connect to Oracle 8i Lite database for Windows CE. I'm using Windows CE toolkit for Visual C++ version 2.0 on Windows CE based palm device. I'm in confusion of how to connect to 8i Lite Database. Are

  • Better Search Options?

    I find the search option on my Blackbery Curve 8330 to be quite limited.  For example, I'd like to search my Address Book to find any restaurants that are in Easton PA.  In Search, I enter "Easton" in the Text box and click on Address Book, but it do