Oracle dblink to sql server, accessing multiple database on same sql server under one dblink

Hi, we have successfully managed to set up an Oracle dblink over to sql server and retrieve data.
The sql server user were using via the dblink has access to more than one database on the same sql server
But the question is how in oracle (if at all possible) do you prefix the sql statement to access this ?
Eg:
Sqlserver_prod has user sqlserver_user which appears to be set up as default database on sqlserver_db1
But we have select access to sqlserver_db2
all work fine as sqlserver_user
select * from  table_fromdb1
select * from  dbo.table_fromdb1
select * from  sqlserver_db1.dbo.table_fromdb1
as does
select * from  sqlserver_db2.dbo.table_fromdb2
over in Oracle
Oracle_db has dblink sqlserver_prod.world connecting as sqlserver_user
all working fine
select * from "table_fromdb1"@sqlserver_prod
select * from "dbo"."table_fromdb1"@sqlserver_prod
but how (if at all possible) do I access from oracle
sqlserver_db2.dbo.table_fromdb2
without having to create a new sqlserver_db2_user referenced in a new dblink
if oracle to oracle would be
select * from remote_oracle_schema.table@remote_oracle_db

Hi, ok cheers, I see, original gateway was connecting purely at host_name level
HS_FDS_CONNECT_INFO=sqlserver_host
Planning to amend this to be
HS_FDS_CONNECT_INFO=sqlserver_host//sqlserver_db1
With exisiting dblink
And to create new gateway
HS_FDS_CONNECT_INFO=sqlserver_host//sqlserver_db2
With new exisitng dblink,will see how we get on
Cheers again

