Database Links and Triggers

Hello altogether,
I'm not sure if I am in the right topic here, if not please excuse!
I got the following problem:
My system consists of two parts - one calculation part P1, and one output part P2. Both parts have their own Oracle DBMS. The calculation part P1 calculates a lot of data and replicates this data to the database of the output part P2.
I created a database link from P1 to P2.
Now I used triggers to replicate the data from tables on P1 side to tables on P2 side.
Problem:
This works fine, as long as the number of inserted or updated entries is low. If it increases, I get the error "Too many database links in use", and everything is stuck. I guess this is because too many triggers fire in parallel.
Question:
Is there a possibility to restrict the number of triggers executed in parallel (some kind of semaphor to serialize on), or can multiple triggers share the same database link?
Thanks a lot for your help!
Bye,
Daniel

Besides from using normal oracle replication I would check your triggers.
Do they fire and access the DB for each row? May change this to statement level.
Or switch from some synchonous process (immediatly update the target database) to some asynchronous process (mark the records that needs to be updated/changed, every half an hour do the change).
3rd version? DO you really need two databases? Consider 2 separate schemas on one database instance.

Similar Messages

  • ORA-00022 with Database Link and Trigger

    Hello altogether,
    I got a very strange behaviour with my oracle 10.2.
    I have two nets N1 and N2, where N1 can access the servers in N2, but not the other way round. In both nets I have an Oracle database running (D1 and D2).
    In N1 I calculate some data, which must be replicated to the database in N2. I do this by using triggers on my tables in database D1 copying the inserted or changed data to D2 by using a shared public database link.
    This works fine most of the time. But sometimes I get the following error:
    ERROR [STDERR] Caused by: java.sql.SQLException: ORA-02068: following severe error from D2
    ORA-00022: invalid session ID; access denied
    ORA-06512: at "CUSTOMER", line 13
    ORA-04088: error during execution of trigger 'CUSTOMER'
    When I use the database links manually, they work.
    Any idea?
    Thank you!!
    Daniel

    The ORA-02068 message might be important
    02068, 00000, "following severe error from %s%s"
    // *Cause: A severe error (disconnect, fatal Oracle error) received from
    //         the indicated database link.  See following error text.
    // *Action: Contact the remote system administrator.Have you searched Oracle support for any bugs associated with the ORA-02068?
    Was the remote session killed, the remote database changed to restricted session, or bounced?
    I take it the distributed session is created using a dedicated session and not shared server?
    HTH -- Mark D Powell --

  • Creation of Database link and access the same plus Snapshot creation

    i want talk between two oracle server. i decided to go for snapshot creation with periodical refresh. For which i am having two oracle server's with different ip address located inside our office setup.
    I have created a database link between two servers.
    first server name global
    userid scott
    password tiger
    second server name asil
    userid scott
    password tiger
    both the user have been given dba rights.
    in both the server the services and listners are all started. i gave the following command to create database link.
    from asil server
    create public database link global connect by scott identified by tiger using 'global'
    the command was successful and the link was created. Now i tried to access a table of the scott user of the global server.
    select * from emp@global;
    now it is giving error. I want to know how the link can be created and how it can be accessed. i refered the 8i online documentation and done the things based on that. i expect valuble solution from all possible persons
    null

    A reason for this problem could be that your database is configured that a database link has to have exactly the same name like the global name of the database instance it should connect to.
    Can you please provide the oracle error code / message ? With this information there might be more hints I can give you.

  • A question about CREATE PUBLIC DATABASE LINK and ORA-12154 error

    Dear all,
    I have a problem about public database link creation and I would appreciate if you could kindly give me a hand. I have the following connection parameters in my
    tnsnames.ora file:
    DGPAPROD.WORLD =
         (DESCRIPTION =
           (ADDRESS_LIST =
            (ADDRESS = (COMMUNITY=tcp.world)
              (PROTOCOL=TCP)(HOST=ORASR001)(PORT=1521)
           (CONNECT_DATA = (SID = DGPAPROD))
    ...Having the above mentioned parameters I can connect to this remote database directly in a SQL*Plus shell:
    $ sqlplus username/[email protected] works pretty well and the connection is established without any problem.
    Now, what I would like to do is to create a public database link to this remote database in order to avoid the user/connection switching for viewing the
    content of this database. I proceeded according to the syntax indicated in the Oracle online documentation:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5005.htm#SQLRF01205
    Therefore I run the following in order to create a public database link
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING 'DGPAPROD.WORLD';Apparently there is no error and the link is created successfully. However it cannot resolve the remote host and whenever I run the following query
    (myenterprise is the name of a table in that remote database)
    SELECT *
    FROM myenterprise@SR001_dblink
    ERROR at line 1:
    ORA-12154: TNS:could not resolve the connect identifier specifiedWhat causes this problem?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    spajdy wrote:
    You must have defined DGPAPROD.WORLD in tnsnames.oar on server where you DB is runnig.Hello there,
    Thanks a lot for this nice solution. In fact I had to add the connection parameters into the tnsnames.ora file of the server on which the link was created (not the tnsnames.ora of my oracle client stored on the localhost)
    After a bit googling I found another solution that allows to create the database link:
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING '(DESCRIPTION =  (ADDRESS_LIST =  (ADDRESS = (COMMUNITY=tcp.world)
    (PROTOCOL=TCP)(HOST=ip_adresse)(PORT=1521)))(CONNECT_DATA = (SID = GPAPROD)))';Thanks a lot for your help!
    Kind Regards,
    Dariyoosh
    Edited by: dariyoosh on 18 nov. 2009 07:15

  • Ora-12154  problem with database link and transparent gateway

    Hello,
    I’m trying to make a communication between oracle and SQL server 2005.
    I use oracle 10g E.E Release 10.2.0.3.0 and the transparent gateway for SQL server 10201_gatway_win32.zip.
    Install:
    The oracle database is installed into a server named ss-serv. This server has two partition disk C and E. Oracle database is installed in E and the gateway in C. There is already a database (instance) running in the oracle home (in E).
    I configured the gateway as described into: http://download.oracle.com/docs/cd/B...3/conf_sql.htm.
    In sql server 2005, there is a database running named ClientTricks.
    I created a user named Avogadro with a login.
    In the partition C where the gateway is installed, the file inittg4msql.ora is like this:
    HS_FDS_CONNECT_INFO= ss-serv. ClientTricks
    The file sqlnet.ora where the gateway is installed is configured like this:
    SQLNET.AUTHENTIFICATION_SERVICES=(NTS)
    NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
    I configured the listener that is in the C partition where the gateway is installed, and the tnsnames that is in the oracle database in E partition disk like this:
    Listener :
    LISTENER=
    (ADDRESS=
    (PROTOCOL=TCP)
    (HOST=ss-serv)
    (PORT=1521))
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=tg4msql)
    (ORACLE_HOME=C:\oracle\product\10.2.0\tg_1)
    (PROGRAM=tg4msql)
    tnsnames:
    mytg4msql=
    (DESCRIPTION=
    (ADDRESS=
    (PROTOCOL=TCP)
    (HOST=ss-serv)
    (PORT=1521)
    (CONNECT_DATA=
    (SID=tg4msql))
    (HS=OK))
    After edited the listener, I stop and start the listener for the transparent gateway from administrative tools in the services.
    Then, connected in oracle (in a database named fakeclient) I created a database link in sqlplus.The the dblink were created, but when I tried to querry some data from ClientTricks by executing the following instructions:
    select * from s_client@dblink
    i got this fatal and terrible error :
    ora-12154 TNS:could not resolve the connect identifier specified
    I verified all my procedure and stapes, all seems to be good. I did a tnsping of mytg4msql
    I got this error in the command prompt:TNS-03505 fail to resolve name
    Could someone help me ?
    Sorry for my English ,I’m French
    best regards

    Hi Mkirtley,
    i clarify you what i've done:
    Pease have a look in the link in my first post. Then, i said that in oracle database home the listener is in port 1521
    here is this listener:
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=PLSExtproc)
    (ORACLE_HOME=E:\oracle\production\10.2.0\db_1)
    (PROGRAM=extproc)
    LISTENER=
    (DESCRIPTION_LIST=
    (DESCRIPTION=
    (ADDRESS= (PROTOCOL=TCP)(HOST=ss-serv)(PORT=1521))
    (ADDRESS= (PROTOCOL=IPC)(KEY=EXTPROC0))
    Here is the tnsnames.ora in oracle database home:
    N.B in this ora file, there's already some descriptions for the database running, so i just add these lines under the description in ora file.Here is:
    Jest=
    (DESCRIPTION=
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=TCP)(HOST=ss-serv)(PORT=2000))
    (CONNECT_DATA=
    (SID=tg4msql)
    (HS=OK)
    for the listener of the gateway (installed in C partition):
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=tg4msql)
    (ORACLE_HOME=C:\oracle\production\10.2.0\tg_1)
    (PROGRAM=tg4msql)
    LISTENER=
    (DESCRIPTION_LIST=
    (DESCRIPTION=
    (ADDRESS= (PROTOCOL=TCP)(HOST=ss-serv)(PORT=2000))
    (ADDRESS= (PROTOCOL=IPC)(KEY=EXTPROC1))
    here are all i did.
    Best regards

  • Database Links and Character Sets

    Can I link a ARABIC Character set database to an English Character one using database links. The Application running on the Arabic database needs to read and write into the English one using a database link.

    Shouldn't be a problem, assuming that all the English characters you want to represent can be properly encoded in the source system's character set. Shouldn't be a problem unless you start dealing with things like Microsoft's curly quotes.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Database Link and error ORA-02019

    Oracle 9.2.0.6 on Windows 2003
    Has anybody encountered this before and been able to resolve.
    SQL> connect SchemaA/password@NSN1
    SQL> create database link MyLink1
    2 connect to REMDB identified okm135
    3 using 'STAF'
    4 /
    Database link created.
    SQL> create or replace VIEW rem_mydocs as
    2 (select * from mydocs@MyLink1)
    3 /
    View created.
    SQL> grant select on rem_mydocs to UserA ;
    Grant succeeded
    SQL> Create or replace function fn_rem_mydocs
    2 return Sys_RefCursor
    3 IS
    4 v_rc Sys_RefCursor;
    5 begin
    6  open v_rc for
    7       select * from rem_mydocs ;
    8  return (v_rc);
    9 end;
    10 /
    Function created.
    SQL> grant execute on fn_rem_mydocs to UserA;
    Grant succeeded
    SQL> connect UserA/test975@NSN1
    Connected.
    SQL> create or replace synonym rem_mydocs for SchemaA.rem_mydocs;
    Synonym created.
    SQL> create or replace synonym fn_rem_mydocs for SchemaA.sp_rem_mydocs ;
    Synonym created.
    SQL> select count(*) from rem_mydocs ;
    COUNT(*)
          324
    SQL> var g_ref refcursor
    SQL> begin :g_ref := fn_rem_mydocs; end;
    2 /
    SQL> print g_ref
    ERROR:
    ORA-02019: connection description for remote database not found                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Metalink Note:262881.1
    The information in this article applies to:
    Oracle Server - Enterprise Edition - Version: 8.0.x to 9.2.0.x
    This problem can occur on any platform.
    Errors
    ORA 2019 connection description for
    Symptoms
    Describe on a Synonym which is based on a database link may issue error:
    ORA-2019 connection description for remote database not found
    Select from the synonym works successfully.
    Cause
    Based on the Bug 3071468 this issue happens when the local
    and the remote database have different domain name in the GLOBAL_NAME.
    For example if:
    select * from global_name;
    gives from local database:
    PROD.UK.ORACLE.COM
    and the remote database has:
    TEST.US.ORACLE.COM
    then we have different domains for the global_name.
    This does not reproduce when the domain is the same for both global_names.
    Fix
    This issue is fixed in 10.1.0.2.
    For previous versions we have the following 2 workarounds:
    1. Use View in the place of the synonym. This works.
    2. Alter one of the databases global_name , so that the 2 global_names to have the same domain.
    For example in the above example chenge the TEST database as:
    sql> alter database rename global_name to test.uk.oracle.com;
    Then you would have to drop and recreate the database link.
    References
    Bug 3071468 - Ora-2019 May Occur When Describing An Synonym Using A Database Link
    Regards,
    Reza
    Message was edited by:
    Reza

  • Database Link and domain suffix problem

    Hi
    I have two machines in the same workgroup with Oracle Server 8.1.6 and two instances, I don't have domain .When I create Database Link on one of them the name of the link appears with unknown suffix "US.ORACLE.COM" .The parameter DB_DOMAIN in the init file has no value.Is anybody know why Oracle adds this suffix every time when I'm trying to create database link?

    You have to check your SQLNET.ORA file. There is a parameter defined in that file called:
    NAMES.DEFAULT_DOMAIN = <default domain to use>
    You need to change this value according to your network settings.

  • Difference between create database link and create shared Database link

    Hi Guys,
    can any one suggest me where to use "create database link" statement and where to use "Create shared database link". I have only idea that using shared database link the process can reuse connections already established to the remote server.
    In my envrionment I am used to connect with db link but sometimes its not working so try with shared link and its working fine. In local as well as remote database we are using DEDICATED only not the shared server.
    so, what the cause behind this?
    Any suggestion?
    Thanks...

    Please refer to documentation:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/ds_concepts.htm#sthref3878
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Database link and remote connection issues..

    We have a sql script... Large script that we would rather not post here. The script connects through a dblink to a remote site at the beginning and gets thousands of records. We then process these records locally which takes around 40 minutes. The link is unused for that time. Then the same script attempts to connect again through the dblink and set a confiirmation flag. But this final confirmation step routinely fails. The script used to work fine when the confirmation was at the beginning of the script.
    My understanding is that when you go out through a dblink it creates a session on the remote computer. The session stays active until the local proc ends or the session times out. Successive calls through the dblink from the same proc will reuse the same remote session? Is this true?
    So, Is the inactivity period possibly causing this dblink connectivity issue? We put some test sql select statements in the script here and there selecting from dual at the remote site to test the link inbetween major proc calls. Sometimes even these fail. What do I have to do to keep this link active? Is this even my issue?
    Like I said this script worked fine when the confirmation piece was at the beginning right before we start downloading files and basically no inactivity period... Now we download files and confirm at the end with a 40min to 2 hour inactivity between.
    The remote site as well as the network claim that they are not dropping us... The only piece of information I can provide is that on our side SQLNET.EXPIRE_TIME = 10 and on there side SQLNET.EXPIRE_TIME = 0. I've read that others solved this issue by manipulating this value.
    Here are some of the errror message we get in our script...
    ORA-03114: not connected to ORACLE
    ERROR at line 1:
    ORA-02068: following severe error from DMVAIS
    ORA-03135: connection lost contact
    Edited by: Mark Reichman on Nov 25, 2008 12:47 PM
    Edited by: Mark Reichman on Nov 25, 2008 12:57 PM

    What version of Oracle?
    What are the values of the following database parameters?
    open_links                       max # open links per session
    open_links_per_instance    # open links per instanceAny chance you are exhausting one or both these parameter values?
    Have you ran a check on the network connection between the two machines?
    HTH -- Mark D Powell --

  • Database link between 8i and 7.3.2.3 servers

    Hi all,
    1 server
    HP9000 : ORACLE 8i 8.1.5.0
    O.S : hp unix
    2 server
    HP B132+ : ORACLE WG 7.3.2.3
    O.S : hp unix
    when i am trying to connect to the remote data base from
    server 1
    i am getting this error i.e ORA-12505:listener could not resolve SID given in connect descriptor
    If i try from the
    server 2
    i am getting this
    error i.e ORA-12154: TNS: could not resolve service name
    The steps i have done
    in both servers i have created database links and i updated
    $ORACLE_HOME/network/admin/tnsnames.ora files
    can anybody please solve this problem for me
    with regards
    a.ratna
    null

    ratna,
    for the server 2 error... could not resolve service name. check your tnsnames file and make sure that SID(not the alias) in tnsnames matches with the SID given in database link.
    "create database link test_link connect to scott identified by tiger using 'SID';
    for error 1 make sure you have the entry of the server 2 SID in server1 tnsnames file.
    good luck,

  • OWA_UTIL and HTP across database link

    Has anyone figured out how to use the features of OWA_UTIL, such as listprint, across a database link? I can create a drop list on data that is in the portal instance. But if I try to create a list based on a table in a back-end database through a database link, it generates errors.
    Also, I create a procedure to generate a dynamic page portlet using htp calls and it works fine if the procedure is located in the portal instance. But move the code to the back-end database and access via a synonym and database link and it generates errors out of the owa_util package.

    Create a view on your local db using tables over the db link and base your list on that view.

  • How to Execute a Remote Procedure in Portal using Database Link

    Hi,
    I followed the instructions to create a Portal form for a remote procedure. But I am encountering the following error. Can someone advise what may be the cause?
    Failed to execute - Missing string(create_package_body) language(us) domain (wwv) sub_domain (wwv_builder) (WWV-04300)
    ORA-04020: deadlock detected while trying to lock object PUBLIC.PORTLET_SCHEMA (WWV-11230)
    Failed to parse as PORTAL - (WWV-08300)
    PURPOSE
    How to execute a remote procedure in Portal using Database Link.
    DESCRIPTION
    This procedure assumes that you have two databases, one of which is remote, and Portal is configured in the other.
    Remote Database A:
    ==================
    1) Create a procedure as follows: Create or Replace PROCEDURE SCOTT.ADD_TWO_VALUES ( v_one IN NUMBER, v_two IN NUMBER, v_result OUT NUMBER) as begin v_result :=v_one+v_two; end; 2) Grant execute privileges to PUBLIC on the procedure.
    Database B (where Portal is configured): ========================================
    1) Create a public database link and choose to connect as a specific user (say SYSTEM). By default, in an Oracle 8i database, the "global_names" parameter in initSID.ora (or init.ora) file is set to "true". This Global Naming parameter enforces that a dblink has the same name as the database it connects to. Therefore, if the remote global database (A) name is "ora8.acme.com" then the database link should also be named as "ora8.acme.com".
    2) Create a synonym for the procedure in Database A. Make sure you fully qualify the procedure name in the remote database (like SCOTT.ADD_TWO_VALUES).
    3) Create a dynamic page to execute the procedure. The ORACLE tags in the dynamic page will look similar to the following: <ORACLE> DECLARE v_total NUMBER; BEGIN ADD_TWO_VALUES(:v_one,:v_two, v_total); htp.p('The total is => '); htp.p('<input type="TEXT" VALUE='||v_total||'>'); htp.para; htp.anchor('http://<machine.domain:port#>/pls/portal30/SCOTT.DYN_ADD_TWO_VALUES.show_parms', 'Re-Execute Procedure'); END; </ORACLE>
    4) Portal does not have an option to create a form based on a synonym. Therefore, if you want to create a form instead of a dynamic page, create a wrapper procedure and then create a form based on this procedure. For example: Create or Replace PROCEDURE PORTAL30.ADD_TWO_VALUES_PR ( v_one IN NUMBER, v_two IN NUMBER, v_total OUT NUMBER) as begin add_two_values(v_one, v_two, v_total); end;
    5) Grant execute privileges to PUBLIC on the procedure.

    hello...
    any input will welcomed... Thanks..

  • Creating a Database link for a user

    Hello All,
    I am trying to create a database link for one of my users.
    When I create it as sysdba the link gets created in the SYS schema which tells me that my syntax is working/fine.
    But when I ALTER my SESSION and set my CURRENT_SCHEMA = <USER_NAME> I get ORA-00990: missing or invalid privilege
    So I tried granting the user CREATE DATABASE LINK, CREATE PUBLIC DATABASE LINK, and DROP PUBLIC DATABASE LINK.
    Same error.
    Any ideas what I am missing?
    Thanks,
    Craig

    CraigBoyd wrote:
    Hello All,
    I am trying to create a database link for one of my users.
    When I create it as sysdba the link gets created in the SYS schema which tells me that my syntax is working/fine.
    But when I ALTER my SESSION and set my CURRENT_SCHEMA = <USER_NAME> I get ORA-00990: missing or invalid privilege
    So I tried granting the user CREATE DATABASE LINK, CREATE PUBLIC DATABASE LINK, and DROP PUBLIC DATABASE LINK.
    Same error.
    Any ideas what I am missing?
    Thanks,
    Craigyou need to create a new session after the GRANT was issued.

  • ORA-31600 when trying to view SQL DDL for a created public database link

    I created and committed a public database link and I can access the external database.
    When I try to view the DDL of the link, on the SQL tab, I'm getting following error:
    ORA-31600: invalid input value EMIT_SCHEMA for parameter NAME in function SET_TRANSFORM_PARAM
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 3900
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 4048
    ORA-06512: at "SYS.DBMS_METADATA", line 836
    ORA-06512: at line 1
    and
    ORA-31600: invalid input value LONGNAME for parameter NAME in function SET_FILTER
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 1980
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 3665
    ORA-06512: at "SYS.DBMS_METADATA", line 670
    ORA-06512: at "SYS.DBMS_METADATA", line 571
    ORA-06512: at "SYS.DBMS_METADATA", line 1221
    ORA-06512: at line 1
    Is this because of a bug in SqlDeveloper or because the db_link and host parameters have 33 characters?
    I'm using sql developer 1.5.3, build MAIN-5783
    tx,
    Roger Vermeir

    It's probably the length; really all sqldev does is calling:
    select DBMS_METADATA.get_ddl('DB_LINK',:NAME,:OWNER) FROM dual;So if you call it a bug, it's a database bug in the DBMS_METADATA package.
    But if you work with identifiers over 30 chars, I'd say that's a bug on it's own...
    FWIW, I can't reproduce this on our 10g DB; are you on 9i?
    Regards,
    K.

Maybe you are looking for