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.

Similar Messages

  • How can i save the data from the Oracle database to my local directory

    How can i save the data from the Oracle database to my local directory instead Of saving the data file to the Directory created on the Oracle Server ?
    I require to design the Procedure which will pull the data from various tables and needs to store the data in the Client's local directory.

    Since SQL*PLUS runs on the client, you can use SQL*PLUS to spool data to your local drive.
    You could also use the database to write a a specified drive where all users have access to (mapped network drive, e.g.). I wouldn't recommend doing it that way, but it is sometimes useful when the files are created in some nightly batch run.

  • THE DATA FROM THE ORACLE DATABASE VIEW DATA IS NOT REFERESHED AUTOMATICALLY

    THE DATA FROM THE ORACLE DATABASE VIEW DATA IS NOT REFERESHED AUTOMATICALLY IN OBIEE DASHBOARD(ANSWERS)
    UNLESS AND UNTILL I OPEN THE ORACLE BI ADMINISTRATOR TOOL AND DO UPDATE ALL ROWCOUNT AND THEN SAVE THE RPD.
    WHERE AS ORACLE DATABASE TABLE DATA IS AUTOMATICALLY REFRESHED.
    PLS SOMEONE HELP OUT IN THIS ISSUE.

    Check whether you have enable cache on that view?

  • Improving performance on migrating data from one Oracle database to another

    We are using hibernate to migrate complete tables from one database to the other. This takes hours to days to transfer a couple of tables, all having relationships between each other. The only difference is that the new tables have an extra column which stores the primary key of the source table as an alias key in the destination table and the destination table has only one extra column which is its own primary key. Another small difference is that the name of the columns is a little different.
    Isn't there a simple way to use Oracle database's in built tools to migrate data if provided the source and destination tables and column names for mapping purposes? Please provide some suggestions for this Oracle newbie. Any other suggestions on improving the migration performance will be greatly appreciated.
    Suggestions please!!!

    Hello Justin,
    Thanks for your prompt reply. Ours is a small company so we take up all kinda roles. In this particular scenario, I was asked to migrate all the tables from one database to another. Both of the databases are present on two different machines but on the same network. There are about 100,000 records in some of the tables and there are about 50 tables to migrate. As I said, both the tables have different columns to be mapped and then transferred and the new table has only one extra column which is a primary key in the new table. Under these constraints, Hibernate is taking way too much time.
    I always felt that there must be a simpler and efficient way to do this. I would appreciate if you could you explain me the procedures in detail please.
    Thanks in advance.

  • Error while pulling data from an Oracle database. ORA-01858: a non-numeric character was found where a numeric was expected

    I'm trying to pull data from an Oracle database using SSIS. When I try to select a few fields from the source table, it returns the following error message:
        [OLE DB Source [47]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E14.
        An OLE DB record is available.  Source: "OraOLEDB"  Hresult: 0x80040E14  Description: "ORA-01858: a non-numeric character was found where a numeric was expected".
        An OLE DB record is available.  Source: "OraOLEDB"  Hresult: 0x80004005  Description: "ORA-01858: a non-numeric character was found where a numeric was expected".
    The source columns are a combination of numeric and texts, and I've also tried selecting one of them, which didn't work. I'm using the Oracle client 11.2.0.1, and it works fine with any other data sources I have connected to so far. How can I resolve this
    error?

    Hi H.James,
    According to your description, the issue is a non-numeric character was found where a numeric was expected while pulling data from an Oracle database in SSIS.
    Based on the error message, the issue should be you are comparing a number column to a non-number column in a query. Such as the query below (ConfID is a number, Sdate is a date):
     where C.ConfID in (select C.Sdate
                       from Conference_C C
                       where C.Sdate < '1-July-12')
    Besides, a default behavior for the Oracle OleDb Provider that change the NLS Date Format of the session to 'YYYY-MM-DD HH24:MI:SS can also cause the issue. For more details about this issue, please refer to the following blog:
    http://blogs.msdn.com/b/dataaccesstechnologies/archive/2012/01/20/every-bug-is-a-microsoft-bug-until-proven-otherwise.aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How configure a primavera web service to return data from the second database?

    Hi everyone,
    We have P6 with first WS deployed on a single server weblogic domain. The first WS return data from the first database instance.
    Then deployed advanced second WS on a separate weblogic domain server with a different port. Configured second WS with <WS2_INSTALL_HOME>/bin/dbconfig.sh, creating a new branch of a configuration that specifies a different second instance of the database. However, this configuration is ignored and second web services return data from the first database.
    We have one domain, which including next servers:
    Name / Host / Port / Deployments
    P6 / localhost / 0001 / P6(v8.3), p6ws1(v8.3)
    p6ws2 / localhost / 0002 / p6ws2(v8.3)
    Now we have two different file BREBootstrap.xml.
    P6 BREBootstrap.xml:
    <Database>
    <URL>jdbc:oracle:thin:@db1:1521:db1</URL>
    <UserName>pubuser</UserName>
    <Password>anycriptopass1</Password>
    <Driver>oracle.jdbc.OracleDriver</Driver>
    <PublicGroupId>1</PublicGroupId>
    </Database>
    <CfgVersion>8.330</CfgVersion>
    <Configurations>
    <BRE name="P6 Config_DB1" instances="1" logDir="anydir/P6EPPM/p6/PrimaveraLogs"/>
    </Configurations>
    p6ws2 BREBootstrap.xml:
    <Database>
    <URL>jdbc:oracle:thin:@db2:1521:db2</URL>
    <UserName>pubuser</UserName>
    <Password>anycriptopass2</Password>
    <Driver>oracle.jdbc.OracleDriver</Driver>
    <PublicGroupId>1</PublicGroupId>
    </Database>
    <CfgVersion>8.330</CfgVersion>
    <Configurations>
    <BRE name="P6 Config_DB2" instances="1" logDir="anydir/P6EPPM/ws2/PrimaveraLogs"/>
    </Configurations>
    ‘P6 Config_DB1’ and ‘P6 Config_DB2’ including Database property for 1 and 2 database respectively.
    How to configure a second web service to return data from the second database?
    Thanks in advance!
    Regards,
    Dmitry

    OK, so I got this to work this morning with Username Token Profile (with little help from Oracle Support).
    I followed your steps 1-4 but in step 2 I didn't add the -Ddatabase.instance=2 because I want to check to see if my code could swap between different instances.
    It appears for Username Token Profile to use Database Instance, you need to set it in the soap header.
    So my soap request looks like this:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <s:Header>
            <DatabaseInstanceId xmlns="http://xmlns.oracle.com/Primavera/P6/WS/Authentication/V1">2</DatabaseInstanceId>
            <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                <u:Timestamp xmlns:u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd' u:Id='uuid-327b6ed1-b26d-4a61-81d5-e326174c1961-3'>
                    <u:Created>2014-10-23T04:28:01.152Z</u:Created>
                    <u:Expires>2014-10-23T04:29:01.152Z</u:Expires>
                </u:Timestamp>
                <o:UsernameToken u:Id='uuid-327b6ed1-b26d-4a61-81d5-e326174c1961-3' xmlns:u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'>
                    <o:Username>admin</o:Username>
                    <o:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'>password</o:Password>
                    <o:Nonce EncodingType='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary'>vJBQhCc28bAeszej7gOaiC2tVCQ=</o:Nonce>
                    <u:Created>2014-10-23T04:28:01.152Z</u:Created>
                </o:UsernameToken>
            </o:Security>
        </s:Header>
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <ReadProjects xmlns="http://xmlns.oracle.com/Primavera/P6/WS/Project/V2">
                <Field>ObjectId</Field>
                <Field>Id</Field>
                <Field>Name</Field>
                <Field>Status</Field>
                <Field>StartDate</Field>
                <Field>FinishDate</Field>
                <Field>DataDate</Field>
                <Filter>Id = 'EC00515'</Filter>
            </ReadProjects>
        </s:Body>
    </s:Envelope>
    This request pulled the project from the second instance.
    V/r,
    Gene

  • ClickOnce WinForms Application to retrieve data from an Oracle Database

    I am hoping someone can help us.
    We are trying to create a ClickOnce WinForms Application that will allow our Customer Service group to retrieve data from an Oracle Database.
    We are currently able to use such a ClickOnce WinForms Application to allow our Customer Service group to retrieve data from SQL Server 2000 databases and even to a PICK Basic database. We use ole db drivers for these connections and keep the connection strings in a configuration file.
    Our primary question now is:
    1) What files would be needed on each client machine?
    Thanks for any pointers.
    :) Anne

    The problem has been fixed.
    If you wanna to load data from Oracle DB,the connect String should be like this:
    cnss.open "Provider=OraOLEDB.Oracle.1;data source=orcl;User Id=fdmitf;Password=fdmitf"
    besides, you should assign a value (True/False) to your function, as TonyScalese said in this post:
    Import from RDB Fails with "Error:Import failed.Invalid data or Empty..."
    Problem solved is always a great joy! Thanks!

  • Extract data into the Oracle Database

    Hello,
    I have file in PDF format.
    I need to extract data into the Oracle Database.
    what should be my action ?
    And how could I accomplish?
    thanks
    DN

    You said:
    Do you know ahead of time how many columns are in the file?
    yes, It has 8 columns.
    But each PDF have different total of columns. Right now I am working on one PDF file only.
    e.g: page emp report has following values:
    Salray History Report in PDF format
    Page 1
    Date 10-21-2005
    LAST NAME SALARY COMMISSION
    Russell 14000 .4
    Partners 13500 .3
    Errazuriz 12000 .3
    Cambrault 11000 .3
    Zlotkey 10500 .2
    after converting it will be come as
    Salray History Report in PDF format
    Page 1
    Date 10-21-2005
    LAST NAME
    SALARY
    COMMISSION
    Russell
    Partners
    Errazuriz
    Cambrault
    Zlotkey
    14000
    13500
    12000
    11000
    .4
    .3
    .3
    .3
    End of Page 1
    Date 10-21-2005
    LAST NAME
    SALARY
    COMMISSION
    DN

  • Frequency migrate data from the operational database SCOM 2012 SP1

    What is the frequency with which
    information is migrated from the operational database
    to the data warehouse database,
    are in separate servers and should perform
    maintenance tasks such as defragmentation to optimize
    disk space, this is recommended?
    thank you very much

    Hi
    Refer below link for data sync from DB to DW
    http://blogs.technet.com/b/jonathanalmquist/archive/2010/01/24/how-and-when-is-data-written-or-synchronized-to-the-data-warehouse.aspx
    Dataware house
    http://blogs.technet.com/b/stefan_stranger/archive/2009/08/15/everything-you-wanted-to-know-about-opsmgr-data-warehouse-grooming-but-were-afraid-to-ask.aspx
    Regards
    sridhar v

  • Transfer data from two oracle version to one sql server 2005

    Hi,
    I have two database servers on different machines. They are
    1) Oracle 8.1.7.4
    2) Oracle 7.3.1.4
    I have to create agents which can transfer tables from these two databases to one machine having sql server 2005 database.
    Please tell me what are the options. What drivers i need to install on machine having sql server 2005 so that i can transfer data from both oracle versions.
    Thanks
    Rajneesh.

    Your Oracle databases are so old you might want to look around and see if you can find dinosaur bones near by.
    Given the differences in data types between Oracle and SQL Server I'd suggest you start off by dumping the data into delimited ASCII files and then loading it using whichever SQL Server tool you wish.

  • Query Data from other Oracle Database into current

    Hi all,
    I have to query data from another oracle database into the current oracle database. Because the customer has standard edition, I cannot use a pipe. I tried "SELECT column_name FROM external_oracle_db.schema.table WHERE column_name = 'column_value';" Unfortunately this does not work.
    Does anyone have a suggestion?
    Thanks
    Hans

    Have you tried with Database links?
    SELECT column_name FROM schema.table@external_oracle_db WHERE column_name = 'column_value';
    Satish

  • Any way to extract data from the "Organizer" database?

    I asked a similar question in the Lightroom forum but I'm asking it here as well. I'm thinking of either getting Lightroom or Elements but my only concern is being able to access to all of the meta-data that I tag my photos with in the "Organizer". Most likely I'll spend hours organizing my photos and I want to be able to access this data from outside the organizer for read-only purposes.
    I realize that from inside of orgainizer all of this is available to me but I want to be able to use other tools and apps (that I'll write myself when needed) to get access to my photo catalogs.
    Does Adobe have any sort of API or library that 3rd party apps can use to access the data in Organizer? I searched the Adobe web-site but didn't find anything. Ideally I could run a SQL query against the database to get what I want.

    This idea intrigued me, so a did a Google search on "extract photo metadata", which resulted in some interesting links.
    You might want to investigate some of these further.
    One which looked quite interesting along the lines of the read/write of metadata can be found here:
    http://devzone.zend.com/article/4025
    Good Luck...

  • Hoa to delete data from the SE11 database table

    Hi Friends,
    Need some urgent help.
    While uploading data to infotype 6 (addresses) in subtype 4(emergency address), I have uploaded the data twice and it has created a duplicate record now in table PA0006.
    I have done this in the quality server. Will this effect the user acceptance testing(UAT) in anyway and how can I delete this data from table PA0006
    Pls help me urgently.
    Bye
    Naveen

    Hi  Naveen ,
    1 .Check what is the time constraint for address infotype .
    2.If it is 2 , it would have delimited the record , if it is 3 it would have created another record , if it is one there will be no problem as it would have deleted the recored provided u have given the dates into consideration .
    3.It will not be  a problem for UAT . If it is not required do  a scat for deletion of records .
    Regards
    Gajalakshmi

  • Why is my WAR file still referencing data from the old database server?

    OK I will outline the steps:
    1. I downloaded a perfectly functioning WAR fIle
    2. Uncompressed it
    3. Changed the database settings in the Database.properties file
    4. Made it a WAR file again
    5. Imported it in Eclipse IDE using File -> Import
    6. Ran a test client by right clicking the WSDL and selecting Web Services->Generate Client
    Now when I insert data using the client, it is still entering that on the old server and not the new one. I am so lost in terms of modifying WAR files.

    Obviously one or more of the steps you took was not performed correctly but the detail is important and we don't have any.
    I would guess that if you extract the content of your modified war file you will find that you did not actually change anything but who knows.

  • Database link from one Oracle database to another

    Hi everyone!
    I have 2 databases. I need to create a database link to copy a table from one of the database to another.
    Both of them are Oracle 10g v2
    Please advice me on how can I go about it.
    I am trying to avoid import and export.
    What are the options left to me?
    Thanks

    user5160274 wrote:
    Hi Kanchana,
    I am using Oracle 10g/Windows Server 2008. I have created a dabaselink. The link works perfectly fine. I want to copy the table (Oracle 11g) from remote server in to my database. It is ongoing process ie, it has to be scheduled and I want the updated rows to be copied in to my database on a daily basis. Please help me out.
    Eagerly awaiting for your response.
    Regards
    Narayanan NAnd once again a new member of the forum, on their very first post, goes on an archeological dig and tries to raise the dead. This thread is well over a year old. You should have started your own thread for your own issue. You say you have created a link and it works, so whatever your problem is, it is NOT even related to the question the OP raised.
    At exactly what point are you unsure about the process? Scheduling a processes? The command to use? Exactly what have you tried? What results do you have so far?.
    Please, start a new thread explaining your issue.
    Moderator --- please lock this thread.

Maybe you are looking for