天天看點

Oracle 10g New Feature:MAXTRANS參數已經廢棄

作者: eygle | English Version 【轉載時請以超連結形式标明文章 出處和作者資訊及 本聲明】

連結: http://www.eygle.com/archives/2006/06/maxtrans_is_deprecated.html

此前寫過兩篇文章,介紹ITL競争的模拟,有朋友在留言版上留言無法模拟,經過詢問,得知在Oracle10g上無法再現我的試驗結果.

首先猜測是Oracle10g的處理方式不同,我決定動手來驗證一下,首先在Oracle9i中,建立一個測試表,設定MAXTRANS參數,結果如下:

SQL> connect eygle/eygle

Connected.

SQL> CREATE TABLE EYGLE_ITL

2 (C1 NUMBER,

3 C2 VARCHAR2(10)

4 )

5 INITRANS 1 MAXTRANS 1

6 /

Table created.

SQL> select table_name,INI_TRANS,MAX_TRANS from user_tables where table_name='EYGLE_ITL';

TABLE_NAME INI_TRANS MAX_TRANS

------------------------------ ---------- ----------

EYGLE_ITL 1 1

而在Oracle10g中,我們注意到MAXTRANS參數的設定已經無效:

[[email protected] ~]$ sqlplus eygle/eygle

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 26 11:59:20 2006

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options

SQL> CREATE TABLE EYGLE_ITL

2 (C1 NUMBER,

3 C2 VARCHAR2(10)

4 )

5 INITRANS 1 MAXTRANS 1

6 /

Table created.

SQL> select table_name,INI_TRANS,MAX_TRANS from user_tables where table_name='EYGLE_ITL';

TABLE_NAME INI_TRANS MAX_TRANS

------------------------------ ---------- ----------

EYGLE_ITL 1 255

我們注意到,不管如何設定,最終的MAX_TRANS都是255。

查閱Oracle手冊得到如下說明:

Note:In earlier releases of Oracle Database, the MAXTRANS parameter limited the number of transaction entries that could concurrently use data in a data block. This parameter has been deprecated.

Oracle Database now automatically allows up to 255 concurrent update transactions for any data block, depending on the available space in the block.

The database ignores MAXTRANS when specified by users only for new objects created when the COMPATIBLE initialization parameter is set to 10.0 or greater.

也就是說在Oracle10g中,對于單個資料塊,Oracle預設最大支援255個并發,MAXTRANS參數被廢棄。

這就是網友在10g上無法模拟我的結果的原因。

總結一下:當我們想要找到一個答案時,步驟可能很簡單,隻需要動手,思考。懶惰是要不得的,要知道天道酬勤。