建表示建立了索引,用pl/sql developer建的
这是建立索引的sql语句
-- Create/Recreate indexes 
create unique index 时间 on FX0.CELL_A (TIME)
  tablespace SYSTEM
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );可是我查询索引信息时却没有该索引,在sqlplus中用
select * from user_indexes where table_name='FX0.CELL_A'
查询,显示'未选定行‘。大家帮帮忙!
索引sqloracle

解决方案 »

  1.   

    to magi1201:
       是啊,没找到索引,所以没数据。
    但关键是我建了索引啊
      

  2.   

    应该是这么查吧?FX0 是不是用户名哦。。select * from user_indexes where table_name='CELL_A'
      

  3.   

    to u010412956:
       呵呵,我好弱啊,确实是这样,不要加用户名。
       顺便问一下,这个用户名什么时候要加,什么时候不要加?
    我在查表时,都是在表名前加了用户名的,而上面查索引却又不要加
      

  4.   

    我怀疑你索引没有创建成功,
    SQL> create table zhangqi (id number, name varchar2(20));
     
    Table created
     
    SQL> create index idx_zhangqi_id_pk on zhangqi(id);
     
    Index created
     
    SQL> select * from user_indexes where table_name = 'ZHANGQI';这时会查询到结果,截图没传上来,你再建下索引,保证索引创建成功。
      

  5.   

    查表你可以select * from 用户名.表名,如果是当前用户登录你也可以直接select * from 表名;
    你查索引的table_name明显要的是表名,你加个用户名肯定不对
      

  6.   

    你说的很明白。
    在问个问题,我在分区表CELL上建了本地分区索引,如下
    -- Create/Recreate indexes 
    create index FX0.LOC_TIME on FX0.CELL (TIME)
      local;可是,我用
    select index_name,table_name,partitioning_type,locality,alignment from user_part_indexes where table_name='CELL'(这句sql正确吗)
    还是没有查到该索引。。
      

  7.   

    你说的很明白。
    在问个问题,我在分区表CELL上建了本地分区索引,如下
    -- Create/Recreate indexes 
    create index FX0.LOC_TIME on FX0.CELL (TIME)
      local;可是,我用
    select index_name,table_name,partitioning_type,locality,alignment from user_part_indexes where table_name='CELL'(这句sql正确吗)
    还是没有查到该索引。。
    CREATE INDEX dbobjs_idx ON dbobjs (created) LOCAL
     (PARTITION dbobjs_06 TABLESPACE users,
     PARTITION dbobjs_07 TABLESPACE users
     );你建到哪个分区了呀,另外可以用all_part_indexes来查是不是你用户不对