TSQL Retrieve from linked Oracle server

We're porting an Oracle system to SQL server and it's not going well...
Our system is a data warehouse that extracts data from an Oracle operational system. In the Oracle version we use database links to access Oracle. On SQL Server we've created a linked server. All OK so far.
When we try to access the linked server in TSQL we have problems:
- select on a four part name does not pass filters to Oracle and our tables are huge
- OPENQUERY works fine but won't let us pass parameters
We therefore seem to be stuck when we want to update SQL server using a single keyed access to Oracle (SQL retrieves the whole table and then filters; we're processing 20,000 records and this is not acceptable!)
I would appreciate any help you can give; I've spent most of the day searching the web for examples where people have this working, but got nowhere... help!
Thanks in advance

Have you tried configuring Oracle Heterogenous Services/ Transparent Gateway? This would let you link Oracle to SQL Server via a database link which should solve your problem.
Justin
Distributed Database Consulting, Inc.
www.ddbcinc.com

Similar Messages

  • Call procedure with MS SQL from linked Oracle server

    I have a procedure on a remote server that I can call from SQL*PLUS
    set serveroutput on
    declare rez varchar2(99); msg varchar2(99); begin radar.test('AL25',rez,msg); dbms_output.put_line('Rez='||rez);
    dbms_output.put_line('Msg='||msg);
    end;
    it gives me the neccessary result.
    But I need to call the same procedure with MS SQL from a linked Oracle server, I'm trying to do it through openquery for a while, but no success yet.
    Can someone tell me what is the right syntax for that query in OPENQUERY?

    Have you tried configuring Oracle Heterogenous Services/ Transparent Gateway? This would let you link Oracle to SQL Server via a database link which should solve your problem.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • Using archivelog and control file from other Oracle server

    I am still bothered with my backup process.
    I have 2 AIX boxes (same model, say A and B); both have BAAN 5 and Oracle 10g R2 on. Right now my colleague insists to use the export pump (cold backup) from Prod Oracle server (A) to restore the Oracle server on Box B. The Prod server has the archivelog mode turn on. But it will miss any transaction data from import pump till the crash point of Box A. So this is my confusion.
    Can I pass the control files and archivelog files form Box A (prod server) to Box B and use them to restore the Box B as the latest Prod server? How?
    I tried to convince them to use the RMAN backup? But not successful?
    I think the best way is probably to use the Oracle Data guard. However, there is always one concern to my manager and colleague, that such process will cause the data on the restored server (failover, Box B) not recognizable by the BAAN, which define the objects (tables).
    Thanks

    Performing a logical backup is not useful to restore to the point of failure. The only valid and available option is a hot backup/archivelog mode. Your recovery manager backup perform a controlfile and redologfile backup, so those can be restored at the destination. You must take care of the way you perform the backup, and ensure the paths where your backup is being deposited are visible by the second node. A shared storage with same mount points is suitable in this case. A tape robot configured at both nodes is also a suitable solution.
    Recovery manager perfoms a controlfile and spfile restore, too. This rman command perform the action:
    SET DBID <DBID of the database,for which you want to restore the controlfile>;
    RESTORE CONTROLFILE FROM <name_of_backupiece_which_contains_the_controlfile backup>';
    I don't see any problem on the recovery manager side, and technically speaking, on the Oracle side it is perfectly possible to restore your database at a remote location. I don't know what happens on the BAAN side, if you are required to have it configured to be operative on the target node. You could try to clone your database at the node B, configure BAAN and prepare the proceduere in case of failure.
    Configuring a dataguard is also a recomended action. So it is to think about Cold Failed Over clusters. I have recently performed a CFC configuration with BAAN. No problem it works smoothly.
    ~ Madrid.

  • Connecting to Windows SQL server from Unix Oracle Server

    How can I connect to Windows MS SQL server from Unix Oracle Server? What installation or package will I need?

    Two options:
    1) Do a search on "Oracle Transparent Gateways" and/or "Heterogenous Services". These are products that are designed solely to connect to other databases from Oracle.
    2) Use a type-4 JDBC driver for SQL Server, installed and running in the JVM of your Oracle server. I'm assuming your Oracle database is sufficiently recent to be java-enabled here.
    Justin

  • How to prevent from starting oracle server every time i start windows?

    I have winXP professinonal, and i would like to know how to prevent from starting oracle server every time i start windows. Because it really slows starting the windows. Thanks

    The scripts above seems to work as intended with no errors and do indeed stop my five XE services. I created the second script to start them and they do indeed start and are listed as "Started" in the Services panel aferwards.
    My XE installation has the 5 services set up to start automatically.
    I was happy to find the script above because I did not know the starting order and using the XE shortcuts for "Stop Database" and "Start Database" just seemed to cause sqlplus to receive ORA-12514 "listener does not currently know of service..." after trying to use them to restart the database. Using the scripts above seems to leave me with a different error.
    I am pretty sure I eliminated my 9i listener and it is no longer listed in my Services panel or the registry.
    Restarting the laptop does start the services correctly, and now I am on to a more pressing JDBC error, so if I get a chance to use the script again, I will post my results. Thanks.

  • Retrieve from cache or server: what is Firefox's logic

    I clicked on a hyperlink to visit a web site that I had not visited for a couple of months. Firefox showed me the page as it was when I last visited it.
    I pressed F5 and the page updated to the latest version.
    I don't seem to have this problem with other websites; just this one.
    Does anybody understand the logic Firefox uses when determining whether to display a page from the cache or to get the latest page from the web server?
    Using Firefox 10; Windows XP

    Thank you cor-el. The first link mnot is particularly useful. But what I have learnt is that caching is a black art. The logic is influenced by the browser logic, the browser cache size, the web servers caching rules and the html on the page. Impossible for the user to control; very difficult for the web page author.
    So even if I were to understand Firefox's logic it would not help me much.

  • How to export a table from one oracle server to another oracle server?

    Hi experts,
    Scenario : Copying table T1 from Server1 to Server2.
    Can I follow any of the following two options. Please advise if these options would be feasible under the current scenario.
    1) Create the same table T1 in Server2. Export the values of T1 in Server1 to an Excel sheet. Make the Excel sheet as source and import the values of the excel sheet to table T1 in Server2.
    2) Use an ETL tool like Oracle Warehouse builder to extract and load the values in T1 in Server1 to T1 in Server2.
    Can we schedule both option1 & 2 as a job in Oracle Warehouse Builder? The job will have 2 steps :-
    a) Delete all rows in T1 (Server2).
    b) Insert the values from T1(Server1) to T1(Server2).
    Please advise.
    Thanks,
    Debashish

    Can you exactly explain a little bit more what is the actual requirement.
    Just to kick off the things..
    In case:
    1) you just need to create a table based on another table in same schema. Its as simple as : create table table2 as (select * from table1)
    2) table1 is on remote db then
    create table table2 as (select * from table1@yourdblink)
    3) Need to export and import table1 refer this link :
    http://wiki.oracle.com/page/Oracle+export+and+import+?t=anon
    4) Need to refresh table periodically either schedule a job or create materialized view refer to this link :
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96567/repmview.htm
    Choose an approach. Then try it and see what errors you get, In case you get errors search on internet for that error code and how to resolve that and in case need any help post it here. But key is understanding first what exactly your requirement is and which approach you need/want to follow.

  • Error while copying a file from windows oracle server to a solaris server

    Hi all,
    DECLARE
      l_conn  UTL_TCP.connection;
    BEGIN
      l_conn := ftp.login('Destination Ip address ', '22', 'Username', 'Password');
      ftp.ascii(p_conn => l_conn);
      ftp.put(p_conn      => l_conn,
              p_from_dir  => 'MID5010_DOC1TEMP', -- Oracle Directory name from where we need to copy a file
              p_from_file => 'Hipaa.33KM.5093.06152011130146885.834.O.irl',
              p_to_file   => '/qatest1/mihipaa5010/mj5010/DevelopmentStage/working_directory/Outbound/Data/75061252/Hipaa.00AN.07262011173844778.820.O.copied.irl'); -- Directory of the destination machine where we need to paste
      ftp.logout(l_conn);    
       exception
        when others then
          dbms_output.put_line(sqlcode || sqlerrm);
          --dbms_output.put_line(l_conn);    
    END;We are getting the below error:
    SSH-1.99-OpenSSH_5.1
    -29260ORA-29260: network error: TNS:connection closed
    Could any one please let us know why this error is raising...

    prakash wrote:
    Hi all,
    DECLARE
    l_conn  UTL_TCP.connection;
    BEGIN
    l_conn := ftp.login('Destination Ip address ', '22', 'Username', 'Password');
    ftp.ascii(p_conn => l_conn);
    ftp.put(p_conn      => l_conn,
    p_from_dir  => 'MID5010_DOC1TEMP', -- Oracle Directory name from where we need to copy a file
    p_from_file => 'Hipaa.33KM.5093.06152011130146885.834.O.irl',
    p_to_file   => '/qatest1/mihipaa5010/mj5010/DevelopmentStage/working_directory/Outbound/Data/75061252/Hipaa.00AN.07262011173844778.820.O.copied.irl'); -- Directory of the destination machine where we need to paste
    ftp.logout(l_conn);    
    exception
    when others then
    dbms_output.put_line(sqlcode || sqlerrm);
    --dbms_output.put_line(l_conn);    
    END;We are getting the below error:
    SSH-1.99-OpenSSH_5.1
    -29260ORA-29260: network error: TNS:connection closed
    Could any one please let us know why this error is raising...As sybrand correctly points out, this issue doesn't belong here.
    You are using a 3rd party package "ftp" and the error it is indicating suggests the issue is a network issue of some sort.
    We don't have the code of that package or know what it is doing, so please consult whoever supplied or wrote the package and/or your network administrators.

  • How data retrieves from an Oracle table

    Hi,
    I have inserted record by record with record_number in a Oracle table. I have executed below query in PL/SQL developer. It displayed the result in same sequence order how I have inserted. But when in Toad it given in different order which does not have any sequence.
    select * from bbs_user
    Anyone please explain this why it is? Please treat this as very urgent.
    Thanks in advance.

    Welcome to the forums.
    In a forum of volunteers, not being a support forum, there is no such thing as 'very urgent'. Your use of this two words in your very first post must be considered insulting and rude.
    Also it appears you are completely clueless with respect to relational databases. Relational databases are about sets.
    By definition -in mathematics- a set has no order.
    If you want your data ordered you must use the ORDER BY clause in your SELECT statement.
    Also I notice both Pl/SQL developer and Toad are non-Oracle products, so questions about these products do not belong in this forum.
    Sybrand Bakker
    Senior Oracle DBA

  • Access denied to remote Oracle server from job

    Hello
    I have a LINKED ORACLE server to SQL Server 2008 R2 (SP1). All the linked tables work OK. I wrote a couple of procedures to transfer/update data between my DB on the SQL Server and the Oracle linked server tables.
    When running a procedure from a query it works. But when putting the same procedure in a job (scheduled) it returns this error:
    Access to the remote server is denied because no login-mapping exists. [SQLSTATE 42000]
    How can I map logins in such a case to make this work? Or any other options?
    Thx in advance
    Miha

    Good Day,
    Recommended Steps as follows:-
    1.Create a credential under SQL Security tab
    2.Create a Proxy(Operating system CMDExec) under SQL Server Agent Tab and link the credential to the proxy.
    3.Create an SQL Agent Job with type - operating system(cmdExec)and Run as the proxy name or SQL Server Agent Service Account .
    4.Use SQLCMD -S instancename -Q "Exec databasename.schemaname.storedprocedurename;" in the command box.
    Consider the Security permission for the user credential.
    Regards,
    Sajith.
    http://sqllive.wordpress.com/

  • Where are APEX images retrieved from in an n-tiered environmen?

    Oracle XE DB 11gR2
    Oracle APEX 4.1.1
    Glassfish 3.1.2
    Red Hat Linux 5.8
    ===========
    I notice when using Glassfish as part of my APEX environment I am required to copy the images to an /i directory on the Glassfish server under the Glassfish domain.
    The question arises --> When APEX needs to render an image, is the image retrieved from the database/database server or from the Glassfish web server?
    Thank you.

    >
    Please update your forum profile with a real handle instead of "user601798".
    Oracle XE DB 11gR2
    Oracle APEX 4.1.1
    Glassfish 3.1.2
    Red Hat Linux 5.8
    ===========
    I notice when using Glassfish as part of my APEX environment I am required to copy the images to an /i directory on the Glassfish server under the Glassfish domain.
    The question arises --> When APEX needs to render an image, is the image retrieved from the database/database server or from the Glassfish web server?The answer (as usual) is "It depends".
    If you're using Glassfish and the APEX Listener (or OHS) then images referenced using <tt>/i/</tt> / <tt>#IMAGE_PREFIX#</tt> are stored on and retrieved from the web server file system. If using EPG then they're stored on and retrieved from the database using the XMLDB repository.
    If the image is referenced using <tt>#WORKSPACE_IMAGES#</tt>, <tt>#APP_IMAGES#</tt>, or declarative BLOBs then they're stored on and retrieved from the database.

  • Need help setting up DB Link from my Oracle 11g XE to SQL Server.

    Hi,
    I'm trying to create a DB Link from my Oracle 11g Express Edition in a Windows XP machine to an SQL Server. Here are the steps I've done so far.
    1. Created and setup an ODBC Connection for the SQL Server DB. Named it SQLSERVER. Windows Authenticated.
    2. Modified listener.ora. See below.
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
          (PROGRAM = extproc)
        (SID_DESC =
          (SID_NAME = CLRExtProc)
          (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
          (PROGRAM = extproc)
        (SID_DESC =
          (SID_NAME = SQLSERVER)
          (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
          (PROGRAM = hsodbc)
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    DEFAULT_SERVICE_LISTENER = (XE)3. Modified tnsnames.ora. See below.
    XE =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = XE)
    EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
    SQLSERVER =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT=1521))
        (CONNECT_DATA =
          (SID = SQLSERVER)
      (HS = OK)
    )4. Copied C:\oraclexe\app\oracle\product\11.2.0\server\hs\admin\initdg4odbc.ora to C:\oraclexe\app\oracle\product\11.2.0\server\hs\admin\initSQLSERVER.ora and modified it. See below.
    # This is a sample agent init file that contains the HS parameters that are
    # needed for the Database Gateway for ODBC
    # HS init parameters
    HS_FDS_CONNECT_INFO = SQLSERVER
    HS_FDS_TRACE_LEVEL = off
    # Environment variables required for the non-Oracle system
    #set <envvar>=<value>5. Restarted listener.
    C:\>lsnrctl stop
    LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-SEP-2012 11:33
    :51
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    The command completed successfully
    C:\>lsnrctl start
    LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-SEP-2012 11:33
    :54
    Copyright (c) 1991, 2010, Oracle.  All rights reserved.
    Starting tnslsnr: please wait...
    TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Production
    System parameter file is C:\oraclexe\app\oracle\product\11.2.0\server\network\ad
    min\listener.ora
    Log messages written to C:\oraclexe\app\oracle\diag\tnslsnr\PHAILORTD000012\list
    ener\alert\log.xml
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    STATUS of the LISTENER
    Alias                     LISTENER
    Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Produ
    ction
    Start Date                18-SEP-2012 11:33:57
    Uptime                    0 days 0 hr. 0 min. 3 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Default Service           XE
    Listener Parameter File   C:\oraclexe\app\oracle\product\11.2.0\server\network\a
    dmin\listener.ora
    Listener Log File         C:\oraclexe\app\oracle\diag\tnslsnr\PHAILORTD000012\li
    stener\alert\log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
      Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "SQLSERVER" has 1 instance(s).
      Instance "SQLSERVER", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully6. Created database link using the following command.
    create database link sqlserver using 'SQLSERVER';7. Test using
    select * from "dbo.mytable"@sqlserver;
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from SQLSERVER
    select * from dbo.mytable@sqlserver;
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from SQLSERVER
    select * from mytable@sqlserver;
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from SQLSERVERI followed the steps provided in this link but not sure where I went wrong. Can someone help me.
    http://www.dba-oracle.com/t_heterogeneous_database_connections_sql_server.htm
    Thanks,
    Allen

    Here's more information on the machines.
    Machine where the Oracle Database 11g Express Edition: IP Address is 10.162.128.67
    Machine where the SQL Server database: IP Address is 142.120.51.30.
    I've modified the tnsnames.ora to the following:
    XE =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 10.162.128.67)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = XE)
    EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
    SQLSERVER =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 142.120.51.30)(PORT=1433))
        (CONNECT_DATA =
          (SID = SQLSERVER)
      (HS = OK)
    )But now I'm getting the following error:
    C:\>tnsping sqlserver
    TNS Ping Utility for 32-bit Windows: Version 11.2.0.2.0 - Production on 18-SEP-2
    012 14:52:59
    Copyright (c) 1997, 2010, Oracle.  All rights reserved.
    Used parameter files:
    C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
    (HOST = 142.120.51.30)(PORT=1434))) (CONNECT_DATA = (SID = SQLSERVER)) (HS = OK)
    TNS-12541: TNS:no listener
    C:\>Regards,
    Allen

  • Retrieve the link from Bookmark of Report view on Enterprise Poral

    Hi All,
    We are running the BEx queries on Enterprise Portal. When I try to Bookmark a particular View of the query it says:
    "Bookmark 4XX9XXYJF84229XXQF2TBAZZD saved".
    If at a later stage I want to run the same view of the report, from where can I retrieve the 'Link' of this Bookmark (considering I did not save the link initially).
    I tried to T-code 'RSWR_BOOKMARK_REORG', but that does not give me the link.
    Regards,
    Shreyas.

    Please take a look at the FAQ for Portal.It has a section on the same topic.
    http://otn.oracle.com/products/iportal/htdocs/portal_faq.htm
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Milan:
    I have made a form in Portal EA 3.0.6.3.3, and I have tried to find a way to link the forms result to a report (as input).
    The Form is base on a non-updateable view and is use in order to use LOVs. The report is showing the details based on the search result of the form.
    What I need is a way to link the result of the form with the report parameters.
    I know I should use the On successful submission of a form, execute this PL/SQL block or PL/SQL procedure: in the firs form tap.
    I is should be something like this call('http://artemis/pls/portal30/APPS.RPT_DETAIL.show');.
    Artemis = local host/server
    APPS.RPT_DETAIL.show = the reports call interface
    I do a make the link with appropriate parameters???
    Yours thankfully<HR></BLOCKQUOTE>
    null

  • Unable to retrieve information from the sync server

    This only just started after I updated to the new 3.1 software, which included an update to the Mobile Me control panel. I sure would love to fix it, because the error message pops up every 20 seconds. My phone is syncing with MM and with my PC.Also,i have been ok with retrieving my job bids from http://www.besteventstaff.com since i signed up.Which was over 2 weeks ago but today everything won't load.I contacted the admin at Best Event Staff and hey are telling me they haven't had any other complaints.Pls help me out here.Why has things stopped loading so suddenly?Thanks in advance

    I have notes from my palm days too!  If you haven't resolved this, below there is a "more like this" set of links. One of them lists four solutions to this problem including how I resolved mine. Good luck!
    Re: How do I resolve "unable to retrieve conflict information from the sync server" when syncing with Outlook

  • HTTP post data from the Oracle database to another web server

    Hi ,
    I have searched the forum and the net on this. And yes I have followed the links
    http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
    http://manib.wordpress.com/2007/12/03/utl_http/
    and Eddie Awad's Blog on the same topic. I was successful in calling the servlet but I keep getting errors.
    I am using Oracle 10 g and My servlet is part of a ADF BC JSF application.
    My requirement is that I have blob table in another DB and our Oracle Forms application based on another DB has to view the documents . Viewing blobs over dblinks is not possible. So Option 1 is to call a procedure passing the doc_blob_id parameter and call the web server passing the parameters.
    The errors I am getting is:
    First the parameters passed returned null. and
    2. Since my servlet directly downloads the document on the response outputStream, gives this error.
    'com.evermind.server.http.HttpIOException: An established connection was aborted by the software in your host machine'
    Any help please. I am running out of time.
    Thanks

    user10264958 wrote:
    My requirement is that I have blob table in another DB and our Oracle Forms application based on another DB has to view the documents . Viewing blobs over dblinks is not possible. Incorrect. You can use remote LOBs via a database link. However, you cannot use a local LOB variable (called a LOB <i>locator</i>) to reference a remote LOB. A LOB variable/locator is a pointer - that pointer cannot reference a LOB that resides on a remote server. So simply do not use a LOB variable locally as it cannot reference a remote LOB.
    Instead provide a remote interface that can deal with that LOB remotely, dereference that pointer on the remote system, and pass the actual contents being pointed at, to the local database.
    The following demonstrates the basic approach. How one designs and implements the actual remote interface, need to be decided taking existing requirements into consideration. I simply used a very basic wrapper function.
    SQL> --// we create a database link to our own database as it is easier for demonstration purposes
    SQL> create database link remote_db connect to scott identified by tiger using
      2  '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=dev)(SERVER=dedicated)))';
    Database link created.
    SQL> --// we create a table with a CLOB that we will access via this db link
    SQL> create table xml_files( file_id number, xml_file clob );
    Table created.
    SQL> insert into xml_files values( 1, '<root><text>What do you want, universe?</text></root>' );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> --// a local select against the table works fine
    SQL> select x.*, length(xml_file) as "SIZE" from xml_files x;
       FILE_ID XML_FILE                                                                                SIZE
             1 <root><text>What do you want, universe?</text></root>                                    53
    SQL> --// a remote select against the table fails as we cannot use remote pointers/locators
    SQL> select * from xml_files@remote_db x;
    ERROR:
    ORA-22992: cannot use LOB locators selected from remote tables
    no rows selected
    SQL> //-- we create an interface on the remote db to deal with the pointer for us
    SQL> create or replace function ReturnXMLFile( fileID number, offset integer, amount integer ) return varchar2 is
      2          buffer  varchar2(32767);
      3  begin
      4          select
      5                  DBMS_LOB.SubStr( x.xml_file, amount, offset )
      6                          into
      7                  buffer
      8          from    xml_files x
      9          where   x.file_id = fileID;
    10 
    11          return( buffer );
    12  end;
    13  /
    Function created.
    SQL> --// we now can access the contents of the remote LOB (only in 4000 char chunks using this example)
    SQL> select
      2          file_id,
      3          ReturnXMLFile@remote_db( x.file_id, 1, 4000 ) as "Chunk_1"
      4  from       xml_files@remote_db x;
       FILE_ID Chunk_1
             1 <root><text>What do you want, universe?</text></root>
    SQL> --// we can also copy the entire remote LOB across into a local LOB and use the local one
    SQL> declare
      2          c               clob;
      3          pos             integer;
      4          iterations      integer;
      5          buf             varchar2(20);   --// small buffer for demonstration purposes only
      6  begin
      7          DBMS_LOB.CreateTemporary( c, true );
      8 
      9          pos := 1;
    10          iterations := 1;
    11          loop
    12                  buf := ReturnXMLFile@remote_db( 1, pos, 20 );
    13                  exit when buf is null;
    14                  pos := pos + length(buf);
    15                  iterations := iterations + 1;
    16                  DBMS_LOB.WriteAppend( c, length(buf), buf );
    17          end loop;
    18 
    19          DBMS_OUTPUT.put_line( 'Copied '||length(c)||' byte(s) from remote LOB' );
    20          DBMS_OUTPUT.put_line( 'Read Iterations: '||iterations );
    21          DBMS_OUTPUT.put_line( 'LOB contents (1-4000):'|| DBMS_LOB.SubStr(c,4000,1) );
    22 
    23          DBMS_LOB.FreeTemporary( c );
    24  end;
    25  /
    Copied 53 byte(s) from remote LOB
    Read Iterations: 4
    LOB contents (1-4000):<root><text>What do you want, universe?</text></root>
    PL/SQL procedure successfully completed.
    SQL> The concern is the size of the LOB. It does not always make sense to access the entire LOB in the database. What if that LOB is a 100GB in size? Irrespective of how you do it, selecting that LOB column from that table will require a 100GB of data to be transferred from the database to your client.
    So you need to decide WHY you want the LOB on the client (which will be the local PL/SQL code in case of dealing with a LOB on a remote database)? Do you need the entire LOB? Do you need a specific piece from it? Do you need the database to first parse that LOB into a more structured data struct and then pass specific information from that struct to you? Etc.
    The bottom line however is that you can use remote LOBs. Simply that you cannot use a local pointer variable to point and dereference a remote LOB.

Maybe you are looking for

  • Missing Hard Drive Space + Other Issues

    My Macbook's been acting funny lately - it wouldn't always come out of sleep, and every now and then an application would crash but its icon would stay in the Dock and there would be no way to get rid of it. When I tried typing in my password on the

  • Select and move multiple keyframs

    I just switched from Adobe Premier Elements on a PC to FCE 4. In PrEl, you can select multiple keyframes in their equivalent of the Viewer, you can them move them as a group. (Select them shift click or drag a square around them.) This is really usef

  • KM document storage

    Hi All, The landscape is like this: Portal and Knowledge Management on one server. TREX and KM documents need to be on another server. The question is whether the persistence mode (database) for the document repository can be retained , and still thi

  • Command Line Interface migration

    Hi, When I trying to make a connection to my source database using mkconn, I encountered this error which complaining about the driver not found. Error:Problem creating connection:Test failed: Driver class not found. Verify the Driver location But, I

  • French in Pages

    I have French as a subject, and I was planning to use Pages to help me with it. So I have a couple of problems: 1. Pages language set to French, French words still come up wrong, although they are right. 2. Unable to get speech to say the French, jus