Documentum objects to Oracle BLOBs
Hi All -
We currently have documents (as images) stored in documentum server. These document images need to be moved to Oracle database as Oracle BLOBs with unique IDs as we are getting rid of documentum server. We have thousands of documents stored in documentum server.
What would be a good/effecient way to migrate all these documents to Oracle as BLOBs using PLSQL? Are there any existing API's to accomplish this? Please share your expertise.
Thanks,
-Seenu
This piece of code, which I got by Googling, updates a table with a BLOB.
update person set portrait= empty_blob()
where id = p_person_id
returning portrait into l_blob;
l_bfile := bfilename( 'MY_IMAGES',p_file_name );
dbms_lob.fileopen( l_bfile );
dbms_lob.loadfromfile( l_blob, l_bfile,
dbms_lob.getlength( l_bfile ) );
dbms_lob.fileclose( l_bfile );
Sybrand Bakker
Senior Oracle DBA
Similar Messages
-
How to store java object in oracle
Hi all,
is it possible to store jva object in oracle.
I have defined myClass. It have only data fields ( no methods).
I make myClass myObject = new myClass();
How can I store this object in oracle DB.
Many thanks in advance.1.Convert this object into stream of Bytes.
2.create a new InputStream from these Byte array.
2.Use the setBinaryStream to set the values inside the table's column.
3.Store this object as a Blob in the table (column type must be Blob).
Hope this helps.
Sudha
PS:- Somebody explained in this forum how to convert an Object into Byte array . -
How to convert oracle BLOB to String
Hi,
I am working on an GIS project using Oracle database which stores the spatial data. When I read the polygon points data which is saved as BLOB type in database table and convert the BLOB to byte[], there is no problem. However when the data is converted to Character, those characters are not recognized something like this:
�����������?�����?���w�����������������!����?o����s��8��n�����H��?
������������������ �?&�?�����|��?��������?���������������L�?
This is the method I used to convert BLOB to String below:
-----mapb is the BLOB instance.
byte[] images = mapb.getBytes(1,(int)mapb.length());
String newstring = new String(images);
Is that decoding problem?
Can somebody help me for this problem?
Thanks in advance!
XRHi,
Thanks for reply,
Actually the data is ESRI spatial data saved in ORACLE database.
the BLOB is not a column, it is part of column of st_geometry.
I looked at some docs in ESRI, they save points which is the last part of st_geometry field with BLOB type. I use the jdbc to get the geometry data and use STRUCT and Datum class to get all members of the st_geometry data. There are 14 members in the field, I can cast most of them into String through Datum instance, but the object #14 is BLOB, will not allow me cast it to String directly, so I use byte[] and cast it though new String().
some of the lines here:
STRUCT st = (oracle.sql.STRUCT) rs.getObject("shape");
Datum[] dtms = st.getOracleAttributes();
BLOB mapb = null;
for (int i=0;i<dtms.length;i++){
if (!(dtms[i] == null)){
if (i==13){
mapb = (BLOB)dtms;
} else {
log.info("data" + i + "=" + dtms[i].stringValue());
byte[] images = mapb.getBytes(1,(int)mapb.length());
String newstring = new String(images);
Thanks again for your reply.
XR -
Can I use oracle blob by CMP bean in weblogic 6?
I use weblogic 6.1(sp3) and Jbuilder 7.when I try to use oracle blob by CMP bean,the
errors are:
javax.ejb.FinderException: Exception raised in findByPrimaryKey
java.io.StreamCorruptedException: InputStream does not contain a serialized object
What should I do?Is there examples about using oracle blob?
thanks a lot!Great! So what was the problem?
Regards,
Slava Imeshev
"Roger Lee" <[email protected]> wrote in message
news:[email protected]...
>
Finally got it working with CMP, which is my preferred choice (over BMP).
I read the Excel Spreadsheet into a "byte []" array, and the Entity Beanmapped
"byte []" to the Blob column in the Oracle table.
"Slava Imeshev" <[email protected]> wrote:
Roger,
I'm not quite sure I undestand the problem. Could you:
1. Post deployment descriptors in part related to this
CMP bean?
2. Post the piece of code that is failing?
Please post the information above and we will help
you to hunt the problem down.
No, I don't have any problems accessing blobs
from CMP.
Regards,
Slava Imeshev
"Roger Lee" <[email protected]> wrote in message
news:[email protected]...
Yes. I have added;
<dbms_column-type>OracleBlob</dbms-column-type>
It fails because the locater to the blob, obtained by findBYPrimaryKeyis
null.
i.e. an empty_blob() is not created.
Have you got CMP to access Blobs in WLS 6.1?
"Slava Imeshev" <[email protected]> wrote:
Hi Roger,
Have you tried using OracleBlob as dbms-column-type?
Also, could you post that part of your code that is failing?
Regards,
Slava Imeshev
"Roger Lee" <[email protected]> wrote in message
news:[email protected]...
I can access Clobs using CMP. If you are using the Oracle OCI Driveryou
do not
need to add this line.
However if you are using the Oracle Type 4 Thin drivers you need
to
add;
<dbms_column-type>OracleClob</dbms-column-type>
to the file;
weblogic-cmp-rdbms-jar-xml
This DOES NOT work with Blobs.
I am unable to get WebLogic 6.1 sp4 persist a Blob to an Oracle
8.1.x
table and
retrieve it using either CMP or BMP.
Unless any one show me a complete working CMP and BMP example?
Roger Lee
Deepak Vohra <[email protected]> wrote:
BLOB and CLOB DBMS Column Support for the Oracle DBMS
http://edocs.bea.com/wls/docs61/ejb/cmp.html#1061636
shybird wrote:
I use weblogic 6.1(sp3) and Jbuilder 7.when I try to use oracle
blob
by CMP bean,the
errors are:
javax.ejb.FinderException: Exception raised in findByPrimaryKey
java.io.StreamCorruptedException: InputStream does not contain
a
serialized
object
What should I do?Is there examples about using oracle blob?
thanks a lot! -
Oracle BLOB value to a LC variable
Hello,
Is it possible in LC ES2 to coerce oracle blob value to some livecycle variable ?
When mapping sql query result (column of type BLOB) to a LC variable (of type Document), we receive:
com.adobe.workflow.datatype.InvalidCoercionException: Cannot coerce object: oracle.sql.BLOB@27e7d6 of type: oracle.sql.BLOB to type: com.adobe.idp.Document
We have tried mapping to string, binary, Document (, we even desperately hardcoded sql.oracle.BLOB to process XML), but none of this works.
Is it possible to solve this other way, then following ?
http://groups.google.com/group/livecycle/browse_thread/thread/6c4b9156b52b71a7
Thanks.My idea is to fetch the BLOB column data as UTF8 (base64) encoded string and then use getDocumentFromBase64 available in ES2.
I am not sure what syntax is to fetch from ORACLE.
I have used MySql database and the query is:
SELECT CONVERT(Blob_Column USING UTF8) as MyBlobDataAsBase64Str FROM myTableName;
Now using SetValue activity to look like: myXMLvariable = getDocumentFromBase64(strVariableHoldingBase64Data)
This case works perfectly without any issues.
The problems is you should find out the appropriate syntax for ORACLE.
I was searching about CONVERT() & UNISTR() functions. But i'm unable to evaluate.
Try by yourself..
Nith -
I'm getting a ClassCastException when I try to the blob I get from my CallableStatment. I've seen alot of post about similar issues with oracle 9 and inserting blobs but I havn't found a solution..
Here is the few lines that Im doing..
When I check to see what type of instance this blob is this is what I get in my debugger oracle.sql.BLOB@71d768
so When I ((BLOB)blob).getBinaryOutputStream() I get the ClassCastException..
I've tried to get the innermost delegate and a number of other things.. When I try to cast anything to the Oracle type I get the ClassCastException. When i do an instanceof on the blob it isn't an oracle Blob.. So why does the debugger and getClass().getName() tell me it is.. And is the any work around for this..
Thanks
Dan
cstmt.registerOutParameter(6, OracleTypes.BLOB);
cstmt.execute();
Blob blob = cstmt.getBlob(6);
if(blob != null) {
writer = new ObjectOutputStream( ((BLOB)blob).getBinaryOutputStream());
if (writer != null) {
writer.writeObject(bean);
writer.flush();
writer.close();
con.commit();Yes, I modified some code that a collegue used in a standalone application.. His solution was using a CLOB.. I just modified my solution to use a CLOB instead of a BLOB(saving a bean as xml instead of the bean object)..
So i litterally copied his code line for line.. And Im getting the same error. My app is running in tomcat whereas my collegue is using it in a standalon application. I just went thru all lib directories to make sure I only have one copy of the oracle ojdbc14.jar which is in the conf/lib directory of the tomcat server..
I even moved my table from our oracle9 db to our oracle 10 db and still no luck..
String beanToXml = xstream.toXML(bean);
cstmt.execute();
oracle.sql.CLOB clob = ((OracleCallableStatement) cstmt).getCLOB(6)
if (clob != null) {
writer = ((CLOB) clob).getCharacterOutputStream();
if (writer != null) {
writer.write(beanToXml.toCharArray());
writer.flush();
writer.close();
} -
Hi everybody,
I need to store binary data (> 32K) in an oracle BLOB field, respectivly commit the data to an oracle PL/SQL stored procedure.
First I tried to use LONG RAW, but failed to commit more than 32K of data. This seems to be a documented problem, you can store 2GBs in an LONG RAW field, but PL/SQL can only store 32K in an LONG RAW variable.
Then I tried to switch from LONG RAW to BLOB (both the field in the table and the in variable in the stored procedure) but it seems to be very complicated to use BLOB fields with JDBC.
I've found example for a plain INSERT. First execute an INSERT with an empty BLOB, then make an SELECT FOR UPDATE on the row, obtain the reference to the BLOB-Object, alter the BLOB-Object and create an UPDATE-Statement with it.
I've not tried this yet, but according to various web sites it should work.
The problem is, that it does not solves the problem how to commit a BLOB value to a PL/SQL stored procedure.
Does anyone knows a solution?
Thx and regards,
RobertHi,
thx for your answer.
That's the solution I described (INSERT, SELECT, UPDATE) and only works with Statements.
But I think I've already found a mistake of mine, I have to try this today.
I already succeeded in creating a BLOB-Object without obtaining it from a resultset, the constructor is not documented but it exists, it looks like BLOB( OracleConnection, byte[] ).
I think I can commit the BLOB to the stored procedure but it won't be a valid BLOB locator.
What I've not tried yet and what I think migth be the solution is creating the valid BLOB locator inside the stored procedure using the PL/SQL BLOB methods.
Sounds simple but for some reasons I have not thougth about it yet. :-)
I'll report the result here if somebody else is interested in the issue. :o)
Thx and regards,
Robert -
Oracle error ORA-01461when trying to insert into an ORACLE BLOB field
I am getting Oracle error ‘ORA-01461: can bind a LONG value only for insert into a LONG column' when trying to insert into an ORACLE BLOB field. The error occurs when trying to insert a large BLOB (JPG), but does not occur when inserting a small (<1K) picture BLOB.(JPG). Any ideas?
BTW, when using a SQL Server datasource using the same code.... everything works with no problems.
ORACLE version is 11.2.0.1
The ORACLE datasource is JDBC using Oracle's JDBC driver ojdbc6.jar v11.2.0.1 (I also have tried ojdbc5.jar v11.2.0.1; ojdbc5.jar v11.2.0.4; and ojdbc6.jar v11.2.0.4 with the same error result.)
Here is my code:
<cfset file_mime = Lcase(Right(postedXMLRoot.objname.XmlText, 3))>
<cfif file_mime EQ 'jpg'><cfset file_mime = 'jpeg'></cfif>
<cfset file_mime = 'data:image/' & file_mime & ';base64,'>
<cfset image64 = ImageReadBase64("#file_mime##postedXMLRoot.objbase64.XmlText#")>
<cfset ramfile = "ram://" & postedXMLRoot.objname.XmlText>
<cfimage action="write" source="#image64#" destination="#ramfile#" overwrite="true">
<cffile action="readbinary" file="#ramfile#" variable="image_bin">
<cffile action="delete" file="#ramfile#">
<cfquery name="InsertImage" datasource="#datasource#">
INSERT INTO test_images
image_blob
SELECT
<cfqueryparam value="#image_bin#" cfsqltype="CF_SQL_BLOB">
FROM dual
</cfquery>Can't you use "alter index <shema.spatial_index_name> rebuild ONLINE" ? Thanks. I could switch to "rebuild ONLINE" and see if that helps. Are there any potential adverse effects going forward, e.g. significantly longer rebuild than not using the ONLINE keyword, etc? Also wondering if spatial index operations (index type = DOMAIN) obey all the typical things you'd expect with "regular" indexes, e.g. B-TREE, etc.
-
JDBC Receiver Adapter and Oracle BLOB
Hi,
I would like to put some raw data into an ORACLE BLOB using XI. My idea was to put the data in an xml element, but the JDBC sender adapter doesn't seem to be able to cope with writing. Has anybody gathered experiences regarding this topic?
Kind regards,
HeikoHi,
The error saying it is unable to connect to the Database, so it may be the drivers problem. once check the drivers and its syntaxes.
Syntax :
http://www.devx.com/tips/tip/28818
For Download and configure the drivers :
http://www.aquafold.com/docs-jdbcdrivers-oracle10g.html
http://www.oxygenxml.com/database_drivers.html
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f04ce027-934d-2a10-5a8f-fa0b1ed4d88f -
How to recompile the objects in oracle apps
i used adadmin and compiled the apps schema .. but still i am getting INVALID objects .. how to compile these objects ?
Below is the output after running adadmin .. suggest
select owner,object_type,status from dba_objects where status='INVALID'
SQL> /
OWNER OBJECT_TYPE STATUS
FLOWS_010500 JAVA SOURCE INVALID
FLOWS_010500 JAVA CLASS INVALID
PUBLIC SYNONYM INVALID
PUBLIC SYNONYM INVALID
PUBLIC SYNONYM INVALID
PUBLIC SYNONYM INVALID
RE PACKAGE BODY INVALID
HERMAN TABLE INVALID
APPS PACKAGE BODY INVALID
APPS PACKAGE BODY INVALID
APPS PACKAGE BODY INVALID
OWNER OBJECT_TYPE STATUS
APPS PACKAGE BODY INVALID
APPS MATERIALIZED VIEW INVALID
CA TABLE INVALID
CA TABLE INVALID
Thanks in advancei have 12.1.1 instance on Linux OS
there is no adcompsc.pls file in $AD_TOP/sql .. i can see only adcompsc.sql You are on R12, and this script is no longer available -- See (Invalid Objects In Oracle Applications FAQs [ID 104457.1]), 10. How can I recompile all my invalid objects using ADCOMPSC.pls?
Below is the error when i try to run the adcompsc.pls file .. please help
[oaebiz@oracle sql]$ sqlplus @adcompsc.pls apps apps %
SQL*Plus: Release 10.1.0.5.0 - Production on Tue Jan 4 08:36:03 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SP2-0310: unable to open file "adcompsc.pls"
Enter User-name :Use adcompsc.sql instead.
Thanks,
Hussein -
Dropping java object from Oracle 8i
We areaable to load java methods and publish them to SQL in Oracle 8i using Jdev Deploy wizard, but we can not drop them thru
Open View As->Database Browser of the connection object, they drop menu is greyed out/disable. What kind privilege we need to drop java object from Oracle 8i? Or there is something wrong with the database setup.
Thank you very muchThere are three options:
Normal
SysDBA
SysOper
I have tried the three of them, none of them works, is there third option SYS?
Thank you very much.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Amit:
Log in as SYS.<HR></BLOCKQUOTE>
null -
Hai all,
I want to know where could I get good material on using Objects in Oracle (in Forms) plus some good tutorial regarding the same.
Thanx
Vinayakit it necessary to use adadmin to compile these objects and whether to use this with Maintenance Mode.No it is not necessary to use adadmin but recommended and you do not need to enable maintenance mode before compiling invalids irrespective of using adadmin or utlrp or adcomps.pls
I was previously using urlrp.sql/etc to recompile invalid objects with non-APPS environment, so what is the difference in these 2. here also you can use utlrp.sql but ideally we use utlrp.sql when no one is connected to system but adadmin can be used while users are in. Also through adadmin you can compile invalid of apps schema only and utlrp will compile all invalids in db.
adadmin calls $AD_TOP/sql/adcompsc.sql for compiling invalids. You can read this sql to view its functioning.
what could be the issues, if i run manual recompile on running APPS environment or by using Oracle EM to compile APPS/etc Scheama.You can do it manually, no issues.
Thanks,
JD -
Data objects and code objects in oracle application
Hi,
can any one please help me out with following question?
1. what are data objects and code objects in oracle apps and why is that difference?
2. How does the objects gets created in Oracle Applications, like during the installation which part is responsible for creating objects and after the installtion later point of time, how the new objects gets created in oracle applications?
3. what are the ways to find out if my 11i application is OATM enabled ?
Thanks in advanceHello,
I managed to find answer for question 1, yet to find answer for 2 and 3.
Answer for question 1 --
Data objects : store and access business data (tables, indexes, sequences, index-organized tables, etc);
Code objects : process data objects but them don't contains business data (functions, procedures, packages, views, synonyms);
Now, here i have a question - under which objects queues are considered ? -
How to alter user defined objects in oracle
Hi all,
Can any one tell me how to alter user defined objects in oracle .
Thanks,
P Prakashprakash wrote:
Hi all,
Can any one tell me how to alter user defined objects in oracle .
DROP
then
CREATE
Handle: prakash
Email: [email protected]
Status Level: Newbie (80)
Registered: Feb 3, 2011
Total Posts: 185
Total Questions: 67 (65 unresolved)
so many questions & so few answers.
How SAD!
Edited by: sb92075 on Sep 22, 2011 9:22 AM -
Want to use sequence object of oracle when loading data in sql loader
Hi,
I want to use sequence when loading data in sqll loader, but the problem is i could not use sequence object of oracle to load the data by sql loader, i can use sequence of sql loader.
I want to use sequence object because in later entries this sequence object will be used.If i use sequence of sql loader how can i use oracle sequence object
Is there any other optionI have a simillar problem, I also want to use a sequence when loading data by the SQL Loader.
My control file is:
load data
infile '0testdata.txt'
into table robertl.tbltest
fields terminated by X'09'
trailing nullcols
(redbrojunos,
broj,
dolazak,
odlazak nullif odlazak=blanks,
komentar nullif komentar=blanks)
And the datafile is:
robertl.brojilo.nextval 1368 17.06.2003 08:02:46 17.06.2003 16:17:18
robertl.brojilo.nextval 2363 17.06.2003 08:18:18 17.06.2003 16:21:52
robertl.brojilo.nextval 7821 17.06.2003 08:29:22 17.06.2003 16:21:59
robertl.brojilo.nextval 0408 17.06.2003 11:20:27 17.06.2003 18:33:00 ispit
robertl.brojilo.nextval 1111 17.06.2003 11:30:58 17.06.2003 16:09:34 Odlazak na ispit
robertl.brojilo.nextval 6129 17.06.2003 14:02:42 17.06.2003 16:23:23 seminar
But all records were rejected by the Loader, for every record I get the error:
Record 1: Rejected - Error on table ROBERTL.TBLTEST, column REDBROJUNOS.
ORA-01722: invalid number
Maybe you are looking for
-
I am trying to extract metadata from essbase into a flat file using ODI.
I have 2 questions in this regard : Some of the account members storage property is missing in the extract.the reason which i suspect is due to the parent child sorting that did not happen while extracting.How do i do this.I do not see this option wh
-
Can I delete all exact duplicates in my library at one time? Do I have to delete each track individually?
-
Hi every body CBWFQ uses both custom based ( with a little enhancement i.e we used percentage of interface bandwidth rather than byte counts) and weighted fair queuing using class map and policy maps Here is my confusion. In Custom based queuing we h
-
How to reset a folio in Adobe Content viewer / Android ?
I am using a folio in Adobe Content Viewer on a Kobo (android tablet), and I want to reset pages. In the iPad, I tap Three times on the name of the folio. The same action doesn't work in the kobo. Do you know how I can catch it ? Thank you for your a
-
I lost my iphone 5 , how do I track it ?
someone stole me iphone , how do I track it and find the location of where my phone is ?