DB2 NPAGES FPAGES REORGCHK 区别解释

NPAGES :Total number of pages on which the rows of the table exist; -1 for a view or alias, or if statistics are not collected; -2 for a subtable or hierarchy table.

FPAGES :Total number of pages; -1 for a view or alias, or if statistics are not collected; -2 for a subtable or hierarchy table.

CARD:Total number of rows in the table; -1 if statistics are not collected.

npage 当前表有效数据占用页,fpage 当前表数据占用页,card 表中行数

举例(每行占用一页时):表占用6页,N=F=6 。删除两行后 N=4 F=6。以上三项可以在SYSCAT.TABLES表中查询到


REORGCHK:Calculates statistics on the database to determine if tables or indexes, or both, need to be reorganized or cleaned up.
计算数据库的表或者索引的统计信息,判断是否表或者索引或者两者都需要重组或者清理。


另外关于REORGCHK 中的REORG标志,还有NPAGES FPAGES的变化,引用一段ITPUB 中 askgyliu 的帖子内容(其中表数据初始化脚本有少许更改)

=============================================================================

总结内容::

reorgchk update statistics inplace notruncate 后 NPAGE 会减少 FPAGE不变

reorgchk update statistics不加参数情况下两者都会更新

(****inplace:: 联机reorg标志)


=============================================================================

db2 -v "create table mytab (f1 integer not null, f2 char(100) not null)"
create table mytab (f1 integer not null, f2 char(100) not null)
DB20000I  The SQL command completed successfully.

cat run

db2 connect to mydb
idx=1
while [ $idx -le 10000 ]
do
        #db2  "insert into mytab values($idx,'$idx')"
        echo "$idx,\"$idx\"" >> imp
        let idx="$idx+1"
        if [ $[$idx%1000] -eq 0 ]
        then
                echo $idx
        fi
done

  db2 -v "import from imp of del insert into mytab"

db2 -v "runstats on table db2inst.mytab "

db2 -v "select npages, fpages, stats_time from syscat.tables where tabname='MYTAB'"

select npages, fpages, stats_time from syscat.tables where tabname='MYTAB'

NPAGES      FPAGES      STATS_TIME
----------- ----------- --------------------------
        286         286 2007-10-12-13.22.17.665385


  1 record(s) selected.

db2 -v "reorgchk update statistics on table db2inst.mytab"
reorgchk update statistics on table db2inst.mytab

Doing RUNSTATS ....

Table statistics:

F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80

SCHEMA    NAME                  CARD    OV    NP    FP ACTBLK    TSIZE  F1  F2  F3 REORG
----------------------------------------------------------------------------------------
Table: DB2INST.MYTAB
DB2INST   MYTAB                10000     0   286   286      -  1140000   0  99 100 ---

db2 -v "delete from mytab where mod(f1,100) between 0 and 19"
delete from mytab where mod(f1,100) between 0 and 19
DB20000I  The SQL command completed successfully.

db2 -v "select count(*) from mytab"
select count(*) from mytab

1
-----------
       8000
  1 record(s) selected.

db2 -v "reorgchk update statistics on table db2inst.mytab"
reorgchk update statistics on table db2inst.mytab

Doing RUNSTATS ....

Table statistics:

F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80

SCHEMA    NAME                  CARD    OV    NP    FP ACTBLK    TSIZE  F1  F2  F3 REORG
----------------------------------------------------------------------------------------
Table: DB2INST.MYTAB
DB2INST   MYTAB                 8000     0   286   286      -   912000   0  79 100 ---

db2 -v "reorg table db2inst.mytab inplace allow write access notruncate table start"
reorg table db2inst.mytab inplace allow write access notruncate table start
DB20000I  The REORG command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.

/home/db2inst/Scripts > db2 -v "reorgchk update statistics on table db2inst.mytab"
reorgchk update statistics on table db2inst.mytab

Doing RUNSTATS ....

Table statistics:

F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80

SCHEMA    NAME                  CARD    OV    NP    FP ACTBLK    TSIZE  F1  F2  F3 REORG
----------------------------------------------------------------------------------------
Table: DB2INST.MYTAB
DB2INST   MYTAB                 8000     0   229   286      -   912000   0  79  80 --*

 db2 -v "delete from mytab where mod(f1,100) between 0 and 27"
delete from mytab where mod(f1,100) between 0 and 27
DB20000I  The SQL command completed successfully.

db2 -v "reorgchk update statistics on table db2inst.mytab"
reorgchk update statistics on table db2inst.mytab
Doing RUNSTATS ....

