users@glassfish.java.net

RE: _at_Lob

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Tue, 9 Jun 2009 08:18:34 -0400

By @LOB i assume you mean one of the 4 predefined Oracle BLOB entities:
BLOB Binary Large Object
CLOB Character Large Object
BFILE Binary File (RO Binary Datafile stored outside DB)
NCLOB CLOB column that supports Multibyte Character Set

create table LOBTest (
Text CLOB,
Budget BLOB,
Letter BFILE,
tablespace MyTablespace
lob(Text,Budget) store as
(tablespace LOB_Tablespace
  storage (initial 100k next 100k pctincrease 0)
           chunk 16k pctversion 10 nocache logging);
//initial segment allocation is 100k, consequent segment allocation is 100k
//each lob value is allocated 16k contiguous(default chunk value is 1k)
//pctversion is max percentage of overall LOB storage used for new LOBVersions
//nocache - lob values not stored in memory
//logging - all operations against LOB are recorded in database redo logfiles

//INITIALISATION
BLOB is initialised with EMPTY_BLOB() function e.g.
INSERT INTO TABLE (BLOBColumn) VALUES (EMPTY_BLOB());

CLOB is initialised with EMPTY_CLOB() function
INSERT INTO TABLE (CLOBColumn) VALUES (EMPTY_CLOB());

NCLOB is initialised with EMPTY_CLOB() function
INSERT INTO TABLE (NCLOBColumn) VALUES (EMPTY_NCLOB());

BFILE is initialised with BFILENAME function;
create directory BFILEDIRECTORY as '/u01/bfiledirectory'
INSERT INTO TABLE (BFILENAMEColumn) VALUES (BFILENAME('BFILEDIRECTORY','a.doc'));

ALL Interactions with LOB are thru DBMS_LOB Oracle package you would of course need to source the scriptfile


    {ORACLE_HOME}/rdbms/admin/dbmslob.sql
More information for manipulating Oracel LOBs can be seen at
http://www.psoug.org/reference/dbms_lob.html

illustration of BFILENAME column creation available at
http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10759/functions011.htm

illustration of BLOB and CLOB column creation available at
http://www.dba-oracle.com/t_table_blob_lob_storage.htm

illustration of NCLOB column available at
http://www.orafaq.com/wiki/NCLOB

HTH
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Mon, 8 Jun 2009 21:28:03 -0700
> From: glassfish_at_javadesktop.org
> To: users_at_glassfish.dev.java.net
> Subject: Re: RE: @Lob
>
> Martin, thanks for the reply.
>
> Whatelse can I do if my object is >64K? Is there a way to detect the size of an object after it is serialized?
> [Message sent by forum member 'senderj' (senderj)]
>
> http://forums.java.net/jive/thread.jspa?messageID=349891
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>

_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009