Grant ctxapp To zhimin;
Grant Execute On ctxsys.ctx_cls To zhimin;
Grant Execute On ctxsys.ctx_ddl To zhimin;
Grant Execute On ctxsys.ctx_doc To zhimin;
Grant Execute On ctxsys.ctx_output To zhimin;
Grant Execute On ctxsys.ctx_query To zhimin;
Grant Execute On ctxsys.ctx_report To zhimin;
Grant Execute On ctxsys.ctx_thes To zhimin;
Grant Execute On ctxsys.ctx_ulexer To zhimin;
    
ctx_ddl.create_preference('cn_lexer', 'chinese_vgran_lexer');
ctx_ddl.create_preference('cn_store', 'BASIC_STORAGE');
ctx_ddl.set_attribute('cn_store', 'I_TABLE_CLAUSE', 'tablespace index');
ctx_ddl.set_attribute('cn_store', 'I_NDEX_CLAUSE', 'tablespace index compress 2');============================================
zhimin 是我的用户名
前面的授权语句执行都成功了,但是后面的 ctx_ddl.create_preference 等语句都无法执行,说是“无效 SQL 语句”怎么回事?

解决方案 »

  1.   

    放到一个pdc文件里面
    begin
       ctx_ddl.create_preference('cn_lexer', 'chinese_vgran_lexer');
       ctx_ddl.create_preference('cn_store', 'BASIC_STORAGE');
       ctx_ddl.set_attribute('cn_store', 'I_TABLE_CLAUSE', 'tablespace index');
       ctx_ddl.set_attribute('cn_store', 'I_NDEX_CLAUSE', 'tablespace index compress 2');
    end;
    /
    执行试试
      

  2.   


    这些语句本来就是放在一个 sql 文件里的,我在 plsql developer 中以 sys 用户登录并执行的:begin
      Grant ctxapp To zhimin;
      Grant Execute On ctxsys.ctx_cls To zhimin;
      Grant Execute On ctxsys.ctx_ddl To zhimin;
      Grant Execute On ctxsys.ctx_doc To zhimin;
      Grant Execute On ctxsys.ctx_output To zhimin;
      Grant Execute On ctxsys.ctx_query To zhimin;
      Grant Execute On ctxsys.ctx_report To zhimin;
      Grant Execute On ctxsys.ctx_thes To zhimin;
      Grant Execute On ctxsys.ctx_ulexer To zhimin;
       
      ctx_ddl.create_preference('cn_lexer', 'chinese_vgran_lexer');
      ctx_ddl.create_preference('cn_store', 'BASIC_STORAGE');
      ctx_ddl.set_attribute('cn_store', 'I_TABLE_CLAUSE', 'tablespace index');
      ctx_ddl.set_attribute('cn_store', 'I_NDEX_CLAUSE', 'tablespace index compress 2');
    end;
      

  3.   

    ctxsys.ctx_ddl.create_preference('cn_lexer', 'chinese_vgran_lexer');
    调用前加用户名
      

  4.   

    已经可以了grant 语句不能放到 begin......end 里面chinese_vgran_lexer 写错了,应该是 chinese_vgram_lexer