Running sql query across multiple (remote) databases

I'd like to run a query that pulls information from multiple databases which are not on the same machine. Is this possible using SQL Developer?

If you are still interested, there is a tool that can query multiple databases and save results in a single text file that you can then modify as necessary - see www.bsutils.com/MuSQL.html

Similar Messages

  • Executing the SQL query across 2 different databases of Oracle

    Hello All,
    In Microsoft SQL server we can execute following type of SQL query across 2 different databases:
    select * from TEST1.dbo.GENERIC_TABLE1 union select * from TEST2.dbo.GENERIC_TABLE2;
    Here TEST1 and TEST2 are 2 different databases.
    Can we do the same in Oracle?

    yes you can, but first one has to setup a database link
    Look up CREATE DATABASE LINK and then take things from there!
    P;

  • Sql query across multiple tables ina database

    I have 3 MS Access tables in database that are linked by keyed fields in the table.  Is there a way to fetch only certain records that match a criteria across all three of these tables using the database connectivity toolset VIs?

    Thanks.  I am trying to mechanize/run an SQL query like this 
    SELECT Code_Type.Code_NUM, Code_Type.Code_Word, Word_Type.Parm_Label, Word_Type.Word_Sequence, Word_Type.Num_Words, Parameter_Label.Parm_Label, Parameter_Label.Parm_Name, Parameter_Label.Num_Bits, Parameter_Label.Num_Bits
    FROM (Code_Type INNER JOIN Word_Type ON Code_Type.Code_Word = Word_Type.Code_Word) INNER JOIN Parameter_Label ON Word_Type.Parm_Label = Parameter_Label.Parm_Label;
    while using the VIs in the database connectivity toolset.  How do I code this using these VIs?  I dont see an example of a straight SQL string like this being able to be put into the VIs.

  • Problem connecting sql developer with a remote database MAc OSX Snow Leopar

    Hi everyone, sorry for my poor english but i don 't speak this language.
    I'm trying to connect Sql develper to a remote database and it does not work, showing this error: The Network Adapter could not establish the connection.
    Before running sql developer i install the oracle instant client and sql plus, i use the same tnsnames.ora file as my windows machine and sqlplus (in snow leopard) connect perfect.
    i set the path of my tnsnames in the setup of sql developer but i can't do it work.
    Anyone can help me please? thanks a lot.

    Duplicate thread Problem running Sql developer in Mac OSX Snow Leopard.

  • Frm-40208 from running in query mode. cannot change database fields

    Hi,
    Could some one help me with this.
    I am calling a form from another form. I am passing the parameter list to the calling form and doing a query by setting the block property. But when queries the message
    FRM-40208 Form running in query mode. cannot change database fields .
    I do not want the message to appear when they go the called form . Please some one could help me how could I avoid displaying the message.
    Regards
    Bain

    Hi,
    Good day! I am working with a module that also calls another form. It uses call_form with query mode parameter set to query_only. My problem is, whenever i call the other form using the call_form, it would display the called module and then as it populates the detail block of the called form, it will display frm-40208 from running in query mode. cannot change database fields per record. What I want is for the message to be displayed only once.
    I have tried capturing the error by using on-error trigger, but it doesn't go to that whenever the other form was being called. I think the message has to do with the post-query trigger, because it passes some values on a dbase block objects.
    Do you have any suggested solutions or workarounds to make the message display only once whenever the other form is being invoked by the call_form?
    I would greatly appreciate any suggestions/ideas.
    Thanks and regards,
    ASantiago

  • Query across multiple databases

    Hi,
    One shot question: is it possible in Oracle to write a query joining two tables from different databases ?
    I used MS SQL, and it was duable there, but I have to port app to Oracle, and I did not manage to do this on oracle.
    I use oracle 9
    Thanks.
    pesq

    1. Create an account on the remote database with permissions to select from the relevent tables.
    2. Create a database link in the local database to connect to the account (step 1.) in the remote database.
    3. Now execute you query in the local database connecting to the tables in the remote database.
    SELECT local_a.col1, local_a.col2, rmt_a.col5
    FROM local_table local_a, remote_table@<name of link> rmt_a
    WHERE local_a.key = rmt_a.key;

  • Same sql query with multiple database links

    Hi All,
    i want to execute an sql query for a SELECT LIST Item. which should use database links in it's query.
    i'm having a list of database links in the region. say :LOC which is having 10 items each linking to different databases.
    i want to use following query for another item in same page.
    select customer_name from working_lines@:LOC where
    phone_no:phone_no
    can i do this.
    Thank you All.

    What we have done before is to create a report based on a PL/SQL procedure that returns a SQL statement.
    The PL/SQL code grabs the "selected" database link from :LOC and parses the SQL QUERY you want to execute replacing some token (like [LINK]) with '@DBNAME'.
    Lets say your SQL statement is coded like this:
    mySQL := 'SELECT cust_name FROM working_lines[LINK] where phone_no = :Phone;'
    Then all you would have to do to replace '[LINK]' with the proper DB alias would be:
    mySQL := REPLACE(mySQL, '[LINK]', '@'||:LOC);
    and then return the new SQL ...
    if :LOC has something like 'V10GPROD' your SQL would look like :
    SELECT cust_name FROM working_lines@V10GPROD where phone_no = :Phone;
    The beauty of this is that you can also include a "null" option that means the select statement will be executed on THIS database...
    Doug

  • How to get running SQL query 2008r2

    Hi
    I am faultfinding multiple slow queries initiated by SharePoint 2010 crawls.
    Is there any way in SQL management studio where i can display the current running queries?
    I'd love to get my hands on the queries running:P
    brgs
    Bjorn

    I use Adam's great utility
    Who Is Active? v10.00 (2010-10-21)
    (C) 2007-2010, Adam Machanic
    Feedback: mailto:[email protected]
    Updates: http://sqlblog.com/blogs/adam_machanic/archive/tags/who+is+active/default.aspx
    "Beta" Builds: http://sqlblog.com/files/folders/beta/tags/who+is+active/default.aspx
    License: 
    Who is Active? is free to download and use for personal, educational, and internal 
    corporate purposes, provided that this header is preserved. Redistribution or sale 
    of Who is Active?, in whole or in part, is prohibited without the author's express 
    written consent.
    BTW http://dimantdatabasesolutions.blogspot.co.il/2008/06/how-do-you-maintain-sharepoint.html
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • SQL Query with MS-Access Database

    Hi,
    I have linked my oracle database with MS-Access via a DB LINK. i can access the data from MS-ACCESS, but i have a problem that when i specify the column name or define a where clause in my query it gives me the error ORA-00904: invalid identfier ..
    This query fetch the data without any problem SELECT * FROM TBLREPORT@M_ACCESS but when i run SELECT EMP_ID FROM TBLREPORT@M_ACCESS it gives me the error i mentioned above. (Column name have No problem or mistake of spelling even CASE)
    also when i try to put where clause in the query it gives me same error SELECT * FROM TBLREPORT@M_ACCESS WHERE EMP_ID = '100' (Error)
    is there any change in SQL query for ACCESS database ??
    any clue
    Regards
    Rehman

    Are column/table names in access case sensitive? Issue
    DESC TBLREPORT@M_ACCESS If column EMP_ID actual name shows up in mixed/lower case, enclose it in double quotes and use the exact case. E.g., if column name shows up as Emp_Id, use:
    SELECT "Emp_Id" FROM TBLREPORT@M_ACCESSSY.

  • Problem in running sql query

    Hello ,
    I am using oracle 10g apex 3.2.
    I have assosiated 2 schema "vpmys and vp" with one workspace.
    In the application , i created a new page of report ,which is assosiated with one schema called "vp" and i wish to run this query
    select * from vpmys.t_devotees
    minus
    select * from vp.t_devotees
    Same database dmp is installed in both schema except that the no of rows may be more or less in one database.So first i need to know the added rows and what are they and then insert the same no of rows into another db.
    But this doesnt run in the application.
    But it runs in the SQL Command window.
    So what way i should change the query so that it runs.
    Thanks
    Swapna

    Post your question in Application Express Forum
    Oracle Application Express (APEX)

  • Cannot query tables in remote database

    Hi, I have looked around for similar topics but have not found anything that would be close to my problem. I created a public link to a remote database from my portal database, it is a public link and I can query tables in the remote database just fine when I am on the sqlplus prompt. When I try to create a report, or a dynamic page, it lets me go through the wizard steps ok, however when I run it as a portlet or just run it as a report/page it does not seem to be able to see the query. Below is the response I get from running it as a portal. I am logged in as portal30.
    ORA-01017: invalid username/password; logon denied
    ORA-02063: preceding line from C2K (WWV-11230)
    Failed to parse as PORTAL30_PUBLIC - select * from populate@c2k (WWV-08300)
    The preference path does not exist:
    ORACLE.WEBVIEW.PARAMETERS.1320061995 (WWC-51000)
    The preference path does not exist:
    ORACLE.WEBVIEW.PARAMETERS.1320061995 (WWC-51000)
    Error: Unable to execute query (WWV-10201)
    Please help, I have tried everything from public to private synonyms for the linked tables and it just does not work. I am using the most recent version of portal that came with ias 1.0.2.2.0

    Actually I solved my problem, it looks like I should have used the db link utility with the portal, I linked the databases on the sqlplus command line and it seems like that was the issue.

  • Hierarchical Query/START WITH/Remote Database error

    Running on: EE 10.1.0.4.0 - 64bit
    Remote DB: EE 11.1.0.6.0 - 64bit Production
    Trying:
    <PRE>
    WITH
    Moo
    AS
    SELECT
    1
    FROM
    Dual@EPO11_Link A
    CONNECT BY
    LEVEL = 1
    START WITH
    EXISTS (SELECT * FROM Dual@EPO11_Link B WHERE A.Dummy = B.Dummy)
    SELECT
    FROM
    Moo;
    </PRE>
    Getting:
    ORA-00904: "A3"."$nso_col_1": invalid identifier
    ORA-02063: preceding line from EPO11_LINK
    00904. 00000 - "%s: invalid identifier"
    *Cause:   
    *Action:
    - The CTE's query runs fine on its own.
    - removing the @ from the first Dual@EPO11_Link , works.
    - removing the @ from the second Dual@EPO11_Link , errors:
    ORA-02016: cannot use a subquery in a START WITH on a remote database
    02016. 00000 - "cannot use a subquery in a START WITH on a remote database"
    *Cause:   
    *Action:
    Error at Line: 10 Column: 24
    - Removing the START WITH clause, works.
    - Changing the START WITH clause's "=" to "IN", works.
    - Changing the START WITH to EXISTS (SELECT * FROM Dual@EPO11_Link B WHERE A.Dummy = B.Dummy) results in:
    ORA-00904: "A3"."DUMMY": invalid identifier
    ORA-02063: preceding line from EPO11_LINK
    00904. 00000 - "%s: invalid identifier"
    *Cause:   
    *Action:
    Am i missing something here?
    Edited by: Brian Tkatch on Jan 19, 2012 1:27 PM

    Searching error messages books:
    These have the ORA-02016:
    8: http://docs.oracle.com/cd/A58617_01/server.804/a58312/newch228.htm#19589
    9: http://docs.oracle.com/cd/A91202_01/901_doc/server.901/a90202/e1500.htm#1001663
    These do not have the ORA-02016:
    10R1: http://docs.oracle.com/cd/B14117_01/server.101/b10744/e1500.htm#ORA-02009
    10R2: http://docs.oracle.com/cd/B19306_01/server.102/b14219/e1500.htm#ORA-02009
    11R1: http://docs.oracle.com/cd/B28359_01/server.111/b28278/e1500.htm#ORA-02009
    Starting with (heh) 10R1 a bunch of error messages were removed regarding hierarchical queries, including this one.
    Is it allowed or not?

  • Help me Please ..... How to Run SQL Query in Creator

    Hi all , I want to Run a SQL query in Creator how do i do it.
    If i want to retrive a set of records based on few matching fields or some join conditions , what method i can use ?
    How Can i run other SQL statements like ALTER , UPDATE , DROP ....
    Please Help me .

    Hi Hanumesh,
    To run SQL commands like ALTER, UPDATE, DROP you will have to go to the Pointbase console. Creator does not provide for database operations on the tables other than querying for data. To start the Pointbase console run startconsole.exe which can be found in <install directory>\SunAppServer8\pointbase\tools\serveroption.
    Hope this helps
    Cheers
    Girish

  • How to run sql query in bat file in task schedular at every 10 seconds

    This is my sql script :
    DECLARE @countRows INT,
    @currDate DATE,
    @checkForTasks INT,
    @created_by_id INT,
    @gst_ID int;
    SET @currDate = Getdate()
    SET @countRows = (SELECT Count(*)
    FROM [dbo].[sd_gst_effective_table]
    WHERE isapplied = 0)
    IF @countRows > 0
    -- Check for those GST''s who are not applied yet : if they are greater than 0 then perform next task
    BEGIN
    SET @checkForTasks = (SELECT Count(*)
    -- Check is current date equals to task date or not
    FROM [dbo].[sd_gst_effective_table]
    WHERE effect_date = @currDate AND isapplied = 0)
    IF @checkForTasks > 0
    -- If current date = task date then perform this task
    BEGIN
    SET @created_by_id = (SELECT TOP 1 createdby FROM [dbo].[sd_gst_effective_table] WHERE effect_date = @currDate AND isapplied = 0)
    SET @gst_ID = (SELECT gst_id FROM [dbo].[sd_gst_effective_table] WHERE effect_date = @currDate AND isapplied = 0)
    -- STEP 1 :: InActivate the existing GST according to createdbyID
    UPDATE sd_gst_rate
    SET isactive = 0,
    inactivedate = Getdate()
    WHERE isactive = 1
    AND createdby = @created_by_id
    -- STEP 2 :: Activate the New GST according to implementation date and gstID
    UPDATE sd_gst_rate
    SET isactive = 1,
    activedate = Getdate()
    WHERE id = @gst_ID
    -- STEP 3 :: Inactivate the applied GST from sd_gst_effective_table
    UPDATE [dbo].[sd_gst_effective_table] SET isApplied = 1 WHERE gst_id = @gst_ID
    END
    END
    DECLARE @Text AS VARCHAR(100)
    DECLARE @Cmd AS VARCHAR(100)
    DECLARE @value nvarchar(1000);
    SET @value = (SELECT CONVERT(TIME,GETDATE()) AS HourMinuteSeconds);
    SET @Text = 'File Writed ' + @value
    SET @Cmd ='echo ' + @Text + ' > E:\AppTextFile.txt'
    EXECUTE Master.dbo.xp_CmdShell @Cmd
    This is resided in videos folder of windows , i have created a task schedular in windows 8.1 to run daily at every 10 seconds , but it is not working ... Please tell me how to deal with it.
    Please note : This sql query is running perfectly in sql server. Query have no errors. Please check whats wrong with my time schedular. I just want my schedular to run every 10 seconds regardless of date.

    Hi Emad,
    Is your script in a ".sql" file? May I know how you configure the schedule task action?
    Since you didn't mention how you configure the schedule task, can you confirm you have followed the below step correctly?
    Save your script in a ".sql" file.
    Create a ".bat" file and call the sql file above inside with
    sqlcmd.exe, you can reference
    here.
    Configure a schedule task to run the ".bat" file in a certain interval.
    Have you tried to run the script in you bat file in a standalone commandline window? Please post the script in your bat file, It can help to diagnose the issue.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Can we run SQL query on a XML file?

    Hi All
    I have an XML document which stores data of a table.
    My requirement is to retreive data from this XML document by firing SQL
    query.
    i.e "SELECT * FROM EMP" should give me the data from the EMP.XML file
    whose name is the table name.
    Does Oracle provide this feature to retreive data from an XML document
    by issuing the same SQL statement that is used in Database?
    Any pointer for this requirement is highly appreciated.
    Thanks in advance..
    Ashish

    select '<EMPLOYEE><EPNUM>' || EPNUM || '</EPNUM><EMPNAME>' || EMPNAME || '</EMPNAME></EMPLOYEE>' from EMPLOYEE;

Maybe you are looking for