Ricky was a young boy

这是歌词里的一段文字,ricky was a young boy。当年我听到18 and life的时候,感慨主唱的声线如此完美,再听到art of life的时候,发现原来toshi的声线更恐怖,有过之而无不及的是november rain的mv。。不过,这些都过去了,我们似乎应当创造历史,是的,我们是在创造历史。这又像是废话,但又让人不得不说。

外面的空气开始变得潮湿了,夏天来了,人却没有躁动。朋友从外地过来,路过要去蜜月,真心的祝福他俩,8年了吧,非常不容易,依旧相守在一起,祝他们一切顺利,旅途愉快吧。

indexfile is not a good solution

indexfile的方式不是一个好的解决办法。接着上一篇文章,试想如果scott用户下面的对象有几万个,还一个个去更改TABLESPACE “USERS”吗?工作量还是大了一些,当然你会说不是有vi,editplus之类的工具嘛。。。个人觉得还是unlimited tablespace权限回收的方式,比较妥当。

************************************************************************
REM  CREATE TABLE “SCOTT”.”DEPT” (“DEPTNO” NUMBER(2, 0), “DNAME”
REM  VARCHAR2(14), “LOC” VARCHAR2(13)) PCTFREE 10 PCTUSED 40 INITRANS 1
REM  MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1
REM  BUFFER_POOL DEFAULT) TABLESPACE “USERS” LOGGING NOCOMPRESS ;
CONNECT SCOTT;
CREATE UNIQUE INDEX “SCOTT”.”PK_DEPT” ON “DEPT” (“DEPTNO” ) PCTFREE 10
INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS
1 BUFFER_POOL DEFAULT) TABLESPACE “USERS” LOGGING ;
REM  ALTER TABLE “SCOTT”.”DEPT” ADD CONSTRAINT “PK_DEPT” PRIMARY KEY
REM  (“DEPTNO”) USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
REM  STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL
REM  DEFAULT) TABLESPACE “USERS” LOGGING ENABLE ;
REM  CREATE TABLE “SCOTT”.”EMP” (“EMPNO” NUMBER(4, 0), “ENAME”
REM  VARCHAR2(10), “JOB” VARCHAR2(9), “MGR” NUMBER(4, 0), “HIREDATE” DATE,
REM  “SAL” NUMBER(7, 2), “COMM” NUMBER(7, 2), “DEPTNO” NUMBER(2, 0))
REM  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536
REM  FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE “USERS”
REM  LOGGING NOCOMPRESS ;
CREATE UNIQUE INDEX “SCOTT”.”PK_EMP” ON “EMP” (“EMPNO” ) PCTFREE 10
INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS
1 BUFFER_POOL DEFAULT) TABLESPACE “USERS” LOGGING ;
REM  ALTER TABLE “SCOTT”.”EMP” ADD CONSTRAINT “PK_EMP” PRIMARY KEY
REM  (“EMPNO”) USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
REM  STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL
REM  DEFAULT) TABLESPACE “USERS” LOGGING ENABLE ;
REM  CREATE TABLE “SCOTT”.”SALGRADE” (“GRADE” NUMBER, “LOSAL” NUMBER,
REM  “HISAL” NUMBER) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
REM  STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL
REM  DEFAULT) TABLESPACE “USERS” LOGGING NOCOMPRESS ;
REM  CREATE TABLE “SCOTT”.”STATTAB” (“STATID” VARCHAR2(30), “TYPE”
REM  CHAR(1), “VERSION” NUMBER, “FLAGS” NUMBER, “C1” VARCHAR2(30), “C2”
REM  VARCHAR2(30), “C3” VARCHAR2(30), “C4” VARCHAR2(30), “C5”
REM  VARCHAR2(30), “N1” NUMBER, “N2” NUMBER, “N3” NUMBER, “N4” NUMBER,
REM  “N5” NUMBER, “N6” NUMBER, “N7” NUMBER, “N8” NUMBER, “N9” NUMBER,
REM  “N10” NUMBER, “N11” NUMBER, “N12” NUMBER, “D1” DATE, “R1” RAW(32),
REM  “R2” RAW(32), “CH1” VARCHAR2(1000), “CL1” CLOB) PCTFREE 10 PCTUSED 40
REM  INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST
REM  GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE “USERS_REORG0” LOGGING
REM  NOCOMPRESS LOB (“CL1”) STORE AS (TABLESPACE “USERS_REORG0” ENABLE
REM  STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE LOGGING
REM  STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL
REM  DEFAULT)) ;
CREATE INDEX “SCOTT”.”STATTAB” ON “STATTAB” (“STATID” , “TYPE” , “C5” ,
“C1” , “C2” , “C3” , “C4” , “VERSION” ) PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE “USERS_REORG0” LOGGING ;
REM  CREATE TABLE “SCOTT”.”TEST” (“OWNER” VARCHAR2(30), “OBJECT_NAME”
REM  VARCHAR2(128), “SUBOBJECT_NAME” VARCHAR2(30), “OBJECT_ID” NUMBER,
REM  “DATA_OBJECT_ID” NUMBER, “OBJECT_TYPE” VARCHAR2(19), “CREATED” DATE,
REM  “LAST_DDL_TIME” DATE, “TIMESTAMP” VARCHAR2(19), “STATUS” VARCHAR2(7),
REM  “TEMPORARY” VARCHAR2(1), “GENERATED” VARCHAR2(1), “SECONDARY”
REM  VARCHAR2(1), “NAMESPACE” NUMBER, “EDITION_NAME” VARCHAR2(30)) PCTFREE
REM  10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 9437184
REM  FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE
REM  “USERS_REORG0” LOGGING NOCOMPRESS ;
REM  CREATE TABLE “SCOTT”.”TEST2″ (“OWNER” VARCHAR2(30), “OBJECT_NAME”
REM  VARCHAR2(128), “SUBOBJECT_NAME” VARCHAR2(30), “OBJECT_ID” NUMBER,
REM  “DATA_OBJECT_ID” NUMBER, “OBJECT_TYPE” VARCHAR2(19), “CREATED” DATE,
REM  “LAST_DDL_TIME” DATE, “TIMESTAMP” VARCHAR2(19), “STATUS” VARCHAR2(7),
REM  “TEMPORARY” VARCHAR2(1), “GENERATED” VARCHAR2(1), “SECONDARY”
REM  VARCHAR2(1), “NAMESPACE” NUMBER, “EDITION_NAME” VARCHAR2(30)) PCTFREE
REM  10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 9437184
REM  FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE
REM  “USERS_REORG0” LOGGING NOCOMPRESS ;
REM  CREATE TABLE “SCOTT”.”TEST3″ (“OWNER” VARCHAR2(30), “OBJECT_NAME”
REM  VARCHAR2(128), “SUBOBJECT_NAME” VARCHAR2(30), “OBJECT_ID” NUMBER,
REM  “DATA_OBJECT_ID” NUMBER, “OBJECT_TYPE” VARCHAR2(19), “CREATED” DATE,
REM  “LAST_DDL_TIME” DATE, “TIMESTAMP” VARCHAR2(19), “STATUS” VARCHAR2(7),
REM  “TEMPORARY” VARCHAR2(1), “GENERATED” VARCHAR2(1), “SECONDARY”
REM  VARCHAR2(1), “NAMESPACE” NUMBER, “EDITION_NAME” VARCHAR2(30)) PCTFREE
REM  10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 9437184
REM  FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE
REM  “USERS_REORG0” LOGGING NOCOMPRESS ;
REM  CREATE TABLE “SCOTT”.”TEST4″ (“DEPTNO” NUMBER(2, 0), “DNAME”
REM  VARCHAR2(14), “LOC” VARCHAR2(13)) PCTFREE 10 PCTUSED 40 INITRANS 1
REM  MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1
REM  BUFFER_POOL DEFAULT) TABLESPACE “USERS_REORG0” LOGGING NOCOMPRESS ;
REM  CREATE TABLE “SCOTT”.”TEST5″ (“DEPTNO” NUMBER(2, 0), “DNAME”
REM  VARCHAR2(14), “LOC” VARCHAR2(13)) PCTFREE 10 PCTUSED 40 INITRANS 1
REM  MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1
REM  BUFFER_POOL DEFAULT) TABLESPACE “USERS_REORG0” LOGGING NOCOMPRESS ;
REM  ALTER TABLE “SCOTT”.”EMP” ADD CONSTRAINT “FK_DEPTNO” FOREIGN KEY
REM  (“DEPTNO”) REFERENCES “DEPT” (“DEPTNO”) ENABLE NOVALIDATE ;
REM  ALTER TABLE “SCOTT”.”EMP” ENABLE CONSTRAINT “FK_DEPTNO” ;

