从报错上看,是属于表空间3的,进一步查select TS#,NAME from v$tablespace; 3号表空间为temp。
然后进一步看ORA-03232的报错信息,查对应版本的error message:
1 2 3 4 5 6 |
8.1.7中: ORA-03232 unable to allocate an extent of string blocks from tablespace string Cause: An attempt was made to specify a HASH_MULTIBLOCK_IO_COUNT value that is greater than the tablespace's NEXT value. Action: Increase the value of NEXT for the tablespace using ALTER TABLESPACE DEFAULT STORAGE or decrease the value of HASH_MULTIBLOCK_IO_COUNT. |
从信息上看,又是处于temp表空间又是有hash_multiblock啥的,应该是在做hash join的时候,申请使用temp表空间,而temp表空间用完再进一步扩展的时候,单次IO的请求量超过了表空间next的属性的值。
而这个单次IO的请求量是有HASH_MULTIBLOCK_IO_COUNT决定的,我们继续来看这个值的意义。
我们继续看reference:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
HASH_MULTIBLOCK_IO_COUNT Parameter type: Integer Parameter class: Dynamic. Scope= ALTER SESSION, ALTER SYSTEM. Default value: Query dependent. Appears as 0 in V$PARAMETER. Range of values: Operating system dependent HASH_MULTIBLOCK_IO_COUNT specifies how many sequential blocks a hash join reads and writes in one I/O. The maximum value is operating system dependent. It is always less than the maximum I/O size of the operating system expressed as Oracle blocks (MAX_IO_SIZE / DB_BLOCK_SIZE). You need not set or change the value of this parameter, because Oracle computes the value individually for every query. If you let Oracle do the automatic computation, the value of the parameter appears as 0 in the V$PARAMETER dynamic performance view. Oracle Corporation does not recommend that you set or change the value of this parameter. If you must set it to investigate its effect on performance, make sure that the following formula remains true: R / M <= Po2(M/C) where: R = number of bytes in the smaller relation to be joined. The number of bytes is the product of the size of each column in the smaller relation times the number of rows in that relation. M = HASH_AREA_SIZE * 0.9 C = HASH_MULTIBLOCK_IO_COUNT * DB_BLOCK_SIZE Po2(n) = a function that returns the largest power of 2 that is smaller than its argument. Note: If you are using Oracle's multi-threaded server architecture, Oracle ignores any value you set for this parameter, and instead uses a value of 1. |
我们看看HASH_MULTIBLOCK_IO_COUNT的值和temp的next ext是多少:
我们看到,temp的next extend为131072,而HASH_MULTIBLOCK_IO_COUNT的值为0,根据reference的说法,当HASH_MULTIBLOCK_IO_COUNT的值为0时,在每次查询时,单次连续的IO请求块数由oracle自动计算生成。
为了让每次连续的IO请求(即HASH_MULTIBLOCK_IO_COUNT)小于temp的extend值,即小于131072,而不是又oracle来自动计算,我们将HASH_MULTIBLOCK_IO_COUNT设置为最小的1。
修改该参数后,应用恢复正常。
一条评论
该参数个人不建议设置为1,我这里没有8i的环境,无法测试,但是以目前我对hash join的理解,应该是会影响的,
而且影响程度不小,建议设置为next extend/DB_BLOCK_SIZE的数字看看