Drop or alter database link question...

I have a database that uses a dblink to connect to a remote database to use a sequence for id's. The remote database is a 12 node rac cluster and when the database link was initially created the admin that created it only specified one of the nodes in the rac cluster in the comnnection description for the database link.
We want to change the link to include both rac nodes but we have a bunch of synonyms that point to the database link and I do not want to invalidate the synonyms.
If I alter the dblink as opposed to drop and recreate then will the synonyms become unusable or invaildated?
Thanks.

First, you cannot change the connection information for a database link using the ALTER DATABASE LINK statement. You'll need to drop and recreate the database link to do so. From the documentation
You cannot use this statement to change the connection or authentication user associated with the database link. To change user, you must re-create the database link.Second, are you saying that the TNS entry was specified explicitly in the CREATE DATABASE LINK statement rather than specifying a TNS alias (i.e. an entry in a tnsnames.ora file)? Normally, you'd specify a TNS alias when you create the database link in which case you could simply modify that alias rather than changing the database link.
Third, synonyms do not become unusable or invalid just because the underlying object does not exist
SQL> create synonym invalid_synonym
  2    for not_a_user.not_a_table@not_a_link;
Synonym created.
SQL> select status from dba_objects where object_name = 'INVALID_SYNONYM';
STATUS
VALIDYou'll get an error if you try to use the synonym, of course, but it won't be invalid. As long as you fix the database link before someone tries to use the synonym, there is no issue.
Justin