困惑好久的事情。。。

很多朋友希望在进行数据迁移的时候,能够将数据导入不同于原来系统的表空间,但是在导入后却发现,数据还是被导入了原表空间,也就是只跟着user变化的想法落空了,fromuser to user。。这是因为如果缺省的原用户具备unlimited tablespace权限的话,那么导入的时候会按照原来的位置导入,也就是带着storage选项,选择缺省的表空间。所以,在规划之初,建议unlimited tablespace选项还是慎重授予。

shrinking database segment online

oracle 10g开始有了一个新的功能:shrinking database segment online,shrink的本质是对表执行一系列的dml操作,可以
填满表段中的”漏洞空间”,而把所有剩余空间留在表的末端,然后oracle可以重置该表的hwm,释放自由空间。但是有代价的,
会产生大量的redo,需要斟酌。100万行的数据表,可能大概有近200M的redo开销。。

SQL> SELECT SUM(BYTES)/1024/1024 FROM DBA_EXTENTS WHERE SEGMENT_NAME=’TEST’;

SUM(BYTES)/1024/1024
——————–
30

SQL> ALTER TABLE USER.TEST ENABLE ROW MOVEMENT;

表已更改。

SQL> ALTER TABLE USER.TEST SHRINK SPACE;

表已更改。

SQL> SELECT SUM(BYTES)/1024/1024 FROM DBA_EXTENTS WHERE SEGMENT_NAME=’TEST’;

