dbms_stats 在9i和10g里的不同行为
9i :ownname VARCHAR2,tabname VARCHAR2,partname VARCHAR2 DEFAULT NULL, --> ALL partitionsestimate_percent NUMBER DEFAULT NULL, --> 100% sam...
10g中function index无法避免排序
SQL> alter session set nls_language=american;Session altered.SQL> create table test_sort(name,object_name) as select 'select',object_name from 2 dba_objects;Table created.SQL> c...
alter index unusable无法起作用的情况
SQL> select * from v$version;BANNER----------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProdPL/SQL Release 10.2.0.1.0 - Productio...
dbms_shared_pool.purge
在日常管理中,经常有让sql重新解析的需求,比如说使用了bind peeking,第一次绑定特定值的时候执行计划走的特别糟,因为绑定变量导致之后的语句不作重新解析,重用了最差的执行计划,这时候我们希望重新解析来得到一个相...
sql tuning之变通
今天翻了下和朋友的聊天记录,看到以前优化过的一条sql,比较有意思,语句大概是这样的(表和字段被我修改过),select count(DISTINCT id), code FROM logWHERE rtime ...
parameter pre_page_sga
PRE_PAGE_SGA can increase the process startup duration, because every process that starts must access every page in the SGA. The cost of this strategy is fixed; however, you might simply determine tha...
(tips) 10g log buffer
The LOG_BUFFER size will be set by default, by Oracle internal algorithm. In 10G R2, Oracle combines fixed SGA area and redo buffer [log buffer] together. If there is a free space after Oracle pu...
rollback相关知识
1.defferred rollback:在前滚完成后,数据就open,而在open后做恢复a.smonb.user process 2.fast start parallel rollbackfast start parallel rollback主要是在宕机之前进行了大事务,使用并行回滚加快恢复...
9i sys_connect_by_path出现错误结果
CREATE TABLE TEST1(A CHAR(16BYTE),B CHAR(16BYTE));insert into test1 (A,B) VALUES ('1','A');insert into test1 (A,B) VALUES ('1','B');insert into test1 (A,B) VALUES ('2'...
另类"死锁"
数据库死锁:不同session之间,因为等待对方释放资源,而导致死锁,这时候数据库会选择终止其中一个会话的sql,来解开死锁,最简单的条件是,session A 等待 session Bsession B 等待 session A,这时候数据库会牺牲到其中的...
cursor_sharing和substr函数索引
当cursor_sharing设置为similar的时候substr的函数索引将不会起作用,例如函数是substr(column,0,3),cursor_sharing为similar或者force的时候,这个条件会被解析成SUBSTR(column,:SYS_B_0,:SYS_B_1)=:SYS_B_2,这是函...
sql出现结果集错误以及出现ora-600或者ora-7445错误的解决方法思路
sql出现结果集错误以及出现ora-600或者ora-7445错误的解决方法思路sql出现结果集错误以及出现ora-600或者ora-7445,一般都是优化器的bug导致的,这时候一般有2种方式解决1.这个bug有相对应的补丁集,这时候可以通过补丁...
比较有意思的问题 --视图不走索引
SYSTEM@oracle10g>create table test_view as select * from dba_objects;表已创建。SYSTEM@oracle10g>ed已写入 file afiedt.buf 1 create view v_test_view as select substr(object_name,0,...
cursor_sharing and like
SQL> create table test_like as select * from dba_objects; 表已创建。 SQL> exec dbms_stats.gather_table_stats(user,'TEST_LIKE'); PL/SQL 过程已成功完成。 SQL> select /*+ aa1 */ * from test_li...
troubleshooting ora-1652 unable to extend temp segment
troubleshooting ora-1652 unable to extend temp segment 1.错误信息 Error: ORA-1652 Text: unable to extend temp segment by %s in tablespace %s ------- ----------------------------...
real-world performance学习笔记之 optimizer expose
1.Data skew cbo默认是按照平均的方式来评估card,当数据倾斜的时候,默认的评估方式存在问题,因此oracle引入了直方图来解决这个问题 2.bind peekingoracle 9i中引入bind peeking,对于等值查询,如果查询...
手工创建数据库
1.确定 ORACLE_SIDexport ORACLE_SID=linux ;// unixset ORACLE_SID=windows ; //windows同时修改/etc/oratab 2.创建口令文件建立连接3.创建参数文件,根据一个模板修改($ORACLE_HOME/dbs/init.ora)4.根据init....
bind peeking and rac
执行计划如下:SQL_ID 1fjad7hzrw2r2, child number 1-------------------------------------SELECT DISTINCT ia_bill.cbillid, ia_bill.vbillcode, ia_bill.pk_corp FROM ia_bill, ia_bill_b WHERE ia_bill.c...
查看sql执行计划
1.dbms_xplan.display dbms_xplan由9i中引入,用来显示explan plan里的执行计划信息,explan plan的结果存储在plan_table表中,9i里plan_table是个物理表,而在10g plan_table是个全局临时表,如果从9i升级到10g里...