Query two tables in two different databases.

Hello,
I have to query two tables say 'a' in database "D1"and 'b' in database "D2".I am using sql developer and it is accepting only querying for repecting databases.
i.e if i would like to access b from the sql script of D1 .Please guide me in this regard.
thank you.

Create a database link in DB "a" pointing to DB "b" then use the db link in your script.
Message was edited by:
skutz

Similar Messages

  • Synch Between Tables in Two different Databases

    Synch between Two Tables in two different Databases.
    I have two identical tables, table T1 in Database D1 and table T1 in Database D2. User can insert/update/delete/select from both of these tables in respective databases. Being said that how can keep them in Synch? Any thing added/modified/deleted should reflect in other. We like this to be Real-Time.
    We are thinking of creating a cross (two way) DB link between them and then update/insert/delete both the tables when changing one. Any suggestions?
    Thanks

    One of my colleagues used snapshot in their previous projects, but he told me that the performance of it wind down while the records in tables increase. I have no idea about the exact situation, but I'm believing we'd think twice about it.
    eilison
    [email protected]

  • Comparing Tables In Two Different Databases

    Hi,
    As part of our project, we need to perform table comparisons in two different databases. I am currently looking for various options to accomplish this.
    One of them is doing minus operation between these two tables.
    Also, i have looked at the data compare option in toad utility.
    Please suggest me any other options that makes my job easy.
    Thanks in advance,
    Sue

    Then just adapt the select that is there
    SELECT stid , c1, c2, c3                      
       FROM
      ( SELECT a.*,
             1 src1,
             to_number(null) src2        
       FROM  a   
       UNION ALL
       SELECT b.*,
             to_number(null) src1,
             2  src2        
        FROM b
       GROUP BY stid , c1, c2, c3
       HAVING count(src1)  count(src2)
       order by stid;Best regards
    Mohamed Houri

  • APEX Application accessing data from two different databases

    Hi All,
    Currently as we all know that APEX Application resides in database and is connected to the schema of that database.
    I want APEX Application to be running and accessing data from two different databases. Elaborating my question,
    Currently, my APEX Production Application is connected with XXXX Schema of DB1 Database(Where APEX Resides). Now I want to add some pages into this APEX Application for REPORT Purpose, But I want to connect this REPORT APEX Pages to get data from Different Schema YYYY for Database DB2.
    Is it possible to configure this scenario?
    The reason for doing this is to avoid the REPORT related (adhoc queries) resource utilization effect on Production DB1 Database.
    Thanks
    Nil

    1. If you do the joining of two or more tables in DB1 then all data is pulled over to DB1 and then the join is executed: so more data over the databaselink and more work for DB1. Better keep the joining stuff where the data resides and just pull exactly that data over that you need.
    2. Don't know about your different block sizes. Seems a nice question for one of the other forums (DBA or SQL).
    3. I mean create synonyms on DB1 for reports VIEWS in DB2.
    Hope all is clear!

  • Can I use two different database with DBSystemLoginModule?

    Finally I can login with Database user id by DBSystemLoginModule on Embedded oc4j server.
    But I confused between [b]jazn-data.xml and system-jazn-data.xml.
    Which xml do I have to edit for jdbcUrl and jdbcDriver?
    Now I would like to use two different database(such as only sid is different).
    In this case I want to show specific database name as realm name.
    What should I do?
    When I use DBSystemLoginModule, I edit JdbcUrl in system-jazn-data.xml.
    So can I pass the parameter for sid programmatically?
    And also I tried to run my application with other database with DBSystemLoginModule on Embedded oc4j server.
    I changed few things(jdbcUrl at system-jazn-data.xml,jazn-data.xml in embedded-oc4j-server/config and database connection for BusinessComponents at Project Properties of Model/ViewController.
    But I got some error.
    Did I miss something?
    ----< my error messgae >------
    500 Internal Server Error
    JBO-30003: The application pool (customer.model.datamodel.CMAppModuleLocal) failed to checkout an application module due to the following exception:oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null     at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2002)     Message was edited by:
    Message was edited by:
    sdcsdc

    I think I understand now, you are modifing the custom login modules configuration within the system-jazn-data.xml file. This is a bit dangerous! Didn't you register the login module in your orion-application.xml? For example, this is the way I do it:
    <web-module id="customProv-web" path="customProv-web.war" />
    <persistence path="persistence" />
    <!--data-sources path="./data-sources.xml"/-->
    <security-role-mapping name="sr_developer">
    <group name="developers" />
    </security-role-mapping>
    <security-role-mapping name="sr_manager">
    <group name="managers" />
    </security-role-mapping>
    <jazn provider="XML">
    <property name="custom.loginmodule.provider" value="true"/>
    <property name="role.mapping.dynamic" value="true"/>
    <property name="role.compare.ignorecase" value="true"/>
    </jazn>
    <!-- Configuring a Login Module in an Application EAR file. -->
    <jazn-loginconfig>
    <application>
    <name>customProv</name>
    <login-modules>
    <login-module>
    <class>oracle.security.jazn.login.module.db.DBTableOraDataSourceLoginModule</class>
    <control-flag>required</control-flag>
    <options>
    <option>
    <name>data_source_name</name>
    <value>jdbc/OracleDS2</value>
    </option>
    <option>
    <name>roles_fk_column</name>
    <value>userName</value>
    </option>
    <option>
    <name>table</name>
    <value>userinfo</value>
    </option>
    <option>
    <name>groupMembershipTableName</name>
    <value>groupinfo</value>
    </option>
    <option>
    <name>groupMembershipGroupFieldName</name>
    <value>role</value>
    </option>
    <option>
    <name>usernameField</name>
    <value>userName</value>
    </option>
    <option>
    <name>user_pk_column</name>
    <value>username</value>
    </option>
    <option>
    <name>passwordField</name>
    <value>passWord</value>
    </option>
    </options>
    </login-module>
    </login-modules>
    </application>
    </jazn-loginconfig>
    <log>
    <file path="application.log" />
    </log>
    <namespace-access>
    <read-access>
    <namespace-resource root="">
    <security-role-mapping name="<jndi-user-role>">
    <group name="administrators" />
    </security-role-mapping>
    </namespace-resource>
    </read-access>
    <write-access>
    <namespace-resource root="">
    <security-role-mapping name="<jndi-user-role>">
    <group name="administrators" />
    </security-role-mapping>
    </namespace-resource>
    </write-access>
    </namespace-access>
    </orion-application>

  • Connecting to two different database instances from a swing application.

    Hi All,
    I am developing a swing application which needs to interact with two different database instances of two different weblogic servers.
    More eloborately,
    I have some data in DB_Instance1 running on[b] Weblogic_Server1 and I need to insert the same data into DB_instance2 running on Weblogic_server2. Is it possible. Could some explain me how to do that..
    Thanks in advance...
    Sreekanth.

    Hi Rick,
    Try logging onto both Server first. You'll have to use either 2 separate ODBC DSN's or 2 separate OLE DB connections. Set them both for Trusted Authentication, you'll have to configure that on the Server also.Then try your query.
    If that doesn't work then you'll have to create a Stored Procedure or View that can link the 2 Server side.
    Thank you
    Don

  • How to handle transactions when two different databases are involved.

    consider two tables namely Table-A and Table-B part of two different databases namely ORACLE and MYSQL.
    Now the project requirement is updating the Table-A(ORACLE) and Table-B (MYSQL) as one transaction. i.e. either update both the tables or rollback both the tables.
    Now my question is how could i handle this situation using JDBC(Type-4) driver.Because i think at a time only one JDBC driver can be loaded into the JVM.

    NareshAnkuskani wrote:
    Now my question is how could i handle this situation using JDBC(Type-4) driver.Because i think at a time only one JDBC driver can be loaded into the JVM.No, that is not true.
    But anyway, you need to use distributed (XA) transactions. i believe that the latest version (5.0) of mysql actually has support for XA transactions. you need to use a to setup a distributed transaction and attach the connections for the two databases to that transaction. then it should function as you desire.

  • How to add two different database connections on Model

    Hi,
    In my application, I need to create View Objects on different databases. So I need to add two different database connections on the Model.
    But it seems like Model can be connected to only one database. I tried adding another project to add the second db connection. But after I created a read-only View Object in the second project, it didn't generate corresponding data control in the Data Controls panel.
    Could anyone help me on this?
    Thanks!

    Do you mean adding the second project folder in ViewController->Project Properties->Libraries and Classpath?Yes, either that or: ViewController -> Project Properties -> Dependencies
    And I didn't see the first Model project in the ViewController classpath. Otherwise it wouldn't work. The first model project IS in 'classpath'. Here's how:
    ViewController -> Project Properties -> Dependencies
    I tried this and recreated the View Object. Still didn't generate the datacontrol. No idea why you had to recreate the VO.
    Is your VO in an application module inside the SECOND project?
    After you are sure that everything is in the ViewController's classpath, just try restarting JDeveloper.
    This is very basic. has to work.

  • Compare performance of two different databases...idea of a report to us?

    Dear Colleagues,
    We would like to compare the performance of two different databases running with SAP. We don't want to start with Loadrunner. We are looking more for some ABAP program which generates a lot of load on the database and then would just run the program on both databases. Any idea for a good report? We thought about sgen, but we think this is taking more into account the application server instead of the database.
    Regards,
    alexander

    Hello,
    If you are not willing to use tools like HP Loadrunner or IBM Rational performance testing
    SGEN could be an option. It is quite intensively using the DB. It will be hard to find a report that only perform DB access.
    SGEN at least allows to test read (REPOSRC, DYNPSOURCE...) & write (REPOLOAD, DYNPLOAD...). If the DBs are on the same servers as the SAP system and both servers has the same power it can be a good way to test.
    Best regards

  • Running same backup script on two different Databases

    Hello All,
    I am running same backup script on two different Databases.
    But output is different.
    Please give me your feedback.
    1) Database 1:
    OS: AIX
    DB: 10.1.0.4.0
    Script:
    export ORACLE_SID=sid1
    cd $ORACLE_HOME/bin
    ./rman nocatalog << EOF
    connect target
    ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE disk;
    configure controlfile autobackup on;
    backup as compressed backupset database plus archivelog delete input;
    delete noprompt obsolete;
    exit
    EOF
    6 Files created:
    -rw-r----- 1 oracle dba 4140032 Jun 19 00:00 uvhlvjs8_1_1
    -rw-r----- 1 oracle dba 38029824 Jun 19 00:00 backup_uuhlvjs8_1_1
    -rw-r----- 1 oracle dba 781287424 Jun 19 00:20 v1hlvjsk_1_1
    -rw-r----- 1 oracle dba 578027520 Jun 19 00:23 backup_v0hlvjsk_1_1
    -rw-r----- 1 oracle dba 1222656 Jun 19 00:23 backup_v2hlvl7r_1_1
    -rw-r----- 1 oracle dba 4259840 Jun 19 00:23 c-1052429639-20060619-00
    -rw-r----- 1 oracle dba 4177920 Jun 19 00:23 SNAPCF_ATHENA.F
    2. Databse 2:
    OS: Linux (SLES 8)
    DB: 10.1.0.5.0
    Log Archive Filename Format: %t_%s_%r.dbf
    2 files created:
    1_17804_535674251.dbf 1_17837_535674251.dbf SID_2chlmrrl_1_1.1
    1_17805_535674251.dbf 1_17838_535674251.dbf SID_2dhlms8c_1_1.1
    I am also getting dbf file every one hour as below:
    1_17868_535674251.dbf
    DN

    waiting for reply

  • How to integrate different tables structures from different databases?

    Hi
    I'm new to oracle ..kindly help me with the below issue...
    I have same set of inter-related attributes (a,b,c,d) in two different databases A and B.
    The structure of tables in both the database are different but they carry same attributes in same relation.
    I have to integrate these attributes into single db object such that any update to base tables updates my object.How can i do this and what object will be helpful?
    Thanks

    Arun Rajesh wrote:
    Hi
    I'm new to oracle ..kindly help me with the below issue...
    I have same set of inter-related attributes (a,b,c,d) in two different databases A and B.
    The structure of tables in both the database are different but they carry same attributes in same relation.
    I have to integrate these attributes into single db object such that any update to base tables updates my object.How can i do this and what object will be helpful?
    ThanksWelcome to Forum!!!
    Please elaborate your question.
    Arun Rajesh wrote:
    I have same set of inter-related attributes (a,b,c,d) in two different databases A and B.1. What are the ATTRIBUTES?
    Arun Rajesh wrote:
    The structure of tables in both the database are different but they carry same attributes in same relation.2. Post the Table Structures.
    Arun Rajesh wrote:
    I have to integrate these attributes into single db object such that any update to base tables updates my object.How can i do this and what object will be helpful?3. What is the end result that you desire? A sample output shall help in our understanding.
    PS:- Please go through this to understand SQL and PL/SQL FAQ.
    Regards,
    P.

  • Querying from two different databases

    Hi All,
    I have a Adhoc requirement where in i have to do a select from two tables, but one of them resides on a different database.
    The tables have a common primary key, so i can do a one to one match. Is there anyway to query them without using a DB link?

    Hi!
    I think - if u create a global synonym using that dblink - next time u can use that synonym and u don't have to use any dblink further.
    Regards.
    Satyaki De.

  • Table transformation from two different database

    Hi all,
    I am trying to load table from one database table to another database table in ODI 10g.I have created two physical and logical topology.
    But when in interface design i have drag the source and target tables in the diagram window, but here it doesnot shows the auto mapping options, when i try it manually by dragging a field, i have failed. when i execute the operation the following error occured:
    create or replace view db1."C$_0 W_INT_ORG_D"
    as select     
    from     db1.W_INT_ORG_DS W_INT_ORG_DS
    where     (1=1)
    here both the source and target db are same..
    How can i resolve it

    Hi,
    Thanks it worked.
    I am getting another error on Insert flow into I$ table step.
    I am connecting two database from two different hosts, both are in oracle.
    I have two logical schema prepared for both database.
    should i have to mentioned these schema in one physical topology? what should be placed in schema and work schema option.
    I have used LKM Oracle to Oracle(DBLINK) as KM.
    Please help
    Best regards,
    manish

  • Joining Querry to check data in two different database tables

    Hi,
    I have table employee in sqlserver and oracle database.I have to perform joining based on emp id.I know how to perform join if tables are present in one
    database.But for different database tables any one can explain

    DBLINK AND Understanding Oracle Heterogeneous Services
    1) http://docs.oracle.com/cd/B28359_01/gateways.111/b31042/newoverview.htm
    2) http://docs.oracle.com/cd/B28359_01/gateways.111/b31042/configodbc.htm
    Ramin Hashimzade

  • Query to compare 2 different tables from 2 different database

    Is it possible to write a SQL query to compare 2 Tables from 2 different Oracle Database. Also I need a query to do the same when the database is same.
    Thanks in advance

    OK, well "compare" can mean one of two things: Compare structure or compare contents. Here is a quick script to compare column structures of two tables on one database:
    (select COLUMN_NAME,
    DATA_TYPE,
    DATA_LENGTH,
    DATA_PRECISION,
    DATA_SCALE,
    NULLABLE
    from dba_Tab_columns
    where owner=:OWNR1
    and table_name = :tablename
    minus
    select COLUMN_NAME,
    DATA_TYPE,
    DATA_LENGTH,
    DATA_PRECISION,
    DATA_SCALE,
    NULLABLE
    from dba_Tab_columns
    where owner=:ownr2
    and table_name = :tablename)
    union all
    (select COLUMN_NAME,
    DATA_TYPE,
    DATA_LENGTH,
    DATA_PRECISION,
    DATA_SCALE,
    NULLABLE
    from dba_Tab_columns
    where owner=:ownr2
    and table_name = :tablename
    minus
    select COLUMN_NAME,
    DATA_TYPE,
    DATA_LENGTH,
    DATA_PRECISION,
    DATA_SCALE,
    NULLABLE
    from dba_Tab_columns
    where owner=:ownr1
    and table_name = :tablename)
    If this query returns any rows, then these indicate that there are structural differences between the tables. We do a minus in both directions to ensure that an additional column in either schema will be returned in the query.
    If you are going across dblinks to remote tables then you have to amend the "dba_tab_columns" to "sys.dba_tab_columns@yourdblink"
    If you also want to compare indexes, triggers, etc then do the same sort of thing for the associated dba_ views for those objects.
    And if you want to compare table contents, then often the fastest way is also to check minuses in both directions, if the tables are not too big:
    e.g.
    (select * from schema1.table@dblink1
    minus
    select * from schema2.table@dblink2)
    union all
    (select * from schema2.table@dblink2
    minus
    select * from schema1.table@dblink1)
    local tables, of course, simply omit the "@dblink" issues.
    There are tools to help in such things. TOAD, for example, has a pretty good schema comparison tool, and there are plenty of other options out there. But if you need to script this yourself then the logic I've shown is a good starting point.
    Cheers,
    Mike

