DML through DBLink

Hi all,
I have a job which executes a stored procedure "A" in database "D1". "A" calls the procedure "B" stored in database "D2" through DBLink. "B" is compiled with autonomous_transaction pragma. My question is does "A" know if "B" has finished its execution? The reason to ask this question is that sometimes "A" never ends eventhough "B" has finished.
Thanks in advance!

Look into the parameter commit_point_strength. Ensure that the primarily driving database is the commit point.
Lee

Similar Messages

  • Insert / update data to a table through DBLINK (oracle)

    I try to insert / update a table from one instance of oracle database to another one through oracle dblink, get following error:
    java.sql.SQLException: ORA-01008: not all variables bound
    ORA-02063: preceding line from MYLINK
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
    The same code to insert / update the exact same table in local instance works fine.No any binding problem. So i am pretty sure all ? mark in SQL are set with some value before sending to Oracle.
    Someone please advise what is possible problem. Db link is not set correctly? or we can not update remote table by dblink.
    By the way i can do insert / update from TOAD to the remote table through DBLINK. Problem happens only in Java code.
    thanks!
    Gary

    dblink links from one database instance to another.
    So it is certainly a source of possible problems when it works on one database and not another.
    You should start by looking at the dblink and it possible testing it in the database not via java.
    Note as well that that error suggests that it is coming from the Oracle database. I believe if you had a bind parameter problem in your java code that the error would come from the driver. But that is a guess on my part.

  • Calling Function in SQL Server through DBLINK

    Hello
    I need to call a function that exists in other database (*SQL Server*) through DBLINK
    Is It possible? If yes, please give me the syntax
    Thanks

    Hi,
    You can call remote functions on SQL*Server if you create the database link using the Database Gateway for SQL*Server (DG4MSQL).
    You need to install and configure DG4MSQL then you can call remote functions as follows -
    SELECT function1@Remote_DB(7782) FROM dual;
    You need to set the parameter -
    HS_CALL_NAME
    in the DG4MSQL init<sid>.ora file with the owner and name of the function, for example -
    HS_CALL_NAME = "owner1.function1, owner2.function2 "
    and if you want to return values using the function you need to set the parameter in the gateway init file -
    HS_FDS_PROC_IS_FUNC=TRUE
    For full details you need to refer to the documentation -
    Oracle® Database Gateway for SQL Server User’s Guide, 11g Release 2 (11.2)
    Oracle® Database Heterogeneous Connectivity User’s Guide 11g Release 2 (11.2)
    which is available from -
    http://www.oracle.com/pls/db112/homepage
    and click on the 'Integration Information' option on the left.
    The documentation has further details on how to call and use remote functions.
    For information about installing and configuring the gateway and links to further information have a look at the following note -
    Note.1083703.1 Master Note for Oracle Gateway Products
    available in My Oracle Support
    You cannot use the Database Gateway for ODBC (DG4ODBC) to create the database link as it does not supported stored procedures or remote functions.
    Regards,
    Mike
    Edited by: mkirtley on Sep 2, 2011 11:09 AM

  • Error in Executing Procedure through DBLink

    Hi,
    I am facing some problems in executing a procedure through DBLink.
    I have two schema A and B in two different database.
    In schema A I am having one procedure X in package Y and my requirement is that I want to execute this procedure in schema B. So in schema B i have created one DBLink ABC and trying to execute procedure X using this DB link.
    begin
    A.Y.X@ABC;
    end;
    But I am getting below error:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'A.Y.X@ABC' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    Any help would be greatly appreciated!
    Thanks In Advance..
    Regards,
    Sachin Bansal

    Hi,
    Yes, I am connecting to user A of DB1 and in this user I am having procedure X in Package Y. My DBLink in Schema B of DB2 is pointing to user A of DB1.
    I have created DBLINK using below script:
    create public database link abc
    connect to A
    identified by A
    using '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=XXX)(PORT=1521)))(CONNECT_DATA=(service_name=XXX)))';
    Above DBLInk is working fine..I am able to access all the table of schema A in schema B using this DBLink. But when I trying to execute any procedre of schema A in schema B then i am getting error.
    Regards,
    Sachin

  • Problem in Mat view execution through dblinks

    HI Experts,
    I am refreshing MAT_VIEW's via dblinks. But during refresh i am getting below error.
    I tried both with Complete and Fast. Both are getting errors.
    Seems i missed some privilages.
    Please assist me here..
    With Fast option
    *===========*
    SQL> exec dbms_mview.refresh('CDS_BANK_BRANCH_NLD',*'F'*);
    BEGIN dbms_mview.refresh('CDS_BANK_BRANCH_NLD','F'); END;
    ERROR at line 1:
    ORA-12018: following error encountered during code generation for
    "ACCOUNTINFO"."CDS_BANK_BRANCH_NLD"
    ORA-00942: table or view does not exist
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2256
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2462
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2431
    ORA-06512: at line 1
    With Complete Option
    SQL> exec dbms_mview.refresh('CDS_BANK_BRANCH_NLD',*'C'*);
    BEGIN dbms_mview.refresh('CDS_BANK_BRANCH_NLD','C'); END;
    ERROR at line 1:
    ORA-12018: following error encountered during code generation for "ACCOUNTINFO"."CDS_BANK_BRANCH_NLD"
    ORA-00942: table or view does not exist
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2256
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2462
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2431
    ORA-06512: at line 1

    Fran wrote:
    You are calling materialized view at local DB where the m_view doesn't exists. To refer another database through dblink you must use m_view@remote_databaseyou are right , i just notice this :)

  • Unable to run spatial operations through dblinks

    Hello All,
    I am trying to run spatial operations through dblinks. Please see the example query below
    select a.OGC_GEOMETRY.sdo_gtype from <table>@dblink a where sdo_nn(a.OGC_GEOMETRY,mdsys.sdo_geometry(2001,null,mdsys.sdo_point_type(0,0,null),null,null),'sdo_num_res=1')='TRUE'.
    Query fails with the following error
    ORA-13249:
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.PRVT_IDX", line 9
    *13249. 00000 - "%s"*
    **Cause: An internal error was encountered in the extensible spatial index*
    component. The text of the message is obtained from some
    other server component.
    **Action: Contact Oracle Support Services with the exact error text.*
    Same Query runs fine in the original database but fails with dblinks. Is it possible to run spatial operations through dblink?
    Thanks & Regards,
    Jasti

    I've never used spatial myself but this other user had issues with it and dblinks. They ended up using the dblink to create a local materialized view with local indexes and used those.
    MapBuilder does not work with DB-link in a spatial view
    Found this as well. Does it mean anything to you?
    4.2 Querying Spatial Data
    This section describes how the structures of a Spatial layer are used to resolve spatial queries and spatial joins.
    Spatial uses a two-tier query model with primary and secondary filter operations to resolve spatial queries and spatial joins, as explained in Section 1.6. The term two-tier indicates that two distinct operations are performed to resolve queries. If both operations are performed, the exact result set is returned.
    You cannot append a database link (dblink) name to the name of a spatial table in a query if a spatial index is defined on that table.
    If a spatial index is created in a database that was created using the UTF8 character set, spatial queries that use the spatial index will fail if the system parameter NLS_LENGTH_SEMANTICS is set to CHAR. For spatial queries to succeed in this case, the NLS_LENGTH_SEMANTICS parameter must be set to BYTE (its default value).
    http://docs.oracle.com/cd/B13789_01/appdev.101/b10826/sdo_index_query.htmEdited by: Gaff on Aug 16, 2012 4:46 PM

  • Accessing tables through DBlinks via ADF BC entities, jdev11.1.1.2.0

    To my understanding, everytime any object is accessed via a dblink, a transaction is created on the database; even if one merely selects from a table. For example, whenever we were writing PL/SQL, after we were finished accessing data through a dblink we performed a commit to close any open transaction that opened via selects. Using ADF BC, if we create an entity that accesses a table via dblink, what guarantee that transaction sessions are closed after simple selects (no DML)? How would these transactions be closed if data from a db link is simply displayed in an ADF table or referenced via LOV? Is there perhaps some setting that can be set to open connections without transactions?
    Reference: http://www.jlcomp.demon.co.uk/faq/dblink_commit.html
    Best Regards,
    Valon

    valon,
    This is indeed a tricky one. You are correct that a transaction is started whenever you do any selects that touch a remote object. The problem that I see is that even if you were somehow able to execute a commit after every SELECT statement, the transaction always executes in the context of an application module - if you committed the transaction, you'd also commit any outstanding transaction going on in the AM at the time. In general, this would be a bad thing, although you may be able to ensure that it is OK for your specific use case. I did a quick scan of the APIs to see if I could locate any method that you could possibly override, but didn't locate anything that looked promising.
    John

  • Accessing DB2 data through DBLINK in Java program recieves ORA-02063 error

    Hello,
    Is it posible to access a mainframe DB2 table through a Java JDBC connection utilizing a DBLink / Synonym. Using Toad or SQLDeveloper, I can select the DB2 data just fine. Also, PL/SQL programs can access the data without issues. When I try to select data from the DB2 Table in a Java program, I get ORA-01002: fetch out of sequence -- ORA-02063 preceding line from DB2D errors.
    The code I am using to test is:
    (Note: TBL_LOC_ADR is the Synonym that points to the Mainfram DB2 table)
    public static void main(String[] args) {
              Connection con = null;
              Statement stmt = null;
              String query = "SELECT * FROM tbl_loc_adr";
              ResultSet rs;
              try {
                   System.out.println("Getting connection");
                   con = BatchDBConnection.getDBConnection();
                   TestConnection tc = new TestConnection();
                   System.out.println("Creating ps");
                   stmt = con.createStatement();
                   System.out.println("Calling qds");
                   rs = stmt.executeQuery(query);
                   System.out.println(" Returned data " );
              } catch (Exception e) {
                   System.out.println("Error " + e.getMessage());
                   e.printStackTrace();
    The error occurs on the rs = stmt.executeQuery(query); line.
    Thanks for any input into this error. It's been driving me nuts all day.
    Chris

    Chris,
    What's your oracle version? You might be hitting a bug as identified in this metalkink doc id, see if this helps out. Resolution posted in the metalink by applying patches or confirm that you have applied all the required patches.
    Doc ID: 456815.1 ORA-01002 ORA-2063 When Profiling DB2/400 Table Accessed by View via Transparent Gateway for DRDA
    Regards

  • Select from multiple tables through dblink

    I am seeking help. Can I select multiple tables through a dblink from a remote database? I tried, it seems it always return ORA-00933 error. code like this:
    select A.ID, B.CODE, C.TYPE_DESC
    from TABLE_ONE A@db_link , TABLE_TWO B@db_link, TABLE_THREE C@db_link;
    where A.ID = B.ID
    and B.CODE = C.CODE
    Thanks in advance.

    Just as an FYI, from a performance standpoint, it is frequently the case (though certainly not guaranteed) that you'll get better performance creating a view on the remote database that does the join of all three tables and to use that view in your query, particularly if you're also joining in local tables. Optimizing SQL statements across database links tends to be particularly hard, a view often helps force Oracle to join the remote tables on the remote database which is generally what you'd want. Of course, this is not a guarantee, and you can always get explicit with hints to force joins to happen on one or the other system, but this is frequently the easiest starting point.
    Justin

  • Oracle procedure through dblink ora-3113

    The architecture of my service as follows: Windows Service connects to database (DB1) through the OCI protocol. After a successful connection it calls the alias of the procedure which is dblinked from another database server(DB2). Next it gets some data from dblinked tables and finally closes connection.
    My oracle version is 9.2.0 on both databases.
    Sometimes the sistem administrator make dump of the databases. And when my service makes the first "lifecicle" after the dump is done i got ora-3113.
    so, when i connecting there is no errors, but when i am calling the procedure, i got this error. And when i start my service again, there is no errors and everythig is going fine!

    Sounds like some kind of connection pooling is used - which means that when your service runs, it attempts to use a previously successful pooled connection to the database. But as the database dump resulted in a db reset, the server process that serviced that connection no longer exists.
    The connection is used, attempts to communicate with the server process no longer there, and gets a eof on that communication in return as the IP stack tears up that invalid tcp connection.

  • Can not insert through dblink in procedure

    I have created one procedure which is selecting,inserting and updating data to another database on same server using dblink. it select and update data successfully but when it is going to insert using dblink it gives following error.
    ORA-02019: connection description FOR remote DATABASE NOT FOUND
    ORA-02063: preceding line FROM PAS
    But when i executed same insert statement on sql prompt it is exeuted successfully.
    insert into tab1@dblink values('blah','blah','blah');
    I have dropped all my dblink and recreate it again i have given priveleges externally means insert any table,select any table,update any table to username.
    but still i have recieved same error. Please guide me.
    Global name of database is same as dblink name.
    Thanks in advance
    dhaval

    1. select * from global_name
    PAS and RATEPAS
    I have created two database on same server.
    named pas and ratepas.
    I can not send procedure's code. but actual logic of procedure is selecting a record from temporary table and check whether it is a valid record on the basis of time_stamp and it is inserting a record to base table and update time_stamp to other two tables. and it is giving error only when
    SELECT * FROM dba_db_links;
    OWNER
    DB_LINK
    USERNAME
    HOST
    CREATED
    PUBLIC
    PAS
    PASUSER
    OWNER
    DB_LINK
    USERNAME
    HOST
    CREATED
    pas125
    13-OCT-05

  • CAN i CALL OLAP DML THROUGH JDBC IN JAVA PROGRAM

    I HAVE ORACLE V 9.2.0.1.0 AND AFTER CREATING A CUBE FROM ENTERPRISE CONSOLE I HAVE TO GO WITH EITHER SQL PACKAGES OR OLAP DML PROGRAMS ,SO PLS GIVE ME PROPER WAY AND LINK OF SOURCES TO WORK WITH OLAP DML IN JAVA PROGRAMS
    CAN I USE AS PREPARED STATEMENT OR CREATE STATEMENT IN JAVA
    TO CALL OLAP DML? BECAUSE NORMALLY WE MUST USE OLAP WORKSHEET TO EXECUTE OLAP COMMANDS
    Message was edited by:
    user594151

    The access OLAP objects via Java you have two options. You can code directly against the OLAP API and I think someone has already provided you with the link to the supporting documentation. The OLAP API docs provide worked examples on access OLAP metadata and retrieving OLAP data. However, this is extremely low level coding. An alternative is to use the Business Intelligence Beans. Oracle Business Intelligence Beans enables developers to productively build business intelligence applications that take advantage of the rich OLAP functionality in the Oracle database. OracleBI Beans includes presentation beans - graph and crosstab, data beans - query and calculation builders and persistence services, which may be deployed in both HTML client and Java client applications. OracleBI Beans is seamlessly integrated into Oracle JDeveloper to provide the most productive development environment for building custom BI applications. For more information goto the the BI Beans home page
    http://www.oracle.com/technology/products/bib/index.html
    Specifically on executing OLAP DML see the following example:
    Developing a Dashboard Application with Oracle BI Beans:
    http://www.oracle.com/technology/products/bib/1012/viewlets/MS%20Developing%20Executive%20Insight.html
    Adding controls to execute OLAP DML      This viewlet demonstrates how to quickly and easily add the controls to execute OLAP DML models that can be executed to update the What If presentation.
    http://www.oracle.com/technology/products/bib/1012/viewlets/Pages/What_If_Analysis_Part_4_viewlet_swf.html
    Hope this helps
    Keith Laker
    Oracle EMEA Consulting
    BI Blog: http://oraclebi.blogspot.com/
    DM Blog: http://oracledmt.blogspot.com/
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Samples: http://www.oracle.com/technology/products/bi/samples/

  • ORA-01017: invalid username/password through dblink when select from view

    Hello all,
    I work on 2 databases :
    - One is a 10g (let's call it db_10 )
    - The second one is a 11g (let's call it db_11 )
    I created a view V_PROTOCOLES in schema SCHEMA_1 on db_11.
    The FROM clause of this view call 4 tables :
    - table1 : owner is SCHEMA_1
    - table2 : owner is SCHEMA_2 (schema on db_11 )
    - table3 : owner is SCHEMA_3 (schema on db_10 )
    - table4 : owner is SCHEMA_4 (schema on db_10 )
    When I simply run SELECT * FROM V_PROTOCOLES on db11 with user X, I can have a result.
    The problem occurs when I connect on db10 also with user X. The V_PROTOCOLES view has a public synonym using the dblink DBDOC_LINK (without explicitly specify a user, so it connects with the X user).
    But here I can't run the SELECT * FROM V_PROTOCOLES. I Have the following error :
    ORA-01017: invalid username/password; logon denied
    ORA-02063: preceding line from DBDOC_LINKThe passwords for user X are obviously the same on both 10g and 11g databases.
    Thanks for the help !

    On 10g :
    select password from dba_users where username = 'U872574';
    PASSWORD
    30811840BC618B77On 11g :
    select password from sys.user$ where name='U872574';
    PASSWORD
    30811840BC618B77I dropped and recreated the dblink but the problem always occurs...
    (By the way, curiously when I dropped the dblink I have no invalid objects although it is used in different packages or triggers)

  • How to call DML through procedures

    Hi,
    I've a requirement like i have to call procedure from function,In that procedure,having so many DML operations.
    I am facing error like 'We can't perform DML operation inside a query'.
    How to eliminate this error?
    Any update please.
    Cheers,
    Arun.

    The problem, as Karthik has suggested, is not that you are calling DML inside a procedure or function, but that the DML is being called in a procedure or function that is taking part in a query transaction i.e. you are using the function inside a query and that function (or a procedure it calls) is trying to do DML. This isn't permitted.
    The reason you can't do this is that the query is in the process of reading data from the database and you can't have the same query try and change the data on the database (using insert/update/delete OR any DDL statements that change the structure of the database) whilst it is in the process of reading it. It would be like you trying to read a Word document and there being macros in the document so that as you visited certain pages, the text of the document changed. By the end of it you wouldn't know if you'd read the document correctly or not or whether it all made sense. Oracle recognises this stupidity and prevents it.

  • Calling public package functions and variables through dblink

    Is it possible to call a global public variable in a package in one database from another package procedure in another database using a database link? If so, could you let me know the syntax? Same question for package functions.

    Hi,
    check this documentation link especially the stmt...
    http://www.mcs.csueastbay.edu/support/oracle/doc/10.2/appdev.102/b14251/adfns_packages.htm#i1007858
    You cannot access remote package variables and constants.May be you can write a function in the remote db which when called will return the variable value.
    for calling remote package functions...
    syntax from documentation is [[schema.]package.]function_name[@dblink][(param_1...param_n)]
    an example given in the above link for this...
    EXECUTE fire_emp1@boston_server(1043);
    Ravi Kumar
    Edited by: ravikumar.sv on Aug 31, 2009 11:29 AM

Maybe you are looking for

  • How to upload a file?

    i would like to know how to upload a file (image, text, exe, etc.) to a database. i have trying a sample code in a book called Java Servlet Programming by Jason Hunter & William Crawford, published by O'Reilly....i have problem when compile that sour

  • OVI truncated many of my Outlook 2007 Contacts not...

    I normally use PC Suite, but had to use OVI find out which Maps have been loaded on my cell. It then inadvertently synced OVI with my E72. Now ALL notes inside Contacts have been truncated to appr 128 characters. Everything just lost on both Outlook

  • How do I index a new search database?

    I want to create a robot and run it against a URL and build an index( RDs), on my own defined search database. But only the default database get's indexed. How do I point my Robot to my new defined search database? Also I would like to be able to ind

  • How to disable custom list --Add New Item in share point 2010

    Hi,   I  have associated the workflow for the custom list .So i should not allow user to add any item on the custom list. Regards, Lakshmi

  • Modelled and Deadline in Latest End

    I want to use Latest end for an activity for both modelled dead line and notification. Notification for 3 days and modelled deadline for 7 days. How to achieve both using Latest end. Thanks, Mohan.