SUM(BYTES)/1024/1024
——————–
29.25
空间占用从30M降到29.25M,看来还是有一定效果的。

How to calculate the actual size of a table

here are the example made by Toms kyte…there is the situation maybe lots of people had made the practice,u just stand on the shoulder of giants,and u need to read it carefully,that’s enough..

and thanks a lot, Tom,u did a lot to help countless person..

*********************************************************************************

for a discussion of the use of ANALYZE and DBMS_SPACE to this end.  Basically -- you can
find out how many blocks are allocated to the table (whether used or NOT), how many
blocks have never been used (subtract them from above) and on the blocks that are used --
the average free space.

For example, in the example from above that I linked to -- we see:

ops$tkyte@DEV8I.WORLD> create table t ( x int,
                                 y char(2000) default '*' )
  2  storage ( initial 40k next 40k minextents 5 )
  3  tablespace system;

Table created.

A table that will create ~2k rows for each row inserted.  makes it easy to do the
math

ops$tkyte@DEV8I.WORLD> insert into t (x) values ( 1 );
1 row created.

ops$tkyte@DEV8I.WORLD> analyze table t compute statistics;
Table analyzed.

ops$tkyte@DEV8I.WORLD> compute sum of blocks on report
ops$tkyte@DEV8I.WORLD> break on report
ops$tkyte@DEV8I.WORLD> select extent_id, bytes, blocks
  2    from user_extents
  3   where segment_name = 'T'
  4     and segment_type = 'TABLE'
  5  /

 EXTENT_ID      BYTES     BLOCKS
---------- ---------- ----------
         2      81920         10
         3     122880         15
         4     163840         20
         0      40960          5
         1      40960          5
                      ----------
sum                           55

ops$tkyte@DEV8I.WORLD> clear breaks
ops$tkyte@DEV8I.WORLD> select blocks, empty_blocks,
  2         avg_space, num_freelist_blocks
  3   from user_tables
  4  where table_name = 'T'
  5  /

    BLOCKS EMPTY_BLOCKS  AVG_SPACE NUM_FREELIST_BLOCKS
---------- ------------ ---------- -------------------
         1           53       6091                   1

Ok, the above shows us:

o we have 55 blocks allocated to the table
o 53 blocks are totally empty (above the HWM)
o 1 block contains data (the other block is used by the system)
o we have an average of about 6k free on each block used.

Therefore, our table

o consumes 1 block
o of which  1block * 8k blocksize - 1 block * 6k free = 2k is used for our data.

