oracle11g添加删除字段 ddl_time_out

SQL> set timing on
SQL> alter table test add (name varchar(2));

Table altered.

Elapsed: 00:00:00.08
SQL> alter table test drop column name;

Table altered.

Elapsed: 00:00:03.42
SQL> insert into test select * from test;

1385280 rows created.

Elapsed: 00:00:55.21
SQL> commit;

Commit complete.

Elapsed: 00:00:00.04
SQL> alter table test add (name varchar(2));

Table altered.

Elapsed: 00:00:00.07
SQL> alter table test drop column name;

Table altered.

Elapsed: 00:00:16.29
添加not null的带默认值的也很快了,之前有写。有文章说存在未提交的事务的情况下,在别的会话中也能在线添加字段不受影响的,但是我机器上测试还是会阻塞
有关ddl_time_out的设置,这个之前看过,没有注意过应用场景,参考:
https://orainternals.wordpress.com/2009/01/08/lock-table-followed-by-ddl/

你可能感兴趣的:(oracle管理)