Problem creating a database link

Hi,
I tried to create a database link, but it doesn't work. When I connect to the database via SQL*Plus or SQL Developer, the entries in the tnsnames.ora work.
create database link DBOPBWS2.BAG connect to demo identified by demo
using 'DBOPBWS2.BAG';
Entry in tnsnames.ora:
DBOPBWS2.BAG =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =serv01.server.spub-systeme.de)(PORT = 1485))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = DBOPBWS2)
Entry in sqlnet.ora:
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
select * from [email protected];
Error:
ORA-12154: TNS: Angegebener Connect Identifier konnte nicht aufgelöst werden
12154. 00000 - "TNS:could not resolve the connect identifier specified"
What is wrong with the datbase link?
Please help me
Siegwin

Hi,
You could also "skip" the TNSNAMES use :Scott@my11g SQL>create database link DBOPBWS2.BAG connect to demo identified by demo
using '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =serv01.server.spub-systeme.de)(PORT = 1485)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = DBOPBWS2)))'
Database link created.

Similar Messages

  • Problem with using database link from oracle 7 to oracle 9i

    Hi To Every One
    I have two oracle database oracle 7.3.4.0.1 and oracle 9i 9.2.0.1.0.
    and the tns alias to connect to oracle 9i database is oracle9i and tns
    alias to oracle 7 database is oracle7.I have no problem in connect to
    these database using these tns aliases from either database.The tns
    alias for oracle 7 is available in tnsnames.ora file of oracle9i and
    tns alias for oracle 9i is available in tnsnames.ora file of oracle 7.
    So there is no connection problem from each other.Connection is
    working fine for each other but the problem with database links is
    like this
    Problem:
    when i create database link from oracle9i user or public database link
    from oracle9i for oracle7 user like this
    SQL ORACLE9I >CREATE DATABASE LINK ORACLE7 CONNECT TO <ORACLE7USER>
    IDENTIFIED BY <PASSWORD> USING 'ORACLE7';
    OR
    SQL ORACLE9I >CREATE PUBLIC DATABASE LINK ORACLE7 CONNECT TO <ORACLE7USER>
    IDENTIFIED BY <PASSWORD> USING 'ORACLE7';
    The links get created sucessfully but when i write command like
    SQL ORACLE9I> DESC <ORACLE7USER_NAME>.<ORACLE7USER_TABLENAME>@ORACLE7
    I RECEIVE A ORACLE ERROR LIKE
    ORA-12663 SERVICE REQUIRED BY CLIENT IS NOT AVAILABLE ON THE SERVER.
    OR IF MY COMMAND IS LIKE
    SQL ORACLE9I> SELECT <FEILD_NAME> FROM
    <ORACLE7USER_NAME>.<ORACLE7USER_TABLENAME>@ORACLE7;
    I RECEIVE AN ORACLE ERROR LIKE
    ORA-01002 FETCH OUT OF SEQUENCE.
    ORA-02063: preceding line from ORACLE7
    BUT IF I CREATE A LINK FROM ORACLE7 USER FOR ORACLE9I USER
    IT WORKS FINE.
    PLZ HELP ME WHAT IS THE PROBLEM THAT THE LINK FOR ORACLE 7 IS NOT WORKING WHEN
    IT IS BEING CREATED FROM ORACLE9I.
    Thank u.

    Oracle 9.2.0 does not support connectivity to Oracle 7. The newest version that will support this is 9.0.1.

  • Creating a database link to another schema in the same database

    Hello,
    I'm trying to create a database link to another schema in the same database. It was created without errors, but when I try to use it I receive "ORA-12154: TNS:could not resolve the connect identifier specified" message...
    I'm trying to do it because on my production enviroment the databases are separated, so there I can use database links without problem, but in my development environment it's all in one database separated by schemas...
    So I'm trying to simulate the same system to not need to rewrite the query every time I move from development to production environment.
    Any ideas?
    Thanks

    Hi,
    Yes, you can create a database link to your own database. I've done it before for exactly the same reason you want to.
    (By the way, I think it's a good reason. What are the alternatives?
    Having different versions of code for Development and Production? Absolutely not! Terrible idea!
    Using synonyms or substitution variables that are set differently in the different databases? That might be more efficient than a database link, but efficiency probably isn't such a big issue in Development.
    [Conditional compilation|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/fundamentals.htm#sthref250]? This might be good; it has all the efficienty of the above options, with more clarity.)
    Assuming you do want to stick with a database link, not all errors are caught when you create the link.
    Is the Development database in the tnsnames.ora file of the Development server? Do you have other database links, either in the Development server or pointing to it, that work? What is different about the ones that work, and the one that doesn't?
    Edited by: Frank Kulash on Oct 14, 2009 1:58 PM
    The more I think about this, the more I agree with the earlier respondent: synonymns are a good solution for this.
    To that suggestion you replied:
    On this way I might use "select * from SCHEMA.table" instead of "select * from table@SCHEMA"... I looking for an option to use the second way...Actually, the suggestion was that you say:
    select  *
    from    SCHEMA_table_ptr;where schema_table_ptr is a synonym.
    In Development, that synonym is defined as schema.table.
    In Production, that synonym is defined as table@SCHEMA
    Why are you "looking for an option to use the second way"?
    If you think that people reading the code should realize that the query is being done via a database link (at least in Production), then add a comment.

  • Deploying a mapping creates a database link

    I have one mapping where everytime I deployed a mapping it always creates a database link. How do I remove this and how did this happen?

    Is the problem that you expect a local reference like SCOTT.EMP rather than SCOTT.EMP@DBLINK? Check the source and target locations for the tables in your mapping, check that the locations are defined identical in the host:port:service name? Did you define them with H:P:S? May be one has localhost the other a machine name or something.
    Cheers
    David

  • Create a database link to access SqlServer 2005 view from oracle 11gr2

    Hi All,
    Greetings for the day.
    Though I have seen quite a few posts but just wanted to cross-verfiy and double check hence posting.
    Oracle Database : 11gr2
    OS :SOLARIS SPARC 64 Bit
    SQL Server Database : Sql Server 2005
    OS : Windows 2003 32 Bit
    The requirement is to access a view residing in the SQL Server 2005 Database using the Oracle Database. This involves creation of a Database link in the Oracle Database to access the SQL Server.
    Can you suggest which approach should i follow ( I am able to understand that both do the same job ):
    How to Configure DG4MSQL (Oracle Database Gateway for MS SQL Server) 64bit Unix OS (Linux, Solaris, AIX,HP-UX) post install [ID 562509.1]or
    How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install [ID 561033.1]Will they do the same job ? And can they be used on any OS and version of the SQL Server Database as version information for SQL Server is not specified anywhere?
    Please let me know so that I can it forward with Business for approvals and budgetting.
    Regards
    KK

    Your question is similar to the post: Oracle 11gr2 connection to Sql Server using dg4msql problem
    Please visit: http://stackoverflow.com/questions/4658942/oracle-11gr2-connection-to-sql-server-using-dg4msql-problem
    Answer on the website:
    You seem to be using the Gateway for MySQL set-up rather than the Heterogeneous Gateway (for ODBC connections). Here is an overview of the process
    On SQL Server create a database user and give it read access to the database/tables you want to read via the Oracle database link.
    In the gateway home each SQL Server database you want to access should have an init.ora located in $OH/dg4msql/admin in the form initsid.ora where sid is the name of the database to be used in the link (e.g. initbob.ora), so create one
    HS_FDS_CONNECT_INFO=msserver1:1234//Example_Database
    HS_FDS_TRACE_LEVEL=OFF
    HS_FDS_RECOVERY_ACCOUNT=RECOVER
    HS_FDS_RECOVERY_PWD=RECOVER
    HS_TRANSACTION_MODEL=READ_ONLY
    You must now add the new sid to the listener.ora in the gateway home using an additional SID_DESC section inside the existing SID_LIST, for example
    (SID_DESC =
    (SID_NAME=bob)
    (ORACLE_HOME=/oracle/gateway/product/11.2.0)
    (ENVS=LD_LIBRARY_PATH=/oracle/gateway/product/11.2.0/dg4msql/driver/lib;/oracle/gateway/product/11.2.0/lib)
    (PROGRAM=dg4msql)
    You should now stop and restart the gateway listener so that the new sid becomes active. NB a reload is not enough.
    You must now add the new sid in the tnsnames.ora file for the listener of each database in which you will create a link. You don't need to do this in the gateway home unless it is also a database home in which you will create a database link.
    bob =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = severname.example.com)(PORT = 1690))
    (CONNECT_DATA = (SID = bob))
    (HS = OK)
    NB: The host and port are for the gateway not for the SQL Server database
    In each database that requires a link to the MS-SQL database you should create a database link to your new gateway sid.
    CREATE PUBLIC DATABASE LINK bob
    CONNECT TO "ms_user" IDENTIFIED BY "ms-passwd" USING 'bob';
    where ms-user and ms-password are the SQL Server user you created right at the start.
    Now you can test the new database link
    SELECT COUNT(*) FROM "Table_Name"@bob;
    Once you have this working you can alter the initsid.ora file to add parameters to suit your connection. If you do it this way you can easily add and manage many different databases via the gateway.
    Hip
    Edited by: 1000595 on 04:58 17-04-2013

  • 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

  • ERROR WHILE CREATING A DATABASE LINK USING HETEROGENEOUS SERVICES

    I'm creating a database link with the Oracle Dataware Builder, and i get the following error:
    Probando...
    Fallo.
    SQL Exception
    Error del repositorio: Excepción SQL.
    Nombre de la Clase: CacheMediator.
    Nombre del Método: getDDEntryFromDB.
    Mensaje de Error del Repositorio: ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Informix][Informix ODBC Driver][Informix]Incorrect password or user [email protected] is not known on the database server. (SQL State: 28000; SQL Code: -951)
    ORA-02063: preceding 2 lines from PRUEBA_SEH
    As you can see i'm using heterogeneus services to connect to a informix database. ALTIADM is a valid user for that database, i don't send my ip address 192.168.0.62, but the error says "[email protected] is not known in the database server". how can i solve it?????

    Right places to ask this question are
    Heterogeneous Connectivity
    Warehouse Builder

  • ERROR WHILE CREATING A DATABASE LINK TO INFORMIX

    I'm creating a database link with the Oracle Dataware Builder, and i get the following error:
    Probando...
    Fallo.
    SQL Exception
    Error del repositorio: Excepción SQL.
    Nombre de la Clase: CacheMediator.
    Nombre del Método: getDDEntryFromDB.
    Mensaje de Error del Repositorio: ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Informix][Informix ODBC Driver][Informix]Incorrect password or user [email protected] is not known on the database server. (SQL State: 28000; SQL Code: -951)
    ORA-02063: preceding 2 lines from PRUEBA_SEH
    As you can see i'm using heterogeneus services to connect to a informix database. ALTIADM is a valid user for that database, i don't send my ip address 192.168.0.62, but the error says "[email protected] is not known in the database server". how can i solve it?????

    Right places to ask this question are
    Heterogeneous Connectivity
    Warehouse Builder

  • Not able to create a database link using the database gateway of oracle 11g

    HI,
    While trying to create a database link to SQL server from Oracle ,using the database gateway provided with 11g, i am getting the following error while making use of it in selecting columns from tables :
    Error starting at line 1 in command:
    select * from test1@dblink
    Error at Command Line:1 Column:20
    Error report:
    SQL Error: ORA-28513: internal error in heterogeneous remote agent
    ORA-02063: preceding line from DBLINK
    These are the steps i have followed for setting up:
    1.Ran the set up for the Database gateway.and mentioned the SQL server name and database .ALos set up a listener.
    2. Added the following in the Listener.ora of Oraclehome 11/NETWORK/ADMIN:
    LISTENER_SQL_FCD =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST =localhost) (PORT = 1541)
    SID_LIST_LISTENER_SQL_FCD =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME=dg4msql)
    (ORACLE_HOME= D:\app\20537\product\11.1.0\db_3)
    (PROGRAM=dg4msql)
    3.Added the following in tnsnames.ora inOracle home/NETWORK/ADMIN:
    dg4msql=
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1541))
    (CONNECT_DATA=(SID=dg4msql))
    (HS=OK)
    4. Following is the entry in initdg4msql.ora in C:\product\11.1.0\tg_5\dg4msql\admin:
    HS_FDS_CONNECT_INFO=10.148.45.242:1433//SalesDemo
    HS_FDS_TRACE_LEVEL=DEBUG
    HS_FDS_RECOVERY_ACCOUNT=RECOVER
    HS_FDS_RECOVERY_PWD=RECOVER
    5. Created the database link :
    create database link dblink
    connect to "sa" identified by "<pswd>"
    using 'dg4msql'
    On running :select * from test1@dblink i get the following error:
    Error starting at line 1 in command:
    select * from test1@dblink
    Error at Command Line:1 Column:20
    Error report:
    SQL Error: ORA-28513: internal error in heterogeneous remote agent
    ORA-02063: preceding line from DBLINK
    Is there any issue with the set or definition that I get the above error?

    What is the version of the Oracle database in which you have specified/and use the database link?
    If it is for example 10.2.0.3.0 you need to apply the mandatory patch for RDBMS bug 5965763 first before being able to use an 11g gateway. Have a look at MetaLink note 457808.1 for details about this patch.
    Regards,
    Ed

  • 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.

  • APP-RG-09518: An error occurred while creating a database link

    Hi All,
    While creating a database link in Oracle EBS from one instance to another instance for transferring FSG reports
    Go to Any GL Setup responsibility...Setup>System>Database links > Create new database link
    Prior to the above...below steps should be done on the server.
    1.grant create database link to <apps.user>; (on db server)
    2.source tns entry should be in destination tns file and destination tns entry in source tns file. (check tnsping after entry)
    3.*make sure destination tns entry of 8.0.6 oracle home should be in source tns file* (Because we are creating db link for the application)
    4.Run the Program FSG Report.
    Regards,
    Harish Muramshetty.

    Hi,
    I have solved the issue as below:
    This error was started when I install a software which I have made myself and it uses sql server compact edition 3.5.  
    I saw when I manually replaced the sql related files from "C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v3.5" with the files which  my software setup had "version 3.5.5386.0" then the error started. And if copy back the latest version 3.5.8080.0
    then it disappear. So use latest sql files in your software too.
    My software was replacing the the latest files with older version. 
    Muhammad Arshad Awan

  • Creating a Database link for a user

    Hello All,
    I am trying to create a database link for one of my users.
    When I create it as sysdba the link gets created in the SYS schema which tells me that my syntax is working/fine.
    But when I ALTER my SESSION and set my CURRENT_SCHEMA = <USER_NAME> I get ORA-00990: missing or invalid privilege
    So I tried granting the user CREATE DATABASE LINK, CREATE PUBLIC DATABASE LINK, and DROP PUBLIC DATABASE LINK.
    Same error.
    Any ideas what I am missing?
    Thanks,
    Craig

    CraigBoyd wrote:
    Hello All,
    I am trying to create a database link for one of my users.
    When I create it as sysdba the link gets created in the SYS schema which tells me that my syntax is working/fine.
    But when I ALTER my SESSION and set my CURRENT_SCHEMA = <USER_NAME> I get ORA-00990: missing or invalid privilege
    So I tried granting the user CREATE DATABASE LINK, CREATE PUBLIC DATABASE LINK, and DROP PUBLIC DATABASE LINK.
    Same error.
    Any ideas what I am missing?
    Thanks,
    Craigyou need to create a new session after the GRANT was issued.

  • Error in Creating a Database Link

    I am trying to create a database link in SQL Workshop but unavailbe to create one because of the error below:
    Create Database Link Failed.
    ORA-00933: SQL command not properly ended
    Hope you can help me with this. Thanks!

    788818 wrote:
    I am trying to create a database link in SQL Workshop but unavailbe to create one because of the error below:
    Create Database Link Failed.
    ORA-00933: SQL command not properly ended
    Hope you can help me with this. Thanks!Not really, because the error message you have posted generally relates to a syntax or typing error and you haven't posted any other information. We need version of the DB and the text of what you are trying to do. But before you post that, have you tried the documentation?
    Regards
    Andre

  • Creating a database link to SQL server

    Hi All,
    How can I create a database link from Oracle9i Enterprise Edition Release 9.2.0.1.0 DB to MS SQL Server database.
    Thanking You
    Regards Lakmal

    It depends on your requirements.
    You can use either Generic Connectivity or Transparent Gateways.
    More information can be found here:
    http://www.oracle.com/technology/products/gateways/index.html

  • 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