Now, lets put more stuff in there...


ops$tkyte@DEV8I.WORLD> insert into t (x)
  2  select rownum
  3    from all_users
  4   where rownum < 50
  5  /
49 rows created.

ops$tkyte@DEV8I.WORLD> analyze table t compute statistics;
Table analyzed.

ops$tkyte@DEV8I.WORLD> compute sum of blocks on report
ops$tkyte@DEV8I.WORLD> break on report
ops$tkyte@DEV8I.WORLD> select extent_id, bytes, blocks
  2    from user_extents
  3   where segment_name = 'T'
  4     and segment_type = 'TABLE'
  5  /

 EXTENT_ID      BYTES     BLOCKS
---------- ---------- ----------
         2      81920         10
         3     122880         15
         4     163840         20
         0      40960          5
         1      40960          5
                      ----------
sum                           55

ops$tkyte@DEV8I.WORLD> clear breaks
ops$tkyte@DEV8I.WORLD> select blocks, empty_blocks,
  2         avg_space, num_freelist_blocks
  3    from user_tables
  4   where table_name = 'T'
  5  /

    BLOCKS EMPTY_BLOCKS  AVG_SPACE NUM_FREELIST_BLOCKS
---------- ------------ ---------- -------------------
        19           35       2810                   3

Ok, the above shows us:

o we have 55 blocks allocated to the table (still)
o 35 blocks are totally empty (above the HWM)
o 19 blocks contains data (the other block is used by the system)
o we have an average of about 2.8k free on each block used.

Therefore, our table

o consumes 19 blocks of storage in total.
o of which  19 blocks * 8k blocksize - 19 block * 2.8k free = 98k is used for our data.

Given our rowsize, this is exactly what we expected.

size of table or index…all the objects in oracle

you can query the size of an object,such as table,index….from user_extents or dba_extents

because,a segment maybe cross muti extents,look at “TEST”,you need to sum all the bytes of each extent_id to get the total size of table “TEST”

SQL> select segment_name,segment_type,tablespace_name,extent_id,bytes from user_extents;

SEGMENT_NAME                   SEGMENT_TYPE       TABLESPACE_NAME                 EXTENT_ID      BYTES
—————————— —————— —————————— ———- ———-
DEPT                           TABLE              USERS                                   0      65536
EMP                            TABLE              USERS                                   0      65536
BONUS                          TABLE              USERS                                   0      65536
SALGRADE                       TABLE              USERS                                   0      65536
TEST                           TABLE              USERS                                   0      65536
TEST                           TABLE              USERS                                   1      65536
TEST                           TABLE              USERS                                   2      65536
TEST                           TABLE              USERS                                   3      65536
TEST                           TABLE              USERS                                   4      65536
TEST                           TABLE              USERS                                   5      65536
TEST                           TABLE              USERS                                   6      65536
TEST                           TABLE              USERS                                   7      65536
TEST                           TABLE              USERS                                   8      65536
TEST                           TABLE              USERS                                   9      65536
TEST                           TABLE              USERS                                  10      65536
TEST                           TABLE              USERS                                  11      65536
TEST                           TABLE              USERS                                  12      65536
TEST                           TABLE              USERS                                  13      65536
TEST                           TABLE              USERS                                  14      65536
TEST                           TABLE              USERS                                  15      65536
TEST                           TABLE              USERS                                  16    1048576
TEST                           TABLE              USERS                                  17    1048576
TEST                           TABLE              USERS                                  18    1048576
TEST                           TABLE              USERS                                  19    1048576
TEST                           TABLE              USERS                                  20    1048576
USERS                          TABLE              USERS                                   0      65536
PK_DEPT                        INDEX              USERS                                   0      65536
PK_EMP                         INDEX              USERS                                   0      65536

28 rows selected.

SQL> select sum(bytes) from user_extents where segment_name=’TEST’;

SUM(BYTES)
———-
6291456

it’s the same as INDEX…..

keep running

晚上跑步的感觉还是非常爽的,不仅仅是身体上。四下无人,围着大大的花园,只有流浪猫与你作伴,可能还会有刺猬,没什么能够比得上人少的惬意了。

analyze the memory consumption of one sql

there will be a easy sample of memory consumption caculation

