MySQL: Difference Between current_date(), sysdate() and now()

Do you know the difference?

current_date(): Only give you the date.
now(): Datetime when the statement,procedure etc… started.
sysdate(): Current datetime.

Take a look between the functions now() and sysdate() after executing sleep of 5 seconds…:

SQL> select current_date(),now(),sysdate(),SLEEP(5),now(),sysdate();
"2016-03-24";"2016-03-24 16:00:43";"2016-03-24 16:00:43";"2016-03-24 16:00:43";"2016-03-24 16:00:48"

Matheus.

Is My Linux Server Physical or Virtual?

Supposing you are in a server shell and don’t know if you machine is virtualized (a VM)?
One way to check that (supposing VMWare as hypervisioning solution) is:

[root@mydbsrvr ~]# dmidecode | grep -i vmware
Manufacturer: VMware, Inc.
Product Name: VMware Virtual Platform
Serial Number: VMware-xx xx xx xx xx xx xx xx-xx xx xx xx xx xx xx xx
Description: VMware SVGA II

If you had an answer like this, yes, it’s a VM. 🙂

Matheus.

11.2.0.1: ORA-00600: internal error code, arguments: [7005], [0], [], [], [], [], [], [], [], [], [], []

# Error

Errors in file /oracle/diag/rdbms/mydb/mydb_1/trace/mydb_1_ora_972.trc (incident=195818):
ORA-00600: internal error code, arguments: [7005], [0], [], [], [], [], [], [], [], [], [], []
Incident details in: /oracle/diag/rdbms/mydb/mydb_1/incident/incdir_195818/mydb_1_ora_972_i195818.trc

#Cause
The query causing this error uses a CONTAINS clause on alphanumerical column using bind variables. This is a perfect match with note ORA-0600 [7005] on a Select Query Using Contains Clause (Doc ID 1176276.1), referencing the unpublished Bug 8770557 ORA-600 [7005] While Running Text Queries.
The symptoms includes this two key factors:
– presence of CONTAINS clause
– use of bind variables

# Solution
Apply 11.2.0.2 patchset or higher, where this issue is fixed or Apply one off Patch 8770557 if available for your version / platform.

See ya!
Matheus.

PSUs for Databases 10.2.0.4 and above

Hi all!
I’m researching about and decided to share the list of all Oracle Patch Set Updates (PSU) for Databases 10.2.0.4 and above, until now.
It’s always good to know the last PSU for every version to better fit on our patching policy.

Note: To understand database version numbers: https://docs.oracle.com/cd/B28359_01/server.111/b28310/dba004.htm

I expect it be useful for you too!

Patches for 12.1.0.2
Patch 21359755 – DATABASE PATCH SET UPDATE 12.1.0.2.5
Patch 21523234 – GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.2.5 (OCT2015)
Patch 20831110 – DATABASE PATCH SET UPDATE 12.1.0.2.4 (INCLUDES CPUJUL2015)
Patch 20996835 – GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.2.4 (JUL2015)
Patch 20299023 – DATABASE PATCH SET UPDATE 12.1.0.2.3 (APR2015)
Patch 20485724 – GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.2.3 (APR2015)
Patch 19769480 – DATABASE PATCH SET UPDATE 12.1.0.2.2 (JAN2015)
Patch 19954978 – GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.2.2 (JAN2015)
Patch 19303936 – DATABASE PATCH SET UPDATE 12.1.0.2.1 (OCT2014)
Patch 19392646 – GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.2.1 (OCT2014)