Maybe you are looking for

  • Cannot view BLOB datatypes in Oracle10g

    After a successful upgrade from Oracle8i to Oracle10g, I cannot view tables with BLOB datatypes. I'm getting the following error in SQL*PLUS upon quering the table: SP2-0678: Column or attribute type can not be displayed by SQL*Plus When i try to do

  • I need to make a spreadsheet based on info from specific table columns and headlines above those tab

    Hi all, A client of mine is requesting that I create a spreadsheet from a huge catalog that I am doing for him (this will also be done for all similar huge catalogs). The spreadsheet needs to pull information from some of the table columns, as well a

  • Loaded stylsheet for loaded xml not recognised

    The following code loads correctly the xml file but not the stylesheet. Do I have to change the ordrer of some chunks of this code? (ta = textarea movieclip; in the css I only have, for the test, spectacle>item>title {font-size:40;} Thank you for you

  • Error loading type library/DL​L?

    I am using ActiveX to call a LabView VI, compiled with the ActiveX Server option enabled. When I load the VI (using the CreateObject method) the front panel appears, but I get back this error: "0x80029c4a {Error loading type library/DLL.}". What is w

  • HT1766 m iphone is disabled, what can i do ?

    hello, i have iphone 5s and it's disabled and i'm connecting itunes but it doesn't read it