Does Operations on blob fields in Oracle produce a large number of redo operations?
Check whether the blob field produces a large number of redo operations. The answer is no. Here is an experiment to test whether the Oracle database version is 11.2.0.1.0:
Install Oracle 11gR2 (x64) in CentOS 6.4)
Steps for installing Oracle 11gR2 in vmwarevm
Install Oracle 11g XE R2 In Debian
-- Create a table for testing
Create table test_blob
(
Id number,
Tupian blob
);
Import java. io. FileInputStream;
Import java. io. OutputStream;
Import java. SQL. Connection;
Import java. SQL. DriverManager;
Import java. SQL. ResultSet;
Import java. SQL. SQLException;
Import java. SQL. Statement;
Import oracle. SQL. BLOB;
Public class BlobExample {
Static final String driver_class = "oracle. jdbc. driver. OracleDriver ";
Static final String connectionURL = "jdbc: oracle: thin: @ 10.10.15.25: 1521: orcl ";
Static final String userID = "test ";
Static final String userPassword = "test ";
Private void insertTestBlob (){
Connection conn = null;
Statement stm = null;
ResultSet rs = null;
BLOB blob = null;
FileInputStream fin = null;
OutputStream out = null;
Try {
Conn = DriverManager. getConnection (connectionURL, userID, userPassword );
Stm = conn. createStatement ();
Conn. setAutoCommit (false );
String SQL = "insert into test_blob values (1, EMPTY_BLOB ())";
Cmd.exe cuteUpdate (SQL );
Rs = cmd.exe cuteQuery ("SELECT tupian FROM test_blob WHERE id = 1 for update ");
Fin = new FileInputStream ("d: // 20130317.jpg ");
Byte [] blobBuf = new byte [(int) fin. available ()];
Fin. read (blobBuf );
Fin. close ();
If (rs. next ()){
Blob = (oracle. SQL. BLOB) rs. getBlob (1 );
Out = blob. getBinaryOutputStream ();
Out. write (blobBuf );
Out. close ();
Conn. commit ();
}
} Catch (Exception e ){
E. printStackTrace ();
} Finally {
Try {
Rs. close ();
Stm. close ();
Conn. close ();
} Catch (SQLException e ){
E. printStackTrace ();
}
}
}
Public static void main (String args []) {
BlobExample blobClobExample = new BlobExample ();
BlobClobExample. insertTestBlob ();
}
}
For more details, please continue to read the highlights on the next page: