TNS/database links
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: TNS/database links

  1. #1
    Join Date
    Jan 2002
    Posts
    474
    I have the database A in my office and database B is at client site and we connect to it through VPN. I can connect to A and B without having any problem.

    I created the link in the database B pointed to the database A. when I query using the link to get data from database A and I got TNS:could nto resolve the service.

    my question is ' Do I have to add the connect string to the TNS names file located on the B machine ???'

    since this is at the client, is there any other way for me to move data from my office to their ???

    I could use import/export but it's not an option b/c I don't have access to their server.


  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    The VPN connection will have to be opened up from the Server A to the client site. You shouldn't have a problem as long as they are accepting packets on port 1521 or whatever.
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Jan 2002
    Posts
    474
    VPN already open at all time. Do you have any other suggestions ???

    Thanks

  4. #4
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Can you login from ServerA to ServerB using sqlplus?
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Originally posted by ashley75

    I could use import/export but it's not an option b/c I don't have access to their server.

    Why not import/export across the VPN connection using an alias?

    For example:

    exp system@serverb file=xyz.dmp full=y
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  6. #6
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Originally posted by ashley75

    I created the link in the database B pointed to the database A. when I query using the link to get data from database A and I got TNS:could nto resolve the service.

    my question is ' Do I have to add the connect string to the TNS names file located on the B machine ???'


    Comming to answer this question.

    1. If you are trying to connect to the server A from server B, your connect string should be defined in tnsnames.ora file in server B.

    2. Once after that try doing tnsping service_name and make sure that you were able to contact and talk to the listener on server A from server B.

    3. Then see what happens on the link.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  7. #7
    Join Date
    Jan 2002
    Posts
    474
    Jeff and Sam,

    I apologize for not bringing this up. Everything I do is on Oracle client running on my machine. I was able to connect to the database A and B without having problem.

    I tried to create the link from B to get the database from A and it's telling me that TNS could not resolve the service.

    Jeff,

    I can't export and import b/c I don't have access to the server B.


  8. #8
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Originally posted by ashley75

    I can't export and import b/c I don't have access to the server B.
    I don't get what you mean by this. Do you mean you don't have a login? If so, how do you get in through sqlplus?

    Do you mean you don't have telnet access to ServerB? That's OK, we can work with that.

    Most likely, your VPN connection is being opened from your client machine. A database link works from the server in which it is created, not the client. If ServerA can see ServerB through the VPN, and vice versa, then you can setup a db link.



    [Edited by marist89 on 01-23-2002 at 04:14 PM]
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  9. #9
    Join Date
    May 2000
    Location
    fremont ca
    Posts
    182
    Hi!
    I am also facing same problems. I am able to connect database A from B,
    and datbase B from A using SQLPLUs.

    When I am trying to create database link from any database ( A or B) it gives me error host string not found or invalid...
    Since yesterday I am trying same thing


  10. #10
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    What is your GLOBAL_NAMES in the initSID.ora file had been set to?

    Do you have the service names defined under the service name of the database link is defined under the tnsnames.ora file in server B, as a alias name for the service that you want to connect at server A.

    Code:
           CREATE  DATABASE LINK link_name  ...
           USING server_A.world;
    Say that you have created the link on server B, then your tnsnames.ora file should have the alis name server_A defined in it.
    Code:
      server_A.world=( DESCRIPTION
                                 (ADDRESS_LIST =
                                    (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERA_HOSTNAME)(PORT = 1521))
                                     )
                                     (CONNECT_DATA =
                                         (SERVICE_NAME = server_A_DB_servicename)
                                     )
                               )
    when you connect to the database link through sqlplus you would have to say
    [code]
    SELECT ... FROM table@dblink;
    [code]
    NOTE: If your database global_names had been set to true, then your link name should be the same as the service name, otherwise, you can specify any name for the databaselink as you want.

    Hope this would help you to solve the problem.

    Sam

    Thanx
    Sam



    Life is a journey, not a destination!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width