表上有事务,online 创建索引会等待?

表上有事务,创建索引:
[oracle@yyjk ~]$ sqlplus tlcbuser/tlcbuser

SQL*Plus: Release 11.2.0.4.0 Production on 星期三 8月 22 08:27:41 2018

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> set linesize 200
SQL> set pagesize 200
SQL> select * from v$mystat where rownum<2;

       SID STATISTIC#       VALUE
---------- ---------- ----------
       143        0           0

SQL> create table test_index as select owner,object_id,object_name,created from dba_objects;

Table created.

SQL> 

SQL>  insert into test_index values ('aa','11','aa',sysdate);

1 row created.

SQL> 



SQL> create index test_index_idx1 on test_index(object_id) online;


SQL> select * from v$mystat where rownum<2;

       SID STATISTIC#       VALUE
---------- ---------- ----------
    30        0           0

SQL> desc test_index
 Name                                                           Null?    Type
 ----------------------------------------------------------------------------------------------------------------- -------- ----------------------------------------------------------------------------
 OWNER                                                                VARCHAR2(30)
 OBJECT_ID                                                            NUMBER
 OBJECT_NAME                                                            VARCHAR2(128)
 CREATED    

       SESSION_ID    SQL_ID    MACHINE    BLOCKING_SESSION    SAMPLE_TIME    MODULE    PROGRAM    EVENT    SQL_TEXT    SQL_FULLTEXT
1    30    31w9z6bn4gq6r    yyjk    143    22-8月 -18 08.48.19.084 上午    SQL*Plus    sqlplus@yyjk (TNS V1-V3)    enq: TX - row lock contention    create index test_index_idx1 on test_index(object_id) online    <CLOB>
2    30    31w9z6bn4gq6r    yyjk    143    22-8月 -18 08.48.18.084 上午    SQL*Plus    sqlplus@yyjk (TNS V1-V3)    enq: TX - row lock contention    create index test_index_idx1 on test_index(object_id) online    <CLOB>
3    30    31w9z6bn4gq6r    yyjk    143    22-8月 -18 08.48.17.084 上午    SQL*Plus    sqlplus@yyjk (TNS V1-V3)    enq: TX - row lock contention    create index test_index_idx1 on test_index(object_id) online    <CLOB>
4    30    31w9z6bn4gq6r    yyjk    143    22-8月 -18 08.48.16.084 上午    SQL*Plus    sqlplus@yyjk (TNS V1-V3)    enq: TX - row lock contention    create index test_index_idx1 on test_index(object_id) online    <CLOB>
5    30    31w9z6bn4gq6r    yyjk    143    22-8月 -18 08.48.15.084 上午    SQL*Plus    sqlplus@yyjk (TNS V1-V3)    enq: TX - row lock contention    create index test_index_idx1 on test_index(object_id) online    <CLOB>
6    30    31w9z6bn4gq6r    yyjk    143    22-8月 -18 08.48.14.084 上午    SQL*Plus    sqlplus@yyjk (TNS V1-V3)    enq: TX - row lock contention    create index test_index_idx1 on test_index(object_id) online    <CLOB>

猜你喜欢

转载自blog.csdn.net/zhaoyangjian724/article/details/81937621