Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Db2 full library integrity check and gadget record

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Db2 "SELECT substr (TABNAME,1,30) as TAB_NAME, STATUS, ACCESS_MODE, substr (CONST_CHECKED,1,1) as FK_CHECKED

Substr (CONST_CHECKED,2,1) as CC_CHECKED

FROM SYSCAT.TABLES WHERE STATUS ='C' "

If there is a result in the echo, there is a table that did not complete the integrity check. It is usually caused by a LOAD operation.

At this time, you can complete the automatic check with a gadget:

SetIdentify.sh

Db2 connect to $1

Db2-tx + w "with gen (tabname, seq) as (select rtrim (tabschema) | |'. | | rtrim (tabname)

As tabname, row_number () over (partition by status) as seq

From syscat.tables

WHERE status='C'), r (a, seq1) as (select CAST (tabname as VARCHAR (3900)), seq

From gen where seq=1 union all select r.a | |','| | rtrim (gen.tabname), gen.seq

From gen, r where (r.seq1+1) = gen.seq), R1 as (select a, seq1 from r)

Select 'SET INTEGRITY FOR' | | a | | 'IMMEDIATE CHECKED;' from R1

Where seq1= (select max (seq1) from R1) "> db2FixCheckPending.sql

Db2-tvf db2FixCheckPending.sql

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report