Patches for 12.1.0.1
Patch 21352619 – DATABASE PATCH SET UPDATE 12.1.0.1.9
Patch 21551666 – GRID INFRASTRUCTURE PSU 12.1.0.1.9 (OCT2015 – INCLUDES DB PSU 12.1.0.1.9)
Patch 20831107 – DATABASE PATCH SET UPDATE 12.1.0.1.8 (INCLUDES CPUJUL2015)
Patch 20996901 – GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.1.8 (JUL2015)
Patch 20299016 – DATABASE PATCH SET UPDATE 12.1.0.1.7
Patch 20485762 – GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.1.7 (APR2015)
Patch 19769486 – DATABASE PATCH SET UPDATE 12.1.0.1.6
Patch 19971324 – GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.1.6 (JAN2015)
Patch 19121550 – DATABASE PATCH SET UPDATE 12.1.0.1.5
Patch 19392372 – GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.1.5 (OCT2014)
Patch 18522516 – DATABASE PATCH SET UPDATE 12.1.0.1.4
Patch 18705901 – GRID INFRASTRUCTURE SYSTEM PATCH 12.1.0.1.4 (Exadata)
Patch 18705972 – GRID INFRASTRUCTURE SYSTEM PATCH 12.1.0.1.4
Patch 18031528 – DATABASE PATCH SET UPDATE 12.1.0.1.3
Patch 18139660 – GRID INFRASTRUCTURE SYSTEM PATCH 12.1.0.1.3 (Exadata)
Patch 18413105 – GRID INFRASTRUCTURE SYSTEM PATCH 12.1.0.1.3
Patch 17552800 – DATABASE PATCH SET UPDATE 12.1.0.1.2
Patch 17735306 – GRID INFRASTRUCTURE SYSTEM PATCH 12.1.0.1.2
Patch 17027533 – DATABASE PATCH SET UPDATE 12.1.0.1.1
Patch 17272829 – GRID INFRASTRUCTURE PSU 12.1.0.1.1

Patches for 11.2.0.4
Patch 21352635 – DATABASE PATCH SET UPDATE 11.2.0.4.8 (INCLUDES CPUOCT2015)
Patch 21523375 – GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.4.8 (OCT2015)
Patch 20760982 – DATABASE PATCH SET UPDATE 11.2.0.4.7 (INCLUDES CPUJUL2015)
Patch 20996923 – GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.4.7 (JUL2015)
Patch 20299013 – DATABASE PATCH SET UPDATE 11.2.0.4.6 (INCLUDES CPUAPR2015)
Patch 20485808 – GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.4.6 (APR2015)
Patch 19769489 – DATABASE PATCH SET UPDATE 11.2.0.4.5 (INCLUDES CPUJAN2015)
Patch 19955028 – GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.4.5 (JAN2015)
Patch 19121551 – DATABASE PATCH SET UPDATE 11.2.0.4.4 (INCLUDES CPUOCT2014)
Patch 19380115 – GRID INFRASTRUCTURE SYSTEM PATCH 11.2.0.4.4
Patch 18522509 – DATABASE PATCH SET UPDATE 11.2.0.4.3 (INCLUDES CPUJUL2014)
Patch 18706472 – GRID INFRASTRUCTURE SYSTEM PATCH 11.2.0.4.3
Patch 18031668 – DATABASE PATCH SET UPDATE 11.2.0.4.2 (INCLUDES CPUAPR2014)
Patch 18139609 – GRID INFRASTRUCTURE SYSTEM PATCH 11.2.0.4.2
Patch 17478514 – DATABASE PATCH SET UPDATE 11.2.0.4.1 (INCLUDES CPUJAN2014)

