SQL> drop tablespace xdb including contents;
drop tablespace xdb including contents
*
ERROR at line 1:
ORA-29857: domain indexes and/or secondary objects exist in the tablespace
怎么找到相关的domain indexes or secondary objects 并删除呢??
谢谢!
SQL> select index_name from all_indexes where tablespace_name='XDB';
INDEX_NAME
------------------------------
XDB$H_INDEX_OID_I
XDB_PK_H_LINK
SYS_C001674
SYS_C001675
SYS_C001676
SYS_C001677
SYS_C001678
SYS_C001679
SYS_C001680
SYS_C001681
SYS_C001682
INDEX_NAMESYS_C001683
SYS_C001684
SYS_C001685
SYS_C001686
SYS_C001687
SYS_C001688
XDB$ELEMENT_PROPNUMBER
XDB$ELEMENT_PROPNAME
XDB$SCHEMA_URL
SYS_C001689
SYS_C001690
INDEX_NAME
------------------------------
XDB$NLOCKS_RAWTOKEN_IDX
XDB$NLOCKS_CHILD_NAME_IDX
XDB$NLOCKS_PARENT_OID_IDX
SYS_C001691
SYS_C001692
SYS_C001693
SYS_C001694
SYS_C001695
COKEY
XDB$CHECKOUTS_VCRUID_IDX
SQL> alter index sys_c001697 rebuild tablespace xdb;
alter index sys_c001697 rebuild tablespace xdb
*
ERROR at line 1:
ORA-01418: specified index does not exist
SQL> alter index XDB$ELEMENT_PROPNUMBER rebuild tablespace xdb;
alter index XDB$ELEMENT_PROPNUMBER rebuild tablespace xdb
*
ERROR at line 1:
ORA-01418: specified index does not exist
最初由 nmgzw 发布
[B]SQL> drop tablespace xdb including contents;
drop tablespace xdb including contents
*
ERROR at line 1:
ORA-29857: domain indexes and/or secondary objects exist in the tablespace
怎么找到相关的domain indexes or secondary objects 并删除呢??
谢谢! [/B]
这样呢?
DROP TABLESPACE xdbINCLUDING CONTENTS CASCADE CONSTRAINTS;
最初由 nmgzw 发布
[B]SQL> select index_name from all_indexes where tablespace_name='XDB';
INDEX_NAME
------------------------------
XDB$H_INDEX_OID_I
XDB_PK_H_LINK
SYS_C001674
SYS_C001675
SYS_C001676
SYS_C001677
SYS_C001678
SYS_C001679
SYS_C001680
SYS_C001681
SYS_C001682
INDEX_NAMESYS_C001683
SYS_C001684
SYS_C001685
SYS_C001686
SYS_C001687
SYS_C001688
XDB$ELEMENT_PROPNUMBER
XDB$ELEMENT_PROPNAME
XDB$SCHEMA_URL
SYS_C001689
SYS_C001690
INDEX_NAME
------------------------------
XDB$NLOCKS_RAWTOKEN_IDX
XDB$NLOCKS_CHILD_NAME_IDX
XDB$NLOCKS_PARENT_OID_IDX
SYS_C001691
SYS_C001692
SYS_C001693
SYS_C001694
SYS_C001695
COKEY
XDB$CHECKOUTS_VCRUID_IDX
SQL> alter index sys_c001697 rebuild tablespace xdb;
alter index sys_c001697 rebuild tablespace xdb
*
ERROR at line 1:
ORA-01418: specified index does not exist
SQL> alter index XDB$ELEMENT_PROPNUMBER rebuild tablespace xdb;
alter index XDB$ELEMENT_PROPNUMBER rebuild tablespace xdb
*
ERROR at line 1:
ORA-01418: specified index does not exist
是那儿错了呢?? [/B]
你用什么用户执行alter index XDB$ELEMENT_PROPNUMBER rebuild tablespace xdb;
?????
最好用sys或者具sysdba的用户执行,还有你后面的表空间就换成另外的吧,你现在要删除xdb,应指向另外的表空间!
sorry!
刚才我试了,重创索引要到自己相应的用户下或者在索引名前加上用户,所以
select OWNER,index_name from all_indexes where tablespace_name='XDB';
这里找到相应的owner
在 as sysdba 下
alter index( 这里加上相应的owner).XDB$ELEMENT_PROPNUMBER rebuild tablespace xdb;
你可以生成一个sql文件,然后批处理.
spool c:\tt.sql;
select 'alter index 'OWNER||'.'||index_name ||'retuild tablespace ??? ;' from all_indexes where tablespace_name='XDB';
spool off;
@c:\tt.sql