oracle常用语句及报错处理原创
5人赞赏了该文章
730次浏览
编辑于2022年06月29日 13:41:12
1、 ORA-12034: materialized view log on "用户名"."T_BD_BANK" younger than last refresh
解决方案:重建物化视图日志
drop materialized view log on T_BD_BANK ; create materialized view log on T_BD_BANK with rowid; drop materialized view log on T_BD_BANK_L ; create materialized view log on T_BD_BANK_L with rowid; drop materialized view log on T_BD_CUSTOMER ; create materialized view log on T_BD_CUSTOMER with rowid; drop materialized view log on T_BD_CUSTOMER_L ; create materialized view log on T_BD_CUSTOMER_L with rowid; drop materialized view log on T_BD_DEPARTMENT ; create materialized view log on T_BD_DEPARTMENT with rowid; drop materialized view log on T_BD_DEPARTMENT_L ; create materialized view log on T_BD_DEPARTMENT_L with rowid; drop materialized view log on T_BD_SUPPLIER ; create materialized view log on T_BD_SUPPLIER with rowid; drop materialized view log on T_BD_SUPPLIER_L ; create materialized view log on T_BD_SUPPLIER_L with rowid; drop materialized view log on T_FIN_OTHERS ; create materialized view log on T_FIN_OTHERS with rowid; drop materialized view log on T_FIN_OTHERS_L ; create materialized view log on T_FIN_OTHERS_L with rowid; drop materialized view log on T_HR_EMPINFO ; create materialized view log on T_HR_EMPINFO with rowid; drop materialized view log on T_HR_EMPINFO_L ; create materialized view log on T_HR_EMPINFO_L with rowid; drop materialized view log on T_ORG_ORGANIZATIONS ; create materialized view log on T_ORG_ORGANIZATIONS with rowid; drop materialized view log on T_ORG_ORGANIZATIONS_L ; create materialized view log on T_ORG_ORGANIZATIONS_L with rowid;
2、刷新物化视图
exec dbms_mview.refresh('V_FIN_CONTACTTYPE','C'); exec dbms_mview.refresh('V_ITEMCLASS_OWNER','C'); exec dbms_mview.refresh('V_ITEMCLASS_KEEPER','C'); exec dbms_mview.refresh('V_FIN_CONTACTTYPE_L','C'); exec dbms_mview.refresh('V_ITEMCLASS_OWNER_L','C'); exec dbms_mview.refresh('V_ITEMCLASS_KEEPER_L','C'); exec dbms_mview.refresh('V_FIN_CONTACTTYPE','F'); exec dbms_mview.refresh('V_ITEMCLASS_OWNER','F'); exec dbms_mview.refresh('V_ITEMCLASS_KEEPER','F'); exec dbms_mview.refresh('V_FIN_CONTACTTYPE_L','F'); exec dbms_mview.refresh('V_ITEMCLASS_OWNER_L','F'); exec dbms_mview.refresh('V_ITEMCLASS_KEEPER_L','F'); exec dbms_mview.refresh('V_ITEMCLASS_DISPUTETO','C'); exec dbms_mview.refresh('V_ITEMCLASS_DISPUTETO','F'); exec dbms_mview.refresh('V_ITEMCLASS_DISPUTETO_L','C'); exec dbms_mview.refresh('V_ITEMCLASS_DISPUTETO_L','F');
3、为了避免项目过程中自动刷新物化视图导致报错,可以先将物化视图修改为手动更新,项目结束后再修改回来。
修改为手动刷新:
alter materialized view V_FIN_CONTACTTYPE refresh fast on demand; alter materialized view V_FIN_CONTACTTYPE_L refresh fast on demand; alter materialized view V_ITEMCLASS_DISPUTETO refresh fast on demand; alter materialized view V_ITEMCLASS_DISPUTETO_L refresh fast on demand; alter materialized view V_ITEMCLASS_KEEPER refresh fast on demand; alter materialized view V_ITEMCLASS_KEEPER_L refresh fast on demand; alter materialized view V_ITEMCLASS_OWNER refresh fast on demand; alter materialized view V_ITEMCLASS_OWNER_L refresh fast on demand;
修改为基本提交后自动更新: alter materialized view V_FIN_CONTACTTYPE refresh fast on commit; alter materialized view V_FIN_CONTACTTYPE_L refresh fast on commit; alter materialized view V_ITEMCLASS_DISPUTETO refresh fast on commit; alter materialized view V_ITEMCLASS_DISPUTETO_L refresh fast on commit; alter materialized view V_ITEMCLASS_KEEPER refresh fast on commit; alter materialized view V_ITEMCLASS_KEEPER_L refresh fast on commit; alter materialized view V_ITEMCLASS_OWNER refresh fast on commit; alter materialized view V_ITEMCLASS_OWNER_L refresh fast on commit;
赞 5
5人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!
推荐阅读