Home » SQL & PL/SQL » SQL & PL/SQL » ora-12096 error in materialized view (2 threads merged by bb) (oracle 10g)
ora-12096 error in materialized view (2 threads merged by bb) [message #521986] Mon, 05 September 2011 05:45 Go to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
Hi ,

I am facing one issue while doing some transaction on one table called "WORKFLOWITEMACTORMOVEMENT". The error which is coming
ORA-12096: error in materialized view log on "PMSMARTDB"."WORKFLOWITEMACTORDATA_TSMS"
ORA-00942: table or view does not exist
ORA-06512: at "PMSMARTDB.HCLT_WFIAD_TSMS", line 16
ORA-04088: error during execution of trigger 'PMSMARTDB.HCLT_WFIAD_TSMS'

The above error are not consistent , some time coming and some time not coming....



There is one trigger on WORKFLOWITEMACTORMOVEMENT table which script is mentioned below
create or replace trigger "HCLT_WFIADM_TSMS" 
after insert or update or delete
ON workflowitemactormovement
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
declare
vincludeintimesheet varchar2(10);
BEGIN
begin
proclog('A','WFIADM');
select et.includeintimesheet into vincludeintimesheet
 from eformtemplate et
where et.templatetype=:new.itemtype and (et.ownertype,et.ownerid)in (
select ownertype,ownerid from workflowitemdata where itemtype=:new.itemtype and itemid=:new.itemid)
and rownum<2;
exception when others then
vincludeintimesheet:=null;
end;
proclog('B','WFIADM');
if inserting then
insert into workflowitemactordatam_tsms( ITEMID,
  ITEMTYPE,
  MOVEMENTID,
  STAGEID,
  ACTUALSTARTDATE,
  ACTUALENDDATE,
  USERID,
  INCLUDETIMESHEET
  ) values (:new.ITEMID             ,
  :new.ITEMTYPE           ,
  :new.MOVEMENTID,
  :new.STAGEID,
  :new.ACTUALstartdate      ,
  :new.ACTUALENDDATE,
  :new.USERID ,
  vincludeintimesheet );
end if;

if updating then
update  workflowitemactordatam_tsms
set ACTUALSTARTDATE= :new.ACTUALSTARTDATE ,
 ACTUALENDDATE=:new.ACTUALENDDATE,
 stageid=:new.stageid,
 userid=:new.userid,
   includetimesheet=vincludeintimesheet
    where ITEMTYPE=:old.itemtype
   and ITEMID=:old.itemid
   and STAGEID=:old.stageid
    and USERID=:old.userid
    and MOVEMENTID=:old.movementid;

 end if;
 if deleting  then
 delete from workflowitemactordatam_tsms where
  ITEMTYPE=:old.itemtype
   and ITEMID=:old.itemid
   and STAGEID=:old.stageid
    and USERID=:old.userid
    and MOVEMENTID=:old.movementid;
 end if;
 proclog('C','WFIADM');
END;


On weekly basis we do the online redefnition of workflowitemactordatam_tsms table whose script is mentioned below:

CREATE TABLE workflowitemactordatam_tsms_in AS SELECT * FROM workflowitemactordatam_tsms WHERE 1=2;  
EXEC DBMS_REDEFINITION.START_REDEF_TABLE(USER,'workflowitemactordatam_tsms','workflowitemactordatam_tsms_in',ORDERBY_COLS=>'USERID,includetimesheet,ITEMTYPE,ITEMID');
DECLARE
V_OUT BINARY_INTEGER;
BEGIN
DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS(USER,'workflowitemactordatam_tsms','workflowitemactordatam_tsms_in',1,FALSE,TRUE,FALSE,TRUE,V_OUT);
END;
/
EXEC DBMS_REDEFINITION.SYNC_INTERIM_TABLE(USER, 'workflowitemactordatam_tsms', 'workflowitemactordatam_tsms_in');
EXEC DBMS_REDEFINITION.FINISH_REDEF_TABLE(USER, 'workflowitemactordatam_tsms', 'workflowitemactordatam_tsms_in');
DROP TABLE workflowitemactordatam_tsms_in CASCADE CONSTRAINTS;    
begin
dbms_stats.gather_table_stats(user,'WORKFLOWITEMACTORDATAM_TSMS',cascade => TRUE);
end;
/


Even there is no materialized view log on WORKFLOWITEMACTORDATA_TSMS this table for that i executed mentioned scripts.

SELECT * FROM user_tables WHERE table_name = 'WORKFLOWITEMACTORDATAM_TSMS'
One record found.

SELECT * from user_mview_logs WHERE master = 'WORKFLOWITEMACTORDATAM_TSMS'
output: No record found

SELECT *
FROM user_tables
WHERE table_name = (
SELECT log_table
FROM user_mview_logs
WHERE master = 'WORKFLOWITEMACTORMOVEMENT'
)

output: No record found

Please advice me why this error is coming.....

Thanks

Re: ora-12096 error in materialized view [message #522017 is a reply to message #521986] Mon, 05 September 2011 10:17 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>ORA-06512: at "PMSMARTDB.HCLT_WFIAD_TSMS", line 16
>ORA-04088: error during execution of trigger 'PMSMARTDB.HCLT_WFIAD_TSMS'

my only observation is that "HCLT_WFIAD_TSMS" only exists in error message & NEVER in any posted code.
so you have a mystery & we have no clue as to what really exists for you.
Re: error in materialized view log [message #522029 is a reply to message #521986] Mon, 05 September 2011 13:35 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>exception when others then
>vincludeintimesheet:=null;
>end;

potentially FATAL flaw.
the whole & complete EXCEPTION handler code should be removed & eliminated.

[Updated on: Mon, 05 September 2011 13:35]

Report message to a moderator

Re: ora-12096 error in materialized view [message #522031 is a reply to message #522017] Tue, 06 September 2011 00:02 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
Actually it was because of copy paste... the trigger name is HCLT_WFIADM_TSMS which is coming in error.
Re: error in materialized view log [message #522032 is a reply to message #522029] Tue, 06 September 2011 00:04 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
Then how can we handle the exception and even why it is giving such error

ORA-12096: error in materialized view log on "PMSMARTDB"."WORKFLOWITEMACTORDATA_TSMS"
ORA-00942: table or view does not exist
Re: ora-12096 error in materialized view [message #522053 is a reply to message #522017] Tue, 06 September 2011 03:39 Go to previous messageGo to next message
prashant_ora
Messages: 196
Registered: July 2010
Senior Member
How this block can be a cause of the mentioned error

exception when others then
>vincludeintimesheet:=null;
>end;

Please suggest
Re: ora-12096 error in materialized view [message #522054 is a reply to message #522053] Tue, 06 September 2011 03:47 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
It can't, but it could be hiding another error message. Change it to no_data_found.
Re: ora-12096 error in materialized view (2 threads merged by bb) [message #632352 is a reply to message #521986] Thu, 29 January 2015 05:40 Go to previous messageGo to next message
Lakme
Messages: 1
Registered: January 2015
Junior Member
Normally there will be one more error associated with 'ora-12096 materialized views log error' that needs to be corrected first.
The root cause lies with the correction of the second Oracle error.
Once that is addressed by taking care of the second Oracle error, the ORA-12096 will not show up anymore.
Re: ora-12096 error in materialized view (2 threads merged by bb) [message #632357 is a reply to message #632352] Thu, 29 January 2015 06:28 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

And don't you see OP posted (twice) this second error along with the first one?
You have only one chance to make a good first impression and you lost it.
Why did you choose to answer a 4 and half years old question to add nothing to the previous posts?

Previous Topic: need a query for following description
Next Topic: Transpose rows to columns without an aggregation
Goto Forum:
  


Current Time: Thu Apr 18 23:36:49 CDT 2024