SQL referencing Two database instances

I have searched through most of the posts regarding this subject so please bear with me.
I have created two views in two database instances. Dev and prd.
I am attempting to execute a simple query from Dev within TOAD.
select * from [view_Name]
minus
select * from [view_Name]@PRD
When I execute this I receive an error that the remote connection cannot be found.
Do I have to create a database link using the TNS connection string, or is there another way to reference another database instance within the SQL?
Any help is appreciated.

You need to create a database link (see [url http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5005.htm#i2061505]Oracle® Database SQL Reference).
But I would not refer to other database objects directly like that. Should the link name change, or the remote object name's change, then each and every reference to those needs to be updated in all SQL and PL/SQL code.
When dealing with foreign databases (like Informix for example), objects are case sensitive. Which means ample use of quotes to enforce case on the Oracle side.
All this gets to be quite messy - especially during the maintenance of the code.
Thus, instead of "hard references", use "soft references". Create local views on remote objects. Use those local views in all SQL and PL/SQL code. Any change to database link or remote object now only requires the applicable view to be updated - no hunting for code that needs to be changed.

Similar Messages

  • MS SQL 2005 clustered database instance.

    Short Text 
    MS SQL cluster database instance - ONLY! 
    Long Text 
    Hi,
    If possible could you please confirm that our planned landscape
    migration is supported by SAP.
    At present our PRD SAP system is a standalone instance that consists of
    the database & central instance running on the same "HOST".
    <u>Current SAP PRD version:</u>
    ERP 2004 ECC 5.0 32 bit
    MS SQL 2000 32 bit
    both running on same host with OS Windows 2003 32 bit
    We plan to upgrade/migrate our PRD SAP system to new 64 bit hardware
    AND to move to a "Distributed" landscape installation i.e. database
    instance & central instance installed on different HOSTS. Also, the
    database instance WILL be clustered but the central instance will NOT
    be clustered. There are also multiple NON-SAP MS SQL databases that
    will run in the same cluster as the PRD SAP database instance.
    <u>SAP PRD version after migration:</u>
    SAP ERP 2004 ECC 5.0 64bit (running on X86_64 AMD64 hardware) on HOST'X'
    MS SQL 2005 64 bit (running on IA64 hardware) on clustered HOST'Y'
    Both running on Windows 2003 64 bit
    <u>My questions are:</u>
    1) Does SAP support a clustered MS SQL 2005 database instance that is
    running on a clustered HOST along with NON-SAP MS SQL databases?
    2)During the migration our PRD SAP MS SQL database will be upgraded
    from MS SQL 2000 32 bit to MS SQL 2005 64 bit IA64, is this also
    supported in a clustered istallation (database instance ONLY)?
    3) The central PRD SAP instance will be running on x86_64 AMD64
    hardware & the database instance will be running on 64 bit IA64
    hardware. Is this configuration supported?
    Thanking you inadvance.

    Hi Greg,
    Have you figured out the answer? We are trying do the exactly the same thing -- Move our SAP WAS 6.40 clustered central instance to a 64-bit hardware/SQL 2005/Clustered system. And this system has several non-SAP database on there. The biggest concern we have is whether SAP support this architecture. I posted a message here last year and several experts like Clas Hortien, N. P. C, in this form suggest NOT go to this architecture because SAP will not support it. One example, is that SAP/SQL requires server collation setting to SQL_Latin1_General_CP850_BIN2 and other databases may work on different collations.
    Migrate SAP SQL Server database to co-exist with others
    Anyway, if you or anyone in this form have some more information please share here.
    Thanks,
    Yujun Ran

  • Connecting to two database instances using the same Toplink

    Hi,
    We are trying to create a process using BPEL where data from one database instance needs to be passed to the other. The process is compiling properly and we could deploy it in BPEL Process Manager. But when we try to run the process, the data is not getting inserted into the second instance. There is no error /exception being thrown at most of the time, but at times we are getting a 'Unique constraint error' eventhough there is no duplication of data.
    Can we connect to two different instances using the same toplink. How can we achieve this.
    Thanks in advance
    Pratheusha

    You need to use two different sessions with two different mapping descriptors

  • Connecting to two database instances from the same TopLink

    Hi,
    We are trying to create a process using BPEL where data from one database instance needs to be passed to the other. The process is compiling properly and we could deploy it in BPEL Process Manager. But when we try to run the process, the data is not getting inserted into the second instance. There is no error /exception being thrown at most of the time, but at times we are getting a 'Unique constraint error' eventhough there is no duplication of data.
    Can we connect to two different instances using the same toplink. How can we achieve this.
    Thanks in advance
    Pratheusha

    You need to use two different sessions with two different mapping descriptors

  • I want to install two database instance on Solaris platform  but fail to do

    I have successed to install Oracle 817 on solaris 2.8 platform and established a database instance.and then I want to install the other database instance to my computer. when i used dbassist.sh. to create database, system infom: " not connect to oracle database". In fact ,oracle can work properly. why?
    I would be grateful if you could tell me about the cause of this problem. I am looking forward to your reply.

    Error downloading, installing, or updating Creative Cloud applications

  • SQL Server two database at two different locations

    Hi Guys,
    We are having same database at two different locations (Database A with Sqlserver 2008/Express, database B with Sqlserver 2012).
    Our requirement is when ever a row is inserted in a table of Database A from location 1. Same value should also be added in Server 2 at different location.
    So that at any point of time both the database base values should be same.
    Which is the best method to do it ?
    Regards,
    Raghu.G
    raghu

    Could you please give more information about the editions of SQL Server? Is SQL 2012 express as well?
    Do you also need udpates/deletes to be moved to another server? Also do you want changes in SQL 2012 to be moved to 2008 as well?
    With Express edition you have very limited options.
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • How can i create a new database instance in oracle 10g express edition?

    hello everybody
    i'm a student
    i am developing a database application
    i'm using oracle 10g express edition
    to run my application i need to create another database instance
    but i didn't find any option for doing so in that product
    if there is pls tell me where it is?
    if not pls tell me how to manually create it?
    regards,
    Chaitanya

    Chaitanya Babu M wrote:
    yaa i'm sure about that .
    i want one more instance of database.Can you perhaps explain why? I have a fair share of production and development servers - and not a single one of them needs to run more than one database instance.
    So I'm interested in what requirement you are trying to satisfy by using two database instances on a single platform.
    Oh yeah - if you want to create a custom XE instance (different SID, different tablespace sizes, more/less PL/SQL stuff installed, hack standard), make a copy of your XE db creation script (in your XE's +$ORACLE_HOME/bin+ and called createdb.sh ) and modify that for your needs.
    PS. even with a different SID, only a single XE instance can be run at a time - you can however have 2 different ones defined and then use one at a time (e.g. testing international settings, init param differences, etc.)

  • Two apex instances on one machine

    I am trying to create two apex instances using the embedded PL/SQL gateway on a single machine. I have two database instances up and running, one for development and one for production. I successfully installed apex 3.2.1 on the development instance, created some simple apps and everything seems to work as advertised, running from port 8080.
    I installed 3.2.1 on my other instance and everthing went fine until I had to create a way to connect. My
    select dbms_xdb.gethttpport from dual;
    returned zero, so I knew I had to set a port to wake up the network services on the instance. That's where I have my question. I cannot find out whether I need to use port 8080 and somehow separate my apex instances based on the DAD or if I should use a separate port for each instance. I tried setting the httpport to 8090 on the new install and my listener shows it active, but when I hit it, I cannot get a response with ~/apex/apex_admin - just a browser password dialog.
    The apex environment on the development install continues to work fine, responding to ~:8080/apex/apex_admin.
    I am guessing that I have a logical gap somewhere. Where can I read about how to manage this kind of setup?
    Thanks,
    Brandt

    Brandt:
    You want to check if a DAD named 'apex' is configured in the Oracle instance where you have the http port set to 8090.
    Login to this instance as the sys user and run this bit of pl/sql. It will display all DADS and their mappings
    SET SERVEROUTPUT ON SIZE UNLIMITED
    DECLARE
      pths  DBMS_EPG.varchar2_table;
      dads DBMS_EPG.varchar2_table;
    BEGIN
      dbms_epg.get_dad_list(dads);
      for i in 1..dads.count loop
        DBMS_EPG.get_all_dad_mappings (
           dad_name => dads(i),
           paths    => pths);
        DBMS_OUTPUT.put_line('Mappings for DAD'|| dads(i));
        FOR j IN 1 .. pths.count LOOP
           DBMS_OUTPUT.put_line(pths(j));
        END LOOP;
    end loop;
    END;Varad
    Edited by: varad acharya on Sep 10, 2009 6:53 AM

  • Identical database & instance names in Oracle 11g R2 RAC

    Hi ,
         We are migrating our EBS 11i (11.5.10 CU 2) and oracle 11gr2 (11.2.0.3) database (database only) which is currently on Solaris to Linux. Currently the database is NON-RAC and as a part of the migration we are converting it in to a 5 Node RAC. A lot of third party interfaces connected to this environment are using hard coded database name. Unfortunately due to the project time lines it's impossible to change those applications within the migration timeline. In order to ensure that they don't break we are thinking of keeping one instance name same as database name so those applications can continue to function without any change to their code. We are aware that this would compromise on fail over capabilities for those applications but we are ok with that.
    This what we have in mind: Create 5 PROD instance named as PROD, PROD1,PROD2, PROD3 & PROD4. PROD being the name of the database also. I would like to know:
    1) Is this configuration allowed i.e., is it ok to have one instance with the same name as database?
    2) We will be creating a 5 node Data gaurd environment for this so what will be the impact of such a naming on it?
    3) Since it's an EBS environment will there be any issues with application configuration?   Our application architecture will be as below:
    6 application nodes - Two for concurrent managers, two for forms & web & two external nodes
    The two CM app nodes will be tied to two database instances using Services
    Remaining app nodes will connect to the remaining 3 instances once again using services.
    We will be configuring services using "vip" instead of scan names.
    4) What will be the impact if the node having the instance name same as database name goes down?
    5) Any other areas to worry about with such a configuration say like cluster services, 3rd partyinterfaces/applications?
    Please let me know if you have any idea of such a configuration.
    regards
    pramod

    Brian, rchem & Martin thanks for your responses. Appreciate it much. I was thinking about the service alternative but unfortunately I understand from my customer that their applications have hard coded database (used as a instance name) name. All they are saying is that their applications are using instance name instead of database name without providing much details on how it's being used. I just know that there 180 applications... Oracle & non Oracle based in which the instance name is hard coded, but haven't got answers to my questions on how it's hard coded i.e., is it being pulled from the database using a hard coded query like "select instance_name from v$instance" or is it a part of some variable in the script/application etc., and what it's being used for (later) within the application.  Answers to those question will help in deciding what  should be the right strategy but since I am short of time I thought of this and wanted to know if anybody has implemented or come across a similar architecture.
    I am creating services and using them in my EBS application ifile thereby avoiding SID but agree with you on the node failure part as I haven't tested this new set up yet.
    Martin,
              You are right, they are using the database name as a SID in their application hence the above need.  My cluster version is 11.2.0.4.0 (both Active & Software versions). The source database on solaris is 11.2.0.3 Non RAC, it's going to be upgraded to 11.2.0.4 before conversion/migration hence I have installed & created a 11.2.04 RAC environment as a part of POC/Load testing.
    Regards
    pramod

  • Do I need Distributed Transaction Scope when I have Two Database in Single SQL Server Instance

    Dear Sirs.
    I have Two Database in SQL Server Express 2008 R2, I Move Row From Database 1 Table 1 to Database 2 Table 1
    Do I need Distributed Transaction or just regular Transaction.
    Thank you in Advance. 
    Irakli Lomidze

    Dear Sirs.
    I have Two Database in SQL Server Express 2008 R2, I Move Row From Database 1 Table 1 to Database 2 Table 1
    Do I need Distributed Transaction or just regular Transaction.
    Thank you in Advance. 
    Irakli Lomidze
    Whats you are doing does not qualify under distributed transaction. Please read about distributed transaction from below link
    http://technet.microsoft.com/en-us/library/ms188721%28v=sql.105%29.aspx
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • One instance and two databases?

    Hello, I've installed oracle database on my server. I've read a lot of documentation to learn the basic concepts.
    Ok, I have a question. I have read that one instance only can manage ONE database. Is it true? If it's true, how on earth I can create two database? for example, I want to create database-one and database-two.
    I would create these with CREATE DATABASE command. How does Instance know if I want to access to database-one or database-two. How I indicate it in initilitation parameter file of my instance?
    In sumary, Can one instance works with two databases?

    Look at the following output. If I do not set my ORACLE_SID variable, the 9.2.0.7 client connects to the 9.2.0.7 database instance. If I set my ORACLE_SID , the same 9.2.0.7 client now connects to the 10.2.0.1 database (the database specified in the ORACLE_SID variable).
    C:\>set ORACLE_SID=
    C:\>sqlplus kkishore/kkishore
    SQL*Plus: Release 9.2.0.7.0 - Production on Mon Jul 17 09:27:55 2006
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    SQL> exit
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    C:\>set ORACLE_SID=ORA10GR2
    C:\>sqlplus kkishore/kkishore
    SQL*Plus: Release 9.2.0.7.0 - Production on Mon Jul 17 09:29:31 2006
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL>Message was edited by:
    Kamal Kishore

  • How to hide not all but a specific database on a SQL Server 2008 R2 instance?

    Hello everyone,
          I need help from all the SQL Server database security experts out there. Any solution/help or work-around will be really appreciated. Here is the scenario; our client is using our application which is a windows forms application
    having in backend as a database under SQL Server 2008 R2 instance. We have successfully installed the SQL Server software with mixed mode authentication on client side, our application is running smoothly and everything is working fine. Our database on which
    application is running is quite intuitive, in the sense, all employees information is stored in EmployeeMaster and all departments information is stored in DepartmentMaster and so on. It consists of more than 500 such tables, stored-procedures and views. We
    have encrypted stored-procedures and views, problem is only with tables.
    We don't want table structure to be visible to anybody in SSMS (or tables must be hidden from all the users) but at the same time the tables should be accessible from the application. And we don't want to go with the option of encrypting
    the tables data and changing the names of all the tables to T001,T002..etc. as that is not feasible. And one last thing, we cannot restrict 'sa' login's password, it has to be shared with the client.
    Regards,
    Sumit R. Santani

    Also, will you please enlighten me more on what you said as "couple of choices" if I want to lock out plain users only?
    Assuming that you are selling a solution to a client, it's more an issue for your client's IT department, that do want their users to connect with Excel or SSMS.
    Anyway, I have a brief overview here:
    http://www.sommarskog.se/grantperm.html#Othermethods
    Again my question on that is how much reliable will be that license agreement?
    That depends on the lawyer you engage to write the license agreement.
    How would I come to know what they are doing with our database?
    Trust. Trust is extremely important. It is very difficult to make business if you don't trust people.
    That said, there are basically two reasons you want to hide the application from the client. One is protecting intellectual property. To this end, I know of nothing else than trust. And maybe after all, your application is not so fantastic that it is worth
    stealing anyway.
    The other reason is that you don't want the client to change it, and then open a free support case when he has messed up. To this end there are some technical approaches you can take to detect such tampering. For instance, you can sign all stored procedures
    with certificates using ADD SIGNATURE WITH SIGNED BLOB, and then ship only the public key of the certificate. This permits SQL Server to verify the signature, but the client cannot change the signature and sign it with that certificate, because the private
    key is not available to them.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Can a SQL Server Failover Cluster Instance (FCI) be Implemented Between Two Hyper-V Hosted Virtual Machines?

    I haven't had the opportunity to implement a SQL Server Failover Cluster Instance (FCI) for over 10 years and that was done with two physical, identical database servers way back in the day of Windows Server 2003 and SQL Server 2000 (old school).
    Can a SQL Server 2008 R2 Failover Cluster Instance (FCI) be implemented between two Hyper-V hosted virtual machines? The environment in question already has Windows Server 2012 R2 Hyper-V hosts in place, so I'm just looking to see if this is even
    possible and/or supported when utilizing virtual machines.
    The client in question is currently using SQL Server 2008 R2 instances running on Win2008R2, Win2012, and Win2012R2, but I'd also be interested how this can be done or not with SQL Server 2012 or 2014 as well. Thanks in advance.
    Bill Thacker

    Yes, it can be done with Hyper-V guests. In fact, with Windows Server 2012 R2 Hyper-V, guests can use the Shared VHDX feature for shared storage used by Windows clusters. The guests can run Windows Server 2008 and higher provided that the Hyper-V Integration
    Services are installed to support Shared VHDX. The only challenge here is making the Hyper-V hosts highly available as well, running it on WSFC.
    Edwin Sarmiento SQL Server MVP | Microsoft Certified Master
    Blog |
    Twitter | LinkedIn
    SQL Server High Availability and Disaster Recover Deep Dive Course

  • IDES Installation - Database Instance for MS SQL

    Hello,
    I preveously posted this topic twice in the wrong area of the froum. So I just try again with little bit more knowledge. The problems I had (see history below) seem to be a run time problem (it only took really long). Now it ended up with the error that the startsap.exe could not be started (returncode -1). What could be the reason for that <b>?</b>
    Actually I think I have also a hardware problem. I was not able to find information about the needed HD space. In one SAP note I read that for the IDES on MS SQL 60 GB are needed. I do also have a problem with the topic database file configuration! How this is done in general and what about the files sizes <b>?</b>
    Thanks for any help concerning the installation of the database instance.
    BR, Volker
    <u>History:</u>
    I want to install a IDES 2004 R1 / Netweaver 2004.
    I am working on WIN 2003 Enterprise Server with a MS SQL DB. The Central Instance installation ended successfully. I get in trouble with the DB Instance installation:
    <b>--></b> The data to be filled in the sapinst tool was possible, the installation stops at the process step: MS SQL Database Layout. In the log the last Phase is "Setting up Server Phase" and the last two informations after are "Creating Directory", one for data and one for the log. In the explorer they are to see. In the data directory is even a file *.mdf.
    Anybody who could tell me what I have to do for the installation ?
    Thanks in advance,
    Volker
    One more note: The information in the footer line of the Installation Wizard says: "Creating database <DB> / this can take a while ...
    The while is a never ending while ...
    Message was edited by: Volker Lehari8

    Hei guys,
    the reason why the installation did not continue was the fact that the dispatch+work process didn't started correct. Why it finally did after many reasons I couldn't find out 100% - searching in the SAP notes helped to only try a restart.
    So after this I continued (new start of sapinst with "Continue installation") was leading to a success. This was a difficult birth.
    Still the question about the needed database space is in my head ! ?? !
    BR, Volker

  • 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

