Dynamic drop database link

Hi,
As user SYS i need to Dynamically DROP all the database link in the Database.
I cant drop private database link .
For example i have few database links under APPS schema that i would like to drop.
Please note that it should be done by SYS user
SQL> declare
  2 
  3  cursor c is
  4  select *
  5  from dba_db_links;
  6 
  7 
  8  begin
  9  for c_rec in c loop
10 
11      if c_rec.owner = 'PUBLIC' then
12          execute immediate ' drop public database link '||'"'||c_rec.db_link||'"';
13      else
14          dbms_output.put_line (' drop database link '||'"'||c_rec.db_link||'"');
15           execute immediate ' drop database link '||'"'||c_rec.db_link||'"';
16      end if;     
17  end loop;
18 
19  end;
20  /
drop database link "APPS_TO_APPS"
declare
ERROR at line 1:
ORA-02024: database link not found
ORA-06512: at line 15Thanks

791550 wrote:
Yet it doest work please see bellow:Correct. The domain name can optionally be included with the database name. So if you for example want to drop database link "ABC.DEF.WORLD.COM", does ABC refer to the link name and DEF.WORLD.COM to the domain?
Or is ABC the schema name, DEF the link name and WORLD.COM the domain?
And what is schema ABC exists with link DEF.WORLD.COM and in the current schema there's a link called ABC for domain DEF.WORLD.COM ?
So there is no clean and correct way for Oracle to resolve the schema scope of a database link name.
If you, as SYS, want to drop all database links, then you can use the DBMS_SYS_SQL interface - this is a (mostly undocumented) interface for parsing SQL as any specific schema on the database. The DBMS_SQL interface (restricted to parsing as the current schema) is documented and runs on top of this system interface.
E.g.
create or replace procedure DropDbLink( schemaName varchar2, dbLink varchar2 ) is
        cur     number;
        plsql   varchar2(1000);
        uid     number;
        rc      number;
