Outer join query for SQL server from Oracle

Hi All,
My question is regarding making queries from Oracle to SQL Server database thorugh DBLink.
In my oracle database I have a DBLink emp.world for SQL Server database.
I need to query SQL Server data from oracle (so that this query can be combined with other oracle tables).
Query is given below:
SELECT
        a."EmpID" as "Employee ID",
        a."EmpStatus" "Employee Status"
        b."EmpSub" as "Employee Subjects"
FROM
        [email protected] a
        left outer join [email protected] b on a."EmpID" = b."suEmpID"
ORDER BY  a."EmpID";My problem is when I run the same query from oracle, it does not show the EmpID that does not exist in Subjects table, but when run from actual SQL Server database, it shows all the records.
Samples are given below:
Run from Oracle
Employee ID      Employee Status     Employee Subjects
101                     Active                     Maths
102                     Active                     Maths
102                     Active                     Physics
104                   Inactive                  Chemistry
Run form SQL Server
Employee ID      Employee Status     Employee Subjects
101                     Active                     Maths
102                     Active                     Maths
102                     Active                     Physics
103                 Active                       NULL
104             Inactive            ChemistryI am not sure why in oracle outer join for SQL server tables is not working. What is the right way for outer join in this case.
I am using oracle database 10gR2 and SQL Server 2005.
Please Help.
Thanks.

SELECT
a."EmpID" as "Employee ID",
a."EmpStatus" "Employee Status"
b."EmpSub" as "Employee Subjects"
FROM
[email protected] a
left outer join [email protected] b on a."EmpID" = b."suEmpID"
ORDER BY a."EmpID";
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm#sthref3175
From your description, it appears you may need a right outer join. You want to get back all the rows from 'B', not from 'A'. Try a right join and let us know.

