Sun Jul 27 15:59:34 2014
ORA-01555 caused by SQL statement below (SQL ID: 6cttns598np15, Query Duration=1699 sec, SCN: 0x0001.086b282b):
INSERT INTO RP_RETAIL001 (ID, AD_CLIENT_ID, AD_ORG_ID, OWNERID, ISACTIVE, BILLDATE, DOCNO, RETAILBILLTYPE, CREATER, C_STORE_ID, DESCRIPTION, C_VIP_ID, SALESREP_ID, M_PRODUCT_ID, M_ATTRIBUTESETINSTANCE_ID, QTY, PRICELIST, TOT_AMT_LIST, PRICEACTUAL, TOT_AMT_ACTUAL, DISCOUNT, TYPE, REFNO, PERCOST, M_PRODUCT_ALIAS_ID, MARKDISAMT, ITEM_DESCRIPTION, C_MARKBALTYPE_ID, STATUSTIME, AD_PI_ID, C_RETAILTYPE_ID) SELECT B.ID, B.AD_CLIENT_ID, B.AD_ORG_ID, B.OWNERID, B.ISACTIVE, A.BILLDATE, A.DOCNO, A.RETAILBILLTYPE, A.OWNERID AS CREATER, A.C_STORE_ID, A.DESCRIPTION, A.C_VIP_ID, B.SALESREP_ID, B.M_PRODUCT_ID, B.M_ATTRIBUTESETINSTANCE_ID, B.QTY, B.PRICELIST, B.TOT_AMT_LIST, B.PRICEACTUAL, B.TOT_AMT_ACTUAL, B.DISCOUNT, B.TYPE, A.REFNO, (SELECT K.PERCOST FROM FA_PRODUCT_CUSCOST K WHERE K.C_CUSTOMER_ID = A.C_CUSTOMER_ID AND K.M_PRODUCT_ID = B.M_PRODUCT_ID) AS PERCOST, B.M_PRODUCTALIAS_ID AS M_PRODUCT_ALIAS_ID, B.TOT_AMT_ACTUAL * 0, B.DESCRIPTION ITEM_DESCRIPTION, B.C_MARKBALTYPE_ID, A.STATUSTIME, :B5 , A.C_RETAILTYPE_ID FROM M_R
Sun Jul 27 16:12:03 2014
今天是周末,难得可以休息一下,晚上8点来到办公室查看下库的情况,发现有条日志报错,这条语句很熟悉了,也就是这几天一直和开发那边沟通的一条报表的存储过程,该语句近一段时间以来一直雄踞ADDM 性能分析中占Top SQL Statements第一位,在7月18号时该语句把undo表空间占满了,日志中出现ORA-01555 caused by SQL statement below 提示,所以马上查看UNDO表空间,
20:25:00 [email protected]> select sum(maxbytes)/1024/1024/1024,SUM(USER_BYTES)/1024/1024/1024 FROM dba_data_files where tablespace_NAME=‘UNDOTBS1‘;
SUM(MAXBYTES)/1024/1024/1024 SUM(USER_BYTES)/1024/1024/1024
---------------------------- ------------------------------
63.9999695 63.9989624
Elapsed: 00:00:00.02
20:25:02 [email protected]> select sum(maxbytes)/1024/1024/1024,SUM(USER_BYTES)/1024/1024/1024 FROM dba_data_files where tablespace_NAME=‘UNDOTBS2‘;
SUM(MAXBYTES)/1024/1024/1024 SUM(USER_BYTES)/1024/1024/1024
---------------------------- ------------------------------
63.9999695 63.9989624
20:10:46 [email protected]> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
这次表空间几乎没有怎么使用;实际上看表空间的大小我会通过OEM查看比较简单明了;
20:29:02 [email protected]> SELECT DISTINCT STATUS ,COUNT(*) , SUM(BYTES) / 1024 / 1024 / 1024 FROM DBA_UNDO_EXTENTS GROUP BY STATUS;
STATUS COUNT(*) SUM(BYTES)/1024/1024/1024
--------- ---------- -------------------------
EXPIRED 2739 11.5249634
UNEXPIRED 957 1.08874512
ACTIVE 5 .01171875
ORA-01555 caused by SQL statement below,布布扣,bubuko.com