一个表上有事务,直接创建索引?

表上有事务,创建索引:
[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> 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    

SQL> create index test_index_idx1 on test_index(object_id);
create index test_index_idx1 on test_index(object_id)
                                *
ERROR at line 1:
ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效


update呢?


SQL> update test_index set owner='CCC' where owner='aa';

1 row updated.




SQL>  create index test_index_idx1 on test_index(object_id);
 create index test_index_idx1 on test_index(object_id)
                                 *
ERROR at line 1:
ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效



delete呢?

SQL> delete from test_index  where owner='aa';

1 row deleted.

SQL> create index test_index_idx1 on test_index(object_id);
create index test_index_idx1 on test_index(object_id)
                                *
ERROR at line 1:
ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效

猜你喜欢

转载自blog.csdn.net/zhaoyangjian724/article/details/81937598
今日推荐