Using temporary LOB
I am trying to use temporary LOB to store texts. When I am manipulating with LOB I can see some IO spikes on server from 50 to 100 % of IO. According to
Oracle documentation V$TEMPORARY_LOBS view should give me enough information but I couldn't find any description of the columns. Can someone point me to any resource that describes LOB and monitoring of about memory/resource
utilization. Can someone tell me how to interpret CACHE_LOBS,NOCACHE_LOBS
numbers.
Thanks in advance for any suggestions
Bob
Hello,
Disclaimer: I've not tried to run your sample...
Question:
You have:
case OracleDbType.NClob:
lobTypeName = "clob";
//NB: Using the constructor without the connection throws an exception
tempLob = new OracleClob(conn, true, true);
tempOracleDbType = OracleDbType.Clob;
break;
Why tempOracleDbType = OracleDbType.Clob; ? Should this be tempOracleDbType = OracleDbType.NClob; ?
I don't understand the comment "//NB: Using the constructor without the connection throws an exception".
There are two OracleClob constructors, both of which require a connection object. There is no constructor that does not take a connection.
- Mark
Similar Messages
-
Temporary LOBs - bad performance when nocache is used
Hello.
Please, advise me what could be the reason of bad performance row 8 from the next anonymous block:
declare
i integer;
c clob := 'c';
procedure LTrimSys(InCLOB in clob ) is
OutCLOB clob;
begin
DBMS_LOB.CREATETEMPORARY(OutCLOB, false, DBMS_LOB.call);
dbms_lob.Copy(OutCLOB, InCLOB, dbms_lob.getlength(InCLOB));
DBMS_LOB.freetemporary(OutCLOB);
end;
begin
for j in 1 .. 1000 loop
LTrimSys(c);
end loop;
end;
I have two practically identical databases 10.2.0.4.0 EE 64-bit on Windows
On first DB I have elapsed time: 4 sec, on second - 0.2 sec
I didn't find important difference between init parameters (hidden parameters too).
First DB has more memory (PGA) then second.
Main time events in time of executing anonymous block on first DB are
PL/SQL execution elapsed time
DB CPU
sql execute elapsed time
DB time
In second DB - the same but much less
If I use caching of temporary LOBs then both DBs work fine, but I can not understand why first DB works slowly when I use nocache temporary LOBs.
What can be the reason?I don't think that is the problem. See next outputs:
select * from V$PGASTAT order by name
NAME
VALUE
UNIT
PGA memory freed back to OS
49016834031616
bytes
aggregate PGA auto target
170893312
bytes
aggregate PGA target parameter
1073741824
bytes
bytes processed
95760297282560
bytes
cache hit percentage
93,43
percent
extra bytes read/written
6724614496256
bytes
global memory bound
107366400
bytes
max processes count
115
maximum PGA allocated
2431493120
bytes
maximum PGA used for auto workareas
372516864
bytes
maximum PGA used for manual workareas
531456
bytes
over allocation count
102639421
process count
57
recompute count (total)
117197176
total PGA allocated
1042407424
bytes
total PGA inuse
879794176
bytes
total PGA used for auto workareas
757760
bytes
total PGA used for manual workareas
0
bytes
total freeable PGA memory
75694080
bytes
select * from V$PGA_TARGET_ADVICE_HISTOGRAM where PGA_TARGET_FACTOR = 1
PGA_TARGET_FOR_ESTIMATE
PGA_TARGET_FACTOR
ADVICE_STATUS
LOW_OPTIMAL_SIZE
HIGH_OPTIMAL_SIZE
ESTD_OPTIMAL_EXECUTIONS
ESTD_ONEPASS_EXECUTIONS
ESTD_MULTIPASSES_EXECUTIONS
ESTD_TOTAL_EXECUTIONS
IGNORED_WORKAREAS_COUNT
1073741824
1
ON
2199023255552
4398046510079
0
0
0
0
0
1073741824
1
ON
1099511627776
2199023255551
0
0
0
0
0
1073741824
1
ON
549755813888
1099511627775
0
0
0
0
0
1073741824
1
ON
274877906944
549755813887
0
0
0
0
0
1073741824
1
ON
137438953472
274877906943
0
0
0
0
0
1073741824
1
ON
68719476736
137438953471
0
0
0
0
0
1073741824
1
ON
34359738368
68719476735
0
0
0
0
0
1073741824
1
ON
17179869184
34359738367
0
0
0
0
0
1073741824
1
ON
8589934592
17179869183
0
0
0
0
0
1073741824
1
ON
4294967296
8589934591
0
0
0
0
0
1073741824
1
ON
2147483648
4294967295
0
0
0
0
0
1073741824
1
ON
1073741824
2147483647
0
0
0
0
0
1073741824
1
ON
536870912
1073741823
0
0
0
0
0
1073741824
1
ON
268435456
536870911
0
0
0
0
0
1073741824
1
ON
134217728
268435455
0
376
0
376
0
1073741824
1
ON
67108864
134217727
0
0
0
0
0
1073741824
1
ON
33554432
67108863
0
0
0
0
0
1073741824
1
ON
16777216
33554431
1
0
0
1
0
1073741824
1
ON
8388608
16777215
10145
45
0
10190
0
1073741824
1
ON
4194304
8388607
20518
21
0
20539
0
1073741824
1
ON
2097152
4194303
832
1
0
833
0
1073741824
1
ON
1048576
2097151
42440
0
0
42440
0
1073741824
1
ON
524288
1048575
393113
7
0
393120
0
1073741824
1
ON
262144
524287
10122
2
0
10124
0
1073741824
1
ON
131072
262143
22712
0
0
22712
0
1073741824
1
ON
65536
131071
110215
0
0
110215
0
1073741824
1
ON
32768
65535
0
0
0
0
0
1073741824
1
ON
16384
32767
0
0
0
0
0
1073741824
1
ON
8192
16383
0
0
0
0
0
1073741824
1
ON
4096
8191
0
0
0
0
0
1073741824
1
ON
2048
4095
83409618
0
0
83409618
0
1073741824
1
ON
1024
2047
0
0
0
0
0
1073741824
1
ON
0
1023
0
0
0
0
0
SELECT optimal_count, round(optimal_count*100/total, 2) optimal_perc,
onepass_count, round(onepass_count*100/total, 2) onepass_perc,
multipass_count, round(multipass_count*100/total, 2) multipass_perc
FROM
(SELECT decode(sum(total_executions), 0, 1, sum(total_executions)) total,
sum(OPTIMAL_EXECUTIONS) optimal_count,
sum(ONEPASS_EXECUTIONS) onepass_count,
sum(MULTIPASSES_EXECUTIONS) multipass_count
FROM v$sql_workarea_histogram);
OPTIMAL_COUNT
OPTIMAL_PERC
ONEPASS_COUNT
ONEPASS_PERC
MULTIPASS_COUNT
MULTIPASS_PERC
12181507016
100
146042
0
0
0 -
What is difference of temporary lob in plsql
hi all,
what is difference of temporary lob for plsql, i mean for ex what is difference for theese codes:
Declare
MyClob Clob;
X pls_integer;
begin
MyClob := 'something clob operation';
x := DBMS_Lob.InStr(MyClob, 'lob');
end;
Declare
MyClob Clob;
X pls_integer;
begin
DBMS_Lob.CreateTemporary(MyClob, True);
MyClob := 'something clob operation';
x := DBMS_Lob.InStr(MyClob, 'lob');
DBMS_Lob.FreeTemporary(MyClob);
end;
i know that temporary clob is stored in temporary tablespace but in the first code block above, what is difference ?
thankswhat is difference ? In this case there's no difference, because the temporary lob is created »silently«: From the Temporary LOB Performance Guidelines:
If you use the newly provided enhanced SQL semantics functionality in your applications, then there are many more temporary LOBs created silently in SQL and PL/SQL than before.
In particular, these temporary LOBs are silently created when you use the following:
SQL functions on LOBs
PL/SQL built-in character functions on LOBs
Variable assignments from VARCHAR2/RAW to CLOBs/BLOBs, respectively.
Perform a LONG-to-LOB migration
Things get different, when no »silent« creation takes place as e.g. in
SQL> declare
2 myclob clob;
3 myclob2 clob;
4 begin
5 myclob := 'something clob operation';
6 dbms_lob.append(myclob2, myclob);
7 end;
8 /
declare
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified:
ORA-22275
ORA-06512: at "SYS.DBMS_LOB", line 639
ORA-06512: at line 6then you can either use createtemporary procedure
SQL> declare
2 myclob clob;
3 myclob2 clob;
4 begin
5 dbms_lob.createtemporary(myclob2,true);
6 myclob := 'something clob operation';
7 dbms_lob.append(myclob2, myclob);
8 end;
9 /
PL/SQL procedure successfully completed.Or force some other initialization:
SQL> declare
2 myclob clob;
3 myclob2 clob;
4 begin
5 myclob := 'something clob operation';
6 myclob2 := trim(to_clob(' '));
7 dbms_lob.append(myclob2, myclob);
8 end;
9 /
PL/SQL procedure successfully completed. -
How to use Temporary Table in PL-SQL
In MySQL there is no Temporary table concept.
So for intermediate calculation I have created a table as below
create table SequenceTempTable
SessionId VARCHAR(50),
Sequence VARCHAR(500),
CreatedDate DATE
) ENGINE=MEMORY;
Whenever I invoke a SP, I load the data into SequenceTempTable using Session Id as below
CREATE PROCEDURE `GetSequence`(
IN Start_Date VARCHAR(25),
IN End_Date VARCHAR(25)
BEGIN
SELECT UUID() INTO v_SessionId;
INSERT INTO SequenceTempTable values (v_SessionId,'1,2,5,3',now());
required code
DELETE FROM SequenceTempTable WHERE SessionId = v_SessionId;
COMMIT;
END;
i.e. I have created a table as temporary table (created once),
and load the data using Session Id and once session specific intermediate computation done,
I deleted the session specific data.
Could you give me examples of How to use Temporary table in PL-SQL code with respect to my above example.
Because I have gone through creating Temporary table but I stuck with use in PL-SQL. I mean to say Is there any need of creating table in advance before invoking SP.
And one more thing as in MySQL temp table I created which is using MEMORY engine i.e. this table will always be in MEMORY so there is no need of writing data on disk.
Regards
SanjeevHi Sanjeev
Read about GTT here
http://www.oracle-base.com/articles/8i/TemporaryTables.php
GTT always contains just session specific data. \
In case you want to use the GTT in the same session again you can use option
ON COMMIT PRESERVE ROWS;
Or if it is used just once in the session use can use
ON COMMIT DELETE ROWS;
Do remember that for GTT the data of one session can not be accessed in other session.
Also you can go away with Delete from GTT if not used again in same session.
Regards
Arun -
'Use Temporary File' in Receiver File channel
hi all,
I am facing a strange issue with receiver file channel which I am not sure if somene had already faced. I couldnt find any help from blogs..!
I have configured the Receiver File channel with Write mode as 'Use Temporary File' with a temporary file name(say tmp.xml) scheme and Empty-Message Handling set to 'Write Empty File'
When the scenario is executed, its so happening that the temporary file of 0 bytes(empty file) is being created as tmp<msgID>.xml before the actual file is being completely written. It is expected that once the Actual file is completely written, the tmp file should be deleted, but here is not the case.Thus causing both the files being present in the target location. This is not happening often though.
As the receiving application is processing all files from the target direcotry, the file is getting errored out in the target application.
I think the 'Write Empty File' has nothing to do with this as the option 'Write Empty File' is for empty payloads resulting from the message mapping.
Please correct me if am wrong and also provide me the inputs on my issue. Am on PI7.0
thanks in advance,Hi Tilak,
this is real time interface
real time by using a file... that's a non-sens according to me. You should use a non physical solution (web service, JMS, JDBC, etc...) but a not a file. well... Anyway, you can image that the receiver application schedule the folder every 30s or every 1min, that's almost a real time. Real time is mainly a conceptual view (only synchronous exchange needs really real time). Morevoer, if you really wanted a real time, you should not add a tool like PI (or other) between your source and your target system, the more we have systems, the less it's efficient (in term of delay and response time!).
Even if we propose that the receiver application should have a condition to its script to avoid picking the tmp*.xml files, after a period of time there would be a chance that the *tmp files may increase in number..
No ! coz if my theory is good, if your receiver application does not pick-up tmp.xml, that means this file is not currently treated and so PI is authorized to delete it. So no increase of tmp.xml files in this folder.
Another solution: to create the target file without option "temporary", but to create it in another folder than this one scheduled by your receiver application, and use an OS command AFTER processing, in your receiver CC, which move the created file from the "temp" folder to the target folder.
[http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature]
regards.
Mickael -
When to use "Use Temporary File" in receiver FTP adapter
Hi Experts,
I have nerver used "Use Temprary File" as the "Write Mode" in receiver ftp adapter.
I want to knwo under what kind of requirment we should use this option?
Thanks in advance.
Best Regards,Hi Aditya
Usually it's advisable to use "use temporary file" as write mode when you want to avoid your file to be picked up by receiver while PI channel is still writing it.
Obviously larger the file, more chances you have that this issue could occur.
If you select the "use temporary file", XI will write the content to a temporary file with another name of your choice and only once writing has finished it will rename it to the actual name setup in the "file name scheme".
Regards,
Giuseppe -
Use temporary file in FTP receiver adapter
Hi guys,
I'm not getting the purpose of "use temporary file" in FTP receiver adapter. Can you describe any situation, where this should be used?
What is the location of this temporary file?
Is it deleted after "normal" file is created?
Thanks a lot,
Olian> I'm not getting the purpose of "use temporary file" in FTP receiver adapter. Can you describe any situation, where this should be used?
Some times when you create the file on your target dir then if there is another application looking for same file is quite faster to pick the file before it is complety written on target dir then in this situation using temporary file option is very helpful. What it does, it simply creates the file first by using temporary name once all bytes or bits has been transfered then it creates the original name and the temp file get deleted.
> What is the location of this temporary file?
Same location, where your original file is suppose to be written.
> Is it deleted after "normal" file is created?
Yes.
Regards,
Sarvesh -
Use Temporary File (File Receiver)
Hi All,
I have a file format in the file receiver which has a special charecter(#0) that represents the end of the file. but i wanna append more than one message to the same file. if i do so, the content would be added after the end of the file charecter (#0) there by my system which processes these files ignores the content. i think i hav to do something using the option 'Use Temporary File'. but i din't find ample info about it on help.sap.com. Can any one plz throw some light on this?
Thnx in Advance
Anil Kumar VeepuriHi Anil,
The functionality of temporary file is that, the receiver file adapter first collects the data of the file into a temporary file before putting it on the server.
This is generally use so that ur target system does not read the file when u are writing it on the server.
Try using File construction mode Append.
Hope this helps.
Regards
Vijaya -
When to use PGA_AGGREGATE_TARGET and when to use temporary table space?
Hi, all.
I am a little confused with regard to when to use pga work area, and
when to use temporary tablespace?
Is there any one who could give me an advice or a document?
Thanks in advance.
Best Regards.
Message was edited by:
user507290You are more than a little confused... What has one to do with the other, do you think?
All Oracle documentation is at http://tahiti.oracle.com - I suggest you start with the Concepts manual of your version -
How to use temporary interface in another interface as derived table in 10g
Hi ,
Can somebody please tell me how to use temporary interface in another interface as derived table in 10g.
I have an option in odi 11g to this task.But i am working on odi 10g for my project.So that please help me to do this task.
I can able to create temporary interface in 10g ,but i dont know how to use that temporary interface in another inerface as derived table.
Thanks in Advance
Thanks,
Srikanth AA temp interface CANNOT be used as a derived table in ODI 10g.
All you can do is to drag and drop the temp interface as the source in the mapping.
PS. Please remember to assign correct/helpful points to the people who help you in the forum. -
Using temporary tables in stored procedures
Suppose that I have created a temporary table in a stored procedure using an "EXECUTE IMMEDIATE" statement. When I compile the procedure, that table is not created yet, so the compiler says that the table does not exist.
What is the way of using temporary tables in stored procedures?It's a good practice to avoid using DDL statements being executed from stored procedures. "Truncate Table" via dynamic SQL from stored procedure is a different story and is useful in DSS environments.
But if you insist on "creating" tables using Dynamic SQL from Stored Procedures then you must also embed your DML statements in Dynamic SQL to avoid compilation errors.
Example:
Create or Replace Procedure Proc_TestDynamicSQL is
Begin
Execute Immediate 'Create table myTable as select * from user_tables' ;
Execute Immediate 'Update myTable set table_name = ''Test'' ' ; --two single quotes before and after the string "Test"
End;
In this case, Oracle wouldn't care about the table references during compilation. -
How to use temporary database?
hi
i am using timesten as cachedb for oracle database。i have some problem about how to use temporary database?
1) what's the difference between temporary and non-temporary database,if i use awt cache group,then timesten will automatically replicate all change to oracle database , even if timesten crashed,i can set up another timesten quickly,no data loss?
2)since all data is in oracle database,does timesten‘s transaction log and checkpoint file useful ? does timesten need backup ?Temporary databases have very limited usefullness; you can't use them with replication or caching for example. They are a very 'niche' use case; I'd recommend that you avoid them for mainstream use.
TimesTen checkpoiint and transaction log files are always required (except for Temporary database which do not have checkpoint files but do have log files).
Chris -
I have a dataflow task which puts the result in a temporary table. I want to put the table result in a flat file but is not able to do that. Can anyone help?
Here is the sql code
use adventureworks2008r2
declare @totalcount as float
declare @addcount as float
declare @citycount as float
declare @addperct as float
declare @cityperct as float
declare @temp table (name varchar (40), percentage float)
set @totalcount = (select count(*)from person.Address)
set @addcount = (select COUNT (*)from person.Address where AddressLine2 = null)
set @citycount = (select COUNT (*) from person.Address where City is not null )
set @addperct = 100*(@addcount/@totalcount)
set @cityperct = 100*(@citycount/@totalcount)
insert into @temp
select 'Addressline2',ROUND (@addperct,2)
insert into @temp
select 'City',ROUND (@CITYPERCT,2)
SELECT * FROM @tempWhat you're using is table variable and not temporary table. It will be out of scope outside batch so you cant use it anywhere after code.
I think if you want to use it in further tasks you should use temporary tables (# tables) after setting RetainSameConnection property to true.
See
http://consultingblogs.emc.com/jamiethomson/archive/2006/11/19/SSIS_3A00_-Using-temporary-tables.aspx
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Using Temporary table as a target
when i used real target table the integration works fine but when i used temporary table i got "com.sunopsis.tools.core.exception.SnpsSimpleMessageException: CKM not selected."
I don't know why inspite of being importing the CKM
do any one has any idea about this?Hi
I have the same problem, and uncheck the option of FLOW CONTROL = NO and still remains error "com.sunopsis.tools.core.exception.SnpsSimpleMessageException: CKM not selected" .. Do you have any idea because I still ticking wrong?
Edited by: user2080320 on 06-oct-2008 11:44
Edited by: user2080320 on 06-oct-2008 11:45 -
CS5 crashes when previewing using temporary file
Hello everyone!
I've started having an issue with CS5 crashing anytime I try to preview a doc with out saving it first.
I've had the "Preview using temporary file" option checked for more than a year and never had an issue.
Any ideas?
Thanks So Much!You might try clearing the Dreamweaver cache: http://forums.adobe.com/thread/494811
Maybe you are looking for
-
I purchased an album on ITunes store, while the items downloaded to my phone, it didn't download to my mac. Some of the songs downloaded but not the majority, when I try to download the songs, it gives me an error 8003 Unknown error occured. What am
-
guys this is so odd and pointless but for some reason my charger wont let my iphone charge or ipod but it works for iphone. iphone running ios 7 same with ipad. any solutions?
-
Useful for monitoring HDV in Final Cut Pro?
Here is a new blackmagic card for HD. Seems like this could be a cheaper way to monitor my FCP timeline. I normally edit HDV shows either natively of as AIC compressed. But I have to monitor it through the "desktop cinema preview" feature which doesn
-
IPod NOTES - I think they can secretly scripting
If you read the original notes file that comes with your ipod, it gives directions for how to place text files in that directory. However, that original file itself, when viewed view PC, contains only the tag <INSTRUCTIONS> - which suggests to me, th
-
HT4901 Lost calendars on mac book pro. What to do?
Hi I was just trying to sync my mac book pro calendar with icloud and most calendar info on the mac disappeared. I have two icloud accounts: original mobileme and new icloud. I think I may have changed a particular setting wrong. Need my calendars ba