检查反应较慢的时间段,数据库整体运行情况,从awr报告总看看是否有异常
以上是两个节点的等待事件排行,其中发现cursor: pin S wait on X等待事件类型是并行,切较高,开始分析的时候先留意一下,接着向下看
在其他的sql方面,比如逻辑读,物理读等方面基本上算是正常的,平时也都可以看到类似的存储过程和sql,但是在CPU time栏位,明显有异常的SQL存在.具体的sql文本为:
SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS IGNORE_WHERE_CLAUSE NO_PARALLEL(SAMPLESUB) opt_param('parallel_execution_enabled', 'false') NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1), : "SYS_B_00"),
NVL(SUM(C2), : "SYS_B_01")
FROM (
SELECT /*+ IGNORE_WHERE_CLAUSE NO_PARALLEL("D") FULL("D") NO_PARALLEL_INDEX("D") */ : "SYS_B_02" AS C1,
CASE
WHEN "D"."CONTACTTEXT" LIKE : "SYS_B_03"
AND "D"."CONTACTTYPECODE" = : "SYS_B_04"
AND "D"."SYSSRC" <> : "SYS_B_05"
AND "D"."SYSSRC" <> : "SYS_B_06"
AND "D"."SYSSRC" <> : "SYS_B_07"
THEN : "SYS_B_08"
ELSE : "SYS_B_09"
END AS C2
FROM "CMDS"."STD_CONTRACT" SAMPLE BLOCK(: "SYS_B_10", : "SYS_B_11") SEED(: "SYS_B_12") "D"
) SAMPLESUB
这个sql是oracle内部执行的,这是oracle发生了动态采样的时候会有的sql.
怀疑Oracle在某个SQL中采用了调节dynamic sample比例的过程,Oracle从11g开始应用一种自动调节的动态收集机制。如果一个SQL对应数据表很大,而且应该用并行策略,同时有没有统计量。这个时候,Oracle会自己调节采样比例,到一个比较大的取值。
awr报告下面的其他部分基本上都是正常的,磁盘的速度,和其他信息,现在怀疑两点:
1.怀疑并行导致
2.怀疑表的统计信息不准确
下面首先检查表和表上面索引的并行度情况:
SQL> select degree,table_name from user_tables where degree > '1';
no rows selected
SQL> select degree,table_name,index_name from user_indexes where degree > '1';
DEGREE TABLE_NAME INDEX_NAME
---------------------------------------- ------------------------------ ------------------------------
8 PSN_CUSTOMER_UPD_BAK IDX_PSN_CUSTOMER_UPD_NEW1_BAK
16 GUIBING_CHECK_1021_2 IDX_GUIBING_CHECK_NO
128 PSN_CUSTOMER IDX_PSN_CUST_5YS2
128 PSN_CUSTOMER IDX_PSN_CUST_CUSTID
8 CHECK_UPD_BAK IDX_CHECK_UPD_NEW1_BAK
8 GRP_CUSTOMER GRP_CUSTOMER_IDX2
16 STD_CONTRACT IDX_STD_SGID
8 COMBINED_CNTR COMBINED_CNTR_IDX2
8 CNTR_CG_ID CNTR_CGID_IDX2
上面的结果看cmds用户的表并行度是正确的,我们一般不设置表的并行度,如有需求,手工在sql中添加hint提示,索引的并行度是错误的,首先不应该大于1,并且在PSN_CUSTOMER上面,并行度太高了,cpus一共是128.
检查表的统计信息情况:
select last_analyzed,table_name from user_tables where table_name in ('PSN_CUSTOMER_UPD_BAK','GUIBING_CHECK_1021_2','PSN_CUSTOMER','CHECK_UPD_BAK','GRP_CUSTOMER','STD_CONTRACT','COMBINED_CNTR','CNTR_CG_ID');
LAST_ANAL TABLE_NAME
--------- ------------------------------
21-SEP-16 CHECK_UPD_BAK
23-DEC-16 CNTR_CG_ID
15-FEB-17 COMBINED_CNTR
06-FEB-17 GRP_CUSTOMER
21-OCT-16 GUIBING_CHECK_1021_2
19-NOV-16 PSN_CUSTOMER
01-SEP-16 PSN_CUSTOMER_UPD_BAK
06-FEB-17 STD_CONTRACT
表统计信息一般没有大问题,个别感觉稍长时间没更新的,手工更新一下就可以,没有差的太多,这个可以忽略了
SQL> exec DBMS_STATS.GATHER_table_STATS ('CMDS','PSN_CUSTOMER',estimate_percent => dbms_stats.auto_sample_size,method_opt => 'for all columns size auto',degree => 15,cascade => true);
PL/SQL procedure successfully completed.
下面删除并行,后续观察数据库情况
select 'alter index '||index_name||' noparallel;' from user_indexes where degree > '1';
'ALTERINDEX'||INDEX_NAME||'NOPARALLEL;'
------------------------------------------------------
alter index IDX_GUIBING_CHECK_NO noparallel;
alter index IDX_CHECK_UPD_NEW1_BAK noparallel;
alter index IDX_PSN_CUSTOMER_UPD_NEW1_BAK noparallel;
alter index IDX_STD_SGID noparallel;
alter index IDX_PSN_CUST_5YS2 noparallel;
alter index IDX_PSN_CUST_CUSTID noparallel;
alter index GRP_CUSTOMER_IDX2 noparallel;
alter index CNTR_CGID_IDX2 noparallel;
alter index COMBINED_CNTR_IDX2 noparallel;
之后检查发现归并的效率并没有得到提高.
检查索引情况
SQL> select status,index_name from user_ind_subpartitions;
STATUS INDEX_NAME
-------- ------------------------------
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE PARTY_RELATION_IND_MAP
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE IDX_CONTACTLIST_CUSTID
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
USABLE CNTR_ID_IDX1
SQL> select status,index_name,table_name from user_indexes where status !='UNUSABLE';
STATUS INDEX_NAME TABLE_NAME
-------- ------------------------------ ------------------------------
VALID PK_TREE_TB TREE_TB
VALID SYS_C0015294 CUS_MERGE_QUERY
VALID PK_CUST_REL_INFO CUST_REL_INFO
VALID IDX_CUST_RELATION_UPD_1 CUST_RELATION_UPD
VALID IDX_CUST_RELATION_UPD_2 CUST_RELATION_UPD
VALID TMP_IDX2_UNCNTRNO CNTR_NO_UN_20160912
VALID TMP_IDX1_UNCNTRNO CNTR_NO_UN
VALID SYS_IL0020101372C00045$$ SYS_EXPORT_SCHEMA_01
VALID SYS_C0024368 SYS_EXPORT_SCHEMA_01
VALID SYS_MTABLE_00132B8FC_IND_1 SYS_EXPORT_SCHEMA_01
VALID SYS_MTABLE_00132B8FC_IND_2 SYS_EXPORT_SCHEMA_01
VALID SYS_C0015292 SUSP_CUSTOMER
VALID IDX_PSN_CUSTOMER_UPD_NEW1_BAK PSN_CUSTOMER_UPD_BAK
VALID IDX_PSN_CUSTOMER_UPD_1 PSN_CUSTOMER_UPD_20160901
VALID IDX_PSN_CUSTOMER_UPD_2 PSN_CUSTOMER_UPD_20160901
VALID IDX_PSN_HLDR_UPD_1 PSN_HLDR_UPD
VALID IDX_PSN_HLDR_UPD_2 PSN_HLDR_UPD
VALID IDX_CUST_RELATION_ID CUST_RELATION
VALID IDX_CUST_RELATION_NO CUST_RELATION
VALID SYS_C0024706 CUST_NO
VALID SYS_C0015296 CUST_MERGE_MANAGE
VALID PK_CUST_INFO CUST_INFO
VALID PK_CUST_FAM_SPLITSHOW CUST_FAM_SPLITSHOW
VALID PK_CUST_FAM_SPLIT CUST_FAM_SPLIT
VALID PK_CUST_FAM_INFO CUST_FAM_INFO
VALID PK_CUST_FAM_DISPLAY CUST_FAM_DISPLAY
VALID PK_CUST_FAM_CHECKQUERY CUST_FAM_CHECKQUERY
VALID PK_CUST_FAM_CHECK CUST_FAM_CHECK
VALID PK_CUSTRELATE CUSTRELATE
VALID PK_AU_CALENDAR AU_WORKCALENDAR
VALID PK_AU_VISITOR AU_VISITOR
VALID PK_AU_USERPROFILE AU_USERPROFILE
VALID PK_LOGIN AU_USER
VALID IDX_USER_LOGINID AU_USER
VALID PK_AU_SYSPARAS AU_SYSPARAS
VALID SYS_IL0001860042C00012$$ AU_SYSERROR
VALID SYS_IL0001860042C00013$$ AU_SYSERROR
VALID PK_AU_SYSERROR AU_SYSERROR
VALID PK_AU_RESOURCE AU_RESOURCE
VALID PK_AU_PROXYHISTORY AU_PROXYHISTORY
VALID PK_AU_POSITION AU_POSITION
VALID PK_AU_PARTYTYPE AU_PARTYTYPE
VALID PK_AU_PARTYRELATIONTYPE AU_PARTYRELATIONTYPE
VALID PK_AU_PARTYRELATION AU_PARTYRELATION
VALID IDX_PR_PARENTCODE_CHILDCODE AU_PARTYRELATION
VALID PK_AU_PARTY AU_PARTY
VALID PK_AU_LOGIN_LOG AU_LOGIN_LOG
VALID PK_AU_HISTORY AU_HISTORY
VALID SYS_IL0001860032C00011$$ AU_HISTORY
VALID PK_AU_FUNCTREE AU_FUNCTREE
VALID IDX_UNIQUE_TOTALCODE AU_FUNCTREE
VALID PK_AU_EMPLOYEE AU_EMPLOYEE
VALID PK_AU_DEPARTMENT AU_DEPARTMENT
VALID PK_AU_CONNECTRULE AU_CONNECTRULE
VALID PK_AU_COMPANY AU_COMPANY
VALID PK_AU_AUTHORIZE_LOG AU_AUTHORIZE_LOG
VALID PK_AU_AUTHORIZE AU_AUTHORIZE
VALID PK_AU_APPENDDATA AU_APPENDDATA
VALID CONTACTLIST_IND1 CONTACTLIST
VALID CONTACTLIST_IND2 CONTACTLIST
VALID GRPPARTY_RELATION_IND1 GRP_PARTY_RELATION
VALID GRPPARTY_RELATION_IND2 GRP_PARTY_RELATION
VALID IDX_PSN_CUSTOMER_UPD_NEW1 PSN_CUSTOMER_UPD
VALID IDX_PSN_CUSTOMER_UPD_NEW2 PSN_CUSTOMER_UPD
VALID IDX_GRPPERSON_INFO GRP_PERSON
VALID IDX_GRPPERSON_PARTYID GRP_PERSON
VALID IDX_GUIBING_CHECK_NO GUIBING_CHECK_1021_2
VALID GUIBINGTEST_IND1 GUIBINGTEST
VALID SYS_IL0001860089C00006$$ EMP_JOB
VALID PK_EMP_JOB EMP_JOB
VALID EMP_ID_UNIQUE EMP_INFO
VALID PK_INFO EMP_INFO
VALID PK_EDUCATION EMP_EDUCATION
VALID DUBIOUSRELATION_INDEX_PCBSC DUBIOUSRELATION
VALID DUBIOUSRELATION_INDEX DUBIOUSRELATION
VALID PK_DB_USERINFO DB_USERINFO
VALID IDX_UNIQUE_BUILD_ROOM DB_ROOM
VALID PK_DB_ROOM DB_ROOM
VALID PK_DB_ORDER DB_ORDER
VALID PK_DB_ITEM DB_ITEM
VALID PK_DB_DISCOUNT DB_DISCOUNT
VALID PK_DB_BUILD DB_BUILD
VALID PK_DB_BOOK DB_BOOK
VALID PK_DB_ACCOUNT DB_ACCOUNT
VALID IDXTMPSTDCONTRACTINCR000002 TMP_STD_CONTRACT_INCR_000002
VALID IND_OPEN_ID CMDS_TS
VALID MERGTOAUDIT_INDEX MERGTOAUDIT
VALID SYS_C0015300 MERGE_VERIFY_QUERY
VALID SYS_C0015302 MERGE_VERIFY
VALID SYS_C0015304 MERGE_RESULT_QUERY
VALID SYS_C0015306 MERGED_MESSAGE
VALID SYS_C0015271 MANUALSPLITSINGLE
VALID SYS_C0015281 MANUALSPLITRESULTSINGLE
VALID PK_MANUALSPLITRESULTLIST MANUALSPLITRESULTLIST
VALID SYS_C0015276 MANUALSPLITCHECKSINGLE
VALID PK_MANUALSPLITCHECKLIST MANUALSPLITCHECKLIST
VALID PK_MANUALMERGERESULTLIST MANUALMERGERESULTLIST
VALID SYS_C0023002 LISTTYPE
VALID SYS_C0022997 LISTORDER
VALID SYS_C0022998 LISTORDER
VALID SYS_C0022995 LISTGROUP
VALID PK_TASTFO IPSNCUSTOMER
VALID IDX_X_FANSINFO_1214 X_FANSINFO_1214
VALID IDX_X_FANSINFO X_FANSINFO_1207
VALID PK_WSPARAM WSPARAM
VALID PK_VERSIONINFO VERSIONINFO
VALID PK_PURVIEWINFO_1 PURVIEWINFOERR
VALID PK_PURVIEWINFO PURVIEWINFO
VALID IDX_ZB_2 TEMP_PSN_CUSTOMER_REP_3
VALID IDX_TEMP_PSN_CUSTOMER_REP_3 TEMP_PSN_CUSTOMER_REP_3
VALID IDX_ZB_032001 TEMP_PSN_CUSTOMER_REP_3
VALID IDX_ZB_1 TEMP_PSN_CNTR_HOLDER_REP_3
VALID PK_REGISTERINFO REGISTERINFO
VALID INDEX_REGISTERINFO_PARTYID REGISTERINFO
VALID SYS_C0022991 BLACKORWHITE
VALID SYS_C0022988 BLACKLIST
VALID PK_BINDPOLOPTION BINDPOLOPTION
VALID IDX_BINDPOLINFO_PARTYID BINDPOLINFO
VALID IDX_BINDPOLINFO_CNTRNO BINDPOLINFO
VALID PK_FACTORY FACTORY
VALID IDX_ZB_031802 TEMP_PERSON_REP_3
VALID IDX_ZB_031904 TEMP_PERSON_REP_21
VALID IDX_ZB_31801 TEMP_INSURED_REP_3
VALID PK_ORDERS ORDERS
VALID PK_ORDERCONTENT ORDERCONTENT
VALID IND_OPENIDPUTINFOBYCCS OPENIDPUTINFOBYCCS
VALID OPENIDINFO_IND1 OPENIDINFO
VALID OPENIDINFO_IND2 OPENIDINFO
VALID INDEX_NEW_CLERK_CODE NEW_CLERK_CODE
VALID IDX_INSURED_UPD_1 INSURED_UPD
VALID IDX_INSURED_UPD_2 INSURED_UPD
VALID INSURED_TMP_STATS_BAK INSURED_TMP_STATS_BAK
VALID SYS_IL0007431970C00026$$ INSURED_TMP_STATS_BAK
VALID TMP_IDX1_JSAPPLNO T_APPL_NO_JS
VALID INDEX_APPL_INSURED APPL_INSURED
VALID INDEX_APPL_INSURED_CUSTNO APPL_INSURED
VALID PK_APPL_STATE APPL_STATE
VALID INDEX_APPL_STATE APPL_STATE
VALID INDEX_APPL_STATE_CNTRNO APPL_STATE
VALID INDEX_INSUR_APPL INSUR_APPL
VALID INDEX_INSUR_APPL_APPLNO INSUR_APPL
VALID INDEX_INSUR_APPL_CUSTNO INSUR_APPL
VALID IDX_INSURED_NO INSURED
VALID IDX_INSURED INSURED
VALID IDX_IDAUTHENTICATION_IDNO IDAUTHENTICATION
VALID IDX_IDAUTHENTICATION_REID IDAUTHENTICATION
VALID IDX_PERSON_YS PERSON_E
VALID IDX_PERSON_NAME PERSON_E
VALID IDX_PERSON_PARTYID PERSON_E
VALID IDX_PERSON_YS_1 PERSON
VALID PERSON_IND1 PERSON
VALID PK_PASSWORDSTAT_1 PASSWORDSTATERR
VALID PK_PASSWORDSTAT PASSWORDSTAT
VALID PK_PASSWORDINFO_TEMP_1126 PASSWORDINFO_TEMP_20141126
VALID PK_PASSWORDINFO_TEMP PASSWORDINFO_TEMP
VALID PK_PASSWORDINFO_1 PASSWORDINFOERR
VALID PK_PASSWORDINFO PASSWORDINFO
VALID PK_APPL_BNFR APPL_BNFR
VALID INDEX_APPL_BNFR APPL_BNFR
VALID PK_ALL_DBLINK_INCR ALL_DBLINK_INCR
VALID PK_ALL_DBLINK ALL_DBLINK
VALID PK_AGENT AGENT
VALID PK_ADDRCITIZENINFO ADDRCITIZENINFO
VALID SYS_IL0008889750C00036$$ PLAN_TABLE
VALID PK_AASTFOA CUSTDETAIL
VALID IDX_CUSTOMINFO_CNTR_ID CUSTOMINFO_E_SINGLE_CNTR
VALID SYS_C0015298 CUSTOMER_MERGE_QUERY
VALID PK_CUSTOMERINFO CUSTOMERINFO
VALID PK_CUSTOMERHISINFO CUSTOMERHISINFO
VALID IDX_PSN_CUST_5YS2 PSN_CUSTOMER
VALID IDX_PSN_CUST_CUSTID PSN_CUSTOMER
VALID PSN_CUSTOMER_IDX1 PSN_CUSTOMER
VALID IDX_PSN_CUST_UPDDATE PSN_CUSTOMER
VALID TMP_IDX_CONTACTTEXT TEMP_CONTACT_LIST_DUBIOUS
VALID TMP_IDX_CUSTID TEMP_CONTACT_LIST_DUBIOUS
VALID IDX_GRPINFO_UPDDATE GRPINFO
VALID CY_SCH_BRANCH_PK CY_SCH_BRANCH
VALID CY_SCHTASK_ITEM_LOG_IDX4_OLD CY_SCHTASK_ITEM_LOG_20170802
VALID CY_SCHTASK_ITEM_LOG_IDX3 CY_SCHTASK_ITEM_LOG
VALID CY_SCHTASK_ITEM_LOG_IDX4 CY_SCHTASK_ITEM_LOG
VALID CY_SCHTASK_ITEM_LOG_IDX1 CY_SCHTASK_ITEM_LOG
VALID CY_SCHTASK_ITEM_LOG_IDX2 CY_SCHTASK_ITEM_LOG
VALID CY_SCHPLAN_TASK_RUNTIME_K0 CY_SCHPLAN_TASK_RUNTIME
VALID PK_CY_SCHPLAN_TASK_BRANCH CY_SCHPLAN_TASK_BRANCH
VALID PK_CITIZENSIMPLEINFO CITIZENSIMPLEINFO
VALID PK_CITIZENINFO CITIZENINFO
VALID IDX_CHECK_UPD_NEW1_BAK CHECK_UPD_BAK
VALID IDX_WECHAT_OPENID_1214 T_WECHAT_REGIST_1214
VALID IDX_WECHAT_OPENID T_WECHAT_REGIST_1208
VALID IDX_WECHAT_REGID T_WECHAT_REGIST_1208
VALID IDX_CONTACT_COMB CONTACT_COMB
VALID GRP_CUSTOMER_HIS_IDX1 GRP_CUSTOMER_HISTROY
VALID GRP_CUSTOMER_HIS_IDX2 GRP_CUSTOMER_HISTROY
VALID PK_GRP_CUSTOMER_EXCEP GRP_CUSTOMER_EXCEP
VALID GRP_CUSTOMER_EXCEP_IDX1 GRP_CUSTOMER_EXCEP
VALID TMP_IDX_STD_CONTACT_CNTRID TEMP_STD_CONTRACT_DUBIOUS
VALID TMP_IDX_STD_CONTACT_CNTRNO TEMP_STD_CONTRACT_DUBIOUS
VALID POL_ATTRIB_CBPS_CODE POL_ATTRIB
VALID TEST1 POL_ATTRIB
VALID GRP_CUSTOMER_IDX1 GRP_CUSTOMER
VALID PK_GRP_CUSTOMER GRP_CUSTOMER
VALID GRP_CUSTOMER_IDX2 GRP_CUSTOMER
VALID TEST2 BRANCH_DEF
VALID SYS_C0022986 RETURNMESSAGE
VALID PK_REMOTESERVICE REMOTESERVICE
VALID GRP_CNTR_HLDR_IDX1 GRP_CNTR_HLDR
VALID GRP_CNTR_HLDR_IDX2 GRP_CNTR_HLDR
VALID IDX_STD_CONTRACT_INFORCE STD_CONTRACT
VALID IDX_STD_CONTACT_CNTRNO STD_CONTRACT
VALID IDX_STD_CONTACT_CNTRID STD_CONTRACT
VALID IDX_STD_CONTACT_APPLNO STD_CONTRACT
VALID IDX_STD_SGID STD_CONTRACT
VALID STAT_TABLE STAT_TABLE
VALID SYS_IL0011725993C00026$$ STAT_TABLE
VALID STAT_INSURED_20151113 STAT_INSURED_20151113
VALID SYS_IL0013384187C00026$$ STAT_INSURED_20151113
VALID STAT_INSURED_20151023 STAT_INSURED_20151023
VALID SYS_IL0013055796C00026$$ STAT_INSURED_20151023
VALID INDEX_SPLITTOAUDIT_PC SPLITTOAUDIT
VALID INDEX_SPLITTOAUDIT_P SPLITTOAUDIT
VALID INDEX_SPLITTOAUDIT_FP SPLITTOAUDIT
VALID PK_SESSIONINFO SESSIONINFO
VALID PK_SERVICEENGINE_SERVER SERVICEENGINE_SERVER
VALID PK_SERVICEENGINE_CLIENT SERVICEENGINE_CLIENT
VALID PK_SERVICEENGINE SERVICEENGINE
VALID PK_RM_DICTIONA2 RM_DICTIONARYTYPE
VALID IDXU_TYPEKEYWORD RM_DICTIONARYTYPE
VALID PK_RM_DICTIONAR RM_DICTIONARY
VALID IDXU_TYPE_KEY RM_DICTIONARY
VALID I_T_PSN_CUSTOMER_V8_610000 T_PSN_CUSTOMER_V8_610000
VALID INDEX_T_CUST_INFO_1512 T_CUST_INFO_1512
VALID IDX_PARTY_REL_PARTYID PARTY_RELATION_E
N/A PARTY_RELATION_IND_MAP PARTY_RELATION_E
VALID PARTY_RELATION_IND2 PARTY_RELATION
VALID PARTY_RELATION_IND1 PARTY_RELATION
VALID IDX_POLINFO_CNTRID POLINFO
VALID IDX_POLINFO_UPDDATE POLINFO
VALID IDX_POLINFO_CGID POLINFO
VALID PK_TASKTRACE TASKTRACE
VALID PK_TASKSTAT TASKSTAT
VALID PK_TASKINFO TASKINFO
VALID PK_PHONEINFO PHONEINFO
VALID IDX_CONTACTTEXT CONTACT_LIST
VALID IDX_CUSTID CONTACT_LIST
N/A IDX_CONTACTLIST_CUSTID CONTACT_LIST
VALID INDEX_PARTYRELATION2_PC PARTYRELATION2
VALID PSN_CUSTOMER_HIS_IDX1 PSN_CUSTOMER_HISTROY
VALID PSN_CUSTOMER_HIS_IDX2 PSN_CUSTOMER_HISTROY
VALID IDX_ZB_031901 PSN_CUSTOMER_DELETED
VALID IDX_PSN_CUSTOMER_DEL_IDX1 PSN_CUSTOMER_DEL
VALID IDX_PSN_CUSTOMER_DEL_IDX2 PSN_CUSTOMER_DEL
VALID IDX_PSN_CNTR_CNTRID PSN_CNTR_HOLDER
VALID IDX_PSN_CNTR_HOLDERNO PSN_CNTR_HOLDER
VALID PK_CNTRHOLDERINFO CNTRHOLDERINFO
VALID PK_PRODUCT PRODUCT
VALID PK_CANCELCITIZENINFO CANCELCITIZENINFO
VALID AA COMBINED_CNTR
VALID COMBINED_CNTR_IDX1 COMBINED_CNTR
VALID COMBINED_CNTR_IDX2 COMBINED_CNTR
VALID CODEMANAGE_CODECODE CODEMANAGE
VALID CNTR_CGID_IDX2 CNTR_CG_ID
N/A CNTR_ID_IDX1 CNTR_CG_ID
查看归并耗时的sql脚本:
SELECT round(ROUND(TO_NUMBER(to_date(aaaa.run_endtime, 'yyyy-mm-dd hh24:mi:ss') - to_date(aaaa.run_begintime, 'yyyy-mm-dd hh24:mi:ss')) * 24 * 60 * 60) / 60, 2),
aaaa.run_begintime,
aaaa.run_endtime,
aaaa.wsid,
bbbb.wsname
FROM cmds.cy_schplan_log aaaa,
cmds.cy_schplan bbbb
WHERE to_date(aaaa.run_begintime, 'yyyy-mm-dd hh24:mi:ss') >= to_date('2017-02-21 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
AND bbbb.wsid = aaaa.wsid
AND aaaa.wsid IN ('WS00000865')
ORDER BY aaaa.run_begintime ASC;
查看中间库27.3的抽取情况
查看索引情况
STATUS INDEX_NAME TABLE_NAME OWNER
-------- ------------------------------ ------------------------------ ------------------------------
N/A IDX_V8_CONTACT_LST_FLAG CONTACT_LST INCRCBPS8
N/A INX2 CONTACT_CLSLIST_TEST INCRCBPS8
N/A IDX_V8_CONTACT_CLSLIST_FLAG CONTACT_CLSLIST INCRCBPS8
N/A IDX_CONTACT_CLSLIST CONTACT_CLSLIST INCRCBPS8
N/A IDX_STD_CONTRACT STD_CONTRACT INCRCBPS8
N/A IDX_V8_STD_CONTRACT_FLAG STD_CONTRACT INCRCBPS8
N/A INDEX_GRP_CUSTOMER_COUNT_SEQ GRP_CUSTOMER INCRCBPS8
N/A INDEX_GRP_CUSTOMER_FLAG GRP_CUSTOMER INCRCBPS8
N/A IDX_V8_INSURED_FLAG INSURED INCRCBPS8
N/A INDEX_HAVE_FLAG_APPL_STATE APPL_STATE INCRCBPS8
N/A INDEX_HAVE_FLAG_APPL_INSURED APPL_INSURED INCRCBPS8
N/A IDX_V8_BENEFICIARY_FLAG BENEFICIARY INCRCBPS8
N/A IDX_V8_PSN_CUSTOMER_FLAG PSN_CUSTOMER INCRCBPS8
N/A IDX_BRANCH_TRANS PSN_CNTR_HOLDER INCRCBPS8
N/A IDX_V8_PSN_CNTR_HOLDER_FLAG PSN_CNTR_HOLDER INCRCBPS8
N/A INDEX_HAVE_FLAG_INSUR_APPL INSUR_APPL INCRCBPS8
N/A IDX_V8_CUSTOMER_FLAG CUSTOMER INCRCBPS8
N/A IDX_V8_SVR_GROUP_FLAG SVR_GROUP INCRCBPS8
N/A INDEX_HAVE_FLAG_APPL_BNFR APPL_BENEFICIARY INCRCBPS8
N/A IDX_PSN_CNTR_HLDR PSN_CNTR_HLDR INCRSLBPS
N/A IDX_STD_CONTRACT STD_CONTRACT INCRSLBPS
N/A IDX_PSN_CUSTOMER PSN_CUSTOMER INCRSLBPS
N/A IDX_CONTACT_CLSLIST CONTACT_CLSLIST INCRSLBPS
N/A IDX_CUSTOMER CUSTOMER INCRSLBPS
N/A IDX_CG_INSURED CG_INSURED INCRSLBPS
N/A IDX_T1PRD T1PRD INCRUBPS
N/A IDX_T1APL T1APL INCRUBPS
N/A IDX_T1BNF T1BNF INCRUBPS
N/A IDX_T1RECVACCT T1RECVACCT INCRUBPS
N/A IDX_T1PLCBASE T1PLCBASE INCRUBPS
N/A IDX_T1ISD T1ISD INCRUBPS
N/A IDX_T4CUSTBASE T4CUSTBASE INCRUBPS
N/A IDX_T_PLCAPL T_PLCAPL INCRGAPS
N/A IDX_T_CUSTOMER T_CUSTOMER INCRGAPS
N/A IDX_T_SUBPLCISD T_SUBPLCISD INCRGAPS
N/A IDX_T_SUBPLCBANK T_SUBPLCBANK INCRGAPS
N/A IDX_T_PLCBASE T_PLCBASE INCRGAPS
N/A IDX_T_SUBPLCBNF T_SUBPLCBNF INCRGAPS
N/A IDX_T_SUBPLCBASE T_SUBPLCBASE INCRGAPS
N/A IDX_T_CUSTOMER T_CUSTOMER INCRTKPS
N/A IDX_T_SUBPLCISD T_SUBPLCISD INCRTKPS
N/A IDX_T_PLCBASE T_PLCBASE INCRTKPS
N/A IDX_T_PLCAPL T_PLCAPL INCRTKPS
N/A IDX_T_SUBPLCBNF T_SUBPLCBNF INCRTKPS
N/A IDX_T_SUBPLCBASE T_SUBPLCBASE INCRTKPS
N/A IDX_T_SUBPLCBANK T_SUBPLCBANK INCRTKPS
46 rows selected.
下面是短险的一些分区表索引情况
SQL> select status,index_name from user_ind_partitions;
STATUS INDEX_NAME
-------- ------------------------------
USABLE IDX_STD_CONTRACT
USABLE IDX_STD_CONTRACT
USABLE IDX_STD_CONTRACT
USABLE IDX_PSN_CUSTOMER
USABLE IDX_PSN_CUSTOMER
USABLE IDX_PSN_CUSTOMER
USABLE IDX_PSN_CNTR_HLDR
USABLE IDX_PSN_CNTR_HLDR
USABLE IDX_PSN_CNTR_HLDR
USABLE IDX_CUSTOMER
USABLE IDX_CUSTOMER
USABLE IDX_CUSTOMER
USABLE IDX_CONTACT_CLSLIST
USABLE IDX_CONTACT_CLSLIST
USABLE IDX_CONTACT_CLSLIST
USABLE IDX_CG_INSURED
USABLE IDX_CG_INSURED
USABLE IDX_CG_INSURED
下面是8版的:
SQL> select status,index_name from user_ind_subpartitions;
STATUS INDEX_NAME
-------- ------------------------------
USABLE INX2
USABLE INX2
USABLE INX2
USABLE INX2
USABLE INX2
USABLE INX2
USABLE IDX_V8_BENEFICIARY_FLAG
USABLE IDX_V8_BENEFICIARY_FLAG
USABLE IDX_V8_BENEFICIARY_FLAG
从结果上,分区表和非分区表上面的索引状态都是正常的。
继续查看目的端库的情况
awr报告,增加了sql的数量
第一节点取了前100个,第二节点取了前50个,都没有看到p_cust_merg_incr_new_n相关的存储过程
其中于到sql语句数量有关的参数是top_n_sql、top_n_sql_max、top_sql_pct,如果我们要在生成的AWR报告里包含50条语句,那么可以先执行
exec DBMS_WORKLOAD_REPOSITORY.AWR_SET_REPORT_THRESHOLDS(top_n_sql=>100),然后再使用@?/rdbms/admin/awrrpt生成报告,如此报告里便能看到top 50的SQL了,记住DBMS_WORKLOAD_REPOSITORY.AWR_SET_REPORT_THRESHOLDS的执行结果仅在session级别生效。
2017/2/23 星期四 10:40:44
今天检查中间库的抽取情况,将awr报告sql数量调到100个
在耗时的排行里面,看到主要sql如下:
第一个sql
SELECT ROWID, "CUST_ID",
"CONTACT_SEQ",
"CONTACT_TYPE",
"PRIM_CONTACT_WAY",
"FROM_BRANCH",
"COMMIT_CSN",
"OP_SEQ",
"LAST_OP_FLAG",
"HAVE_FLAG"
FROM "CONTACT_LST" "B"
WHERE "HAVE_FLAG"='0'
AND "FROM_BRANCH"='120000'
第二个sql
SELECT "CNTR_ID",
"BANK_CODE",
"BANK_ACC_NO",
"ACC_CUST_NAME",
"FROM_BRANCH",
"COMMIT_CSN",
"OP_SEQ",
"LAST_OP_FLAG",
"ORA_ROWSCN"
FROM "STD_CONTRACT" "B"
WHERE "FROM_BRANCH"='440000'
AND "ORA_ROWSCN">=14582484242296
AND "ORA_ROWSCN"<=14582485963333
通过sql id确认第一个sql的执行者是incrslbps,并且经过查询发现
SQL> select index_name from user_indexes where table_name ='CONTACT_LST';
no rows selected
下面梳理短险用户下面所有表的索引情况:
SQL> select a.index_name,b.table_name,a.status from user_indexes a,user_tables b where a.table_name=b.table_name order by b.table_name;
INDEX_NAME TABLE_NAME STATUS
------------------------------ ------------------------------ --------
INDEX_HAVE_FLAG_APPL_BNFR APPL_BENEFICIARY VALID
INDEX_HAVE_FLAG_APPL_INSURED APPL_INSURED VALID
INDEX_HAVE_FLAG_APPL_STATE APPL_STATE VALID
IDX_CG_INSURED CG_INSURED N/A
IDX_CONTACT_CLSLIST CONTACT_CLSLIST N/A
IDX_CUSTOMER CUSTOMER N/A
INDEX_HAVE_FLAG_INSUR_APPL INSUR_APPL VALID
IDX_PSN_CNTR_HLDR PSN_CNTR_HLDR N/A
IDX_PSN_CUSTOMER PSN_CUSTOMER N/A
STD_CONTRACT_IND1 STD_CONTRACT VALID
IDX_STD_CONTRACT STD_CONTRACT N/A
create index CONTACT_LST_IND1 on CONTACT_LST(HAVE_FLAG,FROM_BRANCH) tablespace CMDSEXIDXTBS parallel 32; alter index CONTACT_LST_IND1 noparallel;
SQL> select index_name from user_indexes where table_name ='CONTACT_LST';
INDEX_NAME
------------------------------
CONTACT_LST_IND1
给CONTACT_LST表添加索引,完成之后的执行计划对比
---------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
---------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 8 | 576 | 32441 (3)| 00:06:30 | | |
| 1 | PARTITION RANGE ALL| | 8 | 576 | 32441 (3)| 00:06:30 | 1 |1048575|
|* 2 | TABLE ACCESS FULL | CONTACT_LST | 8 | 576 | 32441 (3)| 00:06:30 | 1 |1048575|
---------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
-----------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 8 | 576 | 5 (0)| 00:00:01 | | |
| 1 | TABLE ACCESS BY GLOBAL INDEX ROWID| CONTACT_LST | 8 | 576 | 5 (0)| 00:00:01 | ROWID | ROWID |
|* 2 | INDEX RANGE SCAN | CONTACT_LST_IND1 | 8 | | 4 (0)| 00:00:01 | | |
-----------------------------------------------------------------------------------------------------------------------
2017/2/24 星期五 20:42:09
今天对日志表进行了归档和重建,删除了不必要的索引
select sess.sid,
sess.serial#,
lo.oracle_username,
lo.os_user_name,
ao.object_name,
lo.locked_mode
from v$locked_object lo, dba_objects ao, v$session sess, v$process p
where ao.object_id = lo.object_id
and lo.session_id = sess.sid and ao.object_name like 'CY_SCHTASK%';
SELECT distinct(object_name)
,STATISTIC_NAME
,value
FROM v$segment_statistics
WHERE STATISTIC_NAME = 'row lock waits'
ORDER BY 1;
CREATE TABLE "CMDS"."CY_SCHTASK_ITEM_LOG"
( "TASKID" VARCHAR2(32),
"TASKNO" VARCHAR2(32),
"STARTDT" VARCHAR2(20),
"ELAPSEDSECS" NUMBER,
"EXSTATE" NUMBER,
"ERRMSG" VARCHAR2(1024),
"EXNO" VARCHAR2(64),
"EXSUBNO" VARCHAR2(64),
"WSID" VARCHAR2(32),
"BRANCHCODE" VARCHAR2(32)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "CUST"
ora ddl cmds index CY_SCHTASK_ITEM_LOG_IDX1
ora ddl cmds index CY_SCHTASK_ITEM_LOG_IDX2
ora ddl cmds index CY_SCHTASK_ITEM_LOG_IDX3
ora ddl cmds index CY_SCHTASK_ITEM_LOG_IDX4
CREATE INDEX "CMDS"."CY_SCHTASK_ITEM_LOG_IDX1" ON "CMDS"."CY_SCHTASK_ITEM_LOG"("TASKNO")
CREATE INDEX "CMDS"."CY_SCHTASK_ITEM_LOG_IDX2" ON "CMDS"."CY_SCHTASK_ITEM_LOG"("BRANCHCODE")
CREATE INDEX "CMDS"."CY_SCHTASK_ITEM_LOG_IDX3" ON "CMDS"."CY_SCHTASK_ITEM_LOG"("TASKID", "EXSTATE")
CREATE INDEX "CMDS"."CY_SCHTASK_ITEM_LOG_IDX4" ON "CMDS"."CY_SCHTASK_ITEM_LOG"("TASKID", "TASKNO", "EXNO", "EXSUBNO");
explain plan for
UPDATE cy_schtask_item_log
SET taskid = 'TA00000321'
,taskno = '141'
,exno = 'SH17337715'
,exsubno = '170223162239632.009160.0001.000000'
,wsid = 'WS00002062'
,exstate = '1'
,elapsedsecs = '0.89'
WHERE taskid = 'TA00000321'
AND taskno = '141'
AND exno = 'SH17337715'
AND exsubno = '170223162239632.009160.0001.000000';
select * from table(dbms_xplan.display);
create index "CMDS"."CY_SCHTASK_ITEM_LOG_IDX5" ON "CMDS"."CY_SCHTASK_ITEM_LOG"("EXSUBNO") parallel 32;
alter index CY_SCHTASK_ITEM_LOG_IDX5 noparallel;