Similar Messages

  • Alter database link

    Hi Team,
    Can we alter a public database link to connect to a different db using the below statement?
    Alter public database link link_name connect to schema identified by password using 'newdb';
    Db version is 10.2.0.4

    You can't change connection string.You have to create new database link.
    http://docs.oracle.com/cd/E11882_01/server.112/e17118/statements_1005.htm
    Also
         user13364377      
           Newbie
    Handle:      user13364377 
    Status Level:      Newbie (10)
    Registered:      Jul 5, 2010
    Total Posts:      340
    Total Questions:      151 (110 unresolved) Why you have so many unresolved thread???
    Try to close your old threads.

  • Create View from Database Links - Question

    Question
    I'm missing something simple.
    I'm trying to create a view, from a Database Link.
    CREATE VIEW view_name
    AS SELECT a.*
    FROM schema.tablename@dblink a;
    When I run this in the SQL Commands window.
    I get this error message.
    ORA-00933: SQL command not properly ended
    What am I missing? Any help is appreciated...

    <i>CREATE VIEW vw_name
    AS SELECT a.*
    FROM [email protected] a;
    </i>
    <br>
    1) User (schema) which is creating view must have proper db_link to source database. For that try this for testing purpose:
    select 1 from [email protected]<br>
    If this fail then db_link is not ok! This step is absolute must to go any further step to!!!
    <br>
    2) when db_link is set, then your view should be named as:
    CREATE VIEW vw_name
    AS SELECT *
    FROM <b>schema_name</b>.[email protected];<br>
    please pay attention to "schema_name", because from remote side every table is in some schema so it really need declaration of owner schema.
    <br>
    Hope this helps...

  • Database Link question ! Please help me ....

    Hi everybody,
    I have some question about database link.
    For example, I have 3 database, database 1 and database 2 connect together by database link db_link1, database 2 and database 3 connect together by database link db_link2.
    I want to ask: Can I connect from database 1 to database 3 ? ( Of course don't use database link between database 1 and 3, just use database db_link1 and db_link2 )
    Both db_link1 and db_link2 are public database link.
    Can I restrict user access by 2 these public database link ?
    Thanks a lot.

    A database link has directionality-- it connects from one database to another database. It is not a bi-directional link.
    Assuming db_link1 exists in database 1 and connects to database 2 and db_link2 exists in database 2 and connects to database 3, it should be possible to read data that is in database 3 from database 1 without creating a new database link. But you'd need some sort of intermediate layer in database 2 (i.e. a view in database 2 that queries an object in database 3) because you can't nest database links in a single SQL statement. Of course, you would almost never actually do this for a variety of reasons. The only time I've ever heard of someone using this sort of setup is if database 1 is a very recent version of Oracle and database 3 is a very very old version of Oracle such that a database link between 1 and 3 is not possible.
    If you create a public database link, you cannot restrict access to that link short of potentially doing something with VPD. If you're creating a database link using a fixed username & password that would create a security issue, it would make far more sense to create private database links.
    Justin

  • Database link question

    hello,
    the requirement is that schemaA of databaseA should be able to access tableB.schemaB (different schema) in databaseB. What type of database link is required here, public or private? Is it required to have a user called schemaA in databaseB with the same schema name?
    Firstly, I created the same user in databaseB called schemaA. That only created a user called schemaA and no schema.
    I then created a database link as schemA in database A, .
    CREATE DATABASE LINK DB9
    CONNECT TO schemaA IDENTIFIED BY password
    USING 'databaseB';
    I am now trying to issue in schemaA the following statement and it won't work.
    select * from tableB.schemaB@DB9
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-02063: preceding line from DB9

    Hi dembal,
    1. It's schema.table not table.schema.So your query should read: select * from schemaB.tableB@DB9.
    2. Your dblink connects to schemaA on DB9. So of course, you can't connect to DB9 and look for a table in schemaB.

  • Database Link Question in JDev.

    Dear all,
    How can I get/read data from Oracle 9i database in Jdev 10.1.3 (Oracle 10g database). I've created the database link.
    Thanks for advance.

    It depends on what you want to do. What is your use case?
    If you want to query the database you can open the connection and browse the database objects and table content. You can also choose to start a sql*plus session and write what ever sql and pl/sql you need against the database.
    If you are writing a Java application you must configure a JDBC connection and write classes to encapsulate your queries. Please, see the JDBC section on OTN. It has lots of usefull examples on this huge topic.

  • 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

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

  • Deleting database links

    When create a data source in OWB, I have to add a database link (in the connection tab, by pressing the "New Db link" button).
    But how can I delete all the database links already defined and not needed anymore? There's no delete button for doing this.
    Regards,
    Maurice

    I don't think it is possible to delete them from OWB.
    You can log in to the OWB user in SQL*Plus and drop the db link here with the syntax below or drop it through Enterprise Manager Console.
    DROP [PUBLIC] DATABASE LINK <link_name>
    Restrictions: You cannot drop a database link in another user's schema and you must specify PUBLIC to drop a PUBLIC database link.
    Regards
    Bent

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

  • Database Link name altered automatically

    Hi everybody,
    I'm facing here some strange behavior when I'm trying to create a database link. Here's the statement for creating the database link:
    CREATE DATABASE LINK "DEVELOP" CONNECT TO "XXX" IDENTIFIED BY XXX USING 'develop';
    After starting Oracle's SQL Developer it turns out that the link is successfully created.
    BUT it's not named 'DEVELOP' as expected! Instead the link is named 'DEVELOP.100.10.82.181'
    This leads to problems with a DataPump-Job because of an "invalid argument" (I suppose in this case the wrong link name)
    How can I avoid this behavior? Or is it possible to alter the name? So far I did not found a solution or comprehendible explanation.
    Any help will be highly appreciated.
    Kind regards
    Alex

    Robert Geier wrote:
    Database version ?
    select db_link from dba_db_links;
    Try removing some of the quotes.@Robert: removing the quotes did not solve the problem.
    Operating System: Mac OS X 10.5.8
    SQL> SELECT * from v$version;
    BANNER
    Oracle Database 10g Release 10.2.0.4.0 - Production
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for MacOS X Server: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> select db_link from dba_db_links;
    DB_LINK
    DEVELOP.100.10.82.181
    SQL> SELECT * FROM GLOBAL_NAME;
    GLOBAL_NAME
    CORPUS.100.10.82.181
    SQL> SHOW PARAMETER global;
    NAME TYPE VALUE
    global_context_pool_size string
    global_names boolean FALSE
    Thanks again
    Edited by: user9253174 on 03.03.2010 01:41

  • 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

  • Greek Data becomes Question Marks when passed through a Database Link

    Hi All,
    We have a 10gR2 sharing a Win32 Server with an MSSQL 2005.
    Data transfers between these are set up using an HS Database Link.
    All latin data is passing well, however we have some Greek in there and its transformed to question marks on the way.
    Measures attempted so far:
    1. I've set the NLS_CHARACTERSET of the 10g to AL32UTF8 . Entered non-Latin data manually to the 10g - works fine.
    2. I've edited the relevant init.ora file to include the following:
    HS_LANGUAGE = AMERICAN.AL32UTF8
    HS_NLS_NCHAR = AL32UTF8
    3. Restarted the DB and Listener.
    Still question marks
    Ideas?
    Thanks
    Tomer

    HSODBC was never certified with NVARCHAR data types. Have a look at the Generic Connectivity Administrator's Guide. It list all supported data types and nchar/nvarchar/ntext is not listed. You can select from those data types, but there is no guarantee the content of those datatypes will be fetched correctly. There are no conversation routines that properly convert unicode content.
    HSODBC has been desupported 15th of March. I strongly recommend you to use DG4ODBC 11.1.0.7. In addition in DG4ODBC the NVARCHAR/NCHAR functionality has improved a lot.
    DG4ODBC V11.1.0.7 needs to be installed into its own Oracle_Home and it can be used with older Oracle database releases like 10.2.0.4 right out of the box; or you have to apply a compatibility patch to your Oracle database releas 9.2.0.8, 10.1.0.5, 10.2.0.3
    Edited by: kgronau on Dec 10, 2008 8:42 PM
    One thing I forgot to mention is the advantage of using DG4ODBC is it maps the nvarchar to Oracle nvarchar and thus there is no codepage translation required.
    But please pay attention; use 11.1.0.7 not the base release 11.1.0.6 as on Windows based operating systems a high/low byte issue was fixed in 11.1.0.7 which is mandatory for NLS support.

Maybe you are looking for

  • Why does my 8GB Ipod Touch have Voice Memos?

    Why does my 8GB Ipod Touch have Voice Memos?  According to Apple's manual the Voice Memos will only work on the 32GB Ipod Touch.  The old 8GB does not have a microphone.

  • Alternative to Outlook to back up contacts on PC and use calendar

    New owner of iphone 3gs 16gb but have just discovered iphone does not support Outlook 2000. I have a recent laptop but my microsoft office is 2000 professional and this currently suits my needs. I am not in a financial position to upgrade Outlook. Is

  • AddOn Manager ....Installed Addons

    Hello, I have problem after installing Addon. After installing AddOn, it shows the status as "Failed" in Installed Addons under Add-on Manager..... But my report runs successfully. I want to change the status from "Failed" to "Connected". To get the

  • Connecting digital camera w/video output to ipod

    can i view pics by connecting my digital camera with video output straight into my ipod?

  • Different many-many problem

    On the face of it this looks simple. The following meta data and declaration for this relation, in the Condition class:- * @jdo.field collection-type="collection" element-type="com.letsys.erespond.business.model.event.Type" * @jdo.field-vendor-extens