Bootstrap

数据库安装及数据库问题解决方法(五)

构建数据表t,其中构建专门的索引对象。

 
 
SQL> create table t as select * from dba_objects;
Table created
--索引对象1
SQL> create index idx_t_owner on t(owner);
Index created
--索引对象2
SQL> create index idx_t_id on t(object_id);
Index created
 
SQL> exec dbms_stats.gather_table_stats(user,'T',cascade => true);
PL/SQL procedure successfully completed

同时,我们准备四个SQL作为演示DEMO。

 
 
explain plan for select * from t where wner='SYS';
select * from table(dbms_xplan.display);
explain plan for select * from t where wner='SCOTT';
select * from table(dbms_xplan.display);
explain plan for select * from t where object_id between 10 and 50000;
select * from table(dbms_xplan.display);
explain plan for select * from t where object_id between 1 and 100;
select * from table(dbms_xplan.display);


CURSOR_SHARING=SIMILAR | EXACT | FORCE
db_file_multiblock_read_count
sort_area_size
db_keep_cache_size
log_buffer
db_block_buffers
----------------------------------------------------------------------------------------------------------------------------------
HWM  高水位
如何知道一个表的高水位
1、首先对表进行分析
   execute dbms_stats.gather_table_stats()


ora-14401: inserted partition key is outside specified partition
插入的分区键值大于分区键
ORA-01008: not all variables bound
动态sql语句里:1这种变量出现了重复

-----------------双重调用变量------------------------
eval echo "$""$a"port

试试这个

我测试:

$ aport=1010

$ b=a

$ eval echo "$""$b"port
1010

-------------------------------------------------------------------------
alter index  IDX_TB_INTERACTSRVLOG_1 rebuild
 
ORA-14086: a partitioned index may not be rebuilt as a whole

分区表需要一个一个分区rebuild

 

;