Patches for 11.2.0.3
Patch 20760997 – DATABASE PATCH SET UPDATE 11.2.0.3.15 (INCLUDES CPUJUL2015)
Patch 20996944 – GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.3.15 (JUL2015)
Patch 20299017 – DATABASE PATCH SET UPDATE 11.2.0.3.14 (INCLUDES CPUAPR2015)
Patch 20485830 – GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.3.14 (APR2015)
Patch 19769496 – DATABASE PATCH SET UPDATE 11.2.0.3.13 (INCLUDES CPUJAN2015)
Patch 19971343 – GRID INFRASTRUCTURE PSU 11.2.0.3.13 (JAN2015)
Patch 19121548 – DATABASE PATCH SET UPDATE 11.2.0.3.12 (INCLUDES CPUOCT2014)
Patch 19440385 – GRID INFRASTRUCTURE PSU 11.2.0.3.12 (INCLUDES DB PSU 11.2.0.3.12)
Patch 18522512 – DATABASE PATCH SET UPDATE 11.2.0.3.11 (INCLUDES CPUJUL2014)
Patch 18706488 – GRID INFRASTRUCTURE PSU 11.2.0.3.11 (INCLUDES DB PSU 11.2.0.3.11)
Patch 18031683 – DATABASE PATCH SET UPDATE 11.2.0.3.10
Patch 18139678 – GRID INFRASTRUCTURE PSU 11.2.0.3.10 (INCLUDES DB PSU 11.2.0.3.10)
Patch 17540582 – DATABASE PATCH SET UPDATE 11.2.0.3.9 (INCLUDES CPUJAN2014)
Patch 17735354 – GRID INFRASTRUCTURE PSU 11.2.0.3.9 (INCLUDES DB PSU 11.2.0.3.9)
Patch 16902043 – DATABASE PATCH SET UPDATE 11.2.0.3.8 (INCLUDES CPUOCT2013)
Patch 17272731 – GRID INFRASTRUCTURE PSU 11.2.0.3.8 (INCLUDES DB PSU 11.2.0.3.8)
Patch 16619892 – DATABASE PATCH SET UPDATE 11.2.0.3.7 (INCLUDES CPUJUL2013)
Patch 16742216 – GRID INFRASTRUCTURE PSU 11.2.0.3.7 (INCLUDES DB PSU 11.2.0.3.7)
Patch 16056266 – DATABASE PATCH SET UPDATE 11.2.0.3.6 (INCLUDES CPUAPR2013)
Patch 16083653 – GRID INFRASTRUCTURE PSU 11.2.0.3.6 (INCLUDES DB PSU 11.2.0.3.6)
Patch 14727310 – DATABASE PATCH SET UPDATE 11.2.0.3.5 (INCLUDES CPUJAN2013)
Patch 14727347 – GRID INFRASTRUCTURE PSU 11.2.0.3.5 (INCLUDES DB PSU 11.2.0.3.5)
Patch 14275605 – DATABASE PATCH SET UPDATE 11.2.0.3.4 (INCLUDES CPUOCT2012)
Patch 14275572 – GRID INFRASTRUCTURE PSU 11.2.0.3.4 (INCLUDES DB PSU 11.2.0.3.4)
Patch 13923374 – DATABASE PATCH SET UPDATE 11.2.0.3.3 (INCLUDES CPU JUL2012)
Patch 13919095 – GRID INFRASTRUCTURE PSU 11.2.0.3.3 (INCLUDES DB PSU 11.2.0.3.3)
Patch 13696216 – DATABASE PATCH SET UPDATE 11.2.0.3.2 (INCLUDES CPU APR2012)
Patch 13696251 – GRID INFRASTRUCTURE PSU 11.2.0.3.2 (INCLUDES DB PSU 11.2.0.3.2)
Patch 13343438 – DATABASE PATCH SET UPDATE 11.2.0.3.1 (INCLUDES CPU JAN2012)