check the block size of your oracle,here are 8192bytes
SQL> show parameter db_block_size;

NAME                                 TYPE        VALUE
———————————— ———– ——————————
db_block_size                        integer     8192

//check the execution plan of sql
SQL> select * from scott.emp;

EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
———- ———- ——— ———- ——— ———- ———- ———-
7369 SMITH      CLERK           7902 17-DEC-80        800                    20
7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
7566 JONES      MANAGER         7839 02-APR-81       2975                    20
7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
7839 KING       PRESIDENT            17-NOV-81       5000                    10
7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20

EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
———- ———- ——— ———- ——— ———- ———- ———-
7900 JAMES      CLERK           7698 03-DEC-81        950                    30
7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
7934 MILLER     CLERK           7782 23-JAN-82       1300                    10

14 rows selected.

Elapsed: 00:00:00.03

Execution Plan
———————————————————-
Plan hash value: 3956160932

————————————————————————–
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
————————————————————————–
|   0 | SELECT STATEMENT  |      |    14 |   518 |     3   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| EMP  |    14 |   518 |     3   (0)| 00:00:01 |
————————————————————————–

Statistics
———————————————————-
1  recursive calls
0  db block gets
8  consistent gets
0  physical reads
0  redo size
1415  bytes sent via SQL*Net to client
385  bytes received via SQL*Net from client
2  SQL*Net roundtrips to/from client
0  sorts (memory)
0  sorts (disk)
14  rows processed

//8 consistent gets,you can calculate the exact memory consumption by:
//8 x 8192bytes=65536bytes=64kb

oracle asm startup with os

maybe u will meet such issues when setting up the self startup with os:

May 15 19:19:29 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:19:29 oel4u8 logger:  ASM instance +ASM. Wait 1.
May 15 19:19:51 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:19:51 oel4u8 logger:  ASM instance +ASM. Wait 2.
May 15 19:20:13 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:20:13 oel4u8 logger:  ASM instance +ASM. Wait 3.
May 15 19:20:35 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:20:35 oel4u8 logger:  ASM instance +ASM. Wait 4.
May 15 19:20:57 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:20:57 oel4u8 logger:  ASM instance +ASM. Wait 5.
May 15 19:21:15 oel4u8 sshd(pam_unix)[6017]: session opened for user oracle by (uid=0)
May 15 19:21:18 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:21:18 oel4u8 logger:  ASM instance +ASM. Wait 6.
May 15 19:21:40 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:21:40 oel4u8 logger:  ASM instance +ASM. Wait 7.
May 15 19:22:02 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:22:02 oel4u8 logger:  ASM instance +ASM. Wait 8.
May 15 19:22:24 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:22:24 oel4u8 logger:  ASM instance +ASM. Wait 9.
May 15 19:22:46 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:22:46 oel4u8 logger:  ASM instance +ASM. Wait 10.
May 15 19:23:08 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:23:08 oel4u8 logger:  ASM instance +ASM. Wait 11.
May 15 19:23:29 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:23:29 oel4u8 logger:  ASM instance +ASM. Wait 12.
May 15 19:23:51 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:23:51 oel4u8 logger:  ASM instance +ASM. Wait 13.
May 15 19:24:13 oel4u8 logger: Waiting for Oracle CSS service to be available before starting
May 15 19:24:13 oel4u8 logger:  ASM instance +ASM. Wait 14.
May 15 19:24:35 oel4u8 logger: Timed out waiting to start ASM instance +ASM
May 15 19:24:35 oel4u8 logger:   CSS service is NOT available.

it’s a bug noted as Oracle Bug 3458327 in metalink,following behand to cover this problem:

add h1:35:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null
between l2 and l3 will cover that

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
h1:35:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4

tired…

最近莫名其妙的反应迟钝,感觉像是从高原刚回来。不管了,每天坚持跑步2公里吧,还是最简单的方式最好。

rebuild the index

sometimes, the index u created in table maybe invaild and cause the problem in query the data of table, for example:
1.”select * from tb” will export the all the data of tb
but..
2. “select * from tb where id=’222′” will hang there and no data exported,there is the index created in colume “id”

most of time, it’s the invaild of index index_name created in id colume which case the situation,just follow this maybe help
“ALTER INDEX index_name REBUILD”..

–EOF—