Table statistics:

F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80

SCHEMA    NAME                  CARD    OV    NP    FP ACTBLK    TSIZE  F1  F2  F3 REORG
----------------------------------------------------------------------------------------
Table: DB2INST.MYTAB
DB2INST   MYTAB                 7200     0   229   286      -   820800   0  71  80 --*

 db2 -v "reorgchk update statistics on table db2inst.mytab"

reorgchk update statistics on table db2inst.mytab

Doing RUNSTATS ....

Table statistics:

F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80

SCHEMA    NAME                  CARD    OV    NP    FP ACTBLK    TSIZE  F1  F2  F3 REORG
----------------------------------------------------------------------------------------
Table: DB2INST.MYTAB
DB2INST   MYTAB                 7000     0   229   286      -   798000   0  69  80 -**

db2 -v "reorg table db2inst.mytab inplace allow write access notruncate table start"
reorg table db2inst.mytab inplace allow write access notruncate table start
DB20000I  The REORG command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.

 db2 -v "reorgchk update statistics on table db2inst.mytab"
reorgchk update statistics on table db2inst.mytab

Doing RUNSTATS ....

Table statistics:

F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80

SCHEMA    NAME                  CARD    OV    NP    FP ACTBLK    TSIZE  F1  F2  F3 REORG
----------------------------------------------------------------------------------------
Table: DB2INST.MYTAB
DB2INST   MYTAB                 7000     0   201   286      -   798000   0  69  70 -**

db2 -v "reorg table db2inst.mytab inplace allow write access start"
reorg table db2inst.mytab inplace allow write access start
DB20000I  The REORG command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.

db2 -v "reorgchk update statistics on table db2inst.mytab"
reorgchk update statistics on table db2inst.mytab

Doing RUNSTATS ....

Table statistics:

F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80

SCHEMA    NAME                  CARD    OV    NP    FP ACTBLK    TSIZE  F1  F2  F3 REORG
----------------------------------------------------------------------------------------
Table: DB2INST.MYTAB
DB2INST   MYTAB                 7000     0   201   201      -   798000   0  99 100 ---

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这段代码是继续在之前的基础上进行攻击的部分。 代码首先定义了一些变量,包括`guf`、`ite`和`matches`。`guf`是一个用来猜测字体对象地址的变量,`ite`是一个标志变量,`matches`用于计数。 接下来,代码定义了一个循环,并在循环中执行以下操作: 首先,将一些指针转换为字符串,并将其保存在变量`p_s`中。这些指针包括一个常量`NPAGES + 2`,以及一个从数组`guf`中获取的一系列指针。 然后,使用循环调用`mkString`函数,创建了256个长度为`HASHMAP_BUCKET`的字符串,并传入之前生成的`p_s`作为参数。 接下来,代码创建了一个新的`FontFaceSet`对象,并将之前创建的恶意字体对象数组作为参数传入。 然后,代码使用`mkString`函数创建了一个名为`badstr1`的字符串,并传入长度为`HASHMAP_BUCKET`和之前生成的`p_s`作为参数。 接下来,代码定义了两个变量`guessed_font`和`guessed_addr`并初始化为null。 然后,通过循环遍历恶意字体对象数组,将每个字体对象的family属性设置为"search"加上当前循环轮次的值。如果截取到的`badstr1`与之前生成的`p_s`不相等,则表示成功猜测到了字体对象的地址。在这种情况下,代码会进一步解析字符串,找到具体的地址,并将`guessed_font`设置为当前字体对象的索引。然后,代码会遍历解析字符串,找到具体的地址。如果`matches`计数为0,则将`guf`更新为猜测地址加上2倍的页大小,并将`guessed_addr`设置为null。 接下来,代码通过更新`ite`变量来决定是否继续循环。如果`ite`为true,则将`guf`增加NPAGES乘以PAGE_SIZE,否则继续循环。 最后,在循环结束后,代码将一些指针转换为字符串,并将其保存在变量`p_s`中。这些指针包括一个常量26,以及之前猜测得到的字体对象地址和地址加上SIZEOF_CSS_FONT_FACE的值。然后,使用循环调用`mkString`函数,创建了256个长度为`HASHMAP_BUCKET`的字符串,并传入之前生成的`p_s`作为参数。 这段代码的目的是通过循环和字符串操作来猜测字体对象的地址,并构建特定的字符串。这些字符串将在后续的攻击中使用,以实现对浏览器的进一步攻击。具体的攻击方式可能包括利用内存错误漏洞进行越界访问、代码执行等。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值