Patches for 11.2.0.2
Patch 17082367 – DATABASE PATCH SET UPDATE 11.2.0.2.12 (INCLUDES CPUOCT2013)
Patch 17272753 – GRID INFRASTRUCTURE PSU 11.2.0.2.12 (INCLUDES DB PSU 11.2.0.2.12)
Patch 16619893 – DATABASE PATCH SET UPDATE 11.2.0.2.11 (INCLUDES CPUJUL2013)
Patch 16742320 – GRID INFRASTRUCTURE PSU 11.2.0.2.11 (INCLUDES DB PSU 11.2.0.2.11)
Patch 16056267 – DATABASE PATCH SET UPDATE 11.2.0.2.10 (INCLUDES CPUAPR2013)
Patch 16166868 – GRID INFRASTRUCTURE PSU 11.2.0.2.10 (INCLUDES DB PSU 11.2.0.2.10)
Patch 14727315 – DATABASE PATCH SET UPDATE 11.2.0.2.9 (INCLUDES CPUJAN2013)
Patch 14841385 – GRID INFRASTRUCTURE PSU 11.2.0.2.9 (INCLUDES DB PSU 11.2.0.2.9)
Patch 14275621 – DATABASE PATCH SET UPDATE 11.2.0.2.8 (INCLUDES CPUOCT2012)
Patch 14390437 – GRID INFRASTRUCTURE PSU 11.2.0.2.8 (INCLUDES DB PSU 11.2.0.2.8)
Patch 13923804 – DATABASE PATCH SET UPDATE 11.2.0.2.7 (INCLUDES CPU JUL2012)
Patch 14192201 – GRID INFRASTRUCTURE PSU 11.2.0.2.7 (INCLUDES DB PSU 11.2.0.2.7)
Patch 13696224 – DATABASE PATCH SET UPDATE 11.2.0.2.6 (INCLUDES CPU APR2012)
Patch 13696242 – GRID INFRASTRUCTURE PSU 11.2.0.2.6 (INCLUDES DB PSU 11.2.0.2.6)
Patch 13343424 – DATABASE PATCH SET UPDATE 11.2.0.2.5 (INCLUDES CPU JAN2012)
Patch 12827726 – DATABASE PSU 11.2.0.2.4 (INCLUDES CPUOCT2011)
Patch 12419331 – DATABASE PSU 11.2.0.2.3 (INCLUDES CPUJUL2011)
Patch 11724916 – DATABASE PSU 11.2.0.2.2 (INCLUDES CPUAPR2011)
Patch 10248523 – DATABASE PSU 11.2.0.2.1 (Patch)

Patches for 11.2.0.1
Patch 12419378 – DATABASE PSU 11.2.0.1.6 (INCLUDES CPUJUL2011)
Patch 11724930 – DATABASE PSU 11.2.0.1.5 (INCLUDES CPUAPR2011)
Patch 10248516 – DATABASE PSU 11.2.0.1.4 (INCLUDES CPUJAN2011)
Patch 9952216 – DATABASE PSU 11.2.0.1.3 (INCLUDES CPUOCT2010)
Patch 9655006 – GI PSU 11.2.0.1.2 (INCLUDES DATABASE PSU 11.2.0.1.2)
Patch 9654983 – DATABASE PSU 11.2.0.1.2 (INCLUDES CPUJUL2010)
Patch 9352237 – DATABASE PSU 11.2.0.1.1 (Patch)

