CLOBS - delay in read ?
I have a process in which I write to a CLOB field in a PL/SQL procedure, then I call a web service immediately afterwards that reads from that CLOB field and performs various functions with it. Usually this works great, however sometimes when the web service goes to read from the CLOB field, it appears "empty" as if there is a short delay from the time that the data gets inserted to the time it is "available" to be read from. Is this a known behavior of CLOBS or am I doing something wrong?
Thanks!
I wonder if you're seeing a delay because the CLOB is > 3964 bytes and suddenly the database has to access the LOB in the out-of-line storage, rather than within the row itself (see: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#sthref166 ).
It's difficult to say, since we don't know your setup, but that'd be where I'd first start checking.
Similar Messages
-
Callable statement Clob problem..reading and writing
Hi,
I am having problem ,,trying to read and write a clob object ...
DB Server is oracle 9i and app server is WAS5.1
I am geting exception...
java.sql.SQLException: Missing IN or OUT parameter at index::
pls check the code below..
Connection connection = null;
CallableStatement csmtObj = null;
Clob clob = null;
try {
connection = getConnection();
csmtObj = connection.prepareCall("{call MYPROC(?,?,?)}");
csmtObj.registerOutParameter(1,Types.CLOB);
csmtObj.setString(2,"xxx");
csmtObj.setString(3,"YYY");
csmtObj.execute();
clob = csmtObj.getClob(1);
} catch (Exception exception){
exception.printStackTrace();
throw exception;
RegardsThanks
I was able to resolve the reading part but ...I am getting exception while writing ..
it says parameter type conflict..
This is the code
public static boolean putStringAsCLOB(String strContent, String strDataType,
String strOperType) {
boolean operationStatus=false;
Connection connection = null;
CallableStatement csmtObj = null;
String clob = strContent;
ByteArrayInputStream bais = new ByteArrayInputStream(pfoAsBytes);
InputStreamReader reader=new InputStreamReader(bais);
try {
connection = getConnection();
csmtObj = connection.prepareCall("{call MYPROC(?,?,?)}");
csmtObj.setCharacterStream(1,reader,pfoAsBytes.length);
csmtObj.setString(2,strDataType);
csmtObj.setString(3,strOperType);
operationStatus=csmtObj.execute();
} catch (Exception exception){
exception.printStackTrace();
} finally{
if(connection != null){
try {
connection.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return operationStatus;
Regards
Message was edited by:
user606712 -
Serious filevault problem, delay, pls read & help
Hi, apologies for the long message but my problem is really a trouble over a month or two! Here's the cause: My battery was exhausted (because of using studio program required to be a lot on power adaptor), put my mac on sleep for a couple hours, then opened to shut down but cos of battery was with X symbol, it suddenly shut down. Next time tried to log in to my admin account -was the only account on mac & with file vault on cos of my work-but displayed msg "you can't log in to your account at this time". Master password lost note & didn't try over once to write in case of lock(failure). I did my homework here & then did the following but nothing solved my problem:
1. reset admin pass by root, made another admin account, then changed original admin account password. When logged in ,noticed there was a sparse image of my home folder. I tried to open it via disk utility, displayed msg " are you sure to open, may damage your system", clicked open, then displayed msg "no mountable file systems". I had a strong belief my data hadn't gone for good.
2. Also tried method of how to repair or verify your home folder, from utilities, users described changed permissions etc, nothing.
3. On disk utility I tried & changed the sparse image to read/write one no compressed, still the same disk size of data but again when opening displayed msg "no mountable file systems".
4.By the way I verified & my HD had a minor repair so I did repaid to HD as well.
I deleted original admin user, recreated it again with same name & password.
I did also archive & install just in case of minor repair corrupted anything & preserved my previous system.
5.Cos my HD is 120GB couldn't turn off vault, so I saved sparse image to external disk, deleted from mac so to turn off filevault, then copied sparse image, same procedure, zero result.
6. Turned on filevault again, tried to reopen sparse image and/or converted one, nothing same message.
7. Last effort, to turn off filevault-notice sparse image is 76.5GB- had to remove items to save somehow disk space I moved applications I didn't use to external disk, even previous system so 19GB were available but not enough.. Then I moved everything back to original place & repaired the disk again.
If I erase & install all over again Tiger & recreate the same admin account, then turn on, off filevault??
I will upgrade to leopard or snow leopard, it'll be easier somehow to open a sparse image then?
You are my last attempt for solution, as I said my HD is 120GB, I've said every personal data on external disk, is there anything left to open or try otherwise to turn off filevault or no trouble cos my data are gone for good so to give up & go on?
I can't waste more time to it, really delays my work, can you help me?
Thanks anyhow.Were these in the things you tried?
[Mac OS X 10.3, 10.4: FileVault - How to verify or repair a home directory image ...|http://support.apple.com/kb/HT2631]
[X-Labs: Repairing a FileVault-protected Home folder|http://www.thexlab.com/faqs/fixfilevault.html] -
WSN 3202: increase sensor power delay before reading?
On an NI WSN-3202, Is there any way to increase the time between activation of sensor power and the time an analog reading is taken? I presently have the devices set for 250ms, but I would like to have the power turned on a good 2-3 seconds before a reading is taken. Is there any way to facilitate this, perhaps through a custom firmware update?
Solved!
Go to Solution.Hi,
Thank you for the reply.
I use a wsn-3226. There seems that there is no option to send data with radio message.
Here a print screen of my sequence, it is fairly simple, I don't understand why it's getting stuck in always on power.
I also tried to change the power setting with a user message and it worked. But it is unpracticable, I really need that to work. I use sensor that need to be power up at least 2 sec before sampling.
Thank you
Mathieu
Attachments:
non working sequence.png 72 KB -
I need to continuously acquire data from daqmx card, write into a file and at the same time corelate (in terms of time) the data with signals from other instruments. The current problem is that there is time delay during read and write data into buffer,thus causing misalignment of the data from multiple instruments. Is there a way to solve the delay? or Is there a way to mark the time of the data acquisition in the buffer? If I know the starting time (e.g. 0) of data acquisition and sampling rate (e.g. 1kHz), can I simply add 1ms to each data sample in the buffer? The current code is shown below.
void DataCollectionWin::ConnectDAQ()
DAQmxErrChk(DAQmxCreateTask ("", &taskHandle));
DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0,Dev1/ai1,Dev1/ai2,Dev1/ai3,Dev1/ai4,Dev1/ai5,Dev1/ai16,Dev1/ai17,Dev1/ai18,Dev1/ai19,Dev1/ai20,Dev1/ai21,Dev1/ai6,Dev1/ai7,Dev1/ai22","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,60000));
DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,50,0,EveryNCallback,NULL));// Every 50 samples the EveryNSamplesEvent will be trigured, to reduce time delay.
DAQmxErrChk (DAQmxRegisterDoneEvent(taskHandle,0,DoneCallback,NULL));
DAQmxErrChk (DAQmxStartTask(taskHandle));
int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,50,10.0,DAQmx_Val_GroupByScanNumber,data,50*15,&read,NULL));
//memcpy(l_data,data,6000);
SetEvent(hEvent);
l_usstatus_e[0]=g_usstatus[0];// signals from other instruments that need to be corelated with the data from daq cards.
l_optstatus_e[0]=g_optstatus[0];
if( read>0 ) // write data into file
//indicator=1;
for (i=0;i<read;i++)
{ //fprintf(datafile,"%d\t",i);
fprintf(datafile,"%c\t",l_usstatus_s[0]);
fprintf(datafile,"%c\t",l_usstatus_e[0]);
fprintf(datafile,"%c\t",l_optstatus_s[0]);
fprintf(datafile,"%c\t",l_optstatus_e[0]);
fprintf(datafile,"%.2f\t",data[15*i]);
// sprintf( pszTemp, "%f", data[6*i]);
// pListCtrl->SetItemText(0, 2, pszTemp);
//pWnd->m_trackinglist.SetItemText(0, 2, pszTemp);
fprintf(datafile,"%.2f\t",data[15*i+1]);
fprintf(datafile,"%.2f\t",data[15*i+2]);Hello kgy,
It is a bit of a judgment call. You should just choose the board that you think has the most to do with your issue. For example, this issue was much more focused on setting up your data acquisition task than the Measurement Studio environment/tools, so the MultifunctionDAQ board would have been the best place for it. As for moving your post to another board, I do not believe that is possible.
Regards,
Dan King -
Reading bytes from CLOB not BLOB
I know that DBMS_LOB.SUBSTR can read number of bytes (for BLOBs) or characters (for CLOBs).
What I want is to read bytes from BLOB instead of characters.
The following tries to read 4000 bytes. Unfortunately It fails to read 4000 bytes if size of CLOB_COLUMN is bigger than 4000 bytes.
select dbms_lob.substr(utl_raw.cast_to_raw(CLOB_COLUMN),4000,1) from dualIs it possible to get only these 4000 bytes from CLOB_COLUMN?
Thank you in advance.Welcome to the forum.
Unfortunately It fails to read 4000 bytes if size of CLOB_COLUMN is bigger than 4000 bytes.Could it be you're mixing up things?
DBMS_LOB.SUBSTR reads bytes from BLOBS, characters from CLOBS.
"amount Number of bytes (for BLOBs) or characters (for CLOBs) to be read."
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#sthref3199
No need to cast_to_raw, afaik:
SQL> create table t as select to_clob(lpad('*', 10000, '*')) clob_col from dual;
Table created.
SQL> desc t;
Name Null? Type
CLOB_COL CLOB
SQL> select substr(clob_col,1, 4000) substr
2 , length(substr(clob_col,1, 4000)) substr_lngth
3 , dbms_lob.substr(clob_col, 4000, 1) lob_substr
4 , length(dbms_lob.substr(clob_col, 4000, 1)) lob_substr_length
5 from t;
SUBSTR SUBSTR_LNGTH
LOB_SUBSTR
LOB_SUBSTR_LENGTH
******************************************************************************** 4000
4000
1 row selected. -
Can't fetch clob and long in one select/query
I created a nightmare table containing numerous binary data types to test an application I was working on, and believe I have found an undocumented bug in Oracle's JDBC drivers that is preventing me from loading a CLOB and a LONG in a single SQL select statement. I can load the CLOB successfully, but attempting to call ResultSet.get...() for the LONG column always results in
java.sql.SQLException: Stream has already been closed
even when processing the columns in the order of the SELECT statement.
I have demonstrated this behaviour with version 9.2.0.3 of Oracle's JDBC drivers, running against Oracle 9.2.0.2.0.
The following Java example contains SQL code to create and populate a table containing a collection of nasty binary columns, and then Java code that demonstrates the problem.
I would really appreciate any workarounds that allow me to pull this data out of a single query.
import java.sql.*;
This class was developed to verify that you can't have a CLOB and a LONG column in the
same SQL select statement, and extract both values. Calling get...() for the LONG column
always causes 'java.sql.SQLException: Stream has already been closed'.
CREATE TABLE BINARY_COLS_TEST
PK INTEGER PRIMARY KEY NOT NULL,
CLOB_COL CLOB,
BLOB_COL BLOB,
RAW_COL RAW(100),
LONG_COL LONG
INSERT INTO BINARY_COLS_TEST (
PK,
CLOB_COL,
BLOB_COL,
RAW_COL,
LONG_COL
) VALUES (
1,
'-- clob value --',
HEXTORAW('01020304050607'),
HEXTORAW('01020304050607'),
'-- long value --'
public class JdbcLongTest
public static void main(String argv[])
throws Exception
Driver driver = (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
DriverManager.registerDriver(driver);
Connection connection = DriverManager.getConnection(argv[0], argv[1], argv[2]);
Statement stmt = connection.createStatement();
ResultSet results = null;
try
String query = "SELECT pk, clob_col, blob_col, raw_col, long_col FROM binary_cols_test";
results = stmt.executeQuery(query);
while (results.next())
int pk = results.getInt(1);
System.out.println("Loaded int");
Clob clob = results.getClob(2);
// It doesn't work if you just close the ascii stream.
// clob.getAsciiStream().close();
String clobString = clob.getSubString(1, (int)clob.length());
System.out.println("Loaded CLOB");
// Streaming not strictly necessary for short values.
// Blob blob = results.getBlob(3);
byte blobData[] = results.getBytes(3);
System.out.println("Loaded BLOB");
byte rawData[] = results.getBytes(4);
System.out.println("Loaded RAW");
byte longData[] = results.getBytes(5);
System.out.println("Loaded LONG");
catch (SQLException e)
e.printStackTrace();
results.close();
stmt.close();
connection.close();
} // public class JdbcLongTestThe problem is that LONGs are not buffered but are read from the wire in the order defined. The problem is the same as
rs = stmt.executeQuery("select myLong, myNumber from tab");
while (rs.next()) {
int n = rs.getInt(2);
String s = rs.getString(1);
The above will fail for the same reason. When the statement is executed the LONG is not read immediately. It is buffered in the server waiting to be read. When getInt is called the driver reads the bytes of the LONG and throws them away so that it can get to the NUMBER and read it. Then when getString is called the LONG value is gone so you get an exception.
Similar problem here. When the query is executed the CLOB and BLOB locators are read from the wire, but the LONG is buffered in the server waiting to be read. When Clob.getString is called, it has to talk to the server to get the value of the CLOB, so it reads the LONG bytes from the wire and throws them away. That clears the connection so that it can ask the server for the CLOB bytes. When the code reads the LONG value, those bytes are gone so you get an exception.
This is a long standing restriction on using LONG and LONG RAW values and is a result of the network protocol. It is one of the reasons that Oracle deprecates LONGs and recommends using BLOBs and CLOBs instead.
Douglas -
Performance issue showing read by other session Event
Hi All,
we are having a severe performance issue in my database when we are running batch jobs.
This was a new database(11.2.0.2) and we are testing the performance by running some batch jobs. These batch jobs included some inserts and updates.
I am seeing read by other session in top 5 timed events and cache buffers chains in Latch Miss Sources section.
Please help me to solve this out.
Inst Num Startup Time Release RAC
1 27-Feb-12 09:03 11.2.0.2.0 NO
Platform CPUs Cores Sockets Memory(GB)
Linux x86 64-bit 8 8 8 48.00
Snap Id Snap Time Sessions Curs/Sess
Begin Snap: 5605 29-Feb-12 03:00:27 63 4.5
End Snap: 5614 29-Feb-12 12:00:47 63 4.3
Elapsed: 540.32 (mins)
DB Time: 1,774.23 (mins)
Cache Sizes Begin End
~~~~~~~~~~~ ---------- ----------
Buffer Cache: 1,952M 1,952M Std Block Size: 16K
Shared Pool Size: 1,024M 1,024M Log Buffer: 18,868K
Load Profile Per Second Per Transaction Per Exec Per Call
~~~~~~~~~~~~ --------------- --------------- ---------- ----------
DB Time(s): 3.3 0.8 0.02 0.05
DB CPU(s): 1.1 0.3 0.01 0.02
Redo size: 55,763.8 13,849.3
Logical reads: 23,906.6 5,937.4
Block changes: 325.7 80.9
Physical reads: 665.6 165.3
Physical writes: 40.4 10.0
User calls: 60.7 15.1
Parses: 10.6 2.6
Hard parses: 1.1 0.3
W/A MB processed: 0.6 0.2
Logons: 0.1 0.0
Executes: 151.2 37.6
Rollbacks: 0.0 0.0
Transactions: 4.0
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 99.94 Redo NoWait %: 100.00
Buffer Hit %: 97.90 In-memory Sort %: 100.00
Library Hit %: 98.06 Soft Parse %: 90.16
Execute to Parse %: 92.96 Latch Hit %: 100.00
Parse CPU to Parse Elapsd %: 76.71 % Non-Parse CPU: 98.57
Shared Pool Statistics Begin End
Memory Usage %: 89.38 87.96
% SQL with executions>1: 97.14 95.15
% Memory for SQL w/exec>1: 96.05 92.46
Top 5 Timed Foreground Events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Avg
wait % DB
Event Waits Time(s) (ms) time Wait Class
db file sequential read 14,092,706 65,613 5 61.6 User I/O
DB CPU 34,819 32.7
read by other session 308,534 1,260 4 1.2 User I/O
direct path read 97,454 987 10 .9 User I/O
db file scattered read 71,870 910 13 .9 User I/O
Host CPU (CPUs: 8 Cores: 8 Sockets: 8)
~~~~~~~~ Load Average
Begin End %User %System %WIO %Idle
0.43 0.36 13.7 0.6 9.7 85.7
Instance CPU
~~~~~~~~~~~~
% of total CPU for Instance: 13.5
% of busy CPU for Instance: 94.2
%DB time waiting for CPU - Resource Mgr: 0.0
Memory Statistics
~~~~~~~~~~~~~~~~~ Begin End
Host Mem (MB): 49,152.0 49,152.0
SGA use (MB): 3,072.0 3,072.0
PGA use (MB): 506.5 629.1
% Host Mem used for SGA+PGA: 7.28 7.53
Time Model Statistics
-> Total time in database user-calls (DB Time): 106453.8s
-> Statistics including the word "background" measure background process
time, and so do not contribute to the DB time statistic
-> Ordered by % or DB time desc, Statistic name
Statistic Name Time (s) % of DB Time
sql execute elapsed time 105,531.1 99.1
DB CPU 34,818.8 32.7
parse time elapsed 714.7 .7
hard parse elapsed time 684.8 .6
PL/SQL execution elapsed time 161.9 .2
PL/SQL compilation elapsed time 44.2 .0
connection management call elapsed time 16.9 .0
hard parse (sharing criteria) elapsed time 10.2 .0
hard parse (bind mismatch) elapsed time 9.4 .0
sequence load elapsed time 2.9 .0
repeated bind elapsed time 0.5 .0
failed parse elapsed time 0.0 .0
DB time 106,453.8
background elapsed time 1,753.9
background cpu time 61.7
Operating System Statistics
-> *TIME statistic values are diffed.
All others display actual values. End Value is displayed if different
-> ordered by statistic type (CPU Use, Virtual Memory, Hardware Config), Name
Statistic Value End Value
BUSY_TIME 3,704,415
IDLE_TIME 22,203,740
IOWAIT_TIME 2,517,864
NICE_TIME 3
SYS_TIME 145,696
USER_TIME 3,557,758
LOAD 0 0
RSRC_MGR_CPU_WAIT_TIME 0
VM_IN_BYTES 358,813,045,760
VM_OUT_BYTES 29,514,830,848
PHYSICAL_MEMORY_BYTES 51,539,607,552
NUM_CPUS 8
NUM_CPU_CORES 8
NUM_CPU_SOCKETS 8
GLOBAL_RECEIVE_SIZE_MAX 4,194,304
GLOBAL_SEND_SIZE_MAX 1,048,586
TCP_RECEIVE_SIZE_DEFAULT 87,380
TCP_RECEIVE_SIZE_MAX 4,194,304
TCP_RECEIVE_SIZE_MIN 4,096
TCP_SEND_SIZE_DEFAULT 16,384
TCP_SEND_SIZE_MAX 4,194,304
TCP_SEND_SIZE_MIN 4,096
Operating System Statistics -
Snap Time Load %busy %user %sys %idle %iowait
29-Feb 03:00:27 0.4 N/A N/A N/A N/A N/A
29-Feb 04:00:35 1.4 11.9 11.2 0.6 88.1 14.3
29-Feb 05:00:41 1.7 13.8 13.2 0.6 86.2 15.8
29-Feb 06:00:48 1.5 14.0 13.5 0.6 86.0 12.3
29-Feb 07:01:00 1.8 16.3 15.8 0.5 83.7 10.4
29-Feb 08:00:12 2.6 23.2 22.5 0.6 76.8 12.6
29-Feb 09:00:26 1.3 16.6 16.0 0.5 83.4 5.7
29-Feb 10:00:33 1.2 13.8 13.3 0.5 86.2 2.0
29-Feb 11:00:43 1.3 14.5 14.0 0.5 85.5 3.8
29-Feb 12:00:47 0.4 4.9 4.2 0.7 95.1 10.6
Foreground Wait Class
-> s - second, ms - millisecond - 1000th of a second
-> ordered by wait time desc, waits desc
-> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
-> Captured Time accounts for 97.9% of Total DB time 106,453.79 (s)
-> Total FG Wait Time: 69,415.64 (s) DB CPU time: 34,818.79 (s)
Avg
%Time Total Wait wait
Wait Class Waits -outs Time (s) (ms) %DB time
User I/O 14,693,843 0 69,222 5 65.0
DB CPU 34,819 32.7
Commit 40,629 0 119 3 0.1
System I/O 26,504 0 57 2 0.1
Network 1,945,010 0 11 0 0.0
Other 125,200 99 4 0 0.0
Application 2,673 0 2 1 0.0
Concurrency 3,059 0 1 0 0.0
Configuration 31 19 0 15 0.0
Foreground Wait Events
-> s - second, ms - millisecond - 1000th of a second
-> Only events with Total Wait Time (s) >= .001 are shown
-> ordered by wait time desc, waits desc (idle events last)
-> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
Avg
%Time Total Wait wait Waits % DB
Event Waits -outs Time (s) (ms) /txn time
db file sequential read 14,092,706 0 65,613 5 108.0 61.6
read by other session 308,534 0 1,260 4 2.4 1.2
direct path read 97,454 0 987 10 0.7 .9
db file scattered read 71,870 0 910 13 0.6 .9
db file parallel read 35,001 0 372 11 0.3 .3
log file sync 40,629 0 119 3 0.3 .1
control file sequential re 26,504 0 57 2 0.2 .1
direct path read temp 14,499 0 49 3 0.1 .0
direct path write temp 9,186 0 28 3 0.1 .0
SQL*Net message to client 1,923,973 0 5 0 14.7 .0
SQL*Net message from dblin 1,056 0 5 5 0.0 .0
Disk file operations I/O 8,848 0 2 0 0.1 .0
ASM file metadata operatio 36 0 2 54 0.0 .0
SQL*Net break/reset to cli 2,636 0 1 1 0.0 .0
ADR block file read 472 0 1 1 0.0 .0
os thread startup 8 0 1 74 0.0 .0
SQL*Net more data to clien 17,656 0 1 0 0.1 .0
asynch descriptor resize 123,852 100 0 0 0.9 .0
local write wait 110 0 0 4 0.0 .0
utl_file I/O 55,635 0 0 0 0.4 .0
log file switch (private s 8 0 0 52 0.0 .0
cursor: pin S wait on X 2 0 0 142 0.0 .0
enq: KO - fast object chec 13 0 0 20 0.0 .0
PX Deq: Slave Session Stat 248 0 0 1 0.0 .0
enq: RO - fast object reus 18 0 0 11 0.0 .0
latch: cache buffers chain 2,511 0 0 0 0.0 .0
latch: shared pool 195 0 0 1 0.0 .0
CSS initialization 12 0 0 8 0.0 .0
PX qref latch 54 100 0 2 0.0 .0
SQL*Net more data from cli 995 0 0 0 0.0 .0
SQL*Net more data from dbl 300 0 0 0 0.0 .0
kksfbc child completion 1 100 0 56 0.0 .0
library cache: mutex X 244 0 0 0 0.0 .0
PX Deq: Signal ACK RSG 124 0 0 0 0.0 .0
undo segment extension 6 100 0 7 0.0 .0
PX Deq: Signal ACK EXT 124 0 0 0 0.0 .0
library cache load lock 3 0 0 9 0.0 .0
ADR block file write 45 0 0 1 0.0 .0
CSS operation: action 12 0 0 2 0.0 .0
reliable message 28 0 0 1 0.0 .0
CSS operation: query 72 0 0 0 0.0 .0
latch: row cache objects 14 0 0 1 0.0 .0
enq: SQ - contention 17 0 0 0 0.0 .0
latch free 32 0 0 0 0.0 .0
buffer busy waits 52 0 0 0 0.0 .0
enq: PS - contention 16 0 0 0 0.0 .0
enq: TX - row lock content 6 0 0 1 0.0 .0
SQL*Net message to dblink 1,018 0 0 0 0.0 .0
cursor: pin S 23 0 0 0 0.0 .0
latch: cache buffers lru c 8 0 0 0 0.0 .0
SQL*Net message from clien 1,923,970 0 944,508 491 14.7
jobq slave wait 66,732 100 33,334 500 0.5
Streams AQ: waiting for me 6,481 100 32,412 5001 0.0
wait for unread message on 32,858 98 32,411 986 0.3
PX Deq: Execution Msg 1,448 0 190 131 0.0
PX Deq: Execute Reply 1,196 0 74 62 0.0
HS message to agent 228 0 4 19 0.0
single-task message 42 0 4 97 0.0
PX Deq Credit: send blkd 904 0 2 3 0.0
PX Deq Credit: need buffer 205 0 1 3 0.0
Foreground Wait Events
-> s - second, ms - millisecond - 1000th of a second
-> Only events with Total Wait Time (s) >= .001 are shown
-> ordered by wait time desc, waits desc (idle events last)
-> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
Avg
%Time Total Wait wait Waits % DB
Event Waits -outs Time (s) (ms) /txn time
PX Deq: Table Q Normal 4,291 0 1 0 0.0
PX Deq: Join ACK 124 0 0 1 0.0
PX Deq: Parse Reply 124 0 0 0 0.0
KSV master wait 256 0 0 0 0.0
Latch Miss Sources
-> only latches with sleeps are shown
-> ordered by name, sleeps desc
NoWait Waiter
Latch Name Where Misses Sleeps Sleeps
ASM map operation freeli kffmTranslate2 0 2 0
DML lock allocation ktadmc 0 2 0
FOB s.o list latch ksfd_allfob 0 2 2
In memory undo latch ktiFlushMe 0 5 0
In memory undo latch ktichg: child 0 3 0
PC and Classifier lists No latch 0 6 0
Real-time plan statistic keswxAddNewPlanEntry 0 20 20
SQL memory manager worka qesmmIRegisterWorkArea:1 0 1 1
active service list kswslogon: session logout 0 23 12
active service list kswssetsvc: PX session swi 0 6 1
active service list kswsite: service iterator 0 1 0
archive process latch kcrrgpll 0 3 3
cache buffers chains kcbgtcr_2 0 1,746 573
cache buffers chains kcbgtcr: fast path (cr pin 0 1,024 2,126
cache buffers chains kcbgcur_2 0 60 8
cache buffers chains kcbchg1: kslbegin: bufs no 0 16 3
cache buffers chains kcbgtcr: fast path 0 14 20
cache buffers chains kcbzibmlt: multi-block rea 0 10 0
cache buffers chains kcbrls_2 0 9 53
cache buffers chains kcbgtcr: kslbegin shared 0 8 1
cache buffers chains kcbrls_1 0 7 84
cache buffers chains kcbgtcr: kslbegin excl 0 6 14
cache buffers chains kcbnew: new latch again 0 6 0
cache buffers chains kcbzgb: scan from tail. no 0 6 0
cache buffers chains kcbzwb 0 5 8
cache buffers chains kcbgcur: fast path (shr) 0 3 0
cache buffers chains kcbget: pin buffer 0 3 0
cache buffers chains kcbzhngcbk2_1 0 1 0
cache buffers lru chain kcbzgws 0 19 0
cache buffers lru chain kcbo_link_q 0 3 0
call allocation ksuxds 0 14 10
call allocation ksudlp: top call 0 2 3
enqueue hash chains ksqgtl3 0 2 1
enqueue hash chains ksqrcl 0 1 2
enqueues ksqgel: create enqueue 0 1 0
object queue header oper kcbo_unlink_q 0 5 2
object queue header oper kcbo_sw_buf 0 2 0
object queue header oper kcbo_link_q 0 1 2
object queue header oper kcbo_switch_cq 0 1 2
object queue header oper kcbo_switch_mq_bg 0 1 4
parallel query alloc buf kxfpbalo 0 1 1
process allocation ksucrp:1 0 2 0
process queue reference kxfpqrsnd 0 1 0
qmn task queue latch kwqmnmvtsks: delay to read 0 1 0
redo allocation kcrfw_redo_gen: redo alloc 0 17 0
row cache objects kqreqd: reget 0 6 0
row cache objects kqrpre: find obj 0 6 13
row cache objects kqrso 0 2 0
row cache objects kqreqd 0 1 2
row cache objects kqrpre: init complete 0 1 1
shared pool kghalo 0 199 106
shared pool kghupr1 0 39 109
shared pool kghfre 0 18 19
shared pool kghalp 0 7 29
space background task la ktsj_grab_task 0 21 27
Mutex Sleep Summary
-> ordered by number of sleeps desc
Wait
Mutex Type Location Sleeps Time (ms)
Library Cache kglhdgn2 106 338 12
Library Cache kgllkc1 57 259 10
Library Cache kgllkdl1 85 123 21
Cursor Pin kkslce [KKSCHLPIN2] 70 286
Library Cache kglget2 2 31 1
Library Cache kglhdgn1 62 31 2
Library Cache kglpin1 4 26 1
Library Cache kglpnal1 90 18 0
Library Cache kglpndl1 95 15 2
Library Cache kgllldl2 112 6 0
Library Cache kglini1 32 1 0
-------------------------------------------------------------Thanks in advance.Hi,
Thanks for reply.
I provided one hour report.
Inst Num Startup Time Release RAC
1 27-Feb-12 09:03 11.2.0.2.0 NO
Platform CPUs Cores Sockets Memory(GB)
Linux x86 64-bit 8 8 8 48.00
Snap Id Snap Time Sessions Curs/Sess
Begin Snap: 5606 29-Feb-12 04:00:35 63 3.7
End Snap: 5607 29-Feb-12 05:00:41 63 3.6
Elapsed: 60.11 (mins)
DB Time: 382.67 (mins)
Cache Sizes Begin End
~~~~~~~~~~~ ---------- ----------
Buffer Cache: 1,952M 1,952M Std Block Size: 16K
Shared Pool Size: 1,024M 1,024M Log Buffer: 18,868K
Load Profile Per Second Per Transaction Per Exec Per Call
~~~~~~~~~~~~ --------------- --------------- ---------- ----------
DB Time(s): 6.4 0.8 0.03 0.03
DB CPU(s): 1.0 0.1 0.00 0.00
Redo size: 84,539.3 10,425.6
Logical reads: 23,345.6 2,879.1
Block changes: 386.5 47.7
Physical reads: 1,605.0 197.9
Physical writes: 7.1 0.9
User calls: 233.9 28.9
Parses: 4.0 0.5
Hard parses: 0.1 0.0
W/A MB processed: 0.1 0.0
Logons: 0.1 0.0
Executes: 210.9 26.0
Rollbacks: 0.0 0.0
Transactions: 8.1
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 99.62 Redo NoWait %: 100.00
Buffer Hit %: 95.57 In-memory Sort %: 100.00
Library Hit %: 99.90 Soft Parse %: 98.68
Execute to Parse %: 98.10 Latch Hit %: 99.99
Parse CPU to Parse Elapsd %: 32.08 % Non-Parse CPU: 99.90
Shared Pool Statistics Begin End
Memory Usage %: 89.25 89.45
% SQL with executions>1: 96.79 97.52
% Memory for SQL w/exec>1: 95.67 96.56
Top 5 Timed Foreground Events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Avg
wait % DB
Event Waits Time(s) (ms) time Wait Class
db file sequential read 3,054,464 17,002 6 74.0 User I/O
DB CPU 3,748 16.3
read by other session 199,603 796 4 3.5 User I/O
direct path read 46,301 439 9 1.9 User I/O
db file scattered read 21,113 269 13 1.2 User I/O
Host CPU (CPUs: 8 Cores: 8 Sockets: 8)
~~~~~~~~ Load Average
Begin End %User %System %WIO %Idle
1.45 1.67 13.2 0.6 15.8 86.2
Instance CPU
~~~~~~~~~~~~
% of total CPU for Instance: 13.0
% of busy CPU for Instance: 94.7
%DB time waiting for CPU - Resource Mgr: 0.0
Memory Statistics
~~~~~~~~~~~~~~~~~ Begin End
Host Mem (MB): 49,152.0 49,152.0
SGA use (MB): 3,072.0 3,072.0
PGA use (MB): 513.5 467.7
% Host Mem used for SGA+PGA: 7.29 7.20
Time Model Statistics
-> Total time in database user-calls (DB Time): 22960.5s
-> Statistics including the word "background" measure background process
time, and so do not contribute to the DB time statistic
-> Ordered by % or DB time desc, Statistic name
Statistic Name Time (s) % of DB Time
sql execute elapsed time 22,835.9 99.5
DB CPU 3,748.4 16.3
parse time elapsed 15.4 .1
hard parse elapsed time 14.3 .1
PL/SQL execution elapsed time 7.5 .0
PL/SQL compilation elapsed time 6.0 .0
connection management call elapsed time 1.6 .0
sequence load elapsed time 0.4 .0
hard parse (sharing criteria) elapsed time 0.0 .0
repeated bind elapsed time 0.0 .0
failed parse elapsed time 0.0 .0
DB time 22,960.5
background elapsed time 238.1
background cpu time 4.9
Operating System Statistics
-> *TIME statistic values are diffed.
All others display actual values. End Value is displayed if different
-> ordered by statistic type (CPU Use, Virtual Memory, Hardware Config), Name
Statistic Value End Value
BUSY_TIME 396,506
IDLE_TIME 2,483,725
IOWAIT_TIME 455,495
NICE_TIME 0
SYS_TIME 16,163
USER_TIME 380,052
LOAD 1 2
RSRC_MGR_CPU_WAIT_TIME 0
VM_IN_BYTES 95,646,943,232
VM_OUT_BYTES 1,686,059,008
PHYSICAL_MEMORY_BYTES 51,539,607,552
NUM_CPUS 8
NUM_CPU_CORES 8
NUM_CPU_SOCKETS 8
GLOBAL_RECEIVE_SIZE_MAX 4,194,304
GLOBAL_SEND_SIZE_MAX 1,048,586
TCP_RECEIVE_SIZE_DEFAULT 87,380
TCP_RECEIVE_SIZE_MAX 4,194,304
TCP_RECEIVE_SIZE_MIN 4,096
TCP_SEND_SIZE_DEFAULT 16,384
TCP_SEND_SIZE_MAX 4,194,304
TCP_SEND_SIZE_MIN 4,096
Operating System Statistics -
Snap Time Load %busy %user %sys %idle %iowait
29-Feb 04:00:35 1.4 N/A N/A N/A N/A N/A
29-Feb 05:00:41 1.7 13.8 13.2 0.6 86.2 15.8
Foreground Wait Class
-> s - second, ms - millisecond - 1000th of a second
-> ordered by wait time desc, waits desc
-> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
-> Captured Time accounts for 97.6% of Total DB time 22,960.46 (s)
-> Total FG Wait Time: 18,651.75 (s) DB CPU time: 3,748.35 (s)
Avg
%Time Total Wait wait
Wait Class Waits -outs Time (s) (ms) %DB time
User I/O 3,327,253 0 18,576 6 80.9
DB CPU 3,748 16.3
Commit 23,882 0 69 3 0.3
System I/O 1,035 0 3 3 0.0
Network 842,393 0 2 0 0.0
Other 10,120 99 0 0 0.0
Configuration 3 0 0 58 0.0
Application 264 0 0 1 0.0
Concurrency 1,482 0 0 0 0.0
Foreground Wait Events
-> s - second, ms - millisecond - 1000th of a second
-> Only events with Total Wait Time (s) >= .001 are shown
-> ordered by wait time desc, waits desc (idle events last)
-> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
Avg
%Time Total Wait wait Waits % DB
Event Waits -outs Time (s) (ms) /txn time
db file sequential read 3,054,464 0 17,002 6 104.5 74.0
read by other session 199,603 0 796 4 6.8 3.5
direct path read 46,301 0 439 9 1.6 1.9
db file scattered read 21,113 0 269 13 0.7 1.2
log file sync 23,882 0 69 3 0.8 .3
db file parallel read 4,727 0 68 14 0.2 .3
control file sequential re 1,035 0 3 3 0.0 .0
SQL*Net message to client 840,792 0 2 0 28.8 .0
direct path read temp 95 0 2 18 0.0 .0
local write wait 79 0 0 4 0.0 .0
Disk file operations I/O 870 0 0 0 0.0 .0
ASM file metadata operatio 4 0 0 50 0.0 .0
log file switch (private s 3 0 0 58 0.0 .0
ADR block file read 36 0 0 3 0.0 .0
enq: RO - fast object reus 5 0 0 16 0.0 .0
latch: cache buffers chain 1,465 0 0 0 0.1 .0
SQL*Net break/reset to cli 256 0 0 0 0.0 .0
asynch descriptor resize 10,059 100 0 0 0.3 .0
SQL*Net more data to clien 1,510 0 0 0 0.1 .0
enq: KO - fast object chec 3 0 0 8 0.0 .0
SQL*Net more data from cli 91 0 0 0 0.0 .0
latch: shared pool 14 0 0 0 0.0 .0
ADR block file write 5 0 0 1 0.0 .0
reliable message 8 0 0 0 0.0 .0
direct path write temp 1 0 0 2 0.0 .0
SQL*Net message from clien 840,794 0 68,885 82 28.8
jobq slave wait 7,365 100 3,679 499 0.3
Streams AQ: waiting for me 721 100 3,605 5000 0.0
wait for unread message on 3,648 98 3,603 988 0.1
KSV master wait 20 0 0 0 0.0
Background Wait Events
-> ordered by wait time desc, waits desc (idle events last)
-> Only events with Total Wait Time (s) >= .001 are shown
-> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
Avg
%Time Total Wait wait Waits % bg
Event Waits -outs Time (s) (ms) /txn time
log file parallel write 29,353 0 83 3 1.0 34.8
db file parallel write 5,753 0 17 3 0.2 6.9
db file sequential read 1,638 0 15 9 0.1 6.1
control file sequential re 5,142 0 13 2 0.2 5.4
os thread startup 140 0 8 58 0.0 3.4
control file parallel writ 1,440 0 8 6 0.0 3.4
log file sequential read 304 0 8 26 0.0 3.3
db file scattered read 214 0 2 9 0.0 .8
ASM file metadata operatio 1,199 0 1 1 0.0 .3
direct path write 35 0 0 6 0.0 .1
direct path read 41 0 0 5 0.0 .1
kfk: async disk IO 6 0 0 9 0.0 .0
Disk file operations I/O 1,266 0 0 0 0.0 .0
ADR block file read 16 0 0 2 0.0 .0
read by other session 3 0 0 8 0.0 .0
Log archive I/O 2 0 0 10 0.0 .0
log file sync 3 0 0 5 0.0 .0
asynch descriptor resize 341 100 0 0 0.0 .0
CSS initialization 1 0 0 6 0.0 .0
log file single write 4 0 0 1 0.0 .0
latch: redo allocation 3 0 0 1 0.0 .0
ADR block file write 5 0 0 1 0.0 .0
LGWR wait for redo copy 45 0 0 0 0.0 .0
CSS operation: query 6 0 0 0 0.0 .0
CSS operation: action 1 0 0 1 0.0 .0
SQL*Net message to client 420 0 0 0 0.0 .0
rdbms ipc message 47,816 39 61,046 1277 1.6
DIAG idle wait 7,200 100 7,200 1000 0.2
Space Manager: slave idle 1,146 98 5,674 4951 0.0
class slave wait 284 0 3,983 14026 0.0
dispatcher timer 61 100 3,660 60006 0.0
Streams AQ: qmn coordinato 258 50 3,613 14003 0.0
Streams AQ: qmn slave idle 130 0 3,613 27789 0.0
Streams AQ: waiting for ti 7 71 3,608 515430 0.0
wait for unread message on 3,605 100 3,606 1000 0.1
pmon timer 1,201 100 3,604 3001 0.0
smon timer 15 73 3,603 240207 0.0
ASM background timer 754 0 3,602 4777 0.0
shared server idle wait 120 100 3,601 30006 0.0
SQL*Net message from clien 554 0 4 7 0.0
KSV master wait 101 0 0 2 0.0
Wait Event Histogram
-> Units for Total Waits column: K is 1000, M is 1000000, G is 1000000000
-> % of Waits: value of .0 indicates value was <.05%; value of null is truly 0
-> % of Waits: column heading of <=1s is truly <1024ms, >1s is truly >=1024ms
-> Ordered by Event (idle events last)
% of Waits
Total
Event Waits <1ms <2ms <4ms <8ms <16ms <32ms <=1s >1s
ADR block file read 52 73.1 1.9 9.6 13.5 1.9
ADR block file write 10 100.0
ADR file lock 12 100.0
ARCH wait for archivelog l 3 100.0
ASM file metadata operatio 1203 97.3 .5 .7 .3 .2 .9
CSS initialization 1 100.0
CSS operation: action 1 100.0
CSS operation: query 6 83.3 16.7
Disk file operations I/O 2118 95.4 4.5 .1
LGWR wait for redo copy 45 100.0
Log archive I/O 2 100.0
SQL*Net break/reset to cli 256 99.6 .4
SQL*Net message to client 839.9 100.0 .0
SQL*Net more data from cli 91 100.0
SQL*Net more data to clien 1503 100.0
asynch descriptor resize 10.4K 100.0
buffer busy waits 2 100.0
control file parallel writ 1440 5.7 35.1 24.0 16.3 12.0 5.5 1.5
control file sequential re 6177 69.4 7.5 5.9 8.1 7.1 1.7 .3
db file parallel read 4727 1.7 3.2 3.2 10.1 46.6 33.3 1.8
db file parallel write 5755 42.3 21.3 18.6 11.2 4.6 1.4 .5
db file scattered read 21.5K 8.4 4.3 11.9 18.9 26.3 25.3 4.9
db file sequential read 3053. 28.7 15.1 11.1 17.9 21.5 5.4 .3 .0
direct path read 46.3K 9.9 8.8 18.5 21.7 22.8 15.7 2.7
direct path read temp 95 9.5 9.5 23.2 49.5 8.4
direct path write 35 11.4 31.4 17.1 22.9 11.4 2.9 2.9
direct path write temp 1 100.0
enq: KO - fast object chec 3 66.7 33.3
enq: RO - fast object reus 5 20.0 20.0 20.0 20.0 20.0
kfk: async disk IO 6 50.0 16.7 16.7 16.7
latch free 3 100.0
latch: cache buffers chain 1465 100.0
latch: cache buffers lru c 1 100.0
latch: object queue header 2 100.0
latch: redo allocation 3 33.3 33.3 33.3
latch: row cache objects 2 100.0
latch: shared pool 15 93.3 6.7
local write wait 79 35.4 34.2 21.5 8.9
log file parallel write 29.4K 47.8 21.7 11.9 9.9 6.8 1.6 .3
log file sequential read 304 6.3 3.0 3.6 10.2 23.4 24.3 29.3
log file single write 4 25.0 75.0
log file switch (private s 3 100.0
log file sync 23.9K 40.9 28.0 12.9 9.7 6.7 1.5 .3
os thread startup 140 100.0
read by other session 199.6 37.1 19.9 12.9 13.1 13.8 3.1 .2
reliable message 8 100.0
ASM background timer 755 2.9 .4 .1 .1 .3 .1 .3 95.8
DIAG idle wait 7196 100.0
KSV master wait 121 88.4 2.5 3.3 2.5 .8 .8 1.7
SQL*Net message from clien 840.1 97.1 1.8 .5 .2 .2 .1 .0 .1
Space Manager: slave idle 1147 .1 .5 99.4
Streams AQ: qmn coordinato 258 49.6 .4 50.0
Streams AQ: qmn slave idle 130 .8 99.2
Streams AQ: waiting for me 721 100.0
Streams AQ: waiting for ti 7 28.6 42.9 28.6
class slave wait 283 39.9 2.5 2.5 3.5 4.9 9.2 15.2 22.3
dispatcher timer 60 100.0
jobq slave wait 7360 .0 .0 .0 99.9
pmon timer 1201 100.0
rdbms ipc message 47.8K 2.7 31.6 17.4 1.1 1.1 .9 20.9 24.3
Wait Event Histogram DB/Inst: I2KPROD/I2KPROD Snaps: 5606-5607
-> Units for Total Waits column: K is 1000, M is 1000000, G is 1000000000
-> % of Waits: value of .0 indicates value was <.05%; value of null is truly 0
-> % of Waits: column heading of <=1s is truly <1024ms, >1s is truly >=1024ms
-> Ordered by Event (idle events last)
% of Waits
Total
Event Waits <1ms <2ms <4ms <8ms <16ms <32ms <=1s >1s
shared server idle wait 120 100.0
smon timer 16 6.3 93.8
wait for unread message on 7250 .1 99.9
Latch Miss Sources
-> only latches with sleeps are shown
-> ordered by name, sleeps desc
NoWait Waiter
Latch Name Where Misses Sleeps Sleeps
In memory undo latch ktichg: child 0 1 0
active service list kswslogon: session logout 0 2 0
cache buffers chains kcbgtcr_2 0 1,123 483
cache buffers chains kcbgtcr: fast path (cr pin 0 496 1,131
cache buffers chains kcbrls_2 0 5 6
cache buffers chains kcbgcur_2 0 4 0
cache buffers chains kcbgtcr: fast path 0 3 1
cache buffers chains kcbzwb 0 2 4
cache buffers chains kcbchg1: kslbegin: bufs no 0 1 0
cache buffers chains kcbnew: new latch again 0 1 0
cache buffers chains kcbrls_1 0 1 6
cache buffers chains kcbzgb: scan from tail. no 0 1 0
cache buffers lru chain kcbzgws 0 1 0
object queue header oper kcbo_switch_cq 0 1 0
object queue header oper kcbo_switch_mq_bg 0 1 2
redo allocation kcrfw_redo_gen: redo alloc 0 3 0
row cache objects kqrpre: find obj 0 1 1
row cache objects kqrso 0 1 0
shared pool kghalo 0 13 3
shared pool kghupr1 0 4 15
shared pool kghalp 0 1 0
space background task la ktsj_grab_task 0 2 2
------------------------------------------------------------- -
Why do I get IOException on nio read from channel before all data is read?
I am working on an NIO based http client library but I've noticed two problems.
#1: I have been testing against an http server that has authentication turned on. Hence, any request that comes its way will respond with a '401 Authentication Required' response. In the case of a POST, I've noticed that this particular http server does not wait for the body to arrive before responding. As soon as it gets the headers, it dumps the 401 response onto the channel and closes the connection. My library then gets an IOException on the next write to the channel even though I've received write interest event. (I'm using non blocking mode)
Whether I get the exception depends on timing. Sometimes, my writes work and the exception is averted. Sometimes not. The longer I delay since the time I get the write interest event, the more likely it is the exception will occur.
Now, in this situation, I really think it's the http server that is violating the http protocol. I give a valid content length that is not zero but it does not wait for me to finish my request. The moment I write the last empty line of the header section, it responds and closes the channel. Even though I don't think this is correct, my library has to deal with it. So in this situation, I've decided my library will abandon the write phase and move on to reading the response.
NOTE: In the majority of cases, a client would have already authenticated by landing on some page that could produce a POST in the first place. However, for technical reasons I can't mention here, I must support the case that the very first (unathenticated) request to the server is a POST.
2) After #1 above occurs, reading from the channel will also throw an IOException but only on Windows. Sometimes I get the headers only, sometimes the whole document, sometimes nothing. Again, the longer I delay reading (since the time I get the read interest event) the more likely it is the exception will be thrown. This NEVER happens on Linux. I always get the full response on Linux after the #1 happens even if I put long delays between reads.
I can understand #1 happening but #2 should not. I can always see the complete response data on the wire using a network protocol analyser. The data is there every time but my library doesn't always get it.
In situation 2, there is nothing I can do. If I don't receive the data, I have to respond with an error even though the request was successful.
I have stripped down my library to the bare essentials and can reproduce the problem in a self-contained environment every time.
Any ideas why the discrepency between Windows/Linux? Does this seem right?I read through the section you mentioned. I realize the connection may be dropped at any time. Handling this is no problem. It is reported as an exception to the client. However, this situation is different. I still see no provision that allows a server to respond to a half written request. A request is defined to include an optional message body (Section 5). The client dictates whether it is optional, not the server. Furthermore, section 6 clearly states "After receiving and interpreting a request message, a server responds with an HTTP response message.". To me, this implies the server must wait for the entire request before responding even if its a waste of time. This particular server is attempting to short circuit what I see is the required request/response cycle. In doing so, it is causing me some pain in trying to deliver its response since it seems on windows this interferes with my ability to read it.
The simple answer to this is to process reads before writes, i.e. OP_READ before OP_WRITE. I tried this as well. Originally, I was not even registering READ interest while I was writing my request. (I saw no reason to. I don't want to give my client a response while they are writing their request.) But even when I do register READ interest while I'm writing (and process read events before write), the read event still produces no data and no eof (-1) indication on the read. The discrepency between linux and windows is bothering me. No matter what I do, I can't deliver the response even though its written to the channel by my peer. I think I will supply some code and see if anyone can get it to work on windows.Edited by: r2rossi on Sep 24, 2008 10:42 AMEdited by: r2rossi on Sep 24, 2008 10:43 AM
Edited by: r2rossi on Sep 24, 2008 10:45 AM
Edited by: r2rossi on Sep 24, 2008 10:46 AM -
Duration & Delay Fields In Keynote 5.0.3
I downloaded the iWork update via Software Update and now I'm unable to type in custom delay or duration times in Keynote 5.0.3! I've noticed that the possibility to edit fields have been going back and forth in recent updates...I'm still able to use the up/down arrows, but who wants to do that if it's a significant change, or a custom timing?
Anyone else notice this?I'm seeing the same problem. Keynote 5.0.3. When I enter a number into the transition delay field, move away from the slide, then back, it will be back at 0.0. If I click from zero up to where I want it, it seems to stay. Pretty tedious for longish delays!
-
Error While returning CLOB back to Front End Application
Hi All,
I have stored procedure which generate XML CLOB and returns CLOB back to front end application.
But when my CLOB exceeds some limit the front end application is not able get the CLOB.
Following is the error i am getting.
Procedure call to stored procedure
_len number;
l_buf VARCHAR2(32767);
v_ret_clob CLOB:=' ';
begin
Orcl_Proc_Ctrl_4_Xml.EXECUTE_CONTROL(v_clob,v_ret_clob);
l_len := dbms_lob.getlength(v_ret_clob);
dbms_output.put_line('the return size OF CLOB------> '||l_len);
dbms_lob.read(v_ret_clob, l_len, 1, l_buf);
virsa_dbms_output(l_buf,100);
end;
Error Output
the return size OF CLOB------> 113906
BEGIN test_oraact1019; END;
ERROR at line 1:
ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 715
ORA-06512: at "APPS.TEST_ORAACT1019", line 16
ORA-06512: at line 1
I am able to get the Size of CLOB but when i try give back to Front end application it is not properly passing CLOB.
Any help on this.
Thanks in advance
PrashantPlease also post this in the XML DB forum:
XML DB -
Bug in Oracle Driver 11.2.0.3.0 when handling CLOB?
Hello,
I got a table which is defined like this:
CREATE TABLE FOO
FOO_id NUMBER(18) NOT NULL ,
xml_content sys.XMLTYPE NOT NULL
According to the documentation Oracle is using a CLOB as internal type.
For reading the CLOB from the database we are using Spring's org.springframework.jdbc.support.lob.OracleLobHandler (Spring 3.0.6.RELEASE) class which is implemented like this:
public String getClobAsString( ResultSet rs, int columnIndex ) throws SQLException
logger.debug( "Returning Oracle CLOB as string" );
Clob clob = rs.getClob( columnIndex );
initializeResourcesBeforeRead( rs.getStatement().getConnection(), clob );
String retVal = ( clob != null ? clob.getSubString( 1, (int) clob.length() ) : null );
releaseResourcesAfterRead( rs.getStatement().getConnection(), clob );
return retVal;
For me, this looks like the valid solution. But when reading CLOB greater than 4109 bytes, the resulting String contains a 0x0 (NULL) byte. Because the table is defined to contain XML, the XML parser is unable to handle this.
As workaround I got the following solution:
public String getClobAsString( ResultSet rs, int columnIndex ) throws SQLException
logger.debug( "Returning Oracle CLOB as string" );
Clob clob = rs.getClob( columnIndex );
initializeResourcesBeforeRead( rs.getStatement().getConnection(), clob );
readAllCharacter( clob );
String retVal = ( clob != null ? clob.getSubString( 1, (int) clob.length() ) : null );
releaseResourcesAfterRead( rs.getStatement().getConnection(), clob );
return retVal;
* Dummy read of all characters of the given lob. This fixes an issue that the resulting string
* contains 0x0 bytes.
* @param clob the clob
* @throws SQLException
private void readAllCharacter( Clob clob ) throws SQLException
if( clob != null )
Reader characterStream = clob.getCharacterStream();
char[] buffer = new char[4 * 1000];
try
while( characterStream.read( buffer ) != -1 )
catch( IOException e )
logger.error( "Exception while reading from the clob", e );
finally
try
characterStream.close();
catch( IOException e )
// nothing to do;
With this dummy read, the string does not contain the 0x0 token.
I think it's a Bug in the oracle.sql.CLOB class or did I miss something?
Kind regards
Michael>
I'm unsure what you mean with your citation and how this affects my code?
>
That citation specifically tells you how the drivers (based on version) support 'the Oracle SQL XML type (XMLType)'.
>
A call to getSubString should give me the content of the clob. But why does the content contain some bytes (0x0) which should not be there.
>
A CLOB instance is just a LOB locator. A locator contains the information necessary for Oracle to 'locate' the full lob contents. It usually also contains all of the lob data that is stored 'inline' in the table row. There is a limit of around 4k for the 'inline' part of the lob data.
A lob locator does NOT contain the part of the lob that is stored in the lob segment. The 'out-of-line' lob is generally retrieved using streams as shown in that doc.
So the 'getSubString' call is only using the contents of the locator.
See Inline and Out-of_Line LOB Storage in the 'Oracle® Database SecureFiles and Large Objects Developer's Guide'
http://docs.oracle.com/cd/B28359_01/appdev.111/b28393/adlob_tables.htm
>
Inline and Out-of-Line LOB Storage
LOB columns store locators that reference the location of the actual LOB value. Depending on the column properties you specify when you create the table, and depending the size of the LOB, actual LOB values are stored either in the table row (inline) or outside of the table row (out-of-line).
LOB values are stored out-of-line when any of the following situations apply:
If you explicitly specify DISABLE STORAGE IN ROW for the LOB storage clause when you create the table.
If the size of the LOB is greater than approximately 4000 bytes (4000 minus system control information), regardless of the LOB storage properties for the column.
If you update a LOB that is stored out-of-line and the resulting LOB is less than approximately 4000 bytes, it is still stored out-of-line.
LOB values are stored inline when any of the following conditions apply:
When the size of the LOB stored in the given row is small, approximately 4000 bytes or less, and you either explicitly specify ENABLE STORAGE IN ROW or the LOB storage clause when you create the table, or when you do not specify this parameter (which is the default).
When the LOB value is NULL (regardless of the LOB storage properties for the column).
Using the default LOB storage properties (inline storage) can allow for better database performance; it avoids the overhead of creating and managing out-of-line storage for smaller LOB values. If LOB values stored in your database are frequently small in size, then using inline storage is recommended.
Note:
LOB locators are always stored in the row.
A LOB locator always exists for any LOB instance regardless of the LOB storage properties or LOB value - NULL, empty, or otherwise.
If the LOB is created with DISABLE STORAGE IN ROW properties and the BASICFILE LOB holds any data, then a minimum of one CHUNK of out-of-line storage space is used; even when the size of the LOB is less than the CHUNK size.
If a LOB column is initialized with EMPTY_CLOB() or EMPTY_BLOB(), then no LOB value exists, not even NULL. The row holds a LOB locator only. No additional LOB storage is used.
LOB storage properties do not affect BFILE columns. BFILE data is always stored in operating system files outside the database.
>
You should generally use streams to read/write LOBs as they are the most efficient way to access them. If you commonly only need a subset of the data I suggest you use a PL/SQL package/function/procedure to perform the substringing and return the results.
>
the first read results also in an String with the 0x0 byte
>
And those would be part of the lob locator. -
Ipod touch 3rd gen iMessage sending/receiving delays
I have been messaging my friend for a while and haven't had any known issues. Well yesterday an issue started occurring randomly. Messages will either not be received or sent.
For instance: I'll send a message but it will never say it has been delivered. It doesn't say "NOT DELIVERED".
And when this happens she can't send messages to my Ipod. Her messages will get the NOT DELIVERED error. She is using a iPhone 4.
Then sometime later The messages will be sent.
We seem to be able to text with out any issues via my regular phone, i just prefer not to use it as message on the iPod is easier and faster than my crappy old phone.
Is this issue related to my Wifi router? Or could it just be that her provider is having issues, even though we can text fine when I'm using my regular phone?
I'm using the latest iOS version.There are many places in the trasmission/receving path that can result in slow/delayed delivery.
-
Write XML CLOB 10 MB in size to an XML file
Hi,
I am trying to export a table into an XML file. Using various examples, I have learned that is really easy to handle objects smaller that 32767 bytes (characters).
The problem is working with big chunks. My XML CLOB is just over 10 MB in size. I can easilly break it into smaller pieces but then I risk to write chr(10) in the middle of a XML Tag (which happened). I have an idea of finding a way around the problem but there are two issues:
1. DBMS_LOB.instr function returns 0 if offset grows above appx 1100.
2. I tried this in oreder to avid the limitation from item 1.:
for c = 1..dbms_lob.getlength(CLOB) loop
dbms_lob.read(CLOB,c,1,MyString);
if MyString = chr(10) then
utl_file.put_line(MyLine);
MyLine := '';
else
MyLine := MyLine || MyString;
end if;
end loop;
This way I generate perfect XML structure, and it takes about an hour of cpu time to create 2.3 MB file. I have tried to run ir for a big one, and it took just over 7 hours to get to 10.2 MB when I had shut it down.
Does anybody has any suggestions?utl_file.put(...) will write the contents of the buffer without a newline
utl_file.put_line will write the contents of the buffer plus a newline character. So, if you use utl_file.put_line(largebuffer) you will get a newline character after the buffer that may break tags.
The following should produce the string:
<tag>
in a file:
utl_file.put(fil, '<ta');
utl_file.put(fil, 'g>');
the following PL/SQL code will produce the string:
<ta
g>
in a file:
utl_file.put_line(fil, '<ta');
utl_file.put_line(fil, 'g>');
Are you saying that utl_file.put() is putting newlines in a file?
This can be because you are not setting MAXLINESIZE for the file to 32767 (or >= your buffer size ) in fopen:
UTL_FILE.FOPEN (
location IN VARCHAR2,
filename IN VARCHAR2,
open_mode IN VARCHAR2,
max_linesize IN BINARY_INTEGER) <<<<<<<<<<< set this to 32767 >>>>>>>>>>>>>>>>>>
RETURN file_type;
Larry -
Read and write Values from Configuration File in BizTalk
There is a requirement where Biz talk orchestration read the value dynamically from Config Store.After some process updating the value in config store.
I though to use SQL Server and create one table with single column.Biztalk will call the Storeproc to get the value and similary for update system will call another SP.
Instead of using SQL Server DB is there option to implement this requirement like app.config,BTSsvcxxexe.config ,SSO Config store etc.
If multi-users access the value from Config store and try to update ,how to handle lock mechanism.Hi BizQ,
Refrain from using BTSConfig file or any custom config file if you have a requirement to update the data. Modifying a
configuration file at runtime can cause some nasty, unexpected behavior inside your application if it's not managed properly.
I would suggest you to use Custom DB or SSO Database in this case.
Both have their Pros and Cons.
SSO Database:
You get out of the box encryption
It is a central store which will service all BizTalk servers within your group
SSO implements a caching mechanism internally for the data
Custom DB:
By storing the configuration in the database you don’t have to worry about consistency of data across servers like you would with a config file.
Cache needs to be implemented by program to avoid delays in reading from physical file.
In your case I recommend to go with SSO DB as in terms of storing custom configuration data in SSO for End Point/Application
specific information and credentials and potentially configuration information which you also need to write and update at runtime from your code or via an administrator.
You can use Richard Seroter's tool to store values as "Config Store" in SSO database and then write a .net helper
utility to retrieve it using SSOConfigStore class. It has method GetConfigInfo and you need to pass application name with other parameters. It returns ConfigurationPropertyBag from where you can read property name and values.
http://seroter.wordpress.com/2007/09/21/biztalk-sso-configuration-data-storage-tool/
http://blogs.msdn.com/b/teekamg/archive/2009/08/19/sso-configuration-application-mmc-snap-in.aspx.
Rachit
Please mark as answer or vote as helpful if my reply does
Maybe you are looking for
-
Missing sub-folders in List View within Finder
I seem to be randomly missing the sub-folder icon from List view within finder. Not only is the icon missing but the functionality has gone too. Anyone else having this problem in Lion?
-
How to extend a class from super package?
Say I have a dir a\ in dir a\ there is a dir b\ in b\ there is a class called DerivedClass in a\ there is a class called ExtendedClass how do I extend ExtendedClass from DerivedClass?
-
Heyas; So I have been going through my iTunes collection - backing up and getting missing artwork, etc. and I have noticed that several songs end early/get cut-off. This happened to one song a while back that was a download from the iTunes store. I f
-
How do i know if phtoshop elements 11 is installed as 64 bit or 32 bit on windows 32
I installed elements 11 upgrade as download purchased from adobe site windows 7 with quad 4 processor and 8 gb memory and 3 mhz speed plenty of power for 64 bits i was not given option on install as to 32 bit vs 64 bit install and i want 64 bit for t
-
Post-installation for BW, help
Hi this is min from india and i want help on steps for the post installation for BW 3.1. i cant work in rsa1 as told in groups i have done the client copy and kept the default profile still i cant work in that rsa1.some where i am doing the mis