Database link creation problem

localhost environment:
OS:windows 2000 server
Database:oracle 8.5
database name:orcl
remotehost environment:
OS:windows 2000 server
Database:oracle 8.5
database name:orac
These two servers in network and in the same workgroup like peer to peer.There is no concept of domain here.
Here in this environment i am getting the response from both of the servers at the time of using tnsping.
C:\>tnsping orac
TNS Ping Utility for 32-bit Windows: Version 8.1.5.0.0 - Production on 15-APR-06 21:30:54
(c) Copyright 1997 Oracle Corporation. All rights reserved.
Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=azad)(PORT=1521))
OK (70 msec)
C:\>tnsping orcl
TNS Ping Utility for 32-bit Windows: Version 8.1.5.0.0 - Production on 15-APR-06 21:31:02
(c) Copyright 1997 Oracle Corporation. All rights reserved.
Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=pvs)(PORT=1521))
OK (70 msec)
But at the time of creating database links in between these databases at local host i am getting this error message when i am using connect_user method:
SQL> create database link REMOTE_CONNECT connect to current_user using 'ORAC';
Database link created.
SQL> select * from emp@REMOTE_CONNECT;
select * from emp@REMOTE_CONNECT
ERROR at line 1:
ORA-00600: internal error code, arguments: [kspgsp2], [64978272], [265], [ent_domain_name], [0],
[1], [], []
But at the time of creating database links in between these databases at local host i am getting this error message when i am using identified method:
SQL> create database link REMOTE_CONNECT2 connect to scott identified by tiger using 'ORAC';
Database link created.
SQL> select * from emp@REMOTE_CONNECT2;
select * from emp@REMOTE_CONNECT2
ERROR at line 1:
ORA-02085: database link REMOTE_CONNECT2 connects to ORACLE
help me to create the database link in between these two databases..........

Hi, I have read carefully your letter.
Firt of all, when you use 'current_user' statement you must guarantee that such users have in both databases.If users exist in both databases and the error will appear again than try create database link with the option 'PUBLIC' as follow:
CREATE PUBLIC DATABASE LINK REMOTE_CONNECT connect to scott identified by tiger using 'ORAC';
and check the creation:
SQL> COL OWNER FORMAT a10
SQL> COL USERNAME FORMAT A8 HEADING "USER"
SQL> COL DB_LINK FORMAT A30
SQL> COL HOST FORMAT A7 HEADING "SERVICE"
SQL> SELECT * FROM DBA_DB_LINKS;
OWNER DB_LINK USER SERVICE CREATED
PUBLIC REMOTE_CONNECT.US.ORACLE.COM SCOTT ORAC 17.04.06
if the error appear again than checks parameter 'open_links' for your database instance. Default is 4. Increase that number. Good luck.Let me know if something go wrong.

Similar Messages

  • Database link creation

    Hi i want to access the data from production to test
    let the production named as naren and other one as naren1
    this link has been created in naren
    create database link test
    connect to naren
    identified by naren
    using 'test'
    conn naren1/naren1;
    i want to access one of the table from naren
    select * from emp@test
    ora-02019 connection description not found
    is it the problem of priviliges or tnsnames

    First make sure you have tns name entry for prod in tnsnames.ora
    When you create the database link like below,
    CREATE DATABASE LINK dblink_name CONNECT TO  remote_username IDENTIFIED BY  remote_password
    USING 'tns_service_name';The tns_service name is the tnsname for PROD not TEST.
    Say if your tnsnames.ora file look like this for your PROD connection, You need to use the service_name value for the 'tns_service_name' above. In the below case it is 'ganesh'
    GANESH=
      (DESCRIPTION=
        (ADDRESS=
          (PROTOCOL=TCP)
          (HOST=GANESH)
          (PORT=1521)
        (CONNECT_DATA=
          (SERVER=dedicated)
          (SERVICE_NAME=ganesh)
      )G.

  • Database Link Creation and Acessing

    i want to talk between two oracle server. i decided to go for snapshot creation with periodical refresh. For which i am having two oracle server's with different ip address located inside our office setup.
    I have created a database link between two servers.
    first server name global
    userid scott
    password tiger
    second server name asil
    userid scott
    password tiger
    both the user have been given dba rights.
    in both the server the services and listners are all started. i gave the following command to create database link.
    from asil server
    create public database link global connect by scott identified by tiger using 'global'
    the command was successful and the link was created. Now i tried to access a table of the scott user of the global server.
    select * from emp@global;
    now it is giving error. I want to know how the link can be created and how it can be accessed. i refered the 8i online documentation and done the things based on that. i expect valuble solution from all possible persons
    null

    See link http://kr.forums.oracle.com/forums/thread.jspa?threadID=221081
    Hope this helps solve your issue.
    thanks
    http://swervedba.wordpress.com/

  • Database Link.  Problem in Forms. Baffled!

    Hoping someone can help.
    I'm working on a system that has a form on it with a problem. Although there is a currently compiled and working version of this form available, I cannot get it to compile.
    The situation is this.
    There are 2 databases, MINX a 9i database, and PROD an APPS 11i database.
    On the database PROD exists a view called MTL_ITEM_CATEGORIES_V.
    SELECT is granted on this to the APPSINQ user.
    On the database MINX exists a public synonym MTL_ITEM_CATEGORIES_V, which points at the view MTL_ITEM_CATEGORIES_V on the PROD database by way of a public database link, also called PROD. The database link uses the APPSINQ user on the PROD database.
    (once the set_org_context, and nls_language have been set)
    From SQL on the MINX database, I can select from the public synonym, MTL_ITEM_CATEGORIES_V, and rows are successfully returned from the MTL_ITEM_CATEGORIES_V view on the PROD database. This is all ok and good.
    However, in the main form, is a trigger which does a select from the public synonym and this will not compile.
    I get the error : identifier 'CATEGORY_SET_ID' must be declared.
    It's like it can't see the category_set_id column in the view. However, if I create a new block, and base it on the public synonym, the category_set_id column is there for me to choose. Meaning that forms CAN see the column.
    Am baffled! Anyone ??

    Hi
    I´ve got some problems with synonyms and dblinks in forms too. Try creating a local view based on the remote view usign the dblink (do not use the public synonym) and try to compile again.
    I think in some cases the compiler gets lost trying to follow synonyms and links. a forms bug maybe?

  • Database link using problem

    Hi all,
    I have created database link using following code.
    CREATE DATABASE LINK mydb
    CONNECT TO system IDENTIFIED BY o
    USING 'mydb'
    After created this database link, I tried to access the table 'emp' from 'mydb' database. so, I was given
    select * from emp@mydb; But its howing me an error message as 'ORA-12154: TNS:could not resolve service name'.
    But when I try to connect mydb,its connecting properly.
    then,why its showing this error message when I given select * from emp@mydb;
    Kindly provide me the solution.
    Thanks & Regards,
    Lakshmi.P.

    To be TNSNAMES.ora independent you would better create the DB link as
    create database link mydb
    connect to your_db_user
    identified by "your_passwd"
    using '(description=(address=(protocol=tcp)(host=your_host)(Port = your_port) )(connect_data=(sid=your_sid)))'
    /change all the your_* parameters accordingly to your environment.
    Note: Never use the sys- or system account for any application development ;)

  • Owb and database link creation

    hi everybody....
    I installed oracle 10g and owb on the samo machine (windows xp). When trying to create oracle module in owb it is required to create database link (is there any workaround?). But how can I create database link to local database when connected to local database???? Can anybody help me???
    thanks in advance

    thanx for your reply... I alredy tried everything.. but I always get this error:
    Testing...
    Failed.
    SQL Exception
    Repository Error:SQL Exception..
    Class Name: CacheMediator.
    Method Name: getDDEntryFromDB.
    Repository Error Message: ORA-28546: connection initialization failed, probable Net8 admin error
    Oracle instance works properly.. but I can not create Oracle module from OWB. Here is my tnsnames.ora file:
    ORCLANTI.LOCAL.HOST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = antix.login.net)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orclanti)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    here is my sqlnet.ora file
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    NAMES.DEFAULT_DOMAIN= local.host
    and here is my listener.ora file
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = E:\ora10g)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = orclanti.local.host)
    (ORACLE_HOME = E:\ora10g)
    (SID_NAME = orclanti)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = antix.login.net)(PORT = 1521))
    username and password are correct and db link name is ok!
    Now, do I have to enter SQL*Net connect string or hostname and oracle service name???
    I repeat... I already tried almost every combination!
    Thanks again
    maybe this is an Oracle configuration error because I am pretty new to this RDBMS :)
    another question:
    1. is ti possible to create a database link to local database (for example if I am connected to local database on my machine can I create database link from that database to same database but for another schema)???
    Message was edited by:
    antix

  • Web link creation problem

    Hi experts
    I have en number of web links in my INDD document. While i am exporting the document as PDF everything works fine. But the problem is some of the web links are changed to local file link in the output PDF
    link in the indesign: www.arl.co.uk/some_text/some/new.htm
    link in the exported PDF: file:///current_file_path/www.arl.co.uk/some_text/some/new.htm
    is anyone experienced this before.
    I am using ID CS3 windows.
    Thanks in advance

    Thanks a lot for fast reply ..
    unfortunatelly when i write my serializer, i can't use it in JDeveloper - syntax of map files in jdev 10.1.3 is different from the one used in the document and when i want to do mapping with the wizard - the wizard always allerts "you must specify a QName for each mapping" - and Qname is specified (maybe bug?)
    i have created java obejcts using xmlbeans (i tried toplink and several others too) .. parsing marshallling and unmarshalling works fine, but i'm not still able to create web service with these objects.
    Thanks a lot for any help
    Tomas

  • A question about CREATE PUBLIC DATABASE LINK and ORA-12154 error

    Dear all,
    I have a problem about public database link creation and I would appreciate if you could kindly give me a hand. I have the following connection parameters in my
    tnsnames.ora file:
    DGPAPROD.WORLD =
         (DESCRIPTION =
           (ADDRESS_LIST =
            (ADDRESS = (COMMUNITY=tcp.world)
              (PROTOCOL=TCP)(HOST=ORASR001)(PORT=1521)
           (CONNECT_DATA = (SID = DGPAPROD))
    ...Having the above mentioned parameters I can connect to this remote database directly in a SQL*Plus shell:
    $ sqlplus username/[email protected] works pretty well and the connection is established without any problem.
    Now, what I would like to do is to create a public database link to this remote database in order to avoid the user/connection switching for viewing the
    content of this database. I proceeded according to the syntax indicated in the Oracle online documentation:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5005.htm#SQLRF01205
    Therefore I run the following in order to create a public database link
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING 'DGPAPROD.WORLD';Apparently there is no error and the link is created successfully. However it cannot resolve the remote host and whenever I run the following query
    (myenterprise is the name of a table in that remote database)
    SELECT *
    FROM myenterprise@SR001_dblink
    ERROR at line 1:
    ORA-12154: TNS:could not resolve the connect identifier specifiedWhat causes this problem?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    spajdy wrote:
    You must have defined DGPAPROD.WORLD in tnsnames.oar on server where you DB is runnig.Hello there,
    Thanks a lot for this nice solution. In fact I had to add the connection parameters into the tnsnames.ora file of the server on which the link was created (not the tnsnames.ora of my oracle client stored on the localhost)
    After a bit googling I found another solution that allows to create the database link:
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING '(DESCRIPTION =  (ADDRESS_LIST =  (ADDRESS = (COMMUNITY=tcp.world)
    (PROTOCOL=TCP)(HOST=ip_adresse)(PORT=1521)))(CONNECT_DATA = (SID = GPAPROD)))';Thanks a lot for your help!
    Kind Regards,
    Dariyoosh
    Edited by: dariyoosh on 18 nov. 2009 07:15

  • OWB 10g -- Can't Create Database Links for Data Source and Target

    We installed OWB 10g server components on a Unix box running Oracle 10g (R2) database. The Designer Repository is in one instance. The Runtime Repository and the Target are in another instance. The OWB client component was installed on Windows XP. We create a data source module and a target module in OWB. The data source is on another Unix box running Oracle 9i (R2) database. We try to create database links for data source module and target module, respective. But when we created and tested the DB links, the DB links were failed.
    For the database link of data source, we got the following error message:
    Testing...
    Failed.
    SQL Exception
    Repository Error:SQL Exception..
    Class Name: CacheMediator.
    Method Name: getDDEntryFromDB.
    Repository Error Message: ORA-12170: TNS:Connect timeout occurred
    For the database link of target , we got the following error message:
    Testing...
    Failed.
    API2215: Cannot create database link. Please contact Oracle Support with the stack trace and the details on how to reproduce it.
    Repository Error:SQL Exception..
    Class Name: oracle.wh.ui.integrator.common.RepositoryUtils.
    Method Name: createDBLink(String, String, String, String).
    Method Name: -1.
    Repository Error Message: java.sql.SQLException: ORA-00933: SQL command not properly ended.
    However, we could connect to the two databases (data source and target) using the OWB’s utility SQL Plus.
    Please help us to solve this problem. Thank you.

    As I said prior the database link creation should work from within the OWB client (also in 10).
    Regarding your issue when deploying, have you registered your target locations in the deployment manager and did you first deployed your target location's connector which points out to your source?
    I myself had some problems with database link creations in the past and I can't remember exactly what they were but it had something to do with
    - the use of abnormal characters in the database link name
    - long domain name used in as names.default_domain in my sqlnet.ora file
    What you can do is check the actual script created when deploying the database link so see if there's something strange and check if executing the created script manually works or not.

  • Creating a database link to another schema in the same database

    Hello,
    I'm trying to create a database link to another schema in the same database. It was created without errors, but when I try to use it I receive "ORA-12154: TNS:could not resolve the connect identifier specified" message...
    I'm trying to do it because on my production enviroment the databases are separated, so there I can use database links without problem, but in my development environment it's all in one database separated by schemas...
    So I'm trying to simulate the same system to not need to rewrite the query every time I move from development to production environment.
    Any ideas?
    Thanks

    Hi,
    Yes, you can create a database link to your own database. I've done it before for exactly the same reason you want to.
    (By the way, I think it's a good reason. What are the alternatives?
    Having different versions of code for Development and Production? Absolutely not! Terrible idea!
    Using synonyms or substitution variables that are set differently in the different databases? That might be more efficient than a database link, but efficiency probably isn't such a big issue in Development.
    [Conditional compilation|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/fundamentals.htm#sthref250]? This might be good; it has all the efficienty of the above options, with more clarity.)
    Assuming you do want to stick with a database link, not all errors are caught when you create the link.
    Is the Development database in the tnsnames.ora file of the Development server? Do you have other database links, either in the Development server or pointing to it, that work? What is different about the ones that work, and the one that doesn't?
    Edited by: Frank Kulash on Oct 14, 2009 1:58 PM
    The more I think about this, the more I agree with the earlier respondent: synonymns are a good solution for this.
    To that suggestion you replied:
    On this way I might use "select * from SCHEMA.table" instead of "select * from table@SCHEMA"... I looking for an option to use the second way...Actually, the suggestion was that you say:
    select  *
    from    SCHEMA_table_ptr;where schema_table_ptr is a synonym.
    In Development, that synonym is defined as schema.table.
    In Production, that synonym is defined as table@SCHEMA
    Why are you "looking for an option to use the second way"?
    If you think that people reading the code should realize that the query is being done via a database link (at least in Production), then add a comment.

  • DB link creation

    Dear
    please explain me the process of database link creation and making entry into tnsnames.ora.
    I have two databases PCDB and IASDB on same server KSPCB.ORG, I want to access the IASDB database from PCDB database.what is the entry that i should make into the tnsnames.ora file before creating the db link.
    I 'll be very thankfull to you if you can write down the process.
    thanks

    hi
    the following script will create a dblink in first database whose name is local and it will be able to connect a database seconddb. you should be able to connect to second db on the first place. Donot forget to set initialization parameter global_names=false before using the dblink.
    create database link LOCAL.WORLD
    connect to SCOTT
    using 'secondDB';
    you will extract data from second db like this.
    select * from scott.emp@secondDB;

  • Creation of Database link and access the same plus Snapshot creation

    i want talk between two oracle server. i decided to go for snapshot creation with periodical refresh. For which i am having two oracle server's with different ip address located inside our office setup.
    I have created a database link between two servers.
    first server name global
    userid scott
    password tiger
    second server name asil
    userid scott
    password tiger
    both the user have been given dba rights.
    in both the server the services and listners are all started. i gave the following command to create database link.
    from asil server
    create public database link global connect by scott identified by tiger using 'global'
    the command was successful and the link was created. Now i tried to access a table of the scott user of the global server.
    select * from emp@global;
    now it is giving error. I want to know how the link can be created and how it can be accessed. i refered the 8i online documentation and done the things based on that. i expect valuble solution from all possible persons
    null

    A reason for this problem could be that your database is configured that a database link has to have exactly the same name like the global name of the database instance it should connect to.
    Can you please provide the oracle error code / message ? With this information there might be more hints I can give you.

  • Problem in DB Link creation of Oracle Wraehouse Builder 3i - Updated question

    I am facing a problem in DB Link creation.
    Backend: Oracle 8i Server on my machine
    DW Software: Oracle warehouse builder 3i ( client , repository
    asistant.....)
    Operating system: Windows NT 4 SERVICE PACK 6
    I wants to use the scott database( default database given by oracle )
    as my input source.
    How can I create the DB LINK ( for scott database) ?
    How can I create the DB LINK ( for any other database) ?
    Should I need to add anything in Setting of"ODBC DATASOURCE
    ADMINISTRATION"
    ==================
    Settings done:
    ==================
    DB Link Name :prashant
    Host name
    Host name: my machine's ip address
    port number: 1521
    oracle sid: prashant ( my oracle sid)
    user name:scott
    password:tiger
    ==================
    Gives error:
    ==================
    Testing...
    Failed.
    Cwm Error Message: Failed in the WBAPIFactory.createDBLink()
    Cwm Error: SQL Exception
    Class Name: oracle.wh.ui.integrator.common.RepositoryUtils
    Method Name: createDBLink(String, String, String, String)
    Method Name: -1
    Repository Error Message: java.sql.SQLException: ORA-02082: a loopback database link must have a connection qualifier
    ==================
    ==================
    How should I proceed further.
    I am expecting URGENT FEEDBACK.
    Reply me on : [email protected] or this OTN Network
    From
    Prashant

    I solved the problem.
    Procedure I followed :
    UNINSTALL ORACLE WRAEHOUSE BUILDER SOFTAWARE.
    'GLOBAL_NAMES = FALSE' in init.ora file.
    RESTARTED MY MACHINE.
    INSTALL THE ORACLE WRAEHOUSE BUILDER SOFTAWARE.

  • Problem in DB Link creation ( Oracle warehouse builder 3i  )

    I am facing a problem in DB Link creation.
    Backend: Oracle 8i Server on my machine
    DW Software: Oracle warehouse builder 3i ( client , repository asistant.....)
    Operating system: Windows NT 4 SERVICE PACK 6
    I wants to use the scott database( default database given by oracle ) as my input source.
    How can I create the DB LINK ( for scott database) ?
    How can I create the DB LINK ( for any other database) ?
    Should I need to add anything in Setting of"ODBC DATASOURCE ADMINISTRATION"
    ==================
    Settings done:
    ==================
    DB Link Name :scott
    Host name
    Host name: my machine's ip address
    port number: 1521
    oracle sid: prashant ( my oracle sid)
    user name:scott
    password:tiger
    ==================
    Gives error:
    ==================
    Testing...
    Failed.
    ORA-02085 Database link %s connects to %s
    *Cause:   a database link connected to a database with a different name.
    The connection is rejected.
    *Action:   create a database link with the same name as the database it
    connects to, or set global_names=false.
    Please change it to false by doing :
    first option:
    Log in the database with DBA privilege and use the command:
    alter system set GLOBAL_NAMES = false
    second option:
    Change the GLOBAL_NAMES to false in database system parameter file, init.ora
    ==================
    Options tried:
    ==================
    1. I tried to change GLOBAL_NAMES = false but still not able to create the DB LINK.
    2. As per suggestion of one the friend
    "A file named "Logon.Properties" under the directory $OWB_HOME/wbapp
    in this file please set the property
    OWBSingleUserLockUsage = false"
    I tried the same but it is still not working.
    How should I proceed further.
    I am expecting URGENT FEEDBACK.
    Reply me on : [email protected]
    From
    Prashant

    I solved the problem.
    Procedure I followed :
    UNINSTALL ORACLE WRAEHOUSE BUILDER SOFTAWARE.
    'GLOBAL_NAMES = FALSE' in init.ora file.
    RESTARTED MY MACHINE.
    INSTALL THE ORACLE WRAEHOUSE BUILDER SOFTAWARE.

  • Interactive report performance problem over database link - Oracle Gateway

    Hello all;
    This is regarding a thread Interactive report performance problem over database link that was posted by Samo.
    The issue that I am facing is when I use Oracle function like (apex_item.check_box) the query slow down by 45 seconds.
    query like this: (due to sensitivity issue, I can not disclose real table name)
    SELECT apex_item.checkbox(1,b.col3)
    , a.col1
    , a.col2
    FROM table_one a
    , table_two b
    WHERE a.col3 = 12345
    AND a.col4 = 100
    AND b.col5 = a.col5
    table_one and table_two are remote tables (non-oracle) which are connected using Oracle Gateway.
    Now if I run above queries without apex_item.checkbox function the query return or response is less than a second but if I have apex_item.checkbox then the query run more than 30 seconds. I have resolved the issues by creating a collection but it’s not a good practice.
    I would like to get ideas from people how to resolve or speed-up the query?
    Any idea how to use sub-factoring for the above scenario? Or others method (creating view or materialized view are not an option).
    Thank you.
    Shaun S.

    Hi Shaun
    Okay, I have a million questions (could you tell me if both tables are from the same remote source, it looks like they're possibly not?), but let's just try some things first.
    By now you should understand the idea of what I termed 'sub-factoring' in a previous post. This is to do with using the WITH blah AS (SELECT... syntax. Now in most circumstances this 'materialises' the results of the inner select statement. This means that we 'get' the results then do something with them afterwards. It's a handy trick when dealing with remote sites as sometimes you want the remote database to do the work. The reason that I ask you to use the MATERIALIZE hint for testing is just to force this, in 99.99% of cases this can be removed later. Using the WITH statement is also handled differently to inline view like SELECT * FROM (SELECT... but the same result can be mimicked with a NO_MERGE hint.
    Looking at your case I would be interested to see what the explain plan and results would be for something like the following two statements (sorry - you're going have to check them, it's late!)
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two),
    sourceqry AS
    (SELECT  b.col3 x
           , a.col1 y
           , a.col2 z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5)
    SELECT apex_item.checkbox(1,x), y , z
    FROM sourceqry
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two)
    SELECT  apex_item.checkbox(1,x), y , z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5If the remote tables are at the same site, then you should have the same results. If they aren't you should get the same results but different to the original query.
    We aren't being told the real cardinality of the inners select here so the explain plan is distorted (this is normal for queries on remote and especially non-oracle sites). This hinders tuning normally but I don't think this is your problem at all. How many distinct values do you normally get of the column aliased 'x' and how many rows are normally returned in total? Also how are you testing response times, in APEX, SQL Developer, Toad SQLplus etc?
    Sorry for all the questions but it helps to answer the question, if I can.
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

Maybe you are looking for