12
返回列表 发新帖
楼主: zhu1

全文检索 Oracle Text, data load by partitation, async refresh index

[复制链接]
论坛徽章:
0
11#
 楼主| 发表于 2004-11-23 11:03 | 只看该作者

Call me

6538.#### x ###

使用道具 举报

回复
论坛徽章:
92
2011新春纪念徽章
日期:2011-01-25 15:42:33咸鸭蛋
日期:2012-03-19 10:46:00版主1段
日期:2012-05-15 15:24:11奥运会纪念徽章:排球
日期:2012-08-29 07:02:50奥运会纪念徽章:跳水
日期:2012-09-26 06:44:27ITPUB 11周年纪念徽章
日期:2012-09-28 17:34:42ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:32奥运会纪念徽章:击剑
日期:2012-10-12 07:20:332013年新春福章
日期:2013-02-25 14:51:242012新春纪念徽章
日期:2012-02-13 15:13:20
12#
发表于 2004-11-23 14:22 | 只看该作者
连接到:
Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.5.0 - Production

SQL> create table part_tab(a int,b varchar2(4000)) partition by range(a) (partit
ion p_tab1 values less than (10),partition p_tab2 values less than (20),partitio
n p_tab3 values less than (30));

表已创建。

SQL> Execute ctx_ddl.drop_preference('mystore1');
BEGIN ctx_ddl.drop_preference('mystore1'); END;

*
ERROR 位于第 1 行:
ORA-20000: Oracle Text 错误:
DRG-10700: 首选项不存在: mystore1
ORA-06512: 在"CTXSYS.DRUE", line 157
ORA-06512: 在"CTXSYS.CTX_DDL", line 80
ORA-06512: 在line 1


SQL> Begin
  2  ctx_ddl.create_preference('mystore1', 'BASIC_STORAGE');
  3  ctx_ddl.set_attribute('mystore1', 'I_TABLE_CLAUSE',
  4                          'tablespace zhangbin8k ');
  5   ctx_ddl.set_attribute('mystore1', 'I_INDEX_CLAUSE',
  6                          'tablespace zhangbin8k compress 2 ');
  7  end;
  8  /

PL/SQL 过程已成功完成。

SQL> CREATE INDEX part_idx on part_tab(b) INDEXTYPE IS CTXSYS.CONTEXT
  2  LOCAL (partition p_idx1 parameters('storage mystore1'), partition p_idx2 pa
rameters('storage mystore1'), partition p_idx3 parameters('storage mystore1'));

索引已创建。

SQL> set autotrace trace stat exp
SQL> alter table part_tab nologging;

表已更改。

SQL> insert /*+ append */into select 1,title from app_Assetbasicinfo where categ
oryid=1 and rownum<10000;
insert /*+ append */into select 1,title from app_Assetbasicinfo where categoryid
=1 and rownum<10000
                         *
ERROR 位于第 1 行:
ORA-00903: 表名无效


SQL> insert /*+ append */into part_tab select 1,title from app_Assetbasicinfo wh
ere categoryid=1 and rownum<10000;

已创建9999行。

Statistics
----------------------------------------------------------
      11634  recursive calls
      22320  db block gets
       1063  consistent gets
        259  physical reads
    3654276  redo size
        619  bytes sent via SQL*Net to client
        611  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
         25  sorts (memory)
          0  sorts (disk)
       9999  rows processed

SQL> execute ctx_ddl.sync_index('part_idx','50M','p_idx1');


看来load慢的原因是因为索引存在的情况下nologging表append 插入的时候产生了过多的redo

SQL> ALTER INDEX part_idx modify partition p_idx3 unusable;

索引已更改。

SQL> insert/*+ append */ into part_tab select 23,title from app_Assetbasicinfo w
here categoryid=1 and rownum<10000;
insert/*+ append */ into part_tab select 23,title from app_Assetbasicinfo where
categoryid=1 and rownum<10000
*
ERROR 位于第 1 行:
ORA-29954: 域索引分区被标记为 LOADING/FAILED/UNUSABLE

SQL> alter session set SKIP_UNUSABLE_INDEXES =true;

会话已更改。

SQL> insert into  part_tab values(23,'abc');
insert into  part_tab values(23,'abc')
*
ERROR 位于第 1 行:
ORA-29954: 域索引分区被标记为 LOADING/FAILED/UNUSABLE


http://download-west.oracle.com/ ... d_pclxut.htm#996816

使用道具 举报

回复
论坛徽章:
42
ITPUB北京香山2007年会纪念徽章
日期:2007-01-24 14:35:022011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:56管理团队成员
日期:2011-05-07 01:45:08ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282012新春纪念徽章
日期:2012-02-13 15:09:232012新春纪念徽章
日期:2012-02-13 15:09:232012新春纪念徽章
日期:2012-02-13 15:09:232012新春纪念徽章
日期:2012-02-13 15:09:232012新春纪念徽章
日期:2012-02-13 15:09:23
13#
发表于 2004-11-29 08:43 | 只看该作者
不要起ctxsrv就不会自动同步了。

使用道具 举报

回复
论坛徽章:
0
14#
 楼主| 发表于 2004-12-1 13:58 | 只看该作者

UNUSABLE以后就不能insert 数据了

10g  怎么停下 ctxsrv.

使用道具 举报

回复
论坛徽章:
0
15#
 楼主| 发表于 2004-12-1 13:59 | 只看该作者

work around is

1. load into temp table
2. sync text index
3. exchange temp table into the partition table

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表