![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
hi ng, it is a bit difficult to explain and more difficult to analyze and we look for a hint where to search for our problem. We use Oracle 11.1.0.6.0 and there are triggers, that write down changes of some tables compressed into a special changelog-table. Something like CREATE TRIGGER MyOwner.MyTrigger BEFORE UPDATE ON TABLE1 FOR EACH ROW declare * * * EOraDatumAuszerhalb EXCEPTION; * * * PRAGMA EXCEPTION_INIT(EOraDatumAuszerhalb, -20100); * * lvs_ChangeLog_Fields varchar2(4000); * * lvs_ChangeLog_Program varchar2(64); * * lvs_ChangeLog_IPAdress varchar2(64); * * lvs_ChangeLog_Machine varchar2(64); begin * *-- some probably uninteresting code * * * if (:new.cdatumfaellung>sysdate) or * * * * *(:new.cdatumpflanzung>sysdate) or * * * * *(:new.cdatumfaellung<:new.cdatumpflanzung) then * * * * raise EOraDatumAuszerhalb;--exception * * * end if; * * lvs_ChangeLog_Fields:= * * * * EncodeXML('CID', ld.CID,:new.CID)||EncodeXML('CIDNEBENANLAGE', ld.CIDNEBENANLAGE,:ne w.CIDNEBENANLAGE)||* * * * EncodeXML... * * ; * * if lvs_ChangeLog_Fields is not null then lvs_ChangeLog_Fields:='<Spalten>'||chr(13)||lvs_Ch angeLog_Fields||'</Spalte*n>'||chr(13); * * * * select * * * * * * program, * * * * * * machine, * * * * * * sys_context('USERENV','IP_ADDRESS') * * * * into * * * * * * lvs_ChangeLog_Program, * * * * * * lvs_ChangeLog_Machine, * * * * * * lvs_ChangeLog_IPAdress * * * * from * * * * * * v$session * * * * where * * * * * * audsid=sys_context('USERENV','SESSIONID'); * * * * insert into BAUMPRG.TBCHANGELOG( * * * * * * clogid, * * * * * * clogtime, * * * * * * clogtable, * * * * * * CLOGIDUSER, * * * * * * CLOGOSUSER, * * * * * * CLOGPROGRAM, * * * * * * CLOGMACHINE, * * * * * * CLOGIPADDRESS, * * * * * * clogschema, * * * * * * clogreason, * * * * * * cdataid, * * * * * * cdatafields * * * * )values( * * * * * * BAUMPRG.PChangeLog.NewGUID(), * * * * * * sysdate, * * * * * * 'TABLE1', * * * * * * :new.CIDNUTZER, * * * * * * SYS_CONTEXT('USERENV','OS_USER'), * * * * * * lvs_ChangeLog_Program, * * * * * * lvs_ChangeLog_Machine, * * * * * * lvs_ChangeLog_IPAdress, * * * * * * 'OWNER', * * * * * * 'U', * * * * * * ld.cid,* * * * * * lvs_ChangeLog_Fields * * * * ); * * end if; end; This is only a Code fragment. EncodeXML is a short function, that returns an XML- string- fragment only if there are differences between old and new value. Now the problem: Sometimes (no way to find out all circumstances) there is an error ORA-01000: maximum open cursors exceeded ORA-06512: at MyOwner.MyTrigger, line 167 ORA-04088: error during execution of trigger MyOwner.MyTrigger Line 167 is the line, where the insert statement is executed There are no loops in the code and so we do not know where new cursors are opened. What can we do to find out our mistake(s)? Many thanks Andreas -- wenn email, dann AndreasMosmann <bei> web <punkt> de |
#3
| |||
| |||
|
|
hi ng, Now the problem: Sometimes (no way to find out all circumstances) there is an error ORA-01000: maximum open cursors exceeded ORA-06512: at MyOwner.MyTrigger, line 167 ORA-04088: error during execution of trigger MyOwner.MyTrigger Line 167 is the line, where the insert statement is executed There are no loops in the code and so we do not know where new cursors are opened. What can we do to find out our mistake(s)? Many thanks Andreas -- wenn email, dann AndreasMosmann <bei> web <punkt> de |
#4
| |||
| |||
|
|
On Apr 1, 7:00*am, Andreas Mosmann <mosm... (AT) expires-30-04-2009 (DOT) news- group.org> wrote: I doubt that there is a mistake, except in the concept that all cursors are explicit cursors you've coded. Oracle can open additional Could you explain this? |
|
cursors to aid in processing your query, and it appears that at times you have a heavier than 'normal' user load consuming the cursors your trigger normally uses. I suggest you increase the value of the open_cursors parameter; you can double this value and it won't affect memory until these cursors are needed. I can increase this value, but in fact I still do not understand where |
|
David Fitzjarrell Thank you |
#5
| |||
| |||
|
|
ddf schrieb am 01.04.2009 in c5b7fcdd-fedc-4273-82a6-2e40b41d5... (AT) e2g2000vbe (DOT) googlegroups.com>: On Apr 1, 7:00*am, Andreas Mosmann <mosm... (AT) expires-30-04-2009 (DOT) news- group.org> wrote: I doubt that there is a mistake, except in the concept that all cursors are explicit cursors you've coded. *Oracle can open additional Could you explain this? What happens, if I f.e. execute an update on this Table Table1, that concerns 1000 rows. Will there be created 1000 Cursors? And if so, what part of my code makes this happen? How can I avoid this? |
|
cursors to aid in processing your query, and it appears that at times you have a heavier than 'normal' user load consuming the cursors your trigger normally uses. I suggest you increase the value of the open_cursors parameter; you can double this value and it won't affect memory until these cursors are needed. I can increase this value, but in fact I still do not understand where these open cursors come from. |
![]() |
| Thread Tools | |
| Display Modes | |
| |