DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: data base link

  1. #1
    Join Date
    Apr 2003
    Location
    india
    Posts
    13

    data base link

    WHEN I CREATED DATA BASE LINK FROM ORACLE8I SERVER TO ORACLE8 SERVER,
    IAM ABLE TO ACCESS TABLES OF ORACLE8.

    BUT WHEN IAM CREATED DATABASE LINK ORACLE8 TO ORACLE8I
    IAM UNABLE TO ACCESS TABLE OF ORACLE8I

    AND THE ERROR MESG:->TNS:COULD NOT RESOLVE THE SERVICE NAMES

    THE SAME ERROR IS COMING WHEN I CREATE LINK FROM ORACLE8 TO ORACLE8 TOO

    SO HOW I CAN I DO THAT...

    THANKS IN ADVANCE
    akhir dil hi hindustani

  2. #2
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    First try connecting from oracle8 to oracle8i using

    sqlplus username(username used in the dblink)/password(password used in the dblink)@connect_string(using 'connect_string' used in the dblink)

    try resolving the TNS:COULD NOT RESOLVE THE SERVICE NAMES problem then use the DBLINK

    HTH
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  3. #3
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by adewri

    (using 'connect_string' used in the dblink)
    dinkar:

    Jus to add...

    in the using clause where u specify connect_string....give it as %SID%.%DOMAIN%.

    Abhay.
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  4. #4
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Originally posted by abhaysk
    dinkar:

    Jus to add...

    in the using clause where u specify connect_string....give it as %SID%.%DOMAIN%.

    Abhay.
    Not necessary.

    create database link global_name.domain_name connect to username identified by password using 'connect_string';

    where using clause is the connect_string. This may or may not be your sid.domain_name can be any thing, it can be abc or xyz depending on what you have name your connect_string.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  5. #5
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by adewri
    Not necessary.

    create database link global_name.domain_name connect to username identified by password using 'connect_string';

    where using clause is the connect_string. This may or may not be your sid.domain_name can be any thing, it can be abc or xyz depending on what you have name your connect_string.
    Amar :

    It would be necessary in a situation some thing like this.

    SQL*NET
    Code:
    # SQLNET.ORA Network Configuration File: C:\Oracle\Ora9i\NETWORK\ADMIN\sqlnet.ora
    # Generated by Oracle configuration tools.
    
    NAMES.DEFAULT_DOMAIN = world
    
    --NAMES.DEFAULT_DOMAIN = digitalindiasw.net
    see the DB creation process and o/p

    Code:
    SQL> create database link oemrep.digitalindiasw.net
      2  connect to scott identified by tiger
      3  using 'OEMREP';
    
    Database link created.
    
    SQL> select * from tab@oemrep.digitalindiasw.net;
    select * from tab@oemrep.digitalindiasw.net
                      *
    ERROR at line 1:
    ORA-12154: TNS:could not resolve service name
    
    
    SQL> drop database link oemrep.digitalindiasw.net;
    
    Database link dropped.
    
    SQL> create database link oemrep.digitalindiasw.net
      2  connect to scott identified by tiger
      3  using 'OEMREP.DIGITALINDIASW.NET';
    
    Database link created.
    
    SQL> select * from tab@oemrep.digitalindiasw.net;
    
    TNAME                          TABTYPE            CLUSTERID
    ------------------------------ ------- --------------------
    BONUS                          TABLE
    DEPT                           TABLE
    EMP                            TABLE
    SALGRADE                       TABLE
    TEMP_EMP                       TABLE
    TEST_DESC                      SYNONYM
    T_EMPLOYEES                    TABLE
    T_YTIVCR                       TABLE
    YTIVCR                         TABLE
    YTIVCRD                        TABLE
    
    10 rows selected.
    Now the SQL*NET is

    Code:
    # SQLNET.ORA Network Configuration File: C:\Oracle\Ora9i\NETWORK\ADMIN\sqlnet.ora
    # Generated by Oracle configuration tools.
    
    --NAMES.DEFAULT_DOMAIN = world
    
    NAMES.DEFAULT_DOMAIN = digitalindiasw.net
    I restart my listener

    Now see the DB creation process and o/p

    Code:
    SQL> drop database link oemrep;
    
    Database link dropped.
    
    SQL> create database link oemrep
      2  connect to scott identified by tiger
      3  using 'OEMREP';
    
    Database link created.
    
    SQL> select * from tab@oemrep;
    
    TNAME                          TABTYPE            CLUSTERID
    ------------------------------ ------- --------------------
    BONUS                          TABLE
    DEPT                           TABLE
    EMP                            TABLE
    SALGRADE                       TABLE
    TEMP_EMP                       TABLE
    TEST_DESC                      SYNONYM
    T_EMPLOYEES                    TABLE
    T_YTIVCR                       TABLE
    YTIVCR                         TABLE
    YTIVCRD                        TABLE
    
    10 rows selected.
    SQL>
    Its always better if u add the domain name to ur connect_string.
    Alteast i would say to be on safer side.

    Thanks
    Abhay.
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  6. #6
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Originally posted by abhaysk
    It would be necessary in a situation some thing like this.
    Why do you need to compare your situation with others. You assume that your situation is the only situation that can occur. There can be more than one situations. What if i do not use sqlnet.ora file at all. What if i have sqlenet.ora and i do not use NAMES.DEFAULT_DOMAIN.


    Originally posted by abhaysk

    Its always better if u add the domain name to ur connect_string.
    Alteast i would say to be on safer side.
    Well if you want a safer side then remove the NAMES.DEFAULT_DOMAIN from your sqlnet.ora file. So you dont have to be dependent on those stupid domain naming conventions.

    And you do not have to show me examples. I can understand what you want to say. And i said its not necessary it can be done any way you want to.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  7. #7
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Originally posted by abhaysk
    Code:
    # SQLNET.ORA Network Configuration File: C:\Oracle\Ora9i\NETWORK\ADMIN\sqlnet.ora
    # Generated by Oracle configuration tools.
    
    NAMES.DEFAULT_DOMAIN = world
    
    --NAMES.DEFAULT_DOMAIN = digitalindiasw.net
    see the DB creation process and o/p

    Code:
    SQL> create database link oemrep.digitalindiasw.net
      2  connect to scott identified by tiger
      3  using 'OEMREP';
    
    Database link created.
    
    SQL> select * from tab@oemrep.digitalindiasw.net;
    select * from tab@oemrep.digitalindiasw.net
                      *
    ERROR at line 1:
    ORA-12154: TNS:could not resolve service name
    And BTW if you use SID instead of SERVICE_NAME in your tnsnames.ora this will also work.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  8. #8
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by adewri
    Why do you need to compare your situation with others. You assume that your situation is the only situation that can occur. There can be more than one situations.
    Amar :

    I didnt tell this is the only situation...but this(wat i showed) could be one of the situations.

    Thinking that i tried to help him. Is that offence?

    Well if you want a safer side then remove the NAMES.DEFAULT_DOMAIN from your sqlnet.ora file. So you dont have to be dependent on those stupid domain naming conventions.
    Correct if TNS names have SID and not service_names to connect to DB.

    And you do not have to show me examples. I can understand what you want to say. And i said its not necessary it can be done any way you want to.[
    I didnt want to show u examples but i thought this wud giv him(thread starter) some idea where he might be going wrong.

    Why are you taking it in wrong way, that i tried to explain u or tired to degrade u.

    AFA "NOT NECESSARY" is conserned, it surely is in some cases ( had TNS names not using SID to connect ).

    Abhay.
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  9. #9
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by adewri
    And BTW if you use SID instead of SERVICE_NAME in your tnsnames.ora this will also work.
    Absolutely.

    Now by such discussions starter will come to know where he is going wrong na.
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  10. #10
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Originally posted by abhaysk
    Why are you taking it in wrong way, that i tried to explain u or tired to degrade u.
    I think i'm not in good mood today, lots of pending work to be finished.
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

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