begin
        select
                u.user_id into uid
        from    dba_users u
        where   u.username = schemaName;
        plsql := 'drop database link "'||dbLink||'"';
        cur := SYS.DBMS_SYS_SQL.open_cursor;
        SYS.DBMS_SYS_SQL.parse_as_user(
                c => cur,
                statement => plsql,
                language_flag => DBMS_SQL.native,
                userID => uid
        rc := SYS.DBMS_SYS_SQL.execute( cur );
        SYS.DBMS_SYS_SQL.close_cursor( cur );
end;
/This proc, as SYS, allows you to drop any private database link from the SYS schema.

Similar Messages

  • Drop database link

    I'm having trouble dropping a database link. In SQLPlus I get:
    SQL> SELECT db_link FROM USER_DB_LINKS where db_link like 'PROD%';
    DB_LINK
    PROD.CBS.STATE.OR.US
    PROD.CBS.STATE.OR.US
    PROD_DB.CBS.STATE.OR.US
    PROD_RI.CBS.STATE.OR.US
    SQL> drop database link PROD_RI.CBS.STATE.OR.US;
    drop database link PROD_RI.CBS.STATE.OR.US
    ERROR at line 1:
    ORA-02084: database name is missing a component
    This is the method identified in the 10g manual: http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10739/ds_admin.htm#sthref3729
    When I try to drop the same link using OEM, I get the message:
    ORA-02024: database link not found
    In the case of OEM, I'm logging on as a different user then the owner of the link. In the case of SQLPlus, I get the same error whether or not I'm logged in as the owner of the db link, or myself.
    Thanks,
    Chuck

    Using the quotes worked:
    drop database link "PROD_RI.CBS.STATE.OR.US";
    but only if I own the database link. How, as the DBA, can I get rid of a link that someone else created (our DEV system is littered with experiemental links).
    The same above doesn't work if it's owned by someone else:
    SQL> DROP DATABASE LINK "IRISHRD.CBS.STATE.OR.US";
    DROP DATABASE LINK "IRISHRD.CBS.STATE.OR.US"
    ERROR at line 1:
    ORA-02024: database link not found
    I tried changing the schema context to no avail either:
    SQL> DROP DATABASE LINK "IRISHRD.CBS.STATE.OR.US";
    DROP DATABASE LINK "IRISHRD.CBS.STATE.OR.US"
    ERROR at line 1:
    ORA-01031: insufficient privileges
    Thanks,
    Chuck

  • Drop database link & ORA-02082 Error

    Hello,
    I have created db link. Now, I would like to DROP it but I got "ORA-02082 a loopback database link must have a connection qualifier".
    I have tried every possible combination but without success.
    Thanks for help
    sasa

    Hello Barbara,
    I agree with you that if db link exist I should be able to drop it. If you look into my first reply there is complete select from user_db_links. Select from dba_db_links are the same because I haven't any others db links. I try to drop the db link as owner or as sys. I do not need to think about drop with name "qwer.cscargo.cz" because is wrong (our inner domain is "in.cscargo.cz"). The only difference among others db links is that qwer have "current_user".
    DB_LINK USERNAME HOST
    CARGODB.IN.CSCARGO.CZ CARGO_ADM cargodb
    LMDB.IN.CSCARGO.CZ CARGO_ADM lmdb
    QWER.IN.CSCARGO.CZ CURRENT_USER speisdb
    SPEISDB.IN.CSCARGO.CZ CARGO_ADM speisdb_rac
    There could be one problem. I created the db link when my db have name "speisdb". I rename my db (using rman - duplicate db) to "speisdev". Could be this source of problems?
    Here is output of your drop script:
    drop database link qwer
    ERROR at line 1:
    ORA-02082: a loopback database link must have a connection qualifier
    drop database link qwer.cscargo.cz
    ERROR at line 1:
    ORA-02024: database link not found
    drop database link qwer.in.cscargo.cz
    ERROR at line 1:
    ORA-02084: database name is missing a component
    drop database link qwer@loopback
    ERROR at line 1:
    ORA-02024: database link not found
    drop database link qwer.cscargo.cz@loopback
    ERROR at line 1:
    ORA-02024: database link not found
    drop database link qwer.in.cscargo.cz@loopback
    ERROR at line 1:
    ORA-02084: database name is missing a component
    drop public database link qwer
    ERROR at line 1:
    ORA-02082: a loopback database link must have a connection qualifier
    drop public database link qwer.cscargo.cz
    ERROR at line 1:
    ORA-02024: database link not found
    drop public database link qwer.in.cscargo.cz
    ERROR at line 1:
    ORA-02084: database name is missing a component
    drop public database link qwer@loopback
    ERROR at line 1:
    ORA-02024: database link not found
    drop public database link qwer.cscargo.cz@loopback
    ERROR at line 1:
    ORA-02024: database link not found
    drop public database link qwer.in.cscargo.cz@loopback
    ERROR at line 1:
    ORA-02084: database name is missing a component
    Thanks SASA

  • ORA-02081 error while trying to drop a database link

    Hello,
    I am trying to drop a database link but getting ORA-02081. How do you drop a database link if it is not open? Any help will be much appreciated.
    Mustafa

    Try this:
    COMMIT;
    alter session close database link dbl1;
    drop database link dbl1;
    Regards,

  • Change of a database link in OWB

    I have a good suggestion to change a a database link when a server is moved to another location (in that case the database link of the source module has to be changed)
    In OWB 9.0.2 it's not impossible to delete a database link in OWB, so you have to do it manually
    (in 9.0.4 it should be possible, but this version is also not easy to use).
    - Start SQL Plus and log in as the schema on which the OWB repository is created (e.g. OWB).
    - Drop the database link ('drop database link <dblink name>')
    - Create a new database link in the same schema with the new parameters, e.g:
    CREATE DATABASE LINK "<dblink name>"
    CONNECT TO "<...>" IDENTIFIED BY "<...>"
    USING '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = <hostname>) (PORT = 1521))) (CONNECT_DATA = (SID = <sid> )))'
    Done!
    No stupid errors in OWB when you create the database link in OWB itself.
    Regards,
    Maurice
    ;

    SQL> create view test_view as select dummy from [email protected]
    2 ;
    View created.
    SQL> select dummy from test_view;
    D
    X
    Execution Plan
    0 SELECT STATEMENT (REMOTE) Optimizer=CHOOSE
    1 0 TABLE ACCESS (FULL) OF 'DUAL' FIRST9.XXXX.COM
    Statistics
    7 recursive calls
    4 db block gets
    2 consistent gets
    0 physical reads
    212 redo size
    363 bytes sent via SQL*Net to client
    425 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    NOW WE PULL OUT THE NETWORK CABLE connecting the two servers.
    SQL> select dummy from test_view;
    select dummy from test_view
    ERROR at line 1:
    ORA-02068: following severe error from FIRST9.XXXX.COM
    ORA-03113: end-of-file on communication channel
    So all you have to do is to test for the communications error.

  • How to refresh a created database link?

    I have created a database link with the command:
    CREATE DATABASE LINK mydb.net CONN TO STRMADM IDENTIFIED BY strmadm_pw USING 'mydb.net'
    and then i changed strmadm_pw at the remote database, which may cause the database link inactive. but how to activiate the link again?

    The best thing is always to try it :
    SQL> show user
    USER is "SCOTT"
    SQL> create database link test connect to test identified by test using 'orcl';
    Database link created.
    SQL> create synonym test_tab for test_tab@test;
    Synonym created.
    SQL> select count(*) from test_tab;
      COUNT(*)
             1
    SQL> create or replace function test_func return number is
      2     counter number;
      3  begin
      4     select count(*) into counter from test_tab@test;
      5     return counter;
      6* end;
    SQL> /
    Function created.
    SQL> select test_func from dual;
    TEST_FUNC
             1
    SQL> conn / as sysdba
    Connected.
    SQL> alter user test identified by test1;
    User altered.
    SQL> conn scott/tiger
    Connected.
    SQL> select count(*) from test_tab;
    select count(*) from test_tab
    ERROR at line 1:
    ORA-01017: invalid username/password; logon denied
    ORA-02063: preceding line from TEST
    SQL> select test_func from dual;
    select test_func from dual
    ERROR at line 1:
    ORA-01017: invalid username/password; logon denied
    ORA-02063: preceding line from TEST
    ORA-06512: at "SCOTT.TEST_FUNC", line 4
    SQL> drop database link test;
    Database link dropped.
    SQL> create database link test connect to test identified by test1 using 'orcl';
    Database link created.
    SQL> select count(*) from test_tab;
      COUNT(*)
             1
    SQL> select test_func from dual;
    TEST_FUNC
             1
    SQL>                                                                                                                                                                                                                

  • Database link not working on client

    All,
    Platform : Linux
    I have created a db link called "TEST_TO_MART " on 11.2.0.1 database which is pointing to another 11.2.0.1 database . Both are resides on same server. I'm getting following error when I'm trying to test.
    SQL> sho user
    USER is "TEST_APP"
    SQL> select * from dual@TEST_TO_MART;
    select * from dual@TEST_TO_MART
    ERROR at line 1:
    ORA-01034: ORACLE not available
    ORA-02063: preceding line from TEST_TO_MART
    Process ID: 3466
    Session ID: 360 Serial number: 16949Target database is up and able to connect without any issues.
    Can you guys suggest me what is the problem?
    Thanks.

    Sorry.  My error and situation seemed so close to this unsolved issue from a year ago, that I didn't copy and paste the details initially.  Here goes:
    oracle@linux99 ~]$ sqlplus
    SQL*Plus: Release 11.2.0.3.0 Production on Mon Aug 12 22:56:33 2013
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    Enter user-name: test_dblink_20130812
    Enter password:
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> DROP DATABASE LINK "TEST_NOW.MDBT.XXX.COM";
    Database link dropped.
    SQL> CREATE DATABASE LINK "TEST_NOW.MDBT.XXX.COM"
    CONNECT TO APP_UHYDRAST_RW
    IDENTIFIED BY XXXXXXXX
    USING 'mdbt';  2    3    4
    Database link created.
    SQL> select * from dual@TEST_NOW.MDBT.XXX.COM;
    select * from dual@TEST_NOW.MDBT.XXX.COM
    ERROR at line 1:
    ORA-01034: ORACLE not available
    ORA-02063: preceding line from TEST_NOW.MDBT.XXX.COM
    Process ID: 6638
    Session ID: 544 Serial number: 1753
    In listener.ora, we have this (some other DB's are in lower case):
    (SID_DESC =
          (SID_NAME = MDBT)
          (ORACLE_HOME = /ora5/app/oracle/product/11.2.0)
          (GLOBAL_DBNAME = MDBT)
    and, in tnsnames.ora we have this:
    LISTENER_MDBT =
      (ADDRESS = (PROTOCOL = TCP)(HOST = linux99.XXX.com)(PORT = 1522))
    MDBT =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = tcp)(HOST = linux99)(PORT = 1522))
        (CONNECT_DATA =
          (SERVICE_NAME = mdbt.XXX.com)
          (SERVICE_NAME = mdbt)
          (SID = MDBT)

  • Problem with database links (naming) Windows/Linux

    Hi
    Windows xp SP3_
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 21 10:28:21 2012
    Connected to:
    Oracle Database 11g Release 11.2.0.1.0 - Production
    name is PORCL30
    Linux (Ubuntu 12.04 LTS)_
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 21 10:28:21 2012
    Connected to:
    Oracle Database 11g Release 11.2.0.1.0 - Production
    Name is GWORCL
    My domain is Initial-Surname.co.uk (I-Surname.co.uk)
    Tnsnames.ora
    PORCL30 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP) (HOST = home1.I-Surname.co.uk) (PORT = 1521) )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SID = PORCL30)
    (SERVICE_NAME = PORCL30.I-Surname.co.uk)
    GWORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP) (HOST = freds-server.I-Surname.co.uk) (PORT = 1521) )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SID = GWORCL)
    (SERVICE_NAME = GWORCL.I-Surname.co.uk)
    From Windows to Linux
    DROP DATABASE LINK "GWLINK4";
    CREATE DATABASE LINK "GWLINK4"
    CONNECT TO "SYSTEM" IDENTIFIED BY VALUES '051BDCE........D55BB704DA'
    USING 'GWORCL';
    results in a working database link named 'GWLINK4.I-Surname.co.uk'
    Where as
    Linux to Windows
    DROP DATABASE LINK "PLINK4";
    CREATE DATABASE LINK "PLINK4"
    CONNECT TO "SYSTEM" IDENTIFIED BY VALUES '0550AA0F39......AE5EF62220FE5A323'
    USING 'PORCL30';
    name is PLINK4 as determined by
    select DB_LINK from user_db_links;
    So what is different between the two databases other than the operating systems they run on? What should I examine?
    I should add that the linux PC is Internet facing and has a Public IP address (USB mobile broadband Modem) to which I-Surname.co.uk resolves via (ZoneEdit.com and ddclient). The ethernet lan port 10.10.1.35 connects to a switch where 10.10.1.30 (home1) is also connected (10.10.1.10 is the AD server)
    Thanks for your time
    Edited by: Neill_R on Nov 21, 2012 1:09 PM

    The problem is that the databases do not work in the same way. As I have said one produces DBLINK.i-surname.co.uk and the other DBLINK. Both machines are members of the i-surname.co.uk domain.
    In Sqldeveloper one can not alter the DBLINK since it has a "-" character (.I-Surname.co.uk)
    Why the difference?
    connect system@TNSGWORCL
    CREATE DATABASE LINK PLINK
    CONNECT TO SYSTEM IDENTIFIED BY
    USING 'TNSPORCL30';
    Connect system@tnsporcl30
    CREATE DATABASE LINK GWLINK
    CONNECT TO SYSTEM IDENTIFIED BY
    USING 'TNSGWORCL';
    connect system@tnsgworcl
    Enter password:
    Connected.
    select 1||' - '||db_link from sys.user_db_links
    union
    select 2||' - '||db_link from sys.user_db_links@PLINK
    DB_LINK
    1 - PLINK
    2 - GWLINK.I-SURNAME.CO.UK
    SQL> connect system@tnsporcl30
    Enter password:
    Connected.
    select 1||' - '||db_link from sys.user_db_links
    union
    select 2||' - '||db_link from sys.user_db_links@GWLINK
    DB_LINK
    1 - GWLINK.I-SURNAME.CO.UK
    2 - PLINK
    Tnsnames.ora
    # tnsnames.ora Network Configuration File: /opt/oracle/11g/network/admin/tnsnames.ora
    # Generated by Oracle configuration tools.
    TNSGWORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = freds-server.i-surname.co.uk)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SID = GWORCL)
    (SERVICE_NAME = GWORCL.i-surname.co.uk)
    TNSPORCL30 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = home1.i-surname.co.uk)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SID = PORCL30)
    (SERVICE_NAME = PORCL30.i-surname.co.uk)
    )

  • DROP DB Link within PL/SQL proc.

    Hi,
    In a PL/SQL procedure and I have to delete and recreate a DB Link within a cursor. The DB Link has always the same name but the definition changes depending of some parameters. If I add DBMS_SESSION.CLOSE_DATABASE_LINK(my_dblink) and EXECUTE IMMEDIATE 'DROP DATABASE LINK my_dblink', I got this error message ORA-00439: feature not enabled: Enterprise User Security. If I don't use DBMS... I got ORA-02011: duplicate database link name. So, it seems I'm unable to delete and recreate a DB Link within my cursor. Any idea what's wrong?
    Thank you.

    This is the part not working :
    LOOP
    FETCH cur_modele_abc INTO v_no_centre, v_modele;
    EXIT WHEN cur_modele_abc%NOTFOUND;
    BEGIN
    --DBMS_SESSION.CLOSE_DATABASE_LINK('MY_DB_LINK');
    EXECUTE IMMEDIATE 'DROP DATABASE LINK MY_DB_LINK';
    COMMIT;
    EXCEPTION WHEN OTHERS THEN --> Si dblink était inexistant.
    v_string := 'CREATE DATABASE LINK MY_DB_LINK'
    ||' CONNECT TO '|| v_modele ||' IDENTIFIED BY '|| v_modele ||
    ' USING ''ABC_NATREL''';
    END;
    v_string := 'CREATE DATABASE LINK MY_DB_LINK'
    ||' CONNECT TO '|| v_modele ||' IDENTIFIED BY '|| v_modele ||
    ' USING ''ABC_NATREL''';
    EXECUTE IMMEDIATE v_string;
    ssdw_abc_stage_production_map.main(v_no_centre, p_job => p_jobname);
         COMMIT;
         --execute immediate 'ALTER SESSION CLOSE DATABASE LINK MY_DB_LINK';
         --DBMS_SESSION.CLOSE_DATABASE_LINK('MY_DB_LINK');
    SELECT TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS') INTO v_date FROM dual;
    abc_courriel('SSDW_STAGE Modèle ABC '||v_date, 'Modèle chargé : '||v_modele||' - '||v_no_centre);
    END LOOP;
    ...

  • Database Link Subsitution

    I am trying to use a substation variable(&DB_Name.) as a database link name in a SQL Query. The value of &DB_Name. is set by the users upon running the application. The problem I'm running into is that the query will not validate because the value of &DB_Name. is not known at the design time. Is it possible to supress the query validation at design time so a variable can be used the link name? Thanks
    Scott

    The SQL validator did not seam to like your last suggestion ether. However, I did come up with a workaround. Instead using multiple links, I created a page process that contains DDL to create a link based on the database that user selects in the application. This allows me to use the same link name in all my SQL Statements but this one link points to whichever database was selected by the user. Here's a brief summary of the code.
    Drop Database Link dblink
    if :dbselect = db1 then
    Create Database Link dblink
    with properties for db1...
    else
    Create Database Link dblink
    with properties for db2...
    end if

  • Change Ownership of Database Link

    Hi Gurus,
    How would I alter the ownership of a newly created database link to another owner (schema) ?
    Thanks,

    Hello;
    Drop and recreate the link in the correct schema.
    Its as simple as that.
    DROP PUBLIC DATABASE LINK <LINK_NAME>;
    or
    DROP DATABASE LINK <LINK_NAME>;
    Create database link ""
    connect to
    identified by ""
    using '(DESCRIPTION =
       (ADDRESS_LIST =
         (ADDRESS =
         (COMMUNITY = tcp.world)
         (PROTOCOL = TCP)
         (Host = )
         (Port = 1521)
       CONNECT_DATA = (SID = )
    )';Best Regards
    mseberg

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

  • Using database link  with a dynamic SQL in Forms 5

    I have a Form 5 application where a database link is specified in a client version of dynamic SQL. The function that the application is designed to perform is to access data in a table in a remote database and use it to populate another table in a local database with the same structure as the source table. Dynamic SQL is used because the name of the table can only be resolved during run time.
    The problem is that it gives error with code 'ORA-03113' and text 'End-of-file on communication channel' when you try to run it.
    Is it not possible to use a database link with a dynamic SQL? What can I do to overcome the problem ?

    Try to create a local view based ao the remote table and use the view.

  • Cannot drop public database link

    Hi all.
    Just trying to drop some old database links and getting the following:
    SQL> select * from dba_db_links where host = 'V638';
    OWNER DB_LINK USERNAME HOST CREATED
    PUBLIC V638 SYSADM V638 23-SEP-04
    SQL> drop public database link V638;
    drop public database link V638
    ERROR at line 1:
    ORA-02024: database link not found
    There was another db link in there called V638.WORLD and when I issued
    drop public database link v638 it removed that one with no errors...
    Any way I can get rid of this other one?
    Version info:
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    PL/SQL Release 9.2.0.4.0 - Production
    CORE 9.2.0.3.0 Production
    TNS for Solaris: Version 9.2.0.4.0 - Production
    NLSRTL Version 9.2.0.4.0 - Production
    Thanks

    Yes I already tried that...
    SQL> select * from global_name;
    GLOBAL_NAME
    VTEST1.WORLD
    SQL> alter database rename global_name to test.world;
    Database altered.
    SQL> alter database rename global_name to test.world;
    Database altered.
    SQL> select * from global_name;
    GLOBAL_NAME
    TEST.WORLD
    SQL> drop public database link v638;
    drop public database link v638
    ERROR at line 1:
    ORA-02024: database link not found
    SQL> alter database rename global_name to vtest1.world;
    Database altered.
    SQL> select * from global_name;
    GLOBAL_NAME
    VTEST1.WORLD

  • Cann't Drop public database link

    I am not able to drop public database link .
    Oracle Version - 11.2.0.1.0 - 64bit Production
    Os Version - Sun Solaris .
    When I am going to drop a public database link it's give a error :
    SQL Error: ORA-00604: error occurred at recursive SQL level 1
    ORA-20000: Can not drop Object
    ORA-06512: at line 2
    00604. 00000 - "error occurred at recursive SQL level %s"
    Can anyone help to resolve this problem? It is a Production Database and it's a Urgent .
    Thanks,
    Dip Sankar Rana

    You say:
    I already given syntax of creating Public database link.
    But you should give real details (exact statements and exact results) to make it clear what you are attempting and what your problem is.
    Please show:
    - The CREATE PUBLIC DATABASE LINK statement (obscuring the password, of course) and its result (i.e. success or failure message)
    - From each of schema1 (working) and schema2 (not working):
    - - The result of SELECT USER FROM DUAL;
    - - The result of SELECT USER FROM DUAL@DB_TST;
    - - The result of SELECT COUNT(*) FROM ALL_OBJECTS@DB_TST WHERE OWNER = 'B1';
    In the meantime, an observation.
    You said:
    I create a public db link from schema1 to other database using below command --
    CREATE PUBLIC DATABASE LINK DB_TST
    CONNECT TO B1 IDENTIFIED BY password
    USING 'SPPROD'Note that any user (in caps: ANY USER) on this database can use this link to connect to database SPPROD as B1 without knowing the password - because you put the credentials in the link.
    If you have a PUBLIC database link with credentials, like you do here, you have a serious, glaring security exposure. You really, REALLY should not do this. Use a private database link (available only to the user that created it) or do not put credentials on the link (so that any user using that link is using his own credentials to connect to the remote database).
    Edited by: mtefft on Jan 14, 2011 4:14 AM

Maybe you are looking for

  • Payee field in F-48

    Hi In the developement system when I enter the alternate payee and permitted payee field in the vendor master and then go to transaction F-48. I can see the payee field. When I try the same in the quality the payee field does not populate in F-48. pl

  • Can Tivoli (TWS) be used for scheduling WebI reports in BO XI 3.1?

    I am trying to figure out if it is possible to schedule WebI reports to refresh using TWS? We are using BO XI 3.1 SP2 deployed on unix and would like to use TWS to refresh WebI reports that are built on SAP BW Bex queries.  Does anyone have any exper

  • Export / Import with FULL=Y

    Hello DBA's, after consulting several thread on exp/imp with the option full=y the doubt that I have left is when using imp with full=y ignore=y in a new data base, the data base obtained will be equal to the data base from which export with full=y b

  • Synch SOAP scenario - access request data as part of response mapping?

    Hello experts, I have a synch SOAP scenario which is working but I want to improve the error handling. Under normal situation I send the SOAP request and the remote web service responds with a given message structure which includes my invoice number

  • How table statistics going to affect insert statements

    I have 2 DB's.I have a process in both DB's which will load records in to tab1 using sql loader.Tab1 in DB1 is not analyzed since 2005 while tab1 in DB2 is recently analyzed.My SQL ldr process is slow in DB1 when compared to DB2. I am wondering how s