Maybe you are looking for

  • ICal alerts to only one phone?

    Not sure how to phrase it but it seems like a simple enough request. My wife and I each have iPhones and we are using iCloud to sync our calendars.  We have multiple calendars set up - Her events, my events, joint events, work schedule, etc.  Is ther

  • How do I install Photoshop Elements 10 on my new mac that doesn't have a disc drive?

    Help!  I have an old imac that has Photoshop Elements 10 installed on it.  I bought a new imac that does not have a disc drive.  How do I uninstall/reinstall on my new computer???  Is there a way besides having to purchase a disc drive?

  • Two External Displays & More Memory & Faster HDD

    Hello fellow HP Laptop users I own an EliteBook 8540w and am wondering a few things about how to best upgrade this box. Detailed specs of the box are as follows. CPU Type: Mobile QuadCore Intel Core i7-740QM, 2100 MHz (16 x 131) Motherboard Name: Hew

  • Does ODI has the ability to organize 1000+ pl/sql programs?

    Hi experts, we are proposing ODI to a customer who has 1000+ pl/sql programs to load data to Oracle DW. Besides, there are many complicated dependencies among these programs. I know that ODI has "package" functionality to build up a workflow and sche

  • Can anyone help with scripting problem?

    I finally figured our how to write my own scripting in InDesign (CS2) to format the schedules I work on. Now we upgraded to CS4 and they don't work anymore. I'm not knowledgeable enough to know why it's not working. I someone familiar with this? I co