Patches for 11.1.0.7
Patch 20761024 – DATABASE PATCH SET UPDATE 11.1.0.7.24 (INCLUDES CPUJUL2015)
Patch 20299012 – DATABASE PATCH SET UPDATE 11.1.0.7.23 (INCLUDES CPUAPR2015)
Patch 19769499 – DATABASE PATCH SET UPDATE 11.1.0.7.22 (INCLUDES CPUJAN2015)
Patch 19152553 – DATABASE PATCH SET UPDATE 11.1.0.7.21 (INCLUDES CPUOCT2014)
Patch 18522513 – DATABASE PATCH SET UPDATE 11.1.0.7.20 (INCLUDES CPUJUL2014)
Patch 18031726 – DATABASE PATCH SET UPDATE 11.1.0.7.19 (INCLUDES CPUAPR2014)
Patch 17465583 – DATABASE PATCH SET UPDATE 11.1.0.7.18 (INCLUDES CPUJAN2014)
Patch 17082366 – DATABASE PATCH SET UPDATE 11.1.0.7.17 (INCLUDES CPUOCT2013)
Patch 16619896 – DATABASE PATCH SET UPDATE 11.1.0.7.16 (INCLUDES CPUJUL2013)
Patch 16056268 – DATABASE PATCH SET UPDATE 11.1.0.7.15 (INCLUDES CPUAPR2013)
Patch 14739378 – DATABASE PATCH SET UPDATE 11.1.0.7.14 (INCLUDES CPUJAN2013)
Patch 14275623 – DATABASE PATCH SET UPDATE 11.1.0.7.13 (INCLUDES CPUOCT2012)
Patch 13923474 – DATABASE PATCH SET UPDATE 11.1.0.7.12 (INCLUDES CPU JUL2012)
Patch 13621679 – DATABASE PATCH SET UPDATE 11.1.0.7.11 (INCLUDES CPU APR2012)
Patch 13343461 – DATABASE PATCH SET UPDATE 11.1.0.7.10 (INCLUDES CPU JAN2012)
Patch 12827740 – DATABASE PSU 11.1.0.7.9 (INCLUDES CPUOCT2011)
Patch 12419384 – DATABASE PSU 11.1.0.7.8 (INCLUDES CPUJUL2011)
Patch 11724953 – TRACKING BUG FOR 11.1.0.7.7 CRS PSU
Patch 11724936 – DATABASE PSU 11.1.0.7.7 (INCLUDES CPUAPR2011)
Patch 10248531 – DATABASE PSU 11.1.0.7.6 (INCLUDES CPUJAN2011)
Patch 9952228 – DATABASE PSU 11.1.0.7.5 (INCLUDES CPUOCT2010)
Patch 9654987 – DATABASE PSU 11.1.0.7.4 (INCLUDES CPUJUL2010)
Patch 9352179 – DATABASE PSU 11.1.0.7.3 (INCLUDES CPUAPR2010)
Patch 9209238 – DATABASE PSU 11.1.0.7.2 (INCLUDES CPUJAN2010)
Patch 8833297 – DATABASE PSU 11.1.0.7.1 (INCLUDES CPUOCT2009)

Patches for 10.2.0.5
Patch 16619894 – DATABASE PATCH SET UPDATE 10.2.0.5.12 (INCLUDES CPUJUL2013)
Patch 16056270 – DATABASE PATCH SET UPDATE 10.2.0.5.11 (INCLUDES CPUAPR2013)
Patch 14727319 – DATABASE PATCH SET UPDATE 10.2.0.5.10 (INCLUDES CPUJAN2013)
Patch 14275629 – DATABASE PATCH SET UPDATE 10.2.0.5.9 (INCLUDES CPUOCT2012)
Patch 13923855 – DATABASE PATCH SET UPDATE 10.2.0.5.8 (INCLUDES CPU JUL2012)
Patch 13632743 – DATABASE PATCH SET UPDATE 10.2.0.5.7 (INCLUDES CPU APR2012)
Patch 13343471 – DATABASE PATCH SET UPDATE 10.2.0.5.6 (INCLUDES CPU JAN2012)
Patch 12827745 – DATABASE PSU 10.2.0.5.5 (INCLUDES CPUOCT2011)
Patch 12419392 – DATABASE PSU 10.2.0.5.4 (INCLUDES CPUJUL2011)
Patch 11724962 – DATABASE PSU 10.2.0.5.3 (INCLUDES CPUAPR2011)
Patch 9952245 – TRACKING BUG FOR 10.2.0.5.2 CRS PSU
Patch 10248542 – DATABASE PSU 10.2.0.5.2 (INCLUDES CPUJAN2011)
Patch 9952230 – DATABASE PSU 10.2.0.5.1 (INCLUDES CPUOCT2010)

