How to Create Public database link in oracle 9i?

Friends,
OS: RHEL AS 3
DB: 9iR2
database name 1 = nubul
database name 2 = test
in the 'nubul' database server using system user.
i created a database link to connect the 'test' database
sql> create public database link test using 'test';
database link created.
then i logged in as normal user....
sql> select count(*) from employee@test
Error at line 1:
ORA-12154: TNS: could not resolve service name
where i am making mistake?
i gave the linkname as my remote database name.
am i have to make any entry in the tnsnames.ora?
thanks & regards

You have to remember that when you access a dblink, the database where the link is defined is acting as a client to the database to which the link points ... exactly the same as if you you were using sqlplus on the machine hosting the db where the link is defined. In other words, given:
Host 'Host-src', with database 'db-src', with a dblink 'lk_target'
Host 'host-trgt', with database 'db-trgt'
When you connect to db-src and access lk-target, db-src is now acting as a client to db-trgt. Exactly as if you had opened sqlplus on host-src and connected directly to db-trgt. So, given the above scenario
host-src$> sqlplus scott/tiger@db-src
sql> select * from emp@lk_target;when you execute that SELECT to the link, the same tns considerations are in effect as if you had
host-src$> sqlplus scott/tiger@db-trgtThe same tnsnames.ora entry, on the source machine, is required for both.