Similar Messages

  • Query in sql server  from Oracle  9.2

    Hi
    How can I to connect and execute query from Oracle without to use others products ( DG4MSQL ....etc) ?
    using 9.2.08

    mkirtley wrote:
    Hi,
    I say it is 'free' because Dg4ODBC is included in your RDBMS license and you just need to supply a third party ODBC driver.
    See this note -
    Gateway and Generic Connectivity Licensing Considerations (Doc ID 232482.1)
    You need to install and configure it in an ORACLE_HOME on a machine somewhere then you can use database links from to connect to it and select from non-Oracle databases.
    Have a look at these notes depending on the platfrom you plan to use -
    How to Setup DG4ODBC on Linux x86 32bit (Doc ID 466228.1)
    How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install (Doc ID 561033.1)
    How to Setup DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit (Doc ID 466225.1)
    How to Setup DG4ODBC (Oracle Database Gateway for ODBC) on 64bit Windows Operating Systems (Doc ID 1266572.1)
    As I said in my earlier update if SQL*Server is your non-Oracle database then an standalone install on Windows is the best option to be able to use the Microsoft ODBC driver, although there is now a MS ODBC available on Linux x86-64 bit.
    Please read through the notes I have referred to because they should have the information you need.
    Regards,
    MikeThank you for informations, I search, because My client is 9.2.08, but I am a DBA and do not have access to UNIX server where is Database

  • How to connect to a Sql server from Oracle using db link

    Hi All,
    Does anybody have any idea about how to connect to a sql server from oracle database using db link to syncronize the data? I need to pull the data from Sql server table to Oracle tables and relay messages back to the sql server.
    Thank you,
    Praveen.

    we have 2 products - DG4MSQL and DG4ODBC.
    DG4ODBC is for free and requires a 3rd party ODBC driver and it can connect to any 3rd party database as long as you use a suitable ODBC driver
    DG4MSQL is more powerfull as it is designed for MS SQL Server databases and it supports many functions it can directly map to SQL Server equivalents - it can also call remote procedures or participtae in distributed transactions. Please be aware DG4MSQL requires a license - it is not for free.
    Check out Metalink and you'll find notes how to configure both products.
    For a generic overview:
    Note.233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases
    And the setup notes:
    DG4ODBC
    Note.561033.1 How to Setup DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX) :
    Note.466225.1 How to Setup DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit RDBMS.HS-3-2 :
    Note.109730.1 How to setup generic connectivity (HSODBC) for 32 bit Windows (Windows NT, Windows 2000, Windows XP, Windows 2003) V817:
    Note.466228.1 How to Setup DG4ODBC on Linux x86 32bit
    DG4MSQL
    Note.466267.1 How to Setup DG4MSQL (Database Gateway for MS SQL Server) on Windows 32bit
    Note.562509.1 How to Setup DG4MSQL (Oracle Database Gateway for MS SQL Server) 64bit Unix OS (Linux, Solaris, AIX,HP-UX)
    Note.437374.1 How to Setup DG4MSQL (Oracle Database Gateway for MS SQL Server) Release 11 on Linux

  • Different output of same query in SQL Server and Oracle

    I have two tables table1 and table2
    --table1 has two columns c1 int and c2 varchar. there are not constraints added in it. it has data as given below
    c1     c2
    6     d
    5     j
    102     g
    4     g
    103     f
    3     h
    501     j
    1     g
    601     n
    2     m
    --table2 has only one column c1 int. there are not constraints added in it. it has data as given below
    c1
    6
    1
    4
    3
    2
    now when i run below given query in sql server and oracle it gives me different result
    select *
    from table1
         inner join (SELECT ROW_NUMBER() OVER (order by c1 ASC) AS c1 from table2) table2 on table2.c1=table1.c1
    sql server output
    c1     c2     c1
    1     g     1
    2     m     2
    3     h     3
    4     g     4
    5     j     5
    oracle output
    C1 C2 C1
    5 j 5
    4 g 4
    3 h 3
    1 g 1
    2 m 2
    If you notice the first column in both output. It is sorted in sql server and not in oracle.
    Why it is behaving differently in oracle? Is there any way I can solve this in oracle?
    Thanks,
    Jigs

    It is NOT behaving "differently" in Oracle; you just haven't specified an order that you expect your results to be in, so you're going to get output in whatever order the database fancies displaying it (ie. no guarenteed order). This is an artifact of how the database chooses to put together the data, and different databases (or even datasets within the same database) can and most likely will behave differently.
    Even SQL Server won't guarentee to always get your data in an ordered fashion if you exclude the order by clause, even if you think it has always output the data in an ordered fashion.
    Your solution is to add an order by clause, in BOTH databases, to force the order of the output data.

  • Regarding the tns-12541 error in connecting to sql server from oracle

    i need to create a database link from oracle on windows box to sql server.I configured everything but when i am trying to tnsping the sqlserver
    it throws me an TNS12541 no listener error.
    The listner status is up and the listener works

    little confusion here, are you trying to tnsping sql server? tnsping is an Oracle utulity.
    To acces sql server from Oracle you may use Transparent Gateway for Microsoft SQL - http://download.oracle.com/docs/cd/B19306_01/gateways.102/b14270/ch3.htm#sthref66 and Heterogeneous Connectivity - http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/intro.htm#sthref33
    Best regards.

  • Why can't i use "INNER JOIN" in a query for SQL Server with JDBC??????

    Hi,
    I'm trying to execute some SQL queries and I just don't understand what's wrong.
    I�m using Tomcat and SQL Server in order to do this, but when I�m try to execute a query with a INNER JOIN statements Tomcat raise a SQL exception... at the very first time I thought there was a problem with database connection but I realize that a simple query to a table works pretty well. then I found out some problems with JDBC:ODBC.... so I install JDBC for SQL Server 2000 and test with the same simple query and works..... so, I come to a conclusion.... INNER JOIN or JOIN statements can't be used in JDBC..... please... somebody tell I�m wrong and give me a hand...
    I'm using TOMCAT 4 and JDK 1.4 SQL Server 2000
    Error occurs when executeQuery() is called.... not prepareStatement().... ??????
    Driver DriverRecResult = (Driver)Class.forName(driver).newInstance();
    Connection ConnRecResult = DriverManager.getConnection(DSN,user,password);
    PreparedStatement StatementRecResult = ConnRecResult.prepareStatement(query);
    ResultSet RecResult = StatementRecResult.executeQuery(); <---- Exception raise here
    So much tahnks in advance,

    That's exactly what I think, driver it's raising the exception, but I don't know why.... i test the same query with INNER JOIN directly from SQL Query Analyser and it's works perfectly, my problem ain't SQL, but JSP and JDBC 'cause i'm a newbie about these issues.
    Common sense tell me possible problems lie in SQLServer drivers 'cause i run the same pages on JRUN through jdbc:odbc and do works well, but by now i just depend on Tomcat.....
    I've installed SQL Server drivers for JDBC but i just find it doesn't work fully... could be the version of JDK i've installed? what version do i need?
    ( I'm running Tomcat 4 with JDK 1.4 & SQL Server 2000 W2K )
    thanks for reply.

  • Accessing SQL Server from Oracle

    I found an article:
    http:www.databasejournal.com/features/oracle/article.php/3442661
    It shows how to setup a connection from Oracle to SQL Server.
    I am new to Oracle Using SQL Loader and PL/SQL.
    I would like to use the SQL Loader in Oracle to load a table in SQL Server. It is my understanding that a ctl file is used and is called by an Oracle application.
    I would not have an Oracle application. I would like to use the ctl file to load the SQL Server table. Can someone point me on how to use the ctl file for SQL Server?
    Also, in PL/SQL would there be a connection string to connect to SQL Server when accessing a table.
    Is there a book or some documentation that would address the above?
    Thanks in Advance.

    that article shows you how to access SQL Server database through Oracle, therefore you have no need to use SQL Loader to load data from SQL Server bcos it can be queried directly by using simple select statement.
    If you want to load the data into Oracle just use CREATE TABLE ... AS SELECT ...
    in PL/SQL, what you need is the database link.
    Cheers,
    NH

  • Connect to SQL Server from Oracle

    Does Oracle offer any connectivity to NON-Oracle databases such as SQL Server from within the Oracle database itself, similar to a database link ?

    Yes, it's called Heterogeneous Connectivity. Basically how it works is you set up an ODBC data source on the Oracle server
    and need to modify the tnsnames.ora and listener.ora files. Once you get it set up it works exactly like a dblink. You should be
    able to find information on it in the Oracle manuals or from Metalink. There's also a Heterogenous Connectivity forum on OTN. If
    you can't find anything let me know and I can send you some documents on how to set it up. I think the hardest part for you might
    be finding a SQL Server ODBC driver for HP-UX.

  • Database independant ETL in ODI for SQL Server and Oracle

    Hi,
    We have a requirement to create ETL which can be run for both SQL Server and Oracle.
    We have some tables to be filled from operational database to data warehouse using business requirement.Our goal is to create code which should be database independant.
    We will provide all DB details at the start of execution and it will code for as per provided details.
    The same can be achieved by Talend.
    I wanted to know if same can be achieved in ODI.
    Any pointers regarding this would be helpful.
    Thanks,
    Mahesh

    A quick trick: Provide one more value at the start of execution. It is something like a flag. For example db_flag. It can be either 'O' or 'S'.
    Open both  oracle and sql server KM. Copy one of the KM code to other KM and put an if condition to check the flag.
    if (#DB_FLAG.equalsTo("O")){
    Oracle code goes here...........
    }else{
    SQL Server code goes here...........
    Its a pure KM customization.
    Bhabani
    http://dwteam.in

  • Accessing SQL Server from ORACLE using Transparent Gateway

    So I had downloaded the gateway installer and was following the guide here to set up the Transparent Gateway for SQL Server: http://www.orafusion.com/art_orahs.htm
    After I had created the database link, I was prompted the following error when trying to do a simple select statement from the SQL Server DB:
    >
    ORA-12154: TNS:could not resolve service name
    12154. 00000 - "TNS:could not resolve the connect identifier specified"
    *Cause:    A connection to a database or other service was requested using
    a connect identifier, and the connect identifier specified could not
    be resolved into a connect descriptor using one of the naming methods
    configured. For example, if the type of connect identifier used was a
    net service name then the net service name could not be found in a
    naming method repository, or the repository could not be
    located or reached.
    *Action:  
    - If you are using local naming (TNSNAMES.ORA file):
    - Make sure that "TNSNAMES" is listed as one of the values of the
    NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
    (SQLNET.ORA)
    - Verify that a TNSNAMES.ORA file exists and is in the proper
    directory and is accessible.
    - Check that the net service name used as the connect identifier
    exists in the TNSNAMES.ORA file.
    - Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
    file. Look for unmatched parentheses or stray characters. Errors
    in a TNSNAMES.ORA file may make it unusable.
    - If you are using directory naming:
    - Verify that "LDAP" is listed as one of the values of the
    NAMES.DIRETORY_PATH parameter in the Oracle Net profile
    (SQLNET.ORA).
    - Verify that the LDAP directory server is up and that it is
    accessible.
    - Verify that the net service name or database name used as the
    connect identifier is configured in the directory.
    - Verify that the default context being used is correct by
    specifying a fully qualified net service name or a full LDAP DN
    as the connect identifier
    - If you are using easy connect naming:
    - Verify that "EZCONNECT" is listed as one of the values of the
    NAMES.DIRETORY_PATH parameter in the Oracle Net profile
    (SQLNET.ORA).
    - Make sure the host, port and service name specified
    are correct.
    - Try enclosing the connect identifier in quote marks.
    Error at Line: 3 Column: 27
    >
    Here are my configuration files:
    initMSQL.ora
    >
    HS_FDS_CONNECT_INFO=webdatasvr:1433.InfoWeb
    HS_FDS_TRACE_LEVEL=OFF
    HS_FDS_RECOVERY_ACCOUNT=RECOVER
    HS_FDS_RECOVERY_PWD=RECOVER
    >
    listener.ora
    >
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC=
    (GLOBAL_DBNAME=UGCMAC)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (SID_NAME=UGCMAC)
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    (SID_DESC =
    (SID_NAME = MSQL)
    (ORACLE_HOME = C:\oracle\product\11.2.0\tg_1)
    (PROGRAM = dg4msql)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (ADDRESS LIST=
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1524))
    >
    tnsname.ora
    >
    UGCMAC =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = UGCMAC)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    MSQL=
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1524))
    (CONNECT_DATA =
    (SID = MSQL)
    (HS=OK)
    >
    Can anyone assist me? thanks!

    Hi kgronau,
    >
    After changing a listener.ora file you need to STOP and START the listener to get the changes loaded. It looks like your listener is not serving the 1524 port which could be related to the fact that you didn't stop/start the listener after you've edited the listener.ora file.
    ... But as stated earlier - please do not use a 10.2 listener to start an 11g gateway. Instead configure the listener of the gateway home.
    >
    I did restart my listener under services.msc whenever I make the changes but there are no effect. Please also note that I can only find "OracleOraDb10g_home1TNSListener" under my services.msc. There is no 11.2 Listener. I did install the gateway and the installation was successful as far as I can tell. But perhaps because there's no 11.2 Listerner under my services.msc, could that mean it was a bad installation?
    >
    Next point is the tnsping you've used is 11.2. You need to make sure that you use the tnsping of the Oracle Database home as the database initiates the gateway connection so the database home tnsnames,ora needs the tns entry for the gateway.
    >
    My current PATH environment variables setting is as follow: C:\oracle\product\11.2.0\tg_1\bin;C:\oracle\product\10.2.0\db_1\bin; So perhaps, I just need to ensure the 10.2 ORACE home is the first?
    >
    As a final tip: There are so many web sites explaining how to configure DG4ODBC - many of them are faulty. If you need a reliable configuration, please have a look at "My Oracle Support" => How to Configure DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit to Connect to Non-Oracle Databases Post Install     [Document 466225.1]     )
    >
    Is there a link?
    Edited by: omnri on 21-Jul-2011 23:59

  • Connect SQL Server From Oracle

    Hi Experts,
    I want's to made connection from Oracle 10g to Ms SQL Server 2000. I made necessary entries in receptive file, but still getting an error...
    Setting info .....
    */hs/initMYSQLSERVERDSN.ora*
    HS_FDS_CONNECT_INFO = MYSQLSERVERDSN
    HS_FDS_TRACE_LEVEL = OFF
    LISTENER.ORA
    LISTENERMYSQLSERVERDSN =
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))
    (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)(queuesize=80)))
    SID_LIST_LISTENERMYSQLSERVERDSN=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=MYSQLSERVERDSN)
    (ORACLE_HOME = E:\oracle\product\10.1.0\db_1)
    (PROGRAM=hsodbc)
    TNSNAME.ORA
    MYSQLSERVERDSN =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))
    (CONNECT_DATA=(SID=MYSQLSERVERDSN))
    (HS=OK)
    LISTENER start successfully, and tnsping working fine.
    But after createing db link , when i execute query desc spt_datatype_info@mysqlserverdsn;
    I am geting an error message in listenermysqlserverdsn.log file
    TNS-12518: TNS:listener could not hand off client connection
    TNS-12560: TNS:protocol adapter error
    Please help me out from this issue.
    Thanks in Advance
    Mani

    You OS ?
    I have also done the same.
    I did install SQL Server & Oracle on another machine with Windows.
    For more pls visit.
    http://www.dba-oracle.com/t_heterogeneous_database_connections_sql_server.htm
    Aqeel Nawaz

  • Linking to SQL Server from Oracle 10g on 64bit Linux

    I have this working, so I thought I would post my steps.
    In versions 8 to 10 of Oracle, the software for making these connections was known as Heterogeneous Services. It was 32bit only software and the actual binary file that was executed when querying a non oracle database was $ORACLE_HOME/bin/hsodbc. When a query was made to the linked database, a process was started on the machine with the name of hsodbcXXX (where XXX is the name of the DSN).
    In version 11g of Oracle this software is now referred to as Database Gateways and there is a 64bit version as well as a 32bit version. The binary file that is executed in this case is $ORACLE_HOME/bin/dg4odbc.
    Fortunately the 64bit Database Gateway software can also be used with Oracle 10g databases as long as it is up to version 10.2.03 and has the odbc compatibility patch installed. (5965763).
    To make use of this, we need to install the 11g ODBC Gateway into a separate ORACLE_HOME and start a listener from that environment. We can then make use of that listener from the 10g environment.
    So here is what I did to get this working: (Note: DSN = MyDSN)
    1.     Download and install 64bit ODBC driver with support for 64-bit ULEN from Easysoft. The file is named odbc-sqlserver-1.1.4-linux-x86-64-ul64.tar. You'll need to email Easysoft support for the URL. Create the DSN entry as part of the install. At the end of the process it can test the DSN. The query should come back with info about the SQL Server. Test the connection using isql from the /opt/easysoft/unixODBC/bin directory to verify that it works as well (/opt/easysoft/unixODBC/bin/isql –v MyDSN). Note, I installed easysoft driver under /opt rather than the /usr/local which is the default. /usr/local/easysoft is a symlink to /opt/easysoft.
    2.     Install ODBC gateway via the 11g Gateways installer. You can do a custom install and deselect all but the ODBC Gateway component. (http://download.oracle.com/otn/linux/oracle11g/linux.x64_11gR1_gateways.zip)
    3.     Create a /home/oracle/11g_environment.sh script that sets 11g ORACLE_HOME, PATH, and LD_LIBRARY_PATH variables. It should look something like this:
    #set ORACLE ENV vars for 11g
    ORACLE_HOME=/u01/app/oracle/product/11.1.0/tg_1 # (assuming that is where ODBC Gateway was installed)
    PATH=/bin:/usr/bin:/u01/app/oracle/product/11.1.0/tg_1/bin:/opt/easysoft/bin:/opt/easysoft/unixODBC/bin
    LD_LIBRARY_PATH=/opt/easysoft/lib:/opt/easysoft/unixODBC/lib:/u01/app/oracle/product/11.1.0/tg_1/lib
    export ORACLE_HOME
    export PATH
    export LD_LIBRARY_PATH
    4.     Create $ORACLE_HOME/hs/admin/initMyDSN.ora, $ORACLE_HOME/network/admin/listener.ora, and $ORACLE_HOME/network/admin/tnsnames.ora under 11g structure. They are as follows:
    initMyDSN.ora:
    # This is a sample agent init file that contains the HS parameters that are
    # needed for an ODBC Agent.
    # HS init parameters
    HS_FDS_CONNECT_INFO=MyDSN
    HS_FDS_TRACE_LEVEL=0
    HS_FDS_TRACE_FILE_NAME=MyDSN.trc
    HS_FDS_SHAREABLE_NAME=/opt/easysoft/unixODBC/lib/libodbc.so
    HS_FDS_SUPPORT_STATISTICS=FALSE
    # ODBC specific environment variables
    #set ODBCINI=/etc/odbc.ini
    #set ODBCINSTINI=/etc/odbcinst.ini
    #set LD_LIBRARY_PATH=/opt/easysoft/lib:/opt/easysoft/unixODBC/lib:/u01/app/oracle/product/11.1.0/lib
    #set PATH=$PATH:/opt/easysoft/unixODBC/bin:/opt/easysoft/bin/
    # Environment variables required for the non-Oracle system
    #set <envvar>=<value>
    listener.ora
    MyDSN =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
    SID_LIST_MyDSN =
    (SID_LIST =
    (SID_DESC=
    (SID_NAME=MyDSN)
    (ORACLE_HOME = /u01/app/oracle/product/11.1.0/tg_1)
    (PROGRAM=dg4odbc)
    (ENVS=LD_LIBRARY_PATH=/opt/easysoft/lib:/opt/easysoft/unixODBC/lib:/u01/app/oracle/product/11.1.0/tg_1/lib)
    tnsnames.ora
    # tnsnames.ora Network Configuration File:
    # Generated by Oracle configuration tools.
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    MyDSN =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST=localhost)(PORT=1522))
    (CONNECT_DATA=(SID=MyDSN))
    (HS=OK)
    5.     Add another entry for MyDSN in /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora so tnsping works in 10g environment as well.
    MyDSN =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST=localhost)(PORT=1522))
    (CONNECT_DATA=(SID=MyDSN))
    (HS=OK)
    *** Notice that the MyDSN listener runs on a different port (1522) as it is a separate listener.
    6.     Login to machine as user oracle and source the 11g environment script. “source ~/11g_environment.sh”. Now start the listener. “cd $ORACLE_HOME/bin”. “./lsnrctl start MyDSN”.
    7.     Login to a new shell as user oracle with a 10g environment.
    8.     Run sqlplus and create the database link. “CREATE PUBLIC DATABASE LINK SQLSERVER connect to “<someuser>” IDENTIFIED BY “<somepass>” USING ‘MyDSN’;”
    9.     test the link. “select * from information_schema.tables@SQLSERVER;”
    If it is successfull, you should see a system process named "dg4odbcMyDSN".

    So what have you found out for yourself so far (considering the solution to this is easily found on the web)?
    Have you looked up Heterogeneous Services?

  • Connect Sql Server From Oracle Both on Windows

    I want to connect my SQL Server running on Windows2003 with my oracle database 10g which is also on windows through some odbc which i have also created on my machine running oracle 10g. Can some one guide me with simple steps.

    Generally most folks use OLEDB rather than ODBC for that.
    If you have Metalink access, check out the following note:
    Note.191368.1 Ext/Pub How to Create a Sql Server Linked Server With The Oracle Provider for OLE DB:
    Hope it helps,
    Greg

  • Connecting ms sql server from oracle using db link

    Hi,
    Source : Oracle 11g on linux
    destination : ms sql server 2005
    i need to create the db link from oracle to ms sql server to view the tables , is it posibble without configuring the gateways( as looks like it is licenced product)
    Please let me know any alternative to achive this
    Thanks
    PGR

    There are 2 gateway - the commercial Database Gateway for Ms SQl Server which requires a license and the Database Gateway for ODBC which is for free. The license for DG4ODBC is included in your database license. You only need to install a suitable ODBC driver on your Linux box (for example use the MS SQl Server ODBC driver for Linux - details can be found here: http://www.microsoft.com/en-gb/download/details.aspx?id=36437 ). and then configure the gateway using the My Oracle Support Note:
    How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install  
    [Article ID 561033.1]
    - Klaus

  • Accesing SQL server from Oracle

    In Oracle and SQL Servers I'm Updating the data manually. But I want make it Automated Process(Updating required columns automatically) in SQL Server by using trigger during manual update in Oracle's table with respect to column .
    Is this possible?
    Im using Oracle 11g in linux and SQL Server 2005 in windows.
    Both Servers are in different locations , but are in same network and not connected with ODBC , dblink .
    I need your Valuable assitance and Helpful guide for succesfully completing my task.
    Useful Replies are Highly Appreciated.

    Hi,
    Yes, look up the product "Heterogeneous Services for ODBC" aka HSODBC.
    You'll need to create an ODBC connection from the Linux box to the SQLServer box though. You may need to get a driver from a 3rd party vendor as ODBC drivers usually come from the database vendor and I don't think SQLServer provides an ODBC driver that runs on Linux.
    I believe there are also gateway products you can purchase to accomplish the task as well.
    In either case you'll probably have better luck posting in the RDBMS forum, as this one specifically deals with Oracle's ODBC driver.
    Hope it helps,
    Greg

Maybe you are looking for