Replacing a TIDBLOB entry (e.g., fixing a slow OLE)

Figure out what the Ole_Object_Id and Ole_Object_Type are.

For example, for X293 data, use the following SQL to get Ole_Object_Id:

select * from passport.tidtpcol
where owner_code_50 = '0000102234000' -- X293 Owner Key
and notes_topic = 'MAINTENANCE HISTORY' -- X293 Notes Topic

Use this SQL to get OLE_OBJECT_TYPE:

select * from passport.tidblob
where ole_object_id = '877777914451'

Extract the TIDBLOB object.

Open a Windows command prompt and change directory to the location of the readBlob.class location. Make certain a directory called output exists.

Run program readBlob.class similar to the following to read TIDBLOB entry out of database. You will be prompted for a user ID, password, database name, Ole_Object_Id and Ole_Object_Type. Output is written to the output directory as OLE_OBJECT_ID.txt.

c:\oracle\ora111\jdk\bin\java -Xmx350m -cp .;c:\oracle\ora111\jdbc\lib\ojdbc5.jar readBlob "PROMPT"

Note that readBlob.java is compiled similar to this:

c:\oracle\ora111\jdk\bin\javac -classpath .;c:\oracle\ora111\jdbc\lib\ojdbc5.jar ./readBlob.java

If you extract an object of Ole_Object_Type=b, then open the file with a hex editor like Ultra Edit and add the two bytes x1F an x9D to the beginning. FTP the file to a Unix box and uncompress it with the uncompress command. FTP the resulting file back to the PC for editing.

The application to edit the file with can be determined by TIDOBLOK.Ole_Object_Class or by the file having a recognized magic number.

If you extract an object of Ole_Object_Type=B, rename the file by adding the appropriate suffix.

Let's say it is a MS Word document with embedded pictures. Use the MS Word Picture Toolbar, Compress to shrink all of the pictures in the document to 200 dpi. This can reduce the file size by a factor of 10.

Rename the existing TIDBLOB object for safe keeping using SQL similar to this:

update passport.tidblob
set ole_object_id = 'PassPortGeek'
where ole_object_id = '877777914451'
and ole_object_type = 'B'

If the file is to be uploaded as Ole_Object_Type=b, FTP the file to a Unix box and use the Unix compress command as follows to perform LZW compression with "bits per code" of 12: compress -b 12 filename. FTP the file back to a PC and use a hex editor to remove the first two bytes of x1F and x9D.

Load the TIDBLOB object.

In the Windows command prompt, run program writeBlob.class in a manner similar to the following to write a file into TIDBLOB. You will be prompted for a user ID, password, database name, Ole_Object_Id, Ole_Object_Type, and file.

c:\oracle\ora111\jdk\bin\java -Xmx350m -cp .;c:\oracle\ora111\jdbc\lib\ojdbc5.jar writeBlob "PROMPT"

You should be good to go. If the OLE is accessed fine in Asset Suite, delete the TIDBLOB entry where OLE_OBJECT_ID = 'PassPortGeek'

Reply