Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

OracleÖÐBLOB/CLOB×ֶοÉÄÜÓöµ½µÄÎÊÌâ

Blob ²ÉÓõ¥×Ö½Ú´æ´¢£¬Êʺϱ£´æ¶þ½øÖÆÊý¾Ý£¬ÈçͼƬ¡¢ÊÓÆµµÈ¡£
Clob ²ÉÓöà×Ö½Ú´æ´¢£¬Êʺϱ£´æ´óÐÍÎı¾Êý¾Ý¡£
1. ÔÚOracle JDBCÖвÉÓÃÁ÷»úÖÆ¶Ô BLOB/CLOB ½øÐжÁд²Ù×÷£¬ËùÒÔҪעÒâ²»ÄÜÔÚÅú´¦ÀíÖжÁд BLOB/CLOB×ֶΣ¬·ñÔò½«³öÏÖ
Stream type cannot be used in batching Òì³£¡£
2. Oracle BLOB/CLOB ×ֶα¾ÉíÓµÓÐÒ»¸öÓα꣨cursor£©£¬JDBCͨ¹ýÓαê¶ÔBlob/Clob×ֶνøÐвÙ×÷£¬ÔÚBlob/Clob×ֶδ´½¨Ö®Ç°£¬ÎÞ·¨»ñÈ¡ÆäÓαê¾ä±ú£¬»á³öÏÖ
Connection reset by peer: socket write error Òì³£¡£
ÕýÈ·µÄ×ö·¨ÊÇ£ºÊ×ÏÈ´´½¨Ò»¸ö¿Õ Blob/Clob ×ֶΣ¬ÔÙ´ÓÕâ¸ö¿Õ Blob/Clob×ֶλñÈ¡Óα꣬ÀýÈçÏÂÃæµÄ´úÂ룺
PreparedStatement ps  =  conn.prepareStatement( " insert into PICTURE(image,resume) values(?,?) " );
//  Í¨¹ýoralce.sql.BLOB/CLOB.empty_lob()¹¹Ôì¿ÕBlob/Clob¶ÔÏó
ps.setBlob( 1 ,oracle.sql.BLOB.empty_lob());
ps.setClob( 2 ,oracle.sql.CLOB.empty_lob());
ps.excuteUpdate();
ps.close();
//  ÔٴζԶÁ³öBlob/Clob¾ä±ú
ps  =  conn.prepareStatement( " select image,resume from PICTURE where id=? for update " );
ps.setInt( 1 , 100 );
ResultSet rs  =  ps.executeQuery();
rs.next();
oracle.sql.BLOB imgBlob  =  (oracle.sql.BLOB)rs.getBlob( 1 );
oracle.sql.CLOB resClob  =  (oracle.sql.CLOB)rs.getClob( 2 );
//  ½«¶þ½øÖÆÊý¾ÝдÈëBlob
FileInputStream inStream  =   new  FileInputStream( " c://image.jpg " );
OutputStream outStream  =  imgBlob.getBinaryOutputStream();
byte [] buf  =   new   byte [ 10240 ];
int  len;
while (len = inStream.read(buf) > 0 ) {
 outStream.write(buf, 0 ,len);
}
inStream.close();
outStream.cloese();
//  ½«×Ö·û´®Ð´ÈëClob
resClob.putString( 1 , " this is a clob " );
//  ÔÙ½«Blob/Clob×ֶθüе½Êý¾Ý¿â
ps  =  conn.prepareStatement( " update PICTURE set image=? and resume=? where id=? " );
ps.setBlob( 1 ,imgBlob);
ps.setClob( 2 ,resClob);
ps.setInt( 3 , 100 );
ps.executeUpdate();
ps.close();
²Î¿¼×ÊÁÏ£º¿ª·¢ÕßÔÚÏßhttp://www.builder.com.cn/files/list-0-0-50259-1-1.


Ïà¹ØÎĵµ£º

oracle wait event:reliable message

½ñÌì¿Í»§µÄÒ»Ì×RAC»·¾³³öÏÖÎÊÌâ
Ë«½ÚµãRAC»·¾³ÖУ¬Ò»¸ö½ÚµãÒòÎªËø¾ºÕù¶ø¹ÒÆð£¬shutdownÖ®ºóÎÞ·¨Æô¶¯¡£
¹ÊÕϳöÏÖʱÎÒÕýÔÚ·ÉÏ£¬´Ò´Ò»Øµ½¼ÒÖУ¬´¦Àí¹ÊÕÏ¡£
½â¾öÖ®ºó²éÕÒ¹ÊÕÏÔ­Òò¡£
¼ì²éµ±Ê±µÄAWRÐÅÏ¢·¢ÏÖTop 5 Timed EventsÏÔʾÈçÏÂÐÅÏ¢£º
Top 5 Timed Events         &nb ......

oracle wait event:PX Deq Credit: send blkd

Just a few days ago a got to two Oracle DBAs discussing why the have so much “PX Deq Credit : send blkd” on a system. And if that is causing their performance problems.
The are some blog on the internet claiming it has to do with qc distribution and what ever.
But in many cases, especi ......

¹ØÓÚoracle mutexºÍlatchµÄÎÊÌâ

¹ØÓÚlatchºÍmutexµÄÎÊÌâ
from:http://www.itpub.net/thread-1004815-1-1.html
A:
latchÊÇãÅËø£¬ÊÇÒ»ÖÖ´®Ðл¯»úÖÆ£¬ÓÃÀ´±£»¤SGAÖеÄÄÚ´æ½á¹¹¡£
mutexÊÇʲô£¬Ò²ÊÇÒ»ÖÖ´®Ðл¯»úÖÆ£¬ÊÇ»¥³âËø£¿
¸öÈ˶ÔmutexûÓÐʲô¸ÅÄî¡£Õâ¸öÊÇ10GÐÂÒý½øµÄ£¿9IºÃÏñûÓа¡¡£
ÄÄλÃ÷°×ÈË£¬¸ø°ïæÏêϸ½âÊÍÏÂmutex£¬×îºÃ»¹ÄܺÍlatch ×öϱȽ ......

oracle½ØÈ¡×Ö·û´®µÄº¯Êýsubstr

Óï·¨:
substr( string, start_position, [ length ] )
È¡×Ó×Ö·û´®,´Óstart_position¿ªÊ¼,È¡length¸ö,lengthΪ¿ÉÑ¡£¬Èç¹ûlengthΪ¿ÕÔò·µ»Østart_positionºóµÄËùÓÐ×Ö·û¡£
ʵÀý:
    substr('This is a test', 6, 2)          would return 'is'
 &nbs ......

oracle»ù±¾²Ù×÷

describe  TABLE_NAME;   --ÃèÊö
----------------------------------------------------------------
create table as select XXXXXX
insert into TABLE_NAME (reac_1,reac_2.....) values(v1,v2)
insert into TABLE_NAME (select * from ..........)
update TABLE_NAME set reac_1=v1,.............. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