Patches for 10.2.0.4
Patch 16619897 – DATABASE PSU 10.2.0.4.17 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUJUL2013)
Patch 16056269 – DATABASE PSU 10.2.0.4.16 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUAPR2013)
Patch 14736542 – DATABASE PSU 10.2.0.4.15 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUJAN2013)
Patch 14275630 – DATABASE PSU 10.2.0.4.14 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUOCT2012)
Patch 13923851 – DATABASE PSU 10.2.0.4.13 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUJUL2012)
Patch 12879933 – DATABASE PSU 10.2.0.4.12 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUAPR2012)
Patch 12879929 – DATABASE PATCH SET UPDATE 10.2.0.4.11 (PRE-REQ 10.2.0.4.4|INCLUDES CPUJAN2012)
Patch 12827778 – DATABASE PSU 10.2.0.4.10 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUOCT2011)
Patch 12419397 – DATABASE PSU 10.2.0.4.9 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUJUL2011)
Patch 11724977 – DATABASE PSU 10.2.0.4.8 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUAPR2011)
Patch 10248636 – DATABASE PSU 10.2.0.4.7 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUJAN2011)
Patch 9952234 – DATABASE PSU 10.2.0.4.6 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUOCT2010)
Patch 9654991 – DATABASE PSU 10.2.0.4.5 (REQUIRES PRE-REQUISITE 10.2.0.4.4|INCLUDES CPUJUL2010)
Patch 9294403 – TRACKING BUG FOR THE 10.2.0.4.4 CRS PSU
Patch 9352164 – DATABASE PSU 10.2.0.4.4 (INCLUDES CPUAPR2010)
Patch 9119284 – DATABASE PSU 10.2.0.4.3 (INCLUDES CPUJAN2010)
Patch 8833280 – DATABASE PSU 10.2.0.4.2 (INCLUDES CPUOCT2009)
Patch 8576156 – DATABASE PSU 10.2.0.4.1 (INCLUDES CPUJUL2009)

ORA-10456: cannot open standby database; media recovery session may be in progress

A dataguard quick tip!

# Error

SQL> ALTER DATABASE OPEN READ ONLY;
ALTER DATABASE OPEN READ ONLY
*
ERROR at line 1:
ORA-10456: cannot open standby database; media recovery session may be in progress

# Solution

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
SQL> ALTER DATABASE OPEN READ ONLY;
Database altered.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
Database altered.

See ya! 🙂
Matheus.

EXP Missing Tables on 11.2

Made an exp and some table is missing, right? The database is 11.2+? The tables missing have no rows in source dabase, right? Bingo!
This happen because Oracle implemented a space saving feature on 11.2 called Deffered Segment Creation.

This feature basically makes that the first segment of a table is only allocated when the first row is inserted. It was implemented because Oracle realized is not rare to find databases with lots of tables that haven’t ever had a row.

The situation occurs because the EXP client uses dab_segments as index to exporting, and, this feature makes that no segment be allocated. For Oracle, it’s not a problem, considering the use of Datapump (EXPDP/IMPDP).

But (there always exist a “but”), let’s suppose you have to export the file to a different location not accessible by directory nor has local space, or either, your table has a long column (yes, it’s deprecated, I know… but let’s suppose this is a legacy system…). Then, you can do:

1) For all tables that has no rows, allocate an extent:
alter table owner.tabela allocate extent;

To generate, the script:

select 'alter table '||owner||'.'||table_name||' allocate extent;' from all_tables where num_rows=0;

2) Export using clausule VERSION=11.1 or lower on EXP. 🙂

More about Deffered Segment Creation: https://oracle-base.com/articles/11g/segment-creation-on-demand-11gr2

Hope It helped.
See ya!
Matheus.

ORA-04091: Table is Mutating, Trigger/Function may not see it

No!
This is not a super-table nor a x-table (X-Men joke, this was awfull, I know… I’m sorry).

ORA-04091: Table "TABLE NAME" is Mutating, Trigger/Function may not see it
ORA-06512: em "TRC_INSERT_TABLE", line 14
ORA-04088: error during execution of trigger 'TRC_INSERT_TABLE'

Very interesting. But not hard to understand. The cause is that the trigger (or a user defined plsql function that is referenced in this statement) attempted to look at (or modify) a table that was in the middle of being modified by the statement which fired it.

In other words, your trying to read a data the you are modifying. The obviously cause an inconsistency, the reason to this error. The data is “mutant”. But the error could be less annoying, right? Oracle and his jokes…

The solution is to rewrite the trigger to not use the table, or, in some situation, you can use an autonomous transaction, to turn it independent. It can be done using the clause PRAGMA AUTONOMOUS_TRANSACTION.

This FAQ can be useful to you: http://www.orafaq.com/wiki/Autonomous_transaction

Matheus.