ORA-02018: database link of same name has an open connection

Hi All,
Am getting the above error msg from a procedure (packaged or not, doesn't seem to matter), run from a .SQL script through sqlPlus, where I've created a DB link, fired off a bunch of queries against it using dynamic SQL, and then tried to drop the database link. Have tried both through dynamic SQL as well as via as a straight statement in the SQL script and in both cases, get this statement. However, if I then open another connection/session to the DB, am able to drop the link fine. So - it seems related to the session life-cycle? Perhaps some sort of caching going on at the DB level is locking the DB link? Anyone else hit this, and if so, any clues on workarounds?
Pretty sure this is "new" (10g) behavior as this script used to work fine in older (9i) DBs...
Thanks,
Jim

Check this link. It explains exactly what you are facing.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1253651449550
Regards
Raj

Similar Messages

  • Need help/info on "database link of same name has an open connection"

    Hello,
    I am trying to create an application on html db (new in html db) to see if I can move data from one database (oracle 9i) say dbdev to another one called dbtest. I want to be able to select the data from html db app and by clicking on a button move them to dbtest ( right now only looking at data from one table ). This is what I have done so far:
    1. created a duplicated table of dbdev into html db with no data.
    2. created package with procedures to
    A. create a database link
    B. delete if there is a record on html db table
    C. go trough a loop (cursor) and get the data from dbdev
    D. drop the database link
    Now, when I do all of the above steps I get an error “database link of same name has an open connection" but when I don’t do the step C. I don’t get this error. So something is wrong in my step C. On my step C, I just open the cursor, do a for loop and insert the records into my html db table.
    Any idea!!!
    Thanks
    More questions to come…..

    never mind, I should not drop the database link with in the procedure.
    thx

  • Persistent Layer Error Message: ORA-01729 database link name expected

    Hi,
    I've done a series of loads from DB2 into Oracle, initially importing the database objects from DB2 and Oracle, then creating the mappings, deploying and executing. It all worked and I had no problems. For some reason now whenever I tried to import a new Database Object (table) from the DB2 I enter the password, test it and it successfully connects but then I get the error message on a popup box:
    SQL Exception
    Persistent Layer Error: SQL Exception
    Class Name: CacheMediator
    Method Name: getSQLResult
    Persistent Layer Error Message: ORA-01729 database link name expected
    If I create a new location for the same database it works and I can import new objects. The only difference I can think from the initial imports is that I’ve moved the repository from one server to another. Might be the case where some information got corrupted in the metadata.
    Has anyone seen this kind of problem before? Can you please help me out with this issue?
    Thanks in advance for your help.
    Regards,
    Leo

    I found it.When I look at the db links there is something missing.When I correct it everything works fine.

  • Error creating Streams example - ORA-01729: database link name expected

    Running 11gR1. Example from doc, "4 Single-Database Capture and Apply Example"
    the database name is "11G3". when I run the Step 3 statement below, I get the error below. What am I doing wrong? Thanks!
    DECLARE
    iscn NUMBER; -- Variable to hold instantiation SCN value
    BEGIN
    iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();
    DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN(
    source_object_name => 'hr.employees',
    source_database_name => '11G3',
    instantiation_scn => iscn);
    END;
    Error at line 1
    ORA-01729: database link name expected
    ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 742
    ORA-06512: at "SYS.DBMS_APPLY_ADM", line 726
    ORA-06512: at line 5

    The manual stated to be GLOBAL_NAMES compliant which means DBLINK=target DB_NAME and SID cannot start with a figure. I strongly suggest to pay a careful look to manuals as Streams has a lot of others tricks under the hat awaiting for you.

  • Standard Data Collection Failing with Error ORA-04054: database link  does not exist.

    Hi Gurus,
    When I am running Standard Data Collection in ASCP(APS) instance R12.1.3, its failing with error : ORA-04054: database link  does not exist.
    There is no such Database link exits which is showing in above error.
    Also the database link name in the above error is not profile values in the database.
    I think, concurrent might be fetching this database link name  from some tables related to plan.
    I am not having much knowledge about how this ASCP/APS works.
    Need your help to resolve this issue.
    Thanks,

    Hi,
    ASCP Collections looks at the dblink from instances definitions from.
    1. Responsibility: Advanced Planning Administrator
    2. Navigation: Admin > Instances
    You may review the note in support.oracle.com - Understanding DB Links Setup for APS Applications - ASCP and ATP Functionality (Doc ID 813231.1)

  • Is it possible to create a Clone database with the same name of source db ?

    Is it possible to create a Clone database with the same name of source db using RMAN ...
    DB version is 11.2.0.2
    Is it possible to clone a 11.2.0.2 database to 11.2.0.3 home location directly on a new server . If it starts in a upgrade mode , it is ok ....

    user11919409 wrote:
    Is it possible to create a Clone database with the same name of source db using RMAN ...
    yes
    >
    DB version is 11.2.0.2
    Is it possible to clone a 11.2.0.2 database to 11.2.0.3 home location directly on a new server . If it starts in a upgrade mode , it is ok ....yes
    Handle:     user11919409
    Status Level:     Newbie (10)
    Registered:     Dec 7, 2009
    Total Posts:     102
    Total Questions:     28 (22 unresolved)
    why do you waste time here when you rarely get any answers to your questions?

  • New database link gets long name with domain name

    When I create a database link with a name "X", oracle renames it to X.regress.rdbms.dev.us.oracle.com
    Why?

    Check this thread:
    REGRESS.RDBMS.DEV.US.ORACLE.COM  concates to every databaselink name.

  • Database link between the databases with the same name

    Hi,
    I need to establish a db link between two databases that are named the same way on two different servers.
    server 1 has a database dev1 and server2 has a database dev1. The tnsnames on server2:
    DEV1 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = server2)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = DEV1)
    DEV1_server1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = server1)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = dev1)
    Can anyone let me know a way to create a database link between the two above?
    Thanks.

    Hi,
    Am not sure what problem you are facing in creating a db link
    create database link dev1_server1 connect to x identified by x using "dev1_server1"
    create database link dev1_server2 connect to x identified by x using "dev1_server2"where dev1_server1 and dev2_server2 are the tns entry in tnsnames.ora file of server2 and server1 respectively.
    Regards
    Anurag

  • Can I create a database with the same name and DBID that one is dropped?

    Hello,
    I need to restore a backup database, made with Oracle Enterprise Manager, in a new one, because the original is dropped. I've tried it with the recovery tools but fails, i suppose because the dbid's are not the same.
    Then, Is it possible create a new database with the same old database dbid to restore de backup?
    Thank you very much.
    P.D.: I've too THE OLD spfile---.ora y el pwd---.ora

    I think you are using the same Composition Class on both project. On the properties tab, you can change this number (e.g.: EDGE-1637270).

  • Database Link on Same Database

    It seems funny to me that If you are importing source metadata from the same database but different schemas you still need to use a dblink. Fetching data over the dblink will require more process overhead than granting select privileges to the owbdesign user.
    Is there anyway I can import metadata from at the same db server without using dblink? Am I missing something?
    Thanks,
    Leo

    A location is a logical entity that describes where a certain OWB object is located. There are several types of locations: an oracle database location refers to an Oracle DB schema, a file location refers to a file on a file system, a SAP location refers to a SAP instance etc. During deployment, the location will have to be 'registered' - i.e.the phisical location parameters will have to be specified (username/password, db instance, port and hostname for the database for example).
    A connector is an object that is created implicitely by OWB once it is established that data will be flowing from one location to the other (for example, if both locations are databases, the connector will represent a database link).
    Regards:
    Igor

  • ODI dataloading Fails With ORA-01729: database link name expected

    Hi All,
              can any one provide me the solution for this error..
    thanks,
    Yogi.

    The correct syntax for denoting a table in a remote database follows:
    username.table_name@ database_name

  • Multiple databases with the same name ... only one named DB can be found

    Hi All
    We are currently in the progress of migrating over to APEX 3.2 from HTMLDB 2.1.
    We have 3 instances on each version - DEV, UAT, LIV.
    The HTMLDB servers and databases are set up with no problems in grid control. However, the new apex instances are not being found (different servers) - I think this has something to do with the names (global database name) being the same as an existing database that is already configured on GC.
    Is there a way around this? as we plan to keep both versions of APEX/HTMLDB running in parallel for at least the next few months.
    Thanks in advance.
    Jake.

    can you manually discover the new instances on the new server?
    Then just make sure the name that appears in Grid Control is different.
    e.g. prod.world is on server A and B. When you discover in Grid control, you can make it prod_B and you will see the latter without any problem.

  • Can't create an E-mail acct after mail list by same name has been deleted.

    I deleted a mailing list through delegated administrator because the user wants it created as an E-mail account instead. After deleting the list through the delegated administrator interface (and after waiting 1.5 hours!) I still cannot create the E-mail account. It says the name is already in use. Is there a way to purge the mailing list name from the system so I can create this E-mail account right away?

    to purge the user
    use command line utility
    ./imadmin user purge
    ( default purge is 10 days, specify -g 0 if required imeediately)

  • ORA-04054 : using variable substitution for the database link name

    Hi,
    I need to use variable substitution for the database link name.
    Here is my command :
    declare
    GET VARCHAR2(50);
    begin
    select OIA_GET_DESIGNATION into GET from INFODRI.OMA_IN_ARTICLES;
    for rec in (select * from [email protected]_GET_DESIGNATION)
    LOOP
    dbms_output.put_line('TEN_CODE vaut : '||rec.ten_code);
    END LOOP;
    exception
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERREUR ORACLE DETECTEE : '||rec.OIR_CUR);
    DBMS_OUTPUT.PUT_LINE('Message Erreur : '||SUBSTR(SQLERRM,1,245));
    :crd := -1;
    end;
    When I run this programm, I receive the error :
    ORA-04054: database link REC.OIA_GET_DESIGNATION does not exist
    When I replace :
    for rec in (select * from [email protected]_GET_DESIGNATION)
    by :
    for rec in (execute immediate 'select * from tensions@'||rec.OIA_GET_DESIGNATION)
    I receive the error :
    PLS-00103 : Encountered the symbol "IMMEDIATE" while parsing.
    What can I do to resolv my problem ?
    Regards,
    Rachel

    What is the name of the DB Link and the name of the object you are selecting
    from?
    I find it easier to create a view on the remote object then use that in selects.
    e.g,
    Link Name = MyLink
    Object_name = Addr_Loc
    create or replace VIEW Rem_Addr_Loc AS
    select * from addr_loc@mylink;
    In the code I then use the view
    begin
      for C_Rec in (select * from Rem_Addr_loc)
      loop
         dbms_output.put_line('Rec: '|| C_Rec.Col1);
      end loop;
    end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • ORA-02020 too many database links

    Hello,
    I'm getting the ORA-02020 too many database links error in my Apex application. This error occurs when I run an interactive report in a page. There are 21 pages and 7 database links in the application. Each page has one interactive report that references one database link in the region source.
    The database links are referenced in each page as follows: database link1 (page 1); database link2 (pages 2 and 3); database link3 (pages 4-7), database link4 (pages 8-15); database link5 (pages 16-18); database link6 (pages 19); and database link7 (pages 20-21). Each database link is referenced to separate schemas in one remote Oracle database.
    I tried to eliminate the error by setting the open_links and open_links_per_instance parameters in the init.ora file of the remote and XE databases to 100 then restarted the both databases. This solution did not work. I created separate Application Processes from the Shared Components to close each database link by implementing the following:
    Click on Shared Components> Logic > Application Processes > Create >
    Name: CLOSE_LINK1
    Sequence: 1
    Point: On Load: Before Header (page template header)
    Type: PL/SQL Anonymous Block
    Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
    Error Message: Database Link Error
    When I run the application now, the ORA-02081: database link is not open error appears.
    Please help anyone! I know someone has experienced these same errors.
    Thanks,
    Ms. H

    Joel,
    Thank you for your quick response. For clarification purposes, could you provide samples for 1) issuing the CLOSE DATABASE LINK and catching the exception; and 2) querying from V$DBLINK prior to issuing the CLOSE DATABASE LINK from the Shared Components > Logic > Application Processes?
    Lets assume the following query with a database link in the region source is referenced for Page 1.
    Page 1 - Employee Listing
    Region Source:
    select ename, job, hiredate
    from scott.emp@link1
    Lets assume the following Application Processes from the Shared Components is referenced to close the database link:
    Click on Shared Components> Logic > Application Processes > Create >
    Name: CLOSE_LINK1
    Sequence: 1
    Point: On Load: Before Header (page template header)
    Type: PL/SQL Anonymous Block
    Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
    Error Message: Database Link Error
    My thoughts are to do the following:
    1. Log in SQL*Plus as SYS
    SQL> grant select to v_$dblink to scott;
    2. In Apex, goto Shared Components> Logic > Application Processes and add the following queries in the Process Text:
    Name: CLOSE_LINK1
    Sequence: 1
    Process Text:
    select db_link from v$dblink;
    execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
    3. Catch the exception???
    Your assistance is greatly appreciated. :8}
    Ms. H

Maybe you are looking for