DATABSE LINK

I WANT TO CREATE A DATABASE LINK FROM ONE SERVER TO ANOTHER SERVER,WHERE BOTH OF SERVER HAS SAME SID.

WHERE BOTH OF SERVER HAS SAME SID. Do you mean database name are same ?
Just try to make two different tns entry name pointing each to the database/server as well.
Nicolas.
PS : write in cap is considering as shouting, there is no reason for that, so please, disable your caplock at the left of your keyboard.

Similar Messages

  • Databse link creation from 9i to 10g

    hii all
    i just want to create databse link as below"create databse link linkname connect to remoteuserid identified by remote password using "........"
    thats where iam getting confused what should we place if my tnsnames looks like "orcl.com =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ip address)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = ORCL)
    well after puting db name as using in statement i am getin error when i execute any table in remote db.
    1.tns -nolistener
    2.ORA-12545-Connect failed becos target host or object does not exit
    above r some of errors i get while iam trying to create databse link
    please put on some thoughts on this kindly..
    thanks

    copy, paste and post here for db link creation and the error returned. you can replace the username/password/host with dummy ones.
    Sean

  • Databse link not work

    I have created database link to access remote data.
    Also added TNSNAME entry for remote databse into tnsname.ora
    but while firing select query using DB link gives error
    ORA-12154: TNS:could not resolve the connect identifier specified
    Plz let me know hw to solve this problem
    Thanks in adavance

    Did you add the entry to the tnsnames file on your client machine? Or the tnsnames file on the database server? A database link will use the TNS configuration of the database server, not your client.
    Justin

  • Problem in Databse Link Creation

    I have created two Databases Named 'DBOLMMS' and 'MMS2' on same Server. There is User 'MMSUSER' in both Database and there two diffrent services for both Databases Named 'DABOLMMS' and 'MMS2' respectively. I wish to share some of the tables in 'MMS2' into 'DABOLMMS'. So I tried to Create Database Link using following command is SQL Plus
    CREATE DATABASE LINK MMS2 CONNECT TO MMSUSER IDENTIFIED BY MMSUSER USING 'DABOLMMS2';
    Link is created without error but when I try to access data using this link as following
    SELECT * FROM TAB@MMS2;
    I get following error
    ERROR at line 1:
    ORA-02085: database link MMS2.US.ORACLE.COM connects to MMS2
    Pl. send solution on [email protected]
    Thanks
    Indraneel
    null

    Please check the following:
    1. Create the DBLink name different than the Database name of the second DB.
    2. in init.ora give global_names=false
    Hope this will solve.

  • Create a databse link to oracle 11g database

    Hi All,
    I have installed oracle 10g express edition n Apex 4.0.2 verion.
    Now i want to connect 11g database to Apex. When i try to connect,
    it prompts me an error saying;
    Error Testing Database Link.
    ORA-01017: invalid username/password; logon denied ORA-02063: preceding line from PRODSTDBY
    And at the same time i can connect a 10g database successfully.. is this because of oracle db versioning issue ???
    if yes, how can i able to overcome from this issue...????
    please somebody help me to solve this......
    Thanks in Advance,
    Max

    Telnet is not running on the server, I tried starting it, but it failed. When trying to connecting from my local machine through telnet, it is giving the following error:*Could not open connection to the host, on port 23: Connect failed*.
    I am able to connect to the machine through SSH(putty).
    Is there any other way to test if port 1521 is accepting connections?
    Thanks,
    Rajesh.

  • Accessing partitioned table thru remote databse link

    Dear All
    I want to use create table command in my database .I want access partitioned table of remote datbase thru database link.Pl let me know the scripts.
    Thanks
    Parth
    NB : I was using the foll but actually the data given is wrong.
    select * from Data@prod "partition(part_feb03)";

    Don't able use partition table with the database link, sorry
    Regards
    Hector

  • Commit through databse link

    Hi all,
    10.2.0.1
    RHEL4
    I am inserting some data to a remote location through database link.
    SQL>insert into tbl1@dblnk select * from tbl1;
    How should i commit?
    How would commit take effect?

    Commit as normal. Oracle will take care of it using two-phase commit.
    For more information see:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14231/ds_txns.htm#g1013136
    Message was edited by:
    Anvar Huseynov
    added the link

  • Create databse link

    hi all,
    i want to get the data from a remote oracle database table into my local oracle database. i heard of the "database link" but unable to interpret it
    can you help me how to get the data from tat remote db table..
    thanks.

    CREATE DATABASE LINK "<REMOTE_DB_NAME>" CONNECT TO <REMOTE_USERNAME> identified by <REMOTE_PASSWORD> USING '<REMOTE_DB_NAME>';
    Select * from <REMOTE_TABLE_NAME>@<REMOTE_DB_NAME>;
    Create <LOCAL_TABLE_NAME> as select * from <REMOTE_TABLE_NAME>@<REMOTE_DB_NAME>;
    Desc <LOCAL_TABLE_NAME>
    Desc <REMOTE_TABLE_NAME>@<REMOTE_DB_NAME>
    Should be the same for both Local and Remote Database
    Select * from <LOCAL_TABLE_NAME>;

  • Regarding databse link

    Hello,
    I am trying to select data from other schema. I have Select privilege with me .The database link is already there. But when I try to select it gives message 'No row selected'. Table is already populated with data. Code is here
    select * from olpmm.cb_error;
    no rows selected
    So wht you think about this.
    Gursimran

    I am trying to select data from other schema. I have
    Select privilege with me .The database link is already there. When you have select privilege on other schema table/s , why you need database link ?
    message 'No row selected'. Table is already
    populated with data. Code is here
    select * from olpmm.cb_error;
    no rows selectedconnect to schema olpmm and check is there data in cb_error ?
    - Virag Sharma
    http://virag.sharma.googlepages.com

  • Databse Link problem

    I am trying to create a database link on a 10g database pointing to a database in Oracle Express 11g.
    CREATE DATABASE LINK "dblinkname"
    CONNECT TO user IDENTIFIED BY pwd
    USING '(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx )(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = XE)
    Whenever i test the db link, i get this message
    ORA-01017: invalid username/password; logon denied
    ORA-02063: a preceder line de
    01017. 00000 - "invalid username/password; logon denied"
    *Cause:   
    *Action:
    Error at Line: 12 Column: 19
    Both login and pwd are correct, by the way.
    Thank you for the help.

    Nuno wrote:
    I am trying to create a database link on a 10g database pointing to a database in Oracle Express 11g.
    CREATE DATABASE LINK "dblinkname"
    CONNECT TO user IDENTIFIED BY pwd
    USING '(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx )(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = XE)
    Whenever i test the db link, i get this message
    ORA-01017: invalid username/password; logon denied
    ORA-02063: a preceder line de
    01017. 00000 - "invalid username/password; logon denied"
    *Cause:   
    *Action:
    Error at Line: 12 Column: 19
    Both login and pwd are correct, by the way.Either you are correct or Oracle is correct.
    I am willing to give you odds that Oracle better reports reality than you.
    BTW, in V11 passwords are CaseSensitive.
    using COPY & PASTE show us your reality & the username & passwords are "correct".

  • DB link problem connecting to DB

    tnsping is ok
    connect from client to DB server is ok using the connect string.
    But when i am using to connect to the database using database link i am getting the error.
    C:\>tnsping srvc1
    TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 13-▌╚╤╟و
    ╤-2007 13:00:34ع↕
    Copyright (c) 1997, 2003, Oracle. All rights reserved.
    Used parameter files:
    N:\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
    (HOST = RUH01WAP01)(PORT = 1521))) (CONNECT_DATA = (SID = srvc1)))
    OK (330 msec)
    SQL>create public database link link_name connect to username identified by password
    using 'srvc1';
    databse link is created.
    SQL>select count(*) from tab@link_name
    ORA-12154: TNS:could not resolve service name.
    Why this problem connecting the DB using DB link...
    Thankx.....

    connect from client to DB server is ok using the connect string.And what about the server side connection ?
    The remote db should be declared into the server tnsnames.ora file.
    Nicolas.

  • 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

  • Execute stored procedures + database link

    Hi,
    I have a stored procedure named "proc1" in the "user1" schema in the "db1" database.
    I have another database "db2".
    I have a public database link named "db2_to_db1", which connects from the "db2" database to "db1" database connecting with the user "user1" from "db1". I tested the database link.... is OK.
    I have a public synonym for "user1"."proc1"@"db1" named "p_proc1"
    So, I want to execute the stored procedure "proc1" from "db2".
    I tried this from Forms and SQLPLUS...
    (1)
    DECLARE
    BEGIN
    p_proc1(...,...,...);
    END;
    (2)
    DECLARE
    BEGIN
    user1.p_proc1(...,...,...)@db2_to_db1;
    END;
    (2)
    DECLARE
    BEGIN
    p_proc1(...,...,...)@db2_to_db1;
    END;
    .........but no one of those codes are right, I got an error like this:
    ORA-06550: line 12, column 3:
    PLS-00201: identifier 'SDI_CON_TRAFO_SID' must be declared
    Please I need some help....
    What can I do in order to execute a stored rpocedure of other database with a databse link??????
    I almost forget.... I already checked the "execute" privilegies over the stored procedure.... and is OK.

    What is the identifier 'SDI_CON_TRAFO_SID'? It sounds like you have a problem with dependencies rather than with how to call it.

  • How to activate a database link?

    How can one activate a database link w/in SQL*Plus or DBA Studio?
    I'm trying to re-create my schema in a new instance and in order to execute my materialized view SQL I must first create a new database link. I'm using the same info as in our other instance so am sure the connection will work IF I can get the database link to be 'active'. I created the link in DBA Studio and attempted to test, but received the error "Database link is not active." Canned it and created through SQL*Plus with same result. I see no option to activate and cannot find any info in 8i DBA Handbook or 8i DBA Bible.
    Only way to create an active dblink is to find another link that is already active and do a Create Like.
    I figure there's an easy solution to this problem, but cannot figure out what it is. Any help is appreciated!
    Thanks.

    Nathan,
    What is the exact sql your using to create the link? Sometimes I've seen OEM say the link is not active when its a private one (the pressing of the TEST button that is). Maybe it's a bug or something (I just tested it now again to make sure I was getting the db link test error). This is with OEM 1.6x though, I thought it would have been fixed by the current version. Maybe it never was a bug I don't know.
    I norammly create and activate a db link like this ...
    DROP DATABASE LINK DB_TEST;
    CREATE PUBLIC DATABASE LINK DB_TEST CONNECT TO <user> IDENTIFIED BY <pass> USING '<tns name entry on the SERVER>;
    SELECT NAME FROM V$DATABASE@DB_TEST;
    Here's an actual run and gets the databsae name off the linked server ...
    15:42:59 ORACLE [->] CREATE DATABASE LINK DB_TEST_PRIVATE CONNECT TO USER1 IDENTIFIED BY
    USER1 USING 'TNS1';
    Database link created.
    15:42:59 ORACLE [->] CREATE PUBLIC DATABASE LINK DB_TEST_PUBLIC CONNECT TO USER1 IDENTIFI
    ED BY USER1 USING 'TNS1';
    Database link created.
    15:42:59 ORACLE [->] SELECT NAME AS "LINK_PRIVATE" FROM V$DATABASE@DB_TEST_PRIVATE;
    LINK_PRIV
    DEVL
    15:43:00 ORACLE [->] SELECT NAME AS "LINK_PUBLIC" FROM V$DATABASE@DB_TEST_PUBLIC;
    LINK_PUBL
    DEVL
    The following link tells more about database links and some good examples ...
    http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/server.901/a90117/ds_admin.htm#12904
    The folowwing is from that page on checking on current open db links ...
    --[START]
    You may find it useful to determine which database link connections are currently open in your session. Note that if you connect as SYSDBA, you cannot query a
    view to determine all the links open for all sessions; you can only access the link information in the session within which you are working.
    The following views show the database link connections that are currently open in your current session:
    V$DBLINK (view) : Lists all open database links in your session, that is, all database links with the IN_TRANSACTION column set to YES.
    GV$DBLINK (view) : Lists all open database links in your session along with their corresponding instances. This view is useful in an Oracle Real Application Clusters
    configuration.
    --[END]
    Sometimes the v$dblink doesn't show all the active ones (since it might have gotton opened under a different user name or something), but doing a simple select * from dual@DB_LINK, will most certainly open it if the connection is not yet open. Creating the databse link itself does not open the actuall connection.
    Hope this helps ya,
    Tyler D.

  • How to create a view consisting of data from tables in2 different databases

    Using Oracle 10.2g
    I have 2 databases Gus and haggis on Comqdhb schema.
    glink indicates a databse link between Haggis and Gus
    In Gus there are tables student,subject,grade,school containing columns like upn...
    STUDENT
    upn
    academicYear
    SUBJECT
    subject
    GRADE
    examlevel
    grade
    SCHOOL
    sn
    In HAGGIS there are tables student,grade,teacher containing columns upn...desc below.
    STUDENT
    upn
    GRADE
    grade
    upn
    academicyear
    level
    Create view in your HAGGIS database which will join all of the exam grades together. You should have one view which will produce the following relation :
    examGrade(upn, subject, examlevel, sn, grade,academicYear)
    so I need to create a view which gets the data from both the tables in both the databases.
    create view as examGrade(upn, subject, examlevel, sn, grade,academicYear) as select s.upn
    But i am not getting how to select a column from 2 tables in different databases
    I mean if i said
    select upn from comqdhb.student@glink,comqdhb.student;
    select upn from comqdhb.student@glink,comqdhb.student
    ERROR at line 1:
    ORA-00918: column ambiguously defined
    help me out,Thank you.

    Thank you for the reply will follow up the code format
    Create views in your HAGGIS schema database which will join all of the exam grades together. You should have one view which will produce the following relation :
    examGrade(upn, subject, examlevel, sn, grade,academicYear)
    I understand that there wont be duplication when we use conditions
    If i query
    select count(upn)
    from   comqdhb.student@glink I get 9000
    but after the union
    create view examGrade(upn, subject, examlevel, sn, grade,academicYear)
    as
    select distinct s.upn as upn
    ,                  g.subject as subject
    ,                  g."LEVEL" as examlevel
    ,                  g.grade as grades
    ,                  '9364097'
    ,                  to_number(g.academicyear) as academicyear
    from             comqdhb.student s
    ,                   comqdhb.grade g
    where           s.upn=g.upn
    union
    select            s.upn
    ,                   sb.subject
    ,                   g.elevel
    ,                   g.grade
    ,                   s.acyr
    ,                   sc.sn
    from              comqdhb.subject@glink sb
    ,                   comqdhb.student@glink s
    ,                    comqdhb.gradevalues@glink g
    ,                    comqdhb.school@glink sc,
    ,                    comqdhb.studentingroup@glink sg
    ,                    comqdhb.teachinggroup@glink tg
    where            sb.sid=tg.sid
    and                tg.gid=sg.gid
    and                sg.upn=s.upn
    and                g."LEVEL"=tg.elevel
    and                s.school=sc.id
    and                sc.id=tg.id; returns
    count(upn) from exam gradeIt gets stuck actually sometimes it returns
    932002 some results.
    2:
    Another problem i am having which i am trying to solve and written up my ideas but haven't been getting the expected results.Hope you can help.Thank you.
    Information:
    =======
    All children take exams at the age of 16 called a General Certificate of SecondaryEducation (GCSE).
    They have to study and take exams in Mathematics, English and Science, and can take other subjects such as History, French, Art etc. Most students will study between 5 and 10 different subjects before taking their GCSEs.
    For each exam, a student is awarded a grade from A*, A, B,C,D,E,F,G,U,X An A* grade is the best grade achievable and an X is the worst grade.
    In order to analyze how students have performed, each grade is mapped to a numeric value as follows:
    Grade Numerical score
    A* 8
    A 7
    B 6
    C 5
    D 4
    E 3
    F 2
    G 1
    U 0
    X 0
    Now why i need this avgGCSE is because i have to create a view containing avgGCSE of the students it is used in the next question where a condition is avgGCSE is between 6.5 and 7
    In order to calculate the avgGCSE the idea is to calculate the grades of the students and map the grades to their corresponding scores/values
    add them all up and div by the total no of grades to get the avg.
    desc comqdhb.STUDENT@glink;
    STUDENT
    =======
    UPN
    FNAME
    CNAME
    DOB
    GENDER
    PREVIOUSSCHOOL
    XGCSE
    SCHOOL
    ACYR
    STUDENTINGROUP
    =============
    UPN
    GID
    STARTDATE
    ENDDATE
    GRADE
    GRADEVALUES
    ===========
    GRADE
    LEVEL
    VALUE
    I have a opinion that xgcse in STUDENT table refers to the avgGCSE which i want to calculate as when i asked my professor as to what xgcse he said that he forgot to take it out of the table and it is not necessary while creating avggcse.
    select *
    from comqdhb.student@glink
    where xgcse<6.5; Displaying a result
    returns:
    UPN FAMILYNAME COMMONNAME DATEOFBIR GENDER PREVIOUSSCHOOL XGCSE SCHOOL ACYR
    ===========================================================================
    1011 KIMBERLY ABBOT 07-JUL-79 f none 3.93500948 2 2
    select *
    from comqdhb.student@glink
    where xgcse between 6.5 and 7 and upn = 1386; Displaying a result
    returns:
    UPN FAMILYNAME COMMONNAME DATEOFBIR GENDER PREVIOUSSCHOOL XGCSE SCHOOL ACYR
    ===========================================================================
    1386 STEPHANIE AANNESSON 15-JAN-79 f none 6.88873 2 2 so if xgcse is the avgGCSE then upn 1011 has avggcse<6.5 and 1386 has avggcse >6.5
    my idea was backward strategy like so now if we find out upn 1368 has suppose xgcse(avggcse)>6.5 how to extract the avggcse for the particular upn We need to map grades from GRADEVALUES to grade in STUDENTINGROUP and map upn from studentingroup to upn in student to output the values for the corresponding grades from GRADEVALUES
    select grade
    from comqdhb.studentingroup@glink
    where upn = 1011;
    Result:
    GRADE
    =====
    D
    F
    B
    E
    C
    E
    E
    B
    8 rows selected. Mapping each grade to the corresponding value and calculating we get
    32/8=4 total(values to corresponding grades)/no of grades.
    But the xgcse for upn 1011 is 3.935 and i am getting 4!! maybe xgcse isn't avggrade but ? is the procedure by me correct for calculating avggcse
    select grade
    from comqdhb.studentingroup@glink
    where upn = 1386;
    Result:
    GRADE
    ======
    A*
    A*
    A*
    A*
    B
    A*
    A*
    A
    B
    B
    B
    11 rows selected. grade to the corresponding value and calculating we get
    79/11=7.12 total(values to corresponding grades)/no of grades.
    But the xgcse for upn 1011 is 6.88... and i am getting 7.12!!
    But another problem
    when i say
    select   g.value,g.grade
    from     comqdhb.gradevalues@glink g
    ,        comqdhb.studentingroup@glink sg
    where    g.grade=sg.grade
    and      sg.upn=1011;
    result:
    ======
    VALUE GRADE
    ===========
      100 B
      100 B
       80 C
       60 D
       40 E
       40 E
       40 E
       20 F
        6 B
        6 B
        5 C
    VALUE GRADE
    =============
        4 D
        3 E
        3 E
        3 E
        2 F
    16 rows selected.
    select   distinct g.value,g.grade
    from     comqdhb.gradevalues@glink g
    ,        comqdhb.studentingroup@glink sg
    where    g.grade=sg.grade
    and      sg.upn=1011;
    result:
    ======
    VALUE GRADE
    ============
         2 F
       100 B
         6 B
         3 E
        60 D
         5 C
         4 D
        80 C
        40 E
        20 F
    10 rows selected. I am getting only 8 for the query
    select grade
    from comqdhb.studentingroup@glink
    where upn = 1386; here its becomming 10 and also its displaying values as 100 and ...
    select distinct *
    from   comqdhb.gradevalues@glink;
    GRADEVALUES
    ===========
    LEVEL      GRADE           VALUE
    ================================
    a          A                 120
    a          B                 100
    a          C                  80
    a          D                  60
    a          E                  40
    a          F                  20
    a          U                   0
    a          X                   0
    g          A                   7
    g          A*                  8
    g          B                   6
    LEVEL      GRADE           VALUE
    ================================
    g          C                   5
    g          D                   4
    g          E                   3
    g          F                   2
    g          G                   1
    g          U                   0
    g          X                   0
    18 rows selected. I was hoping if i could map the grades and get the values and calculate avggrade by total(values)/count(values)that would be it but here there are values like 100...
    select  sum(g.value)/count(g.grade) as avggrade
    from    comqdhb.gradevalues@glink g
    ,         comqdhb.studentingroup@glink sg
    where  g.grade=sg.grade
    and     sg.upn=1386;
    avggrade
    ========
    37.4375 the avggrade cant be this big and when i map each grade i obtained for 1368 like a to 7+b to 6 so on i get avggrade 7.12
    kindly help.
    Edited by: Trooper on Dec 15, 2008 4:49 AM

Maybe you are looking for