Multiple Oracle Connexions In A Script

Hi,
I am actually encounter some problems with my oracle connexions.
I need to have multiple opened connexions with differents user logons on a same database in a script .
When I configure the second connexion, I could no more make request on the first one which reference the new connexion....
In fact the problem can be described with the code below :
Le problème peut se décrire de la manière suivante :
STEP 1 - I try with success a 1 connexion :
$test = OCILogon( 'USER1', PASS1', INSTANCE' );
$rSth = OCIParse($test, "SELECT * FROM APPLICATIONS" );
$rRet = OCIExecute($rSth);
Result : OK.STEP 2 - I build a second one
$test2 = OCILogon( 'USER2', 'PASS2', INSTANCE' );
Result : OKSTEP 3 - I try to request again the first connexion :
$rSth = OCIParse($test, "SELECT * FROM APPLICATIONS" );
$rRet = OCIExecute($rSth);
Result : "Warning: OCIStmtExecute: ORA-00942: table or view does not exist "...If try to request the first connexion with a sql-statement on a table of the second connexion, it works.....
It will be nice if someone have a solution or an explication.
Alex

I don't have an immediate answer.
I just logged a PHP bug http://bugs.php.net/29013 against the problem.
-- CJ

Similar Messages

  • Multiple Oracle home and multiple Oracle database versions on same server?

    Hi all,
    I want to setup a test environment on single Windows XP server with an instance
    of Oracle 10g and Oracle 11g. How can I install both versions without problems?
    Thanks

    Hi,
    I am facing a problem on the same..
    below is the link to my thread.
    Multiple Oracle Home in Windows
    Please reply me how to solve this problem
    Thanks
    Bhavik Fuletra

  • Multiple Oracle home

    Hi ,
    I have some doubt which needs to be cleared.
    If I will install multiple oracle home like ORACLE_HOME=/u01/app/oracle/product/10.1.0/asm
    ORACLE_HOME=/u01/app/oracle/product/9.2.0
    ORACLE_HOME=/u01/app/oracle/product/10.2.0
    ORACLE_HOME=/u01/app/oracle/product/crs
    Now in this when I will set export ORACLE_HOME then which version will be picked up.
    Is ORAENV isgoing to come into picture.
    Please throw some light on it.
    Mk

    asifkabirdba wrote:
    You have installed your oracle product (db,application server) using one of os user like oracle,appl,oraprod ect. When you log in to your OS by using OS user then .profile file executed automatically to export necessary environmental variables. You did not mention your OS. Normally you will find it to your OS user home directory. You can edit this file to set your desired ORACLE_HOME.
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
         . ~/.bashrc
    fi
    # User specific environment and startup programs
    PATH=$PATH:$HOME/bin
    export PATH
    unset USERNAME
    ORACLE_HOME=/oracle/product/102
    ORACLE_SID=ogtest
    LD_LIBRARY_PATH=$ORACLE_HOME/lib
    TNS_ADMIN=/oracle/product/102/network/admin/
    export ORACLE_HOME
    export ORACLE_SID
    export LD_LIBRARY_PATH
    export TNS_ADMIN
    export PATH=$PATH:$ORACLE_HOME/bin
    Regards
    Asif KabirAsif,
    Your advice to hard code the Oracle environment directly into the profile is poorly thought out. And a direct carry over of 'worst practices' unfortunately taught in some Oracle related classes.
    The OP did correctly identify oraenv (as described in the "Administrator's Reference for UNIX-Based Operating Systems" at http://www.oracle.com/pls/db102/portal.portal_db?selected=4) as the preferred solution. Putting THAT into the profile (using ORAENV_ASK as described in the manual) is OK.
    I'll leave you to figure out why the difference - I've posted many times about that in these forums.
    /Hans

  • Multiple Oracle Products on Single Server

    Can we install Multiple Oracle Products for Development and Testing on a Single Server?
    Oracle Database 9i Enterprise Edition.
    Oracle 9i Application Server
    Oracle Applications 11i (Financials GL,HRMS PAYROLL)
    Oracle Discoverer 4.x
    Oracle Internet Developer Suite (Forms Server, Reports Server,
    If yes,
    Do they need to be in separate ORACLE_HOME or same ?
    Also what should be the sequence of Install, i.e. what should be installed first?

    The following products needs to be in their own Oracle Home:
    Oracle Database 9i Enterprise Edition. --> in its own O_H
    Oracle 9i Application Server --> in its own O_H (assuming this is 1.0.2.2 or 9.0.2)
    Oracle Applications 11i (Financials GL,HRMS PAYROLL) --> in its own O_H
    Oracle Discoverer 4.x --> in its own O_H (this is a 806 based product btw)
    Oracle Internet Developer Suite (Forms Server, Reports Server) --> This can either be in its own O_H or in the O_H which has 1.0.2.2 Oracle9i Application Server.

  • Calling oracle function in OMB script

    Hi
    Can anyone please tell me how can i get the returned value of an oracle function in OMB script. or how can i get the value into OMB variable and use it.
    Basically i want to set the properties of OWB mapping via OMB script.
    Following OMB code sets the max error limit of a mapping.
    OMBALTER MAPPING 'MAP_DATA' SET PROPERTIES (MAXIMUM_NUMBER_OF_ERRORS) VALUES ('100')
    i dont want to hard code the value 100 rather i want this value to be returned from a function.
    If it is not possible then plz tell me how can i set MAXIMUM_NUMBER_OF_ERRORS property of OWB mapping via sql or pl/sql.
    Any type of clue will be highly appreciated.
    Best Regards

    Here is my bare-bones OMB SQL Library to allow you to do pure SQL calls from within OMB+. All I have ever used it for is to run queries, so I don't have a library procedure for calling a function, however if your function is SQL-callable (e.g. select my_func() from dual) then it would work. Either that or you'll want to augment this library to build a procedure that will call and return the results from a java preparedStatement. It's something I've been meaning to do, but haven't got around to it yet.
    All you should need to do is save this as it's own tcl file and then source it at the top of your own script, or embed it into your script.
    EDIT: Here is a page with some sample code on using java.sql.CallableStatement to call a Pl/SQL procedure from Java which should certainly do the trick for you in conjunction with the basic session control in my library.
    http://www.exampledepot.com/egs/java.sql/CallProcedure.html
    Cheers,
    Mike
    package require java
    #file omb_sql_library.tcl
    proc oracleConnect { serverName databaseName portNumber username password } {
       # import required classes
       java::import java.sql.Connection
       java::import java.sql.DriverManager
       java::import java.sql.ResultSet
       java::import java.sql.SQLWarning
       java::import java.sql.Statement
       java::import java.sql.CallableStatement
       java::import java.sql.ResultSetMetaData
       java::import java.sql.DatabaseMetaData
       java::import java.sql.Types
       java::import oracle.jdbc.OracleDatabaseMetaData
       # load database driver .
       java::call Class forName oracle.jdbc.OracleDriver
       # set the connection url.
       append url jdbc:oracle:thin
       append url :
       append url $username
       append url /
       append url $password
       append url "@"
       append url $serverName
       append url :
       append url $portNumber
       append url :
       append url $databaseName
       set oraConnection [ java::call DriverManager getConnection $url ]
       set oraDatabaseMetaData [ $oraConnection getMetaData ]
       set oraDatabaseVersion [ $oraDatabaseMetaData getDatabaseProductVersion ]
       puts "Connected to: $url"
       puts "$oraDatabaseVersion"
       return $oraConnection
    proc oracleDisconnect { oraConnect } {
      $oraConnect close
    proc oraJDBCType { oraType } {
      #translation of JDBC types as defined in XOPEN interface
      set rv "NUMBER"
      switch $oraType {
         "0" {set rv "NULL"}
         "1" {set rv "CHAR"}
         "2" {set rv "NUMBER"}
         "3" {set rv "DECIMAL"}
         "4" {set rv "INTEGER"}
         "5" {set rv "SMALLINT"}
         "6" {set rv "FLOAT"}
         "7" {set rv "REAL"}
         "8" {set rv "DOUBLE"}
         "12" {set rv "VARCHAR"}
         "16" {set rv "BOOLEAN"}
         "91" {set rv "DATE"}
         "92" {set rv "TIME"}
         "93" {set rv "TIMESTAMP"}
         default {set rv "OBJECT"}
      return $rv
    proc oracleQuery { oraConnect oraQuery } {
       set oraStatement [ $oraConnect createStatement ]
       set oraResults [ $oraStatement executeQuery $oraQuery ]
       # The following metadata dump is not required, but will be a helpfull sort of thing
       # if ever want to really build an abstraction layer
       set oraResultsMetaData [ $oraResults getMetaData ]
       set columnCount        [ $oraResultsMetaData getColumnCount ]
       set i 1
       #puts "ResultSet Metadata:"
       while { $i <= $columnCount} {
          set fname [ $oraResultsMetaData getColumnName $i]
          set ftype [oraJDBCType [ $oraResultsMetaData getColumnType $i]]
          #puts "Output Field $i Name: $fname Type: $ftype"
          incr i
       # end of metadata dump
       return $oraResults
    # SAMPLE CODE to run a quick query and dump the results. #
    #set oraConn [ oracleConnect myserver orcl 1555 scott tiger ]
    #set oraRs [ oracleQuery $oraConn "select name, count(*) numlines from user_source group by name" ]
    #for each row in the result set
    #while {[$oraRs next]} {
      #grab the field values
    #  set procName [$oraRs getString name]
    #  set procCount [$oraRs getInt numlines]
    #  puts "Program unit $procName comprises $procCount lines"
    #$oraRs close
    #oracleDisconnect $oraConnEdited by: zeppo on Nov 25, 2008 7:19 AM

  • From IDOC to Multiple Oracle tables Structure

    Hi Guys,
    I am doing a one Senario which is Custom idoc and Custom Tables of oracle they both have same fields and Same Sturucte does it possible from to do 1:1 mapping shall i process these in 1:n.Need a sugestion in these  How i can slove these problem. IF some from india will give their cont pho to my mail id [email protected] i can call them and dicuss about these problem..
      the senario is idoc to multiple oracle tables..need to map.
    Regd's
    Raj

    Hi Raj,
    you scenario can be:
    R/3 -> XI -> JDBC
    The flow is asynchronous - so you dont have any responses. If you want to use BPM/acknowledgements to catch errors have a look to <a href="/people/udo.martens/blog/2005/09/30/one-logical-system-name-for-serveral-bpm-acknowledgements Logical System Name for serveral BPM Acknowledgements</a>
    You can split the IDoc (<a href="/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible without BPM - Yes, it’s possible!</a>) to several JDBC messages or put serveral statements into one message (
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm">Document Formats for the Receiver JDBC Adapter</a>)
    Regards,
    Udo

  • Multiple Oracle Homes

    Hi everybody,
    I have Oracle 9i installed on my Windows machine.
    I installed Oracle Developer Suite, but could not login due to TNS errors.
    I have a little idea of what the problem is. We need to edit TNSNAMES.ORA file so that it could resolve the service name.
    Can u please help me out in configuring Developer Suite to work properly?
    Thanks.
    -- Kishore.

    Not quite sure why your title is Multiple Oracle Homes. Can you connect to SQLPLUS or any other product in the suite? Is it just Designer you are having hassles with? Do you have the database on the same machine and can you connect to that? If you are successful at connecting to SQLPLUS, then take a look at the tnsnames file in the Database network /admin directories.
    There was a bug at one point where the tnsnames would fail if the network connect string was between 184 and 192 characters in length. You may be running into this. In which case if your tnsnames.ora contains
    (CONNECT_DATA =(SID = <SID>), you can change this to use (CONNECT_DATA =(SERVICE_NAME= <SID>)
    Regards
    Sue

  • Guidelines regarding directory structure for multiple Oracle homes on Unix!

    Hi All,
    Are there any guidelines published regarding directory structures that should be defined while using multiple Oracle homes on Unix/Linux box?
    I am looking for guidelines regarding admin and oradata folders so that we dont accidentally mess up with the DB contents with a wrong Oracle home.
    Its a development server with 8i and 10g. 11g might also get loaded on the same server in future.
    Thanks in advance...
    Regards

    Thanks Maran.
    I have already checked many installation guides before posting here. All of them mention about creating folders like /admin or /oradata on various mount points but none of the naming conventions really indicate whether it is a 8i database or a 10g database.
    This is required when you are having multiple Oracle installations under /opt and databases are running from different mount points.
    Regards,

  • Multiple OracleAS installs

    We are creating a shared services environment where we plan to install multiple OracleAS. We don't want the different organizations to have to access URLs containing ports.
    Is there a way to make this work?
    For example:
    Install 1 Listens on port 7777, 443 and we added 80. The url for this OracleAS is https://xyz.org
    Install 2 Listens on port 7778, 4443. We want url for this OracleAS to be https://abc.org

    Good point, I overlooked the point that you wanted to install both of these on the same machine.
    Yes you are right that the default ports that browsers don't require to be specified are 443 and 80. As you said those are used by other install so yes you will not be able to bypass it just with OHS.
    I guess in this situation you will either have to have either a software/hardware load balancer or a proxy server to front end these two OHSs. And there you define a rule to redirect to respective OHS based on requested URL.
    You can have another (third) installation of OHS and configure it as the proxy for other OHSs. You can configure this third OHS to run on port 443 and 80 and other two OHSs on different ports.
    You can also use Oracle Web Cache product (which can act as a reverse proxy/software load balancer). There you can create two sites (of desired external facing URLs with proper DNS settings so those URLs are resolvable) and define a site-to-server mapping for each site pointing to respective origin server (OHS).
    Hope this will help.
    Thanks
    Shail

  • Need to Load data in XML file into multiple Oracle tables

    Experts
    I want to load data that is stored at XML file into multiple Oracle table using plsql.
    I am novice in this area.Kindly explain in depth or step by step so that i can achive this.
    Thanks in advnace.

    Hi,
    extract your xml and then you can use insert all clause.
    here's very small example on 10.2.0.1.0
    SQL> create table table1(id number,val varchar2(10));
    Table created.
    SQL> create table table2(id number,val varchar2(10));
    Table created.
    SQL> insert all
      2  into table1 values(id,val)
      3  into table2 values(id2,val2)
      4  select extractValue(x.col,'/a/id1') id
      5        ,extractValue(x.col,'/a/value') val
      6        ,extractValue(x.col,'/a/value2') val2
      7        ,extractValue(x.col,'/a/id2') id2
      8  from (select xmltype('<a><id1>1</id1><value>a</value><id2>2</id2><value2>b</value2></a>') col from dual) x;
    2 rows created.
    SQL> select * from table1;
            ID VAL                                                                 
             1 a                                                                   
    SQL> select * from table2;
            ID VAL                                                                 
             2 b                                                                    Ants

  • C# application to execute both oracle and sql server script files.

    Hi All,
    I am suppose to develop an application using c# which can execute oracle script files as well as sql server script files based on some user's choice. 
    Both the script files(oracle/sql server) contains scripts to create tables, create views and create functions.
    What is the best way to do this and which existing c# functions should is use.
    Thanks in advance.

    I am suppose to develop an application using c# which can execute oracle script files as well as sql server script files based on some user's choice. 
    You can use SQL Plus for Oracle. You can have a C# program that issues commands  for  scripts for table, views, triggers  creation and the whole 10 yards to SQL Plus,
    http://docs.oracle.com/cd/B19306_01/server.102/b14357/qstart.htm
    https://www.google.com/#q=sql+plus
    I started writing a program to use SQL Plus to run the scripts, but cI ame to the conclusion that it was a waste of my time.
    A tool called OSM, an Oracle, tool gives a list of script files that need to be run do to a change in a script file based on file timestamp. You can copy the list doing a copy/past operation and drop it into SQL Plus's Command line, and SQL Plus runs the
    scripts.
    For MS SQL Server, you have this, which you can run from a C# program too.
    http://www.webfactory-world.de/wfknowledgebase/wfknowledgebase_wf3.3/Content/AdditionalWindowsSettings/Tutorials/UpdatingSQLDBFromCommandLine.htm
    I would consider using the above from a C# program a waste of time too.
    I look at it this way. If the user doesn't have database admin experience and know how to use DB admin tools, then they have no business doing anything with a database - period.
    BTW, the Invoke statement in VB or C# will run SQL Plus or SQL Server command line tool.

  • Single or separate users owning multiple Oracle Resource Groups?

    Being an infrastructure DBA, I have a question which I'm trying to sort out with my sys admin:
    - We're trying to setup multiple Oracle 11g (non-RAC) instances on a two-node Solaris 10 cluster.
    - each 'database' would have its own resource group, filesystem, binaries, and listener
    - In order to fully separate the two instances, the SA actually gave us two different oracle accounts to control each resource group.
    ie. a different oracle user (ie. oracle1, oracle2, oracle3) owns each resource group (/rg1, /rg2, /rg3)
    - to patch/startup/shutdown each instance, we have to login as a separate user
    - no user can run/touch the other's files (they're in completely different groups (dba/oinstall, dba2/oinstal2, dba3/oinstal3)
    - to run patch/installing, we use a separate inventorypointer flag which points to that particular db's oraInventory (ie. ./runInstaller -invPtrLoc /var/opt/oracle/oraInst.loc.<resource_group_name>)
    I asked why couldn't one user own all resource groups, and was told:
    ...Oracle uses the shared memory, semaphores and queues to exchange information. Each IPC object has an identifier and access information, similar to files (owner, ,group, mode). If you use the single oracle account in different RGs, you or system might accidentally destroy the IPC object which belongs to other Resource Group.
    Is this true? I could have sworn I've seen other solaris setups (albeit with Veritas Resource Groups) setups which have multiple resource groups owned/managed by a single oracle user, but I don't know enough about semaphores and shared memory to truly understand his argument.
    The way I was hoping to work would be:
    - a single oracle user owning several resource groups
    - each resource group mapping to a filesystem tree, ie:
         /home
              /oracle
         /rg1
              /opt
                   /oracle
         /rg2
              /opt
                   /oracle
         /rg3
              /opt
                   /oracle- shared /var/opt/oracle/oratab
    - to switch between instances, the oracle user simply does the same '. oraenv' command as regular.
    I understand it can be done, just that I need something to counter my SA's argument that there would be potential IPC/shared memory/semaphore collisions.

    I've marked the question as answered, to a degree: I can agree that there are successful implementations out there with one person running multiple solaris zones, I just couldn't explain it to the SA in an articulate manner. I've gone to Oracle Metalink with a service request and will post references to the notes that the support person gave me on the subject. It's good for research in this area:
    Note 15654.1 TECH: Calculating Oracle's SEMAPHORE Requirements
    Note 70688.1 Location and Display of kernel parameters - Solaris
    Note 33244.1 SOLARIS: Shared Memory and Semaphore Kernel Parameters on Solaris (SPARC) Servers
    Note 153961.1 Semaphores and Shared Memory - An Overview
    We've ruled out local zones at the time, for other implementation reasons. What I think we're looking at is the trade-off between Sysadmin's management complexity (separate zones) and DB Admin's management complexity (separate users).

  • Can I have multiple Oracle drivers installed?

    I have a Windows 2000 machine that has Oracle 7.3 drivers installed for one application and now I have another app going on that has 8.01.07.00 of the Oracle driver. I have been having problems getting the new driver installed and then both apps running. If I can get them both installed, will I need to combine the tnsnames.ora files into one or can I have both?
    Thanks.

    I'm assuming that you have two different ORACLE_HOME's (i.e. both Oracle7 & Oracle8 client software has been installed into different directories). If this is the case, I believe this should work, though I don't believe it's officially supported.
    8i added official support for multiple Oracle homes-- the latest ODBC drivers support multiple homes, although the ODBC drivers didn't add this support right with 8i. You may try grabbing the latest 8.1.7 driver, just to make sure that you've got a multi-home capable driver.
    Justin

  • Can we install multiple oracle product in same oracle home

    hi,
    It would be appreciated if any one can answer below:
    Is it possible to install multiple oracle product in same oracle home?
    thanks

    installing XE and enterprise edition in same oracle _home oracle 10g?                                                                                                                                                                                           

  • Problem with Oracle 9i client to access multiple oracle databases

    I am having problem setting up oracle client 9i to access multiple oracle db. When I finish installing Oracle 8.x client, I simply replace the tnsnames.ora that the installation created with the ones that I have. I can access three different databases. I only need to add three diffrent entries in the tnsnames.ora file. I cannot be able to do this with Oracle 9i client. I follow the instruction from the CD installation to use local naming method. It appears that Oracle client try to create multiple entries on my tnsnames.ora file but I can only be able to access one db.
    Any help is appreciated.
    Thanks! HD

    the old tnsnames.ora is working with Oracle 8 client. The new tnsnames.ora (if I use the Oracle Net config) have two entries, one is dev and the other is prod.
    Thanks!

Maybe you are looking for

  • Can not open email or delete it in yahoo. Delete menu bar is missing when I display inbox

    Yahoo inbox displays email list. Clicking on check box does not open email. Can't check multiple emails. Works in IE

  • Help with divs

    Hi, I am looking for some help getting this layout using divs working correctly.  It will be going inside an existing spry tabbed panel.  At the moment the styles are inline but I will be moving them to my external style sheet once it is working.  Wh

  • How do I connect a hyperlink to a Word file in iWeb sucessfully?

    I just started using iweb and I know how to use the Inspector to connect to the file to the link, but it won't open the file when I click on the link. Please help. When I connect to one of my own pages the link works.

  • Video Quality Poor???

    the quality is poor when a third person joins the Chat.....we are all on hi - speed broadband and even tried to lower the bandwith......no luck in improving the quality. Any suggestions???

  • Wanted to change the Exchange rate while saving the PO

    Hi, I have a requirement that i have to change the value of Exchange rate while saving the PO. Even i checked with more BADI's. but i am not able to update the new value. Can you tell me any specific user exits available for this. Thanks in Advance,