Similar Messages

  • How to create a database link on an ms acces data source

    Hello every body
    Is it possible to create a database link on an MS access data source under
    oracle 10 g and Apex ?
    If yes how to do it ?
    Thanks in advace

    I don't know what Apex is!!! But try to follow these instructions.
    It works for Oracle 9i.
    As far as I know, you are supposed to have installed other than ORACLE Client to complete these instructions.
    1. Control Panel / Administrative Tools / Data Sources (ODBC)
    Folder: System DSN /
    click add
    Choose : Microsoft Access Driver
    Data Source Name : my_test
    Description : any_description_you_want
    click Database/Select... : full pathname for <your_file.mdb>
    click OK
    Click OK
    2. Goto OH\hs\admin:
    2.1) Create a copy of "inithsodbc.ora" file giving it this name:
    initmy_test.ora
    2.2) Edit "initmy_test.ora" and change as below.
    # HS init parameters
    HS_FDS_CONNECT_INFO = my_test
    HS_FDS_TRACE_LEVEL = OFF
    3. Add this entry to listener ( Don't forget to stop/start the listener )
    (SID_DESC =
    (SID_NAME = my_teste)
    (ORACLE_HOME = <Path to OH> ) ### Ex: D:\ORANT901
    (PROGRAM = hsolesql)
    4. Now you need to add entries to point to the HS in the tnsnames.ora :
    access =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=<your_host>)(PORT=1521))
    (CONNECT_DATA=(SID=my_test))
    (HS=my_test)
    5. Now you need to go into the database and create the database link:
    CREATE PUBLIC DATABASE LINK "ACCESS_DB" USING 'access';
    6. select * from your_table@ACCESS_DB;
    HTH
    RK
    Message was edited by:
    RKravcenko

  • How to create a database link between an 8i (apps) database and APEX

    Want to link my Oracle APPS databse on 8i with Oracle XE and APEX. Any idea how to achieve this ?

    I don't know what Apex is!!! But try to follow these instructions.
    It works for Oracle 9i.
    As far as I know, you are supposed to have installed other than ORACLE Client to complete these instructions.
    1. Control Panel / Administrative Tools / Data Sources (ODBC)
    Folder: System DSN /
    click add
    Choose : Microsoft Access Driver
    Data Source Name : my_test
    Description : any_description_you_want
    click Database/Select... : full pathname for <your_file.mdb>
    click OK
    Click OK
    2. Goto OH\hs\admin:
    2.1) Create a copy of "inithsodbc.ora" file giving it this name:
    initmy_test.ora
    2.2) Edit "initmy_test.ora" and change as below.
    # HS init parameters
    HS_FDS_CONNECT_INFO = my_test
    HS_FDS_TRACE_LEVEL = OFF
    3. Add this entry to listener ( Don't forget to stop/start the listener )
    (SID_DESC =
    (SID_NAME = my_teste)
    (ORACLE_HOME = <Path to OH> ) ### Ex: D:\ORANT901
    (PROGRAM = hsolesql)
    4. Now you need to add entries to point to the HS in the tnsnames.ora :
    access =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=<your_host>)(PORT=1521))
    (CONNECT_DATA=(SID=my_test))
    (HS=my_test)
    5. Now you need to go into the database and create the database link:
    CREATE PUBLIC DATABASE LINK "ACCESS_DB" USING 'access';
    6. select * from your_table@ACCESS_DB;
    HTH
    RK
    Message was edited by:
    RKravcenko

  • A question about CREATE PUBLIC DATABASE LINK and ORA-12154 error

    Dear all,
    I have a problem about public database link creation and I would appreciate if you could kindly give me a hand. I have the following connection parameters in my
    tnsnames.ora file:
    DGPAPROD.WORLD =
         (DESCRIPTION =
           (ADDRESS_LIST =
            (ADDRESS = (COMMUNITY=tcp.world)
              (PROTOCOL=TCP)(HOST=ORASR001)(PORT=1521)
           (CONNECT_DATA = (SID = DGPAPROD))
    ...Having the above mentioned parameters I can connect to this remote database directly in a SQL*Plus shell:
    $ sqlplus username/[email protected] works pretty well and the connection is established without any problem.
    Now, what I would like to do is to create a public database link to this remote database in order to avoid the user/connection switching for viewing the
    content of this database. I proceeded according to the syntax indicated in the Oracle online documentation:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5005.htm#SQLRF01205
    Therefore I run the following in order to create a public database link
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING 'DGPAPROD.WORLD';Apparently there is no error and the link is created successfully. However it cannot resolve the remote host and whenever I run the following query
    (myenterprise is the name of a table in that remote database)
    SELECT *
    FROM myenterprise@SR001_dblink
    ERROR at line 1:
    ORA-12154: TNS:could not resolve the connect identifier specifiedWhat causes this problem?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    spajdy wrote:
    You must have defined DGPAPROD.WORLD in tnsnames.oar on server where you DB is runnig.Hello there,
    Thanks a lot for this nice solution. In fact I had to add the connection parameters into the tnsnames.ora file of the server on which the link was created (not the tnsnames.ora of my oracle client stored on the localhost)
    After a bit googling I found another solution that allows to create the database link:
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING '(DESCRIPTION =  (ADDRESS_LIST =  (ADDRESS = (COMMUNITY=tcp.world)
    (PROTOCOL=TCP)(HOST=ip_adresse)(PORT=1521)))(CONNECT_DATA = (SID = GPAPROD)))';Thanks a lot for your help!
    Kind Regards,
    Dariyoosh
    Edited by: dariyoosh on 18 nov. 2009 07:15

  • To create a database link from oracle to sqlserver with NT authentication

    Hi ,
    I need to create a database link from oracle 9i to sql server database with windows authentication.I dont have the database username and password instead the access is given to my NT ID and password.So can anyone provide me the information about creating a dblink to sql server with windows authentication.
    Thanks

    Oracle is attempting to log in to SQL Server using NT authentication.
    The Oracle process, however, is running presumably with a local admin account (normal for a Windows service). SQL Server has no idea what this local account is, so it denies the login.
    You could change the Oracle service to run as a known user (presumably not as your Windows ID but some other Windows ID you create explicitly for Oracle) and then grant that Windows ID in SQL Server appropriate privileges. That would mean, though, that when you queried tables over the database link, you'd be using that new Windows ID's privileges on SQL Server, not your Windows ID's privileges.
    As I've said, though, this is a general architectural limitation for a multi-tier architecture. The end system (SQL Server) generally has no idea who the end user (your Windows ID) is when that user is coming through a middle tier (Oracle). So it cannot apply end-user permissions to connections created by the middle tier.
    Justin

  • Create a Database Link from Oracle to MYSQL on windows

    Hi
    I need to create a database link from oracle to mysql database on windows to fetch some records.Can anyone help me on this?

    Search for Transparent Gateways, Heterogeneous Services...
    The Oracle SQL Developer have drivers to Access, MySQL and SQL Server.

  • ORA-31600 when trying to view SQL DDL for a created public database link

    I created and committed a public database link and I can access the external database.
    When I try to view the DDL of the link, on the SQL tab, I'm getting following error:
    ORA-31600: invalid input value EMIT_SCHEMA for parameter NAME in function SET_TRANSFORM_PARAM
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 3900
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 4048
    ORA-06512: at "SYS.DBMS_METADATA", line 836
    ORA-06512: at line 1
    and
    ORA-31600: invalid input value LONGNAME for parameter NAME in function SET_FILTER
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 1980
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 3665
    ORA-06512: at "SYS.DBMS_METADATA", line 670
    ORA-06512: at "SYS.DBMS_METADATA", line 571
    ORA-06512: at "SYS.DBMS_METADATA", line 1221
    ORA-06512: at line 1
    Is this because of a bug in SqlDeveloper or because the db_link and host parameters have 33 characters?
    I'm using sql developer 1.5.3, build MAIN-5783
    tx,
    Roger Vermeir

    It's probably the length; really all sqldev does is calling:
    select DBMS_METADATA.get_ddl('DB_LINK',:NAME,:OWNER) FROM dual;So if you call it a bug, it's a database bug in the DBMS_METADATA package.
    But if you work with identifiers over 30 chars, I'd say that's a bug on it's own...
    FWIW, I can't reproduce this on our 10g DB; are you on 9i?
    Regards,
    K.

  • How to create a database link ?

    i want to create a database link.please give mesteps

    There is a chapter in the DBA Administration manual for versions 8.1, 9.2, and 10g on this topic which provide all the information you need.
    You will need to choose the type of database link: global, current user, or imbedded user and if you need a public or private link.
    Basically all you do is create a tnsnames.ora entry for the remote db and then create a database link (See SQL manual entry CREATE DATABASE LINK) that references the tnsnames.ora entry.
    The manuals or the entire manual set can be downloaded from technet.
    HTH -- Mark D Powell --

  • Create public Database link

    I have two computers at my training lab. Both have computer Oracle 9i install. Bith have service/tag cats.
    1.)
    Computer Name : 10227-mr-srv.abc.com
    Oracle service name : cats
    2.)
    Computer Name : 10227-ocrsrv.abc.com
    Oracle service name : cats
    Now from 1st oracle server, I want to connect to 2nd oracle server.
    May be using fixed user hr Password hr_1.
    Can you please give exact CREATE PUBILC DATABASE LINK statement for same.
    May have to use identifier as creating loop.

    You can check out the syntax and examples here

  • How to create & use database links

    i have 2 databases (oracle 8.1.6) and (oracle8.1.5)
    i want to call a function of one d/b from another
    i think this is possible via databse links.
    how do i go about creating and using them
    can someone guide me to a site or post an example .
    what all changes do i need to make in my configuration settings of the databases
    null

    Yes, you can do this with database links.
    Please see: http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a76960/ds_admin.htm#22393
    null

  • How to create a database link in someone else's schema?

    I have access to Sys, but I don't have the passwords to all personal accounts. generally if you have a create any privilege you just do
    create <object> <schema>.object_name ....
    if i try this with a database link, the link gets created in my schema with the first part as part of its name.
    so
    create database link <user>.<db link> does not put the link in the other schema.
    what do I do?

    I assume Sybrand's suggestion works, but it is common not to know the schema passwords (who wants to remember them anyway?).
    We use the time tested "db_su.sql" script:
    -- db_su.sql: connect as another user
    set term off
    store set sqlplus_env rep
    set pages 0 feed off ver off echo off term off
    DEF user=&1
    spo temp.sql
    conn / as sysdba
    select 'alter user &user identified by values '''||password||''';'
      from dba_users where username = UPPER('&user')
    spo off
    alter user &user identified by temp;
    connect &user/temp
    START temp.sql
    @sqlplus_env
    set term on:p

  • How to create same database structure in Oracle database as in SQLserver?

    Hi experts,
    I have created application in Oracle ADF which used SQL Server as a backend. In SQL server I have six databases. I am using that all six databases.
    I connected the same application with Oracle 11g. In oracle I created only one schema and created all the tables in that schema.
    There are around 2000 tables. I want to know is it better way to keep all the tables in one schema or should I create six different schema as sql server.
    Also please tell me if there is any other solution for situation like this.
    Thanks.

    Digambar, Ithink the answer might depend on how and why the tables were separated in SQL Server. Did you have six separate schemas or just have the tables spread out over six SQL Server databbase with DBO as the owner in all six? Does each SQL Server database represent a different group of objects that make up a different module/feature set of the application?
    If each SQL Server database represents a different portion/module of the application then the ability to identify the tables/objects in that module without having to refer to documentation might be useful so assigning the objects to different owners may be helpful. That is if the object naming standard in use does not provide an easy way to identify the portion of the application the objects belong to.
    HTH -- Mark D Powell --

  • How to create a database link to SQL Server from a RAC environment

    We have a 4 node RAC running 11.2.0.3 binaries on 64-bit linux.
    Grid owns the listener named listener.
    Oracle owns the database.

    Thanks all! But I tried to configure and I am getting
    TNS-01201: Listener cannot find executable /u01/app/oracle/product/11.2.0.3/dbhome_1/bin/InfoEdb10 for SID InfoEdb10
    Listener failed to start. See the error message(s) above...
    So! What I did was
    1. Configure the odbc from the OS (only one node) and create the DSN and its odbc files.  connectivity works from Operating Systems.
    2. Create the listener entry (under GRID) user.
    3. Create the remotedb.ora file under $ORACLE_HOME/hs/admin
    --- Here is listener.ora file
    LISTENER_NODE1_TG =
       (DESCRIPTION_LIST =
        (DESCRIPTION =
           (ADDRESS = (PROTOCOL = TCP)(HOST = devrac-a-01-vip.cssd.pitt.edu)(PORT = 1549)(IP = FIRST))
           (ADDRESS = (PROTOCOL = TCP)(HOST = devrac-a-01.cssd.pitt.edu)(PORT = 1549)(IP = FIRST))
    SID_LIST_LISTENER_NODE1_TG =
       (SID_LIST =
           (SID_DESC =
             (SID_NAME = InfoEdb10)
             (ORACLE_HOME = /u01/app/oracle/product/11.2.0.3/dbhome_1)
             (ENVS = "LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0.3/dbhome_1/lib")
             (PROGRAM = InfoEdb10)
    any  help is appreciated

  • How to create a database link to connect to Progress

    I using 10g (10.2.0.4) and want to connect to progress 9.x using a databaselink.
    Which are the steps, examples to acomplish this?.

    You have to use the 11g Database Gateway for ODBC (DG4ODBC) to connect from Oracle 10.2.0.4 to Postgres.There's a note on My Oracle Support how to configure the gateway - please have a look at:
    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)
    I would recommend you to use the latest gateway release (11.2.0.3) which can be downloaded from My Oracle Support portal as well. Just click on Patches and Updates and look for the 11.2.0.3 patch set:
    Patch 10404530: 11.2.0.3.0 PATCH SET FOR ORACLE DATABASE SERVER
    Although it is a patch set this software can also be used to install the gateway from scratch.
    Check out the readme as it lists which ZIP file contains the gateway software you have to download.
    The DG4ODBC gateway is for free and its license is included in the Oracle database license. You only need to make sure you have a suitable ODBC driver which is able to connect to your Postgres database.
    Best regards,
    Klaus

  • How to create database link from oracle to sql server

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal
    Hi Vishal,
    I found a lof of information regarding how to create a database link from Oracle to SQL Server, please see:
    https://www.google.co.in/?gws_rd=cr&ei=vd3XUvGFO8TgkAXqlYCADg#q=how+to+create+database+link+from+oracle+to+sql+server
    We discuss SQL Server related issue in this forum. If you have any more question regarding Oracle, please post it in Oracle communities forum for better support.
    Regards,
    Elvis Long
    TechNet Community Support

Maybe you are looking for