Maybe you are looking for

  • How can i connect between WS−G5484 1000BASE−SX and GLC-LH-SMD ?

    Dear experts, My customer has 6509 A-side and B-side core switches and need to migrate only 6509 B-side to Nexus. I have some question below. 1. Customer's 6509A-side has multiple WS−G5484 1000BASE−SX and WS−G5486 1000BASE−LX links and it is connecte

  • Can not deploy application on websphere 6.0

    Hi all, I use Jdeveloper(10.1.2) and Jheadstart(10.1.2) converted a oracle form to J2EE.It can run on Oracle Application Server and Tomcat.I try to deploy it on websphere 6.0,after i added ADF runtime *.jar file into {WAS_HOME}\lib\ext manually,websp

  • Weblogic queues each request from Web Services client

    Hello everyone, Currently, I have a performance issue deploying a web services application on Weblogic 11g Patch1 (10.3.2). There are 40 clients which consume Web Services. After Weblogic queues each requests (40 requests) which takes about 2 or 3 mi

  • Lost my grub bootsplash after upgrade

    Hi all, Loving Arch and have been using for a few weeks.  Just did a pacman -Syu today and now my nice custom Arch bootsplash is gone in grub.  When I started up after my upgrade the screen stayed blank and loaded Arch instead of giving my splash scr

  • Map content server properties to custom PT properties anyone?

    Has anyone ever mapped a content item property to a plumtree property? I would like to create a customer property and be able to update the property via a dataentry template. thanks, Craig