Similar Messages

  • Accessing Multiple Databases

    I have a requirement in which I will need to use the same classes to
    access different databases. In other words, let's say I have a Person
    class. I'd like to use the enhanced Person class to pull people from a
    SQL Server database, and an Oracle database.
    The documentation mentions that you can access multiple databases by using
    different kodo.properties files with different names. However, it doesn't
    mention using different mappings, that I can see.
    What I'm thinking I could do is extend kodo.jdbc.meta.FileMappingFactory.
    Then I could have a .mapping file for each different database. My
    extension would just need to know to access *.sqlserver.mapping or
    *.oracle.mapping for instance.
    Is this plausible? If so, any hints on extending FileMappingFactory? How
    is that guy determining the name of the mapping file? Can I simply
    override a method?
    I'm hoping this will work, so that I don't have to create a
    SQLServerPerson and an OraclePerson. Any ideas appreciated.
    Thanks,
    Steve

    Ok, in answer to my own question, I'm providing the following which I hope
    Abe or Stephen will look at, and tell me this won't break everything.
    It seems that jdbc-class-ind is only read at the base level, and thus I
    couldn't add an "indicator" for each of my subclasses. So, as I wrote
    previously, I needed a way to read my jdbc-class-ind-value in my .mapping
    file for each class. Here is the code I came up with:
    <code>
    public class MyFileMappingFactory extends FileMappingFactory {
    JDBCConfiguration myConfiguration = null;
    static Logger log = Logger.getLogger(MyFileMappingFactory.class);
    public synchronized void readMapping(ClassMetaData type,
    MappingInfoRepository repos) {
    super.readMapping(type,repos);
    try {
    String[] persistentClasses =
    myConfiguration.getPersistentClassesList();
    MappingRepository mappingRepos =
    myConfiguration.getMappingRepository ();
    for (int i=0;i<persistentClasses.length;i++) {
    String className = persistentClasses;
    try {
    Class clazz = Class.forName(className);
    ClassMapping mapping = mappingRepos.getMapping(
    clazz, clazz.getClassLoader(), true);
    mapping.addExtension(
    "jdbc-class-ind-value",
    mapping.getMappingInfo().getAttribute("jdbc-class-ind-value"));
    catch (Exception e) {
    log.error("Could not set jdbc-class-ind-value for class '" +
    className + "'.");
    catch (Exception ex) {
    public void setConfiguration(Configuration conf)
    myConfiguration = (JDBCConfiguration) conf;
    super.setConfiguration(conf);
    </code>
    I did a lot of introspection using JBuilder as well as the Javadoc to
    figure out what I needed to call. Basically, I need to have
    kodo.PersistentClasses set in my config file, and I added an attribute to
    the .mapping jdbc-class-map element. Finally, my kodo.properties has to
    point to my custom MappingFactory.
    It all seems to work, but I wanted to verify with the experts I'm not
    breaking anything. I had hoped to figure out how to put an <extension> in
    the .mapping file so that it stood out even more as being "custom code",
    but could not figure out how to read such an element.
    Steven Kouri wrote:
    I think you've answered my question, but it doesn't help my problem. I
    actually did both: I loaded the static classes in my code as well as used
    the kodo.PersistentClasses property. Neither helped this situation.
    The reason it seems is when the fromMapping() gets called. It only got
    called after calling execute() on my query. Thus, the rest of my mappings
    hadn't been loaded yet. I put a breakpoint in fromMapping(), and here was
    my stack trace:
    execute()
    executeWithArray()
    executeWithMap()
    internalCompile()
    getMetaDatas()
    getMappings()
    getMapping()
    getMappingInternal()
    getMapping()
    getMappingInternal()
    intialize()
    fromMapping()
    So, I need to figure out a way to get my code to read all the mappings
    before I do an execute(). I think. :) I'll investigate further unless
    you can give me a pointer in the right direction.
    Thanks!
    Steve
    PS: 1pm? 1PM? I'm here before 7am! But then, I usually leave at 4pm. :)
    Abe White wrote:
    Is the .mapping file preparsed, or is it only accessed when a class is
    requested from the datastore?
    We only resolve mappings when the classes are actually used. Have you
    listed all your persistent classes in the kodo.PersistentClasses
    configuration property, as suggested by the documentation for
    MetadataValueIndicator?
    PS: It's 5:37pm on a Friday. I'm going home. You should too! :)
    When you decide to start work at 1pm, you tend to stick around a little
    later.

  • Using Single Datasource to Access Multiple Databases

    Hi,
    We would like to know the pros and cons of accessing multiple
    databases through a single datasource, versus accessing each
    database through its own datasource. Our environment includes
    multiple web servers w/ the latest version of ColdFusion MX 7,
    clustered through a load balancer. Each web server has 800+ dsns
    pointing to different SQL databases on the same SQL server. We have
    noticed that the ColdFusion administrator is taking a long time to
    display or verify all datasources and sometimes it even times out.
    Another problem is that sometimes the neo-query file gets corrupted
    (for unknown reasons) which results in the deletion of one, or
    more, or all datasources on the web server.
    Because of the issues above we are researching the
    possibility of removing most of the datasources, and then accessing
    each database through a single bridge datasource. In that regard we
    plan to change our queries by inserting the sql db name and user in
    front of each table in the query such as:
    <cfquery name="query" datasource="single_dsn_name">
    select * from [#dbname#].dbo.tableName
    </cfquery>
    In the example above, obviously #dbname# would be a variable
    that will hold the name of the requested database. The code above
    would similarly apply to queries using, update, insert and join
    words.
    Are there any limitations or negatives from scalability,
    performance, and reliability perspective in implementing the above
    scenario versus having one datasource for each database.
    Also, if there is a better way of accomplishing this, we
    would love to hear about it.

    Here is my opinion, because I work with both schemas. The
    main advantage to use one datasource for all DBs in a SQL Server is
    the simplicity of administration.
    But the main disadvantage is security, because you are using
    a single user to access all DB in a server, you don't have
    isolation, and a user that knows your schema can access data of
    other DBs that he sould not be authorized.
    Another issue is is a user must access 2 differents DB with
    different permissions (a DB only read and the other read/write),
    you'll have to create another datasource, user, etc for it.
    But the decision depends in the enviroment. If you are a
    hosting company, I would use 1 datasource for user or DB. If the
    servers and DBs are of the same company, I could use one datasource
    for each SQL server.
    Best regards

  • How to access multiple database present in single instance

    Hi Team,
    In oracle 11.2, can there be multiple databases in an instance???  In one of our environment, I could see multiple databases in an instance. Could you please help me in giving the data dictionary or query to access those databases?
    Actually, querying v$database, I could see only one database which is same as instance name. But in inventory, there are multiple database in an instance?
    I am still not exactly clear about this. Can someone help me with this?
    Thanks!
    Vidhya

    In Oracle one instance manages one (1) database. A database consists of multiple *schemas*.
    Other vendors erroneously call a schema 'database'.
    So, no, you didn't see multiple databases.
    There is also one datadictionary, consisting of a set of views.
    All views beginning with dba_  list the entire database, all schemas.
    All views beginning with all_ list the objects you have access to.
    All views beginning with user_ list your own objects.
    The view DICT show you the contents of the datadictionary.
    Oracle also has online documentation at http://docs.oracle.com
    From your question it is clear you should read the document called the 'Oracle Concepts Manual'.
    You can find all documentation for 11gR2 here Oracle Database Online Documentation 11g Release 2 (11.2)
    Too many people here don't make any effort to read it. This is probably the reason why you got no response.
    Sybrand Bakker
    Senior Oracle DBA

  • 1 user license access multiple database

    Hi all...
    I have a question :
    In SAP B1 8.8, can 1 user license (for 1 physical user) access multiple databases?
    Multiple database is created for Head Office and Branches.
    Since Finance Accounting Manager is centralized at Head Office, so the Manager must have access to multiple databases.
    Can only 1 user license applied to this Finance Accounting Manager?
    Regards,

    Hi Ingrid,
    Finance/Logistic/CRM Limited will perform as professional user license in the multiple db accessing in one server except  the functionality authorization. You must make sure that all the users that use the Finance/Logistic/CRM Limited license have the same user code in the dbs
    JimM
    <ultra - said it once>

  • I have multiple computers set up on homesharing under one itunes account. Can I use face time on all of them or do i need seperate accounts for each?

    I have multiple computers set up on homesharing under one itunes account. Can I use face time on all of them or do i need seperate accounts for each?

    I'd suggest you consider a cloud-based file sharing service such as Dropbox for this sort of use. iOS is not designed to be synched with more than one iTunes library at a time, so attempting to use it as you describe, connecting a single iPad to multiple computers, almost certainly won't work as you intend and is likely to cause nothing but headaches.
    Regads.

  • How to create linked server to multiple database on same server?

    Hi Experts
    I want to create linked server to multiple databases on the same server.
    I have 2 database servers (ServerA and ServerB) and want to create linked server on ServerB to link multiple databases on ServerA).
    I have admin right on ServerB.
    I don't have admin right on ServerA but have different accounts to access on each databases on ServerA.
    After I created one linked server object to a database, I cannot create another linked server object for another database as it has already used the server name which is ServerA.
    Please advise.
    Thanks.

    EXEC sp_addlinkedserver 'ServerADB1', '', 'SQLNCLI', 'ServerA', @catalog = 'DB1'
    EXEC sp_addlinkedserver 'ServerADB2', '', 'SQLNCLI', 'ServerA', @catalog = 'DB2'
    etc.
    Please look up the details for sp_addlinkedserver as I typed this from memory.
    I can certainly see a point in having one linked server per database, as then you don't have to hardcode the database name in the queries, and the linked-server definitions can be changed if the database name changes.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Multiple databases on same server

    we're planning to consolidate our SAP R/3 databases on a 64bit based cluster running Windows 2003/SQL Server 2005.
    the "SAP with Microsoft SQL Server 2005: Best Practices for High Availability, Maximum Performance, and Scalability" document states "SAP products support multiple instances of SQL Server 2005 on the same server. However, running the database of the SAP production system together with other application databases on one server is not recommended." and "An alternative is to run two or three SAP databases on one SQL Server 2005 instance.".
    giving this, I'd like to know if it's not recommended even if the 'other application databases' are related to other instances of SAP R/3 product.
    it would be useful to know why one SQL Server instance with multiple SAP databases is better than multiple SQL Server instances with one SAP database for each.
    thank you.

    Dear Matro,
    Please review the following thread:
    Multiple database instances on single server on SQL2005
    I also note that you state your database server is clustered using MSCS.  If this is the case you should not use a "Named Instance".  If you download the latest Netweaver 2004s Installation guide (SR1) for Windows SQL you will note that on page 172 it specifically states that you must install a "default instance". 
    If you plan to consolidate several SAP database systems on one host and use a default instance you need to consider the fact that all databases running on this instance will share resources such a memory cache etc.
    Factors such as the size of the SAP systems, whether the systems are OLTP will influence your decision
    Please post if you have any additional questions.
    Thanks
    N.P.C

  • Universe accessing multiple databases

    <p>Hi,</p><p>Here is the problem I am facing:</p><p>1. we have 20 databases. The structure of these databases is same, data is different. </p><p>2. we need to create an XI environment, where people can query on these databases using web intelligence.</p><p>How can I create 1 universe that can read from 20 different databases?</p><p>Thanks.</p>

    A stupid method:
    - Duplicate the universe 20 times and create 20 connections to 20 DB
    - one universe connect to one DB
    - In webi, u add query for the DB you want
    Â any better methods ?Â

  • TDE Wallets & Multiple Databases on same Host

    The Oracle TDE Best Practices (doc ID 130696) states this:
    Multiple databases on the same host
    If there are multiple Oracle Databases installed on the same server, they
    must access their own individual TDE wallet. Sharing the same wallet between independent instances is not supported
    and can potentially lead to the loss of encrypted data.
    If the databases share the same ORACLE_HOME, they also share the same
    sqlnet.ora file in $TNS_ADMIN . In order to access their individual wallet, the
    DIRECTORY entry for the ENCRYPTION_WALLET_LOCATION
    needs to point each database to its own wallet location:
    DIRECTORY= /etc/ORACLE/WALLETS/$ORACLE_UNQNAME
    The names of the subdirectories under /etc/ORACLE/WALLETS/ reflect
    the ORACLE_UNQNAME names of the individual databases.
    If the databases do not share the same ORACLE_HOME, they will also have their individual sqlnet.ora
    files that have to point to the individual subdirectories.
    What is the correct sqlnet.ora syntax to do this?  I currently have what is below but it doesn't seem to be correct:
    ENCRYPTION_WALLET_LOCATION =
      (SOURCE = (METHOD = FILE)
      (METHOD_DATA =
      (DIRECTORY = /local/oracle/admin/wallet/DB#1)
      (DIRECTORY = /local/oracle/admin/wallet/DB#2)

    Hi,
    You can check this :Setting ENCRYPTION_WALLET_LOCATION For Wallets Of Multiple Instances Sharing The Same Oracle Home (Doc ID 1504783.1)
    i haven't done this for multiple database, but as per Doc you can use the syntex like
    ENCRYPTION_WALLET_LOCATION =
      (SOURCE = (METHOD = FILE)
      (METHOD_DATA =
      (DIRECTORY = /local/oracle/admin/wallet/$ORACLE_UNQNAME)
    Whenever you set the Environmnet with
    export $ORACLE_UNQNAME=DB#1 
    it will choose the file from respective directory like  /local/oracle/admin/wallet/DB#1
    HTH

  • Ref: Multiple databases on same ASM Instance

    I am having an existing two Node RAC using ASM FIle System. I want to add one more database to the existing RAC using the same ASM diskgroup. We can create multiple databases using the same ASM instance?

    You need one ASM instance per server. You can have multiple instances resp databases running on that server accessing the same diskgroup made available on the server by the ASM instance.
    Kind regards
    Uwe Hesse
    http://uhesse.wordpress.com

  • Generic Reports accessing Multiple Database Servers

    <p>Hi,</p><p>I have a report which is accessing a table present within SQL Server. This is done by creating a system DSN which points to SQL Server at report design time through the database expert from the Crystal Reports Developer. The same table is also present in another database server ie ORACLE. The requirement is that I should be able to execute the report against ORACLE database at runtime. I have seen a lot of examples to do this using ODBC and OLEDB ie changing datasources at runtime but all of these have to specify the database username and password at runtime. </p><p>Is there any way for me to achieve this without passing the username and password at runtime? If so it would be great if i could get all possible approaches to achieve this. </p><p>Thanks in advance</p><p>Joseph Samuel</p><p>&#160;</p>

    I am doing the samething.
    I found that if the report is created under OS Auth mode of Oracle, then it is OK in integrated security mode in runtime, you don't need to set any logon information in runtime, but sure, please follow the OS Auth requirement of Oracle.
    But if the report is created using stand security mode and wish it to be run under integrated security mode in runtime, then a logon error would occurs, but if the crystal report view control set to enable the database logon promot, then we can still enter something in username textbox and check the "use integrated security" checkbox, then the report is still OK.
    I wish to have the database logon prompt disable and override the logon information in program in runtime and let the report shown without any problem, but up to now, i still have no any idea.  I will come back after I got any solution for this.

  • ADF app, single deployment - possible to access multiple databases?

    Hi,
    I am writing an ADF app that I'd like to connect to multiple different databases. In other words the app will be deployed once on a Weblogic server and will use a parameter to connect to the appropriate database for each user session. Ideally there will be no hard coded connection details embedded within the app before it is deployed, the different potential connections should be able to be administered on the app server.
    I have been looking at Dynamic JDBC Credentials and understand it is used to connect to different database users - can it also be used to connect to different databases?
    Alternately, is there a way to switch between different JDBC Datasources at runtime?
    ADF/Jdeveloper 11.1.1.3, WLS 10.3.3.
    Cheers,
    Kevin.

    Here is my opinion, because I work with both schemas. The
    main advantage to use one datasource for all DBs in a SQL Server is
    the simplicity of administration.
    But the main disadvantage is security, because you are using
    a single user to access all DB in a server, you don't have
    isolation, and a user that knows your schema can access data of
    other DBs that he sould not be authorized.
    Another issue is is a user must access 2 differents DB with
    different permissions (a DB only read and the other read/write),
    you'll have to create another datasource, user, etc for it.
    But the decision depends in the enviroment. If you are a
    hosting company, I would use 1 datasource for user or DB. If the
    servers and DBs are of the same company, I could use one datasource
    for each SQL server.
    Best regards

  • Using Java within a stored proc to access multiple database connections

    Hi List;
    We have an environment where we have needs to provide cross database visibility between Oracle, Sql Server and PostgreSQL. So we need the capability for Oracle to query PostgreSQL and Sql Server tables, PostgreSQL must be able to query Oracle and Sql Server tables and Sql Server must be able to query Oracle and PostgreSQL tables.
    I'm thinking that we can implement stored procs which are either written in java or call a java process . The java code in turn should be able to connect to any DBMS desired via JDBC query the tables in question and return the result set to the calling database.
    Any thoughts on how feasable this is would be appreciated. Does this seem like a solid solution? Any initial concerns or red flags? what about performance via JDBC?
    Thanks in advance for your help.

    John,
    from your description I understand that you essentially program the VO yourself. So I suggest that you read chapter 35.9 of the 'Fusion Developer’s Guide for Oracle Application Development Framework' (I guess you know where to find it). Since you still call the actual SQL not all of the chapter apply, but you get the idea how it works.
    And yes you analyzed the behavior correct. executeQueryForCollection() is allways called bevore getQueryHitCount().
    Timo

  • Multiple databases on same server installation

    Hi,
    We will have multiple RAC databases installed on the same pair of servers. The idea is to have them as independent as possible meaning when one fails it won't trigger others to failover. Want to understand from the experienced DBA here what should be separated.
    A list of items I can think about is,
    Different Oracle binary;
    Different Oracle home;
    Different disk group for data;
    What about
    their virtual ip, scan ip;
    voting disk and ocr disk
    etc
    Thanks

    rac100g wrote:
    T
    To have two databases running on one pair of RAC nodes is for two completely unrelated application in my context and it's not for redundancy purpose if I confused you. You can say to group them together is for saving money.And you can also save oxygen by holding your breath for 60 seconds every 300 seconds. ;-)
    It does NOT make sense to me to run 2 RAC instances on a single RAC node ito performance and scalability.
    I would rather create a single Grid (e.g. 10 nodes). Create multiple policy based RAC databases (e.g. 3 databases). Create 3 server groups (e.g. group 1 with 5 nodes, group 2 with 3 nodes and group 3 with 2 nodes). Then assign a single database to a server group.
    Should database 3 need more than 2 nodes, server group 1 (and database 1) can be reduced to 4 nodes and group 3 increased to 3 nodes.
    Etc.
    The list I provided earlier is the area I think I can reserve extra IP, creating extra set of disks to avoid them crash same time.Grid and RAC are redundant. Understand how that works and correctly implement it (e.g. h/w redundancy in storage system, redundancy in fabric and interconnect switching layers, redundancy in cabling, etc).
    It does not make sense to try and implement your own idea of redundancy by adding multiple Oracle Homes and so on.

Maybe you are looking for

  • I am trying to install Creative Cloud app for Desktop and it's shutting down

    Trying to install the  Creative Cloud app for Desktop but every time I try the Adobe Application Manager shuts itself every time.  I have OS X Yosemite 10.10.1 If it is automatically installed, where do I find it? I don't think it has installed becau

  • Discounts on Terms of payment

    Hello all I configured a Term of payment in order to the system gives discounts if the invoice is paid in the following 15 days. Everything is running ok, but, does anyone know if I can configure the system for the automatic generation of a credit no

  • How do I install Mountain Lion on a Macbook after it was deleted and it is registered under an unknown Apple ID?

    Supposedly the person has to delete it from their Apple ID. Is this true? It is mine and was installed by a teacher under their Apple ID and now is not back until mid September! Thanks for your help!

  • Projecting Video from iPad via TV

    Hi,     I purchased an Apple adapter that allows me to connect my iPad to my HDMI televison.  When I connect it, I can see the iPad screen and all the icons for my Apps.  When I launch my TruTV app, I can see the app banner, but when I go to view the

  • Installing CTIOS client 7.2 on Vista

    I do not know if this is the correct place to post this question...If not I apologize and please direct me to the correct discussion board. I'm aware of updates and compatible versions however my company does not  want to upgrade. I had to reformat m