| 向荣 的个人资料eagle's home照片日志列表 | 帮助 |
|
eagle's home“We are what we repeatedly do. Excellence, then, is not an act, but a habit.” -Aristotle 2月23日 你平时用什么工具计算有一个比较有趣的话题,你平时用什么工具计算? 我一般手边有什么就用什么。想到的这儿列举一些: 1. 笔和纸 在没有电脑的时候只能用这个,不过用的次数很少,因为电脑不离手:) 2. windows计算器 相信有不少人是用这个计算的。我不太喜欢用这个,因为要从附件中找出这个不容易,而且功能也不行,先乘除后加减都不知道,和windows一样苯 3. google的搜索栏 在装了google的toolbar后这个蛮好用的,直接输入回车就可以了,如果当前窗口是mozilla,这是首选。 4. sqlplus 这个我相信不做DBA的人很少会知道。 如果当前我的窗口是sqlplus的话,懒得切换,直接select xxx*xxxx from dual;就出来了,功能强大,函数众多,强烈推荐dba适用 5. bc Unix命令,如果当前窗口是在一台没有安装数据库的server下,你可以选择bc。 6. Perl 编程语言,Perl的随意在这种时候也能够显示出来,两行代码就可以给出你要的答案,功能强大,函数很多。 7. Excel 这个我比较少用,不是很熟悉。都是别人做好了我来用。 如果你的工具不在上述7种工具中,欢迎补充 2月14日 Tips: PL/SQL中监控执行进度两种方法这是我常用的两种PL/SQL监控运行状况的方法: 1. 使用dbms_application_info.SET_CLIENT_INFO 举例如下: declare cursor cr is select rowid from test; delete_count number; total_count number; begin delete_count :=0; total_count :=0; for i in cr loop delete from test where rowid=i.rowid; delete_count :=delete_count+1; total_count :=total_count+1; if (delete_count>100) then dbms_application_info.SET_CLIENT_INFO(' So far '||total_count||' rows has been deleted'); delete_count :=0; commit; end if; end loop; end; / 另开一session, select client_info from v$session where client_info like 'So far%'; 注意info的长度有限制,超过64字符会被截断 2. 使用dbms_system.ksdwrt, 这个可以写到300个字符 KSDWRT Procedure This procedure prints the message to the target file (alert log and/or trace file). Syntax DBMS_SYSTEM.KSDWRT ( Parameters Table KSDWRT Procedure Parameters
举例如下: declare cursor cr is select rowid from test; delete_count number; total_count number; begin delete_count :=0; total_count :=0; for i in cr loop delete from test where rowid=i.rowid; delete_count :=delete_count+1; total_count :=total_count+1; if (delete_count>100) then dbms_system.ksdwrt (1,' So far '||total_count||' rows has been deleted'); delete_count :=0; commit; end if; end loop; end; / 然后开一session, tail -30f xxx.trc 2月12日 霍元甲带着很大的期待去看,但是感觉没有特别出众的地方.
缺少了一些以前常有的搞笑成分. 打斗感觉还是不如经典的<新少林五祖>
想表明"武术的真谛"的思想表露的太过于直接了.最后结局不太好
想想这么多年看李连杰的电影都是看盗版,这次去和平影都看他最后的一部动作片也算是还了吧:)
Open Hourse周六下午没去公司参加Open House,在家帮同事cover oncall.
本以为周六应该比较安静,结果运气不好,还是有事情.
挂着美国电话bridge上一挂就是四个多小时(不知道算不算俺们家话费
听说人很多,很热闹.
希望能够招到更多的高手. 估计很快DBA Team吃饭快一桌坐不下了 1月23日 Copying Object Cache File from Source to Target(shareplex)Problem: The post is stopped and the event_log has the following error. "Error: sp_opst(osp) (for o.sid-o.sid queue hostname) 17000 - Error opening file /backup/vardir/state/0xc0a30144+PP+hostname+sp_opst+o.sid-o.sid-objcache_sp_opst.1: No such file or directory." Solution: If the object cache for the post queue is missing from the $SP_SYS_VARDIR/state directory. The object caches are synced up on startup. Start Shareplex on the source and shut it down, then restart shareplex and shut it down again. This will sync up the object cache. Copy the file from the source $SP_SYS_VARDIR/state directory to the target in binary. The source file will look like: o.sid-objcache_sp_conf.<highest number> The target file will look like: 0x<numbers_for_ip_address>+PP+hostname+sp_opst+o.sid-o.sid-objcache_sp_opst.<same number as source> Check the event_log on the target for the exact name. Restart the post queue on the target. If the event_log shows the following: "Internal error: sp_opst (for o.stock-o.stock queue unknown) 15010 - Error reading pre-sync'd objcache for datasource 0xc01010101+PP+hostname+sp_opst+o.sid-o.sid, actid 1" the file should be renamed on the target to: $SP_SYS_VARDIR/state/0xc01010101+PP+hostname+sp_opst+o.sid-o.sid.1 1月21日 笑话一则大清早 5点10分起床打车去车站买票 问:有k369学生票么?坐票? 问:卧铺呢? 问:那站票 呢?
问:跪票总该有吧?阿姨! 后面推推攘攘,忽然有一人手拿票子大喊!蹲票!蹲票!谁要蹲票!12车厢厕所的! 接着人群向黑贩子流去,正当黑贩子准备数钱时,又一人冲出大喊,趴票!趴票!谁要趴票!13车厢顶盖!~买票送绳子!
.................
学生:有K369的票吗? 学生:我前几天在您这买过票的,阿姨还记得我吗? 学生:您回忆一下,我当时问了许多问题!买的挂票走的! 学生:别提了,被乘务员挂在车厢中,到了终点站,他把我们忘了!好几十口子都被拉回来了...... 办公桌Anual party 临走前拍的
做完最后一个停机维护,很顺利
下周准备回家了~~
1月3日 虚拟索引的使用首先来看一下real index的创建,便于和后面virtual index进行比较 SQL> create table test Table created. SQL> create index test_idx on test(object_id); Index created. SQL> select index_name,index_type,status from user_indexes INDEX_NAME INDEX_TYPE STATUS SQL> select object_id from dba_objects OBJECT_ID
OBJ# DATAOBJ# TS# FILE# BLOCK# BO# INDMETHOD# COLS PCTFREE$ INITRANS MAXTRANS PCTTHRES$
Index dropped.
我们创建了一个虚拟的index Index created.
OBJECT_ID SQL> select segment_name,segment_type,bytes from user_segments no rows selected SQL> select * from ind$ where obj#=8058; OBJ# DATAOBJ# TS# FILE# BLOCK# BO# INDMETHOD# COLS PCTFREE$ INITRANS MAXTRANS PCTTHRES$
可见virtual index并没有真实的被创建出来,没有分配segment空间. 根据我trace的结果,它只更新了obj$,ind$,icol$三个表.
虚拟index的作用在于可用于optimizer,但是有几个条件 2. hint 对virtual index有效
下面来看个试验: SQL> analyze table test compute statistics; Table analyzed. SQL> alter session set optimizer_mode=choose; Session altered. SQL> explain plan for select /*+ index(test,test_idx) */ * from test where object_id=10; Explained. SQL> @?/rdbms/admin/utlxpls PLAN_TABLE_OUTPUT -------------------------------------------------------------------- Predicate Information (identified by operation id): 1 - filter("TEST"."OBJECT_ID"=10) Note: cpu costing is off 14 rows selected.
_use_nosegment_indexes=false时, virtual index对于optimizer来讲不可见
SQL> alter session set "_use_nosegment_indexes"=TRUE; Session altered. SQL> explain plan for select /*+ index(test,test_idx) */ * from test where object_id=10; Explained. SQL> @?/rdbms/admin/utlxpls PLAN_TABLE_OUTPUT --------------------------------------------------------------------------- Predicate Information (identified by operation id): 2 - access("TEST"."OBJECT_ID"=10) Note: cpu costing is off 15 rows selected. SQL> ALTER SESSION SET OPTIMIZER_MODE=RULE; Session altered. Explained. SQL> @?/rdbms/admin/utlxpls PLAN_TABLE_OUTPUT --------------------------------------------------------------------------- Predicate Information (identified by operation id): 2 - access("TEST"."OBJECT_ID"=10) Note: cpu costing is off 15 rows selected.
#index hint在RBO和CBO下均有效
SQL> EXPLAIN PLAN FOR SELECT * FROM TEST WHERE OBJECT_ID=10; Explained. SQL> @?/rdbms/admin/utlxpls PLAN_TABLE_OUTPUT -------------------------------------------------------------------- Predicate Information (identified by operation id): 1 - filter("TEST"."OBJECT_ID"=10) Note: rule based optimization 14 rows selected.
#RBO下, virtual index对于optimizer来讲不可见 SQL> alter session set optimizer_mode=choose; Session altered. SQL> @?/rdbms/admin/utlxpls PLAN_TABLE_OUTPUT --------------------------------------------------------------------------- Predicate Information (identified by operation id): 2 - access("TEST"."OBJECT_ID"=10) Note: cpu costing is off 15 rows selected.
#CBO下有效 虚拟索引有以下几个特性: 1. virtual index对实际的sql运行并没有作用,看下面的试验 Session altered. SQL> alter session set optimizer_mode=choose; Session altered. SQL> EXPLAIN PLAN FOR SELECT * FROM TEST WHERE OBJECT_ID=10; Explained. SQL> @?/rdbms/admin/utlxpls PLAN_TABLE_OUTPUT --------------------------------------------------------------------------- Predicate Information (identified by operation id): 2 - access("TEST"."OBJECT_ID"=10) Note: cpu costing is off 15 rows selected. SQL> set autotrace on OWNER
Execution Plan 2 1 INDEX (RANGE SCAN) OF 'TEST_IDX' (NON-UNIQUE) (Cost=1 Ca Statistics 使用10046 trace: SQL> alter session set events '10046 trace name context forever, level 8'; Session altered. SQL> set autotrace off OWNER
SQL> alter index test_idx rebuild; 3. 相同名字的index不能被创建,但是可以创建相同列上的不同名index
Index created. 4. 分析有效且起作用,但是dba_indexes中看不到统计信息 6783 rows updated. SQL> commit; SQL> explain plan for select * from test where object_id=10; Explained. SQL> @?/rdbms/admin/utlxpls PLAN_TABLE_OUTPUT --------------------------------------------------------------------------- Predicate Information (identified by operation id): 2 - access("TEST"."OBJECT_ID"=10) Note: cpu costing is off 15 rows selected. QL> analyze table test compute statistics for all indexed columns size 100; Table analyzed. SQL> explain plan for select * from test where object_id=10; Explained. SQL> @?/rdbms/admin/utlxpls PLAN_TABLE_OUTPUT -------------------------------------------------------------------- Predicate Information (identified by operation id): 1 - filter("TEST"."OBJECT_ID"=10) Note: cpu costing is off
中文翻译的质量今天想去找一找Tom的那个一边压缩一边exp的脚本,打算把他改成perl 的function, 以后写程序用.
因为手边有一本expert-one-on-one的书,就懒得去开英文的pdf文档找了(主要电脑太慢
翻到295页一看,竟然脚本中setenv, cd ,date这些Unix命令都是Setenv, Cd, Date.
想想这个太离谱了吧,Tom不至于没注意到这点吧,于是把英文版本拿过来看(P412),发现英文版是正确的.
专业术语不会翻译也就罢了,竟然照抄别人的也会抄错,实在是太不负责任了. 三种allocate extent方法的比较这里讨论和HWM的关系,看下面这个试验:
SQL> create table test(x int);
Table created.
SQL> exec show_space('TEST','SYS');
Free Blocks.............................0 Total Blocks............................2 Total Bytes.............................16384 Unused Blocks...........................1 Unused Bytes............................8192 Last Used Ext FileId....................7 Last Used Ext BlockId...................4 Last Used Block.........................1 PL/SQL procedure successfully completed.
SQL> alter table test allocate extent;
Table altered.
SQL> exec show_space('TEST','SYS');
Free Blocks.............................0 Total Blocks............................4 Total Bytes.............................32768 Unused Blocks...........................3 Unused Bytes............................24576 Last Used Ext FileId....................7 Last Used Ext BlockId...................4 Last Used Block.........................1 PL/SQL procedure successfully completed.
#block数目增加了,但是HWM没有变化
SQL> alter table test allocate extent (size 10M datafile '/oracle/ora9i/data01/xfan/system02.dbf'); Table altered. SQL> exec show_space('TEST','SYS');
#仍然没有变化
SQL> alter table test allocate extent (size 10M instance 1); Table altered. SQL> exec show_space('TEST','SYS'); PL/SQL procedure successfully completed.
#HWM被调高了
所以,只要在allocate extent 中加入 (instance 1),才可以将新加入的blocks加入到HWM之下
How to add errors for which Post will not stop (shareplex Reference)SP_OPO_CONT_ON_ERR
This parameter controls whether or not Post stops when it encounters Oracle errors that can be corrected. When this flag is set to the default of 0, Post stops for all Oracle errors except the following: Default errors for which Post will not stop unique key violation operation interrupted no data found no such table invalid number non-numeric in date invalid rowid invalid hex number insert null into not-null cannot update not-null to null check constraint violated packet writer failure sequence not found resource busy with nowait Oracle internal error To add errors for which Post will not stop
You can direct SharePlex to ignore additional Oracle errors and continue posting. Follow
these instructions to add the errors to the oramsglist file on the target system, and then change the SP_OPO_CONT_ON_ERR setting to 1. 1 Stop Post.
sp_ctrl(sysB)> stop post 2 On the target system, change directories to the data sub-directory of the SharePlex variable-data directory. 3 Using any ASCII text editor, open the oramsglist file in the data sub-directory. 4 Increase the number on the first line by the number of Oracle errors you are adding. This number tells SharePlex how many error messages are in the file. 5 Starting at the end of the file, add the number of each Oracle error, one per line .
The messages need not be in numerical order.
6.Save and close the file using the text editor’s standard commands.
7 Change the value of SP_OPO_CONT_ON_ERR setting to 1.
sp_ctrl(sysB)> set param SP_OPO_CONT_ON_ERR 1 8 Start Post. sp_ctrl(sysB)> start post From now on, the Oracle errors that you listed will be recorded by SharePlex in the
Event Log, but Post will not stop when they are encountered. SharePlex will log the errors and the offending SQL statements in the SID_errlog.sql($SP_SYS_VARDIR/log)log file. Warning! Use caution when setting this parameter to 1. Your data could become very
out-of-sync without your knowing it. It is recommended that you enable this parameter only if your target instance must be as up-to-date as possible and you can tolerate some out-of-sync data. If you direct Post to ignore Oracle error messages, you should check the SID_errlog.sql log frequently to see if there were errors that could cause replication problems. 1月2日 2005年随感2006年刚刚开始,就看到各个blog上满是2005年回忆录.以前一直不敢写,感觉回忆录总是属于成功人士或者没落人士,而我并不属于这两种人. 所以定位随感好了
05年,变化还是蛮大的. 最重要的就是职业方向的确定吧.
04年初,从台湾回来的时候,我行李箱里装着一套MSCN的英文教材,几本CCNA, CCNP的英文教材,一本Java的书,还有一本oracle8的文档.
那个时候是没有职业方向的,一直很迷茫,什么都学,什么都看. 最后觉得自己这样不行,自己不是超人.于是大约04年7,8月的时候决定走dba的方展方向,开始考OCP.其实也知道证书并不能带来什么,只是想确定一下自己的方向.2个月后拿到OCP的证书,也算是最后一批不需要参加培训的OCP了吧.
当时心理上是已经打算走dba的方向,看书的重点也放在oracle上,可是工作上的角色还是SA,DBA, 网络,NT admin.于是想换份工作,找工作的想法始于2004年底05年初,04年年终聚餐更加坚定了我换工作的决心,种种表演让我觉得这不是一个做技术的地方,虽然聚餐时还摸到了一台彩电 (这大约可以算是我摸到最大的奖了),.
05年5月份终于转行成了专职的DBA.可以专心做自己想做的事情,算是一个不小的进步吧. 5月13号星期五上完最后一天班,5月16号星期一到新公司报道,马不停蹄. 现在半年多过去了,各方面和预期都挺相符,纯技术的工作,专业专职的方向.
05年身体很健康,没病没灾. 甚至还新增了两项运动:羽毛球和乒乓球. 身体是革命的本钱:)
再来就是娱乐了,星际争霸水平有所提高,主要在于换了一个罗技的鼠标:)但打算06年暂时搁置一下,这个实在太耗费时间了.并且发现自己远远不是职业选手的材料:)
05年去过乌镇,杭州,黄山. 乌镇没什么感觉,杭州不错,还想再去看看. 黄山景色很美,不过爬山确实蛮累的.
05年自己还是满意的,06年的希望很多,不说了,说出来就不灵了:)
12月31日 劲乐团1.8版后的任务列表这个是1.8版本后的列表:
MISSION_4 您只要通过弹奏歌曲获得40以上的G币,就可以升级了。 MISSION_8 您只要在中级星球中弹奏一首歌曲,并且顺利过关,就可以升级了。 MISSION_12 您只要在高级星球中选择困难模式的歌曲进行一次游戏,就可以升级了。 MISSION_16 请选择5级或5级难度以上的歌曲,游戏顺利过关的同时打出50个以上的连击(Combo)。 MISSION_20 请选择6级或6级难度以上的歌曲,游戏顺利过关的同时打出70%以上的Cool。 MISSION_24 请选择8级或8级难度以上的歌曲,游戏顺利过关的同时打出100个连击(Combo),建议在中级星球 完成该任务。 MISSION_28 请选择10级或10级难度以上的歌曲,游戏顺利过关的同时打出10个以上的Jam,建议在中级星球完成 该任务。 MISSION_32 请选择11级或11级难度以上的歌曲,游戏顺利过关的同时打出70%以上的Cool,建议在中级星球完成 该任务。 MISSION_36 请选择12级或12级难度以上的歌曲,游戏顺利过关的同时***s的数量少于10个,建议在中级星球完 成该任务。 MISSION_40 请选择14级或14级难度以上的歌曲,游戏顺利过关的同时打出20个以上的Jam,建议在中级星球完成该任务。 MISSION_44 请选择15级或15级难度以上的歌曲,使用游戏道具(失落手镯)顺利过关。 MISSION_48 请选择16级或16级难度以上的歌曲,使用游戏道具(幻境之戒)顺利过关。 MISSION_52 请选择17级或17级难度以上的歌曲,使用游戏道具和(狂风之戒)顺利过关的同时打出80%以上的Cool。 MISSION_56 请选择18级或18级难度以上的歌曲,游戏顺利过关的同时打出80%以上的Cool。 MISSION_60 请选择17级或17级难度以上的歌曲,使用游戏道具(幻镜之戒)顺利过关的同时打出90%以上的Cool。 MISSION_64 请选择17级或17级难度以上的歌曲,使用游戏道具(闪灵手镯)顺利过关的同时打出70%以上的Cool。 MISSION_68 请选择18级或18级难度以上的歌曲,使用游戏道具(失落手镯)顺利过关的同时打出80%以上的Cool。 MISSION_72 请选择18级或18级难度以上的歌曲,使用游戏道具(狂风之戒)游戏顺利过关的同时全连(All Combo)通过。 MISSION_76 请选择19级或19级难度以上的歌曲,使用游戏道具(混乱之戒)游戏顺利过关的同时打出0个Jam。 MISSION_80 请选择18级或18级难度以上的歌曲,使用游戏道具(失落手镯)游戏顺利过关的同时打出100%的Cool。 MISSION_84 请选择19级或19级难度以上的歌曲,使用游戏道具(黑暗手镯)顺利过关的同时打出80%以上的Cool。 MISSION_88 请选择20级或20级难度以上的歌曲,游戏顺利过关的同时打出95%以上的Cool。 MISSION_92 请选择25级或25级难度以上的歌曲,游戏顺利过关的同时打出全连(All Combo)。 MISSION_96 请选择18级或18级难度以上的歌曲,游戏顺利过关的同时打出100%的Good。 MISSION_100 请选择31级或31级难度以上的歌曲,游戏顺利过关的同时打出全连(All Combo)。 12月30日 VOS (Virtual Orchestra Studio)今天中午在饭桌上,我随便问了句“你们以前有人玩过VOS吗” 注意,我指的是 Virtual Orchestra Studio一种音乐模拟类游戏 沉默一会,还好,不是没有人知道,还是有人知道的,不过解释是 Veritas Oracle Sun而且还真有这个联合体狂晕 12月29日 劲乐团慢慢爬级吧:)
等级:通过条件 4 :通过弹奏歌曲获得40以上的G币 12月27日 无极平安夜做了一天的on call,虽然一个call没有接到
星期天出来透透气,中午先去小尾羊吃了一顿红焖羊骨,平安夜的损失算补回来了。
下午去新世界一看,里面人暴多,像家门口的家乐福超市:)
停留片刻就出来了,南京路上也是人狂多。一向害怕人潮,转着转着就转到了和平影都。看到无极的海报,虽然已经听说无数人说其烂,但是没看过还是要亲眼看一下究竟如何:)90的票价不便宜啊,发了一个价值2元的和平影都纪念钥匙扣。
看完没什么特别的感觉,因为看前就没有太高的期望。感觉一般般吧,也没有出现暴场,可能大家都睡着了:)有些场景还是不错的。
片前有播放《金刚》的预告片,确实不错。感觉特效比指环王还要好。相比下后面看无极的特效就有点小儿科了。06年1月上映,期待中 secureCRT的登录sudo脚本如果你和我一样每天要开很多secureCRT窗口并且需要sudo(或者其他的事情),并且sudo还设置了timeout,那么一定要阅读这篇文章 一开始没每开一个secureCRT窗口总是要重复下面的事情: sudo su - oracle Password: 在等待sudo su 的时候经常会timeout,后来到google,baidu上去找自动sudo 的脚本也没有找到,最后还是乖乖的翻secureCRT的help文档解决了这个问题。 在secureCRT安装目录下C:\Program Files\SecureCRT\scripts 打开example1.vbs #$language = "VBScript" #$interface = "1.0" Sub main ' turn on synchronous mode so we don't miss any data crt.Screen.Synchronous = True ' Wait for a string that looks like "login: " or "Login: " crt.Screen.WaitForString "ogin: " ' Send your username followed by a carriage return crt.Screen.Send "username" & VbCr ' Wait for a tring that looks like "password: " or "Password: " crt.Screen.WaitForString "assword:" ' Send your password followed by a carriage return crt.Screen.Send "password" & VbCr ' turn off synchronous mode to restore normal input processing crt.Screen.Synchronous = False End Sub 修改username 为sudo su - oracle 修改password 为你自己的password 然后在session options里面设置logon script为该文件 最后记得把windows里面的权限设定为尽量小 12月20日 hash partition table的add partition和coalesce partition操作hash partition的分区数需要是power(2)数,否则可能会出现各个分区间数据量的不平衡。但到底是怎样的不平衡,加分区后oracle如何操作以及coalesce如何进行,下面给出一个试验过程: 1 create table test_hash( 2 id number) 3 partition by hash(id) 4* partitions 6 SQL> / Table created. SQL> begin 2 for i in 1..8000 loop 3 insert into test_hash values(i); 4 end loop; 5 end; 6 / PL/SQL procedure successfully completed. SQL> select table_name,partition_name from dba_tab_partitions 2 where table_name='TEST_HASH'; TABLE_NAME PARTITION_NAME ------------------------------ ------------------------------ TEST_HASH SYS_P1 TEST_HASH SYS_P2 TEST_HASH SYS_P3 TEST_HASH SYS_P4 TEST_HASH SYS_P5 TEST_HASH SYS_P6 SQL> select count(*) from test_hash partition (sys_p1); COUNT(*) ---------- 1013 SQL> c/p1/p2 1* select count(*) from test_hash partition (sys_p2) SQL> SQL> / COUNT(*) ---------- 980 SQL> c/p2/p3 1* select count(*) from test_hash partition (sys_p3) SQL> / COUNT(*) ---------- 2043 SQL> c/p3/p4 1* select count(*) from test_hash partition (sys_p4) SQL> / COUNT(*) ---------- 1988 SQL> c/p4/p5 1* select count(*) from test_hash partition (sys_p5) SQL> / COUNT(*) ---------- 938 SQL> c/p5/p6 1* select count(*) from test_hash partition (sys_p6) SQL> / COUNT(*) ---------- 1038 发现P1,P2,P5,P6差不多都是1000,而P3,P4为2000行,差不多是两倍的关系。 而P5-P1=4(2的二次方),P6-P2=4,所以结构大约如下(practical Oracle8i上解释为何如此): P1 P5 P2 P6 P3 P4 这时我们添加一个partition P7 SQL> alter table test_hash 2 add partition ; Table altered. SQL> select table_name,partition_name from dba_tab_partitions 2 where table_name='TEST_HASH'; TABLE_NAME PARTITION_NAME ------------------------------ ------------------------------ TEST_HASH SYS_P1 TEST_HASH SYS_P2 TEST_HASH SYS_P3 TEST_HASH SYS_P4 TEST_HASH SYS_P5 TEST_HASH SYS_P6 TEST_HASH SYS_P7 SQL> select count(*) from test_hash partition (sys_p1); COUNT(*) ---------- 1013 SQL> c/p1/p2 1* select count(*) from test_hash partition (sys_p2) SQL> / COUNT(*) ---------- 980 SQL> c/p2/p3 1* select count(*) from test_hash partition (sys_p3) SQL> / COUNT(*) ---------- 1021 SQL> c/p3/p4 1* select count(*) from test_hash partition (sys_p4) SQL> / COUNT(*) ---------- 1988 SQL> c/p4/p5 1* select count(*) from test_hash partition (sys_p5) SQL> / COUNT(*) ---------- 938 SQL> c/p5/p6 1* select count(*) from test_hash partition (sys_p6) SQL> / COUNT(*) ---------- 1038 SQL> c/p6/p7 1* select count(*) from test_hash partition (sys_p7) SQL> / COUNT(*) ---------- 1022 发现原来的P3被一分为二成为新的P3和P7 (2043=1021+1022),结构变为如下: P1 P5 P2 P6 P3 P7 P4 此时我们coalesce partition: SQL> alter table test_hash coalesce partition; Table altered. SQL> select table_name,partition_name from dba_tab_partitions 2 where table_name='TEST_HASH'; TABLE_NAME PARTITION_NAME ------------------------------ ------------------------------ TEST_HASH SYS_P1 TEST_HASH SYS_P2 TEST_HASH SYS_P3 TEST_HASH SYS_P4 TEST_HASH SYS_P5 TEST_HASH SYS_P6 6 rows selected. SQL> alter table test_hash coalesce partition; Table altered. SQL> select table_name,partition_name from dba_tab_partitions 2 where table_name='TEST_HASH'; TABLE_NAME PARTITION_NAME ------------------------------ ------------------------------ TEST_HASH SYS_P1 TEST_HASH SYS_P2 TEST_HASH SYS_P3 TEST_HASH SYS_P4 TEST_HASH SYS_P5 SQL> select count(*) from test_hash partition (sys_p1); COUNT(*) ---------- 1013 SQL> c/p1/p2 1* select count(*) from test_hash partition (sys_p2) SQL> / COUNT(*) ---------- 2018 SQL> c/p2/p3 1* select count(*) from test_hash partition (sys_p3) SQL> / COUNT(*) ---------- 2043 SQL> c/p3/p4 1* select count(*) from test_hash partition (sys_p4) SQL> / COUNT(*) ---------- 1988 第一次coalesce, P3和P7 merge成为新P3, 第二次coalesce, P2和P6 merge成为新P2,结构如下: P1 P5 P2 P3 P4 12月13日 physical rowid, logical rowid and urowid type以前写有一个purge几个月前记录的脚本。但是今天在一个新的表上测试的时候确得到错误: PLS-00386: type mismatch found at 'REC_TAB' between FETCH cursor and INTO variables fetch这段的pl/sql为 declare cursor rec is select /*+ index(test,test_a) */ rowid from TEST where a>=mindate and a<mindate+1; type recstartype1 is table of rowid index by BINARY_INTEGER; rec_tab recstartype1; busy_inline exception; begin open rec; loop fetch rec bulk collect into rec_tab limit 1000; FORALL i in 1..rec_tab.count delete from TEST WHERE rowid = rec_tab(i); 类型不匹配,自然想到是logical rowid的问题。去查看表类型,果然是IOT表。对IOT table执行select rowid 返回的为logical rowid(因为记录的physical rowid 对于IOT表是可能变化的)。于是将 type recstartype1 is table of rowid index by BINARY_INTEGER; 改为 type recstartype1 is table of urowid index by BINARY_INTEGER; 就可以了。 oracle文档如下: Oracle uses a
A single datatype called the universal rowid, or A column of the 12月2日 _serial_direct_read, direct path read和checkpoint (妖精指数:2)这个不是我遇到的问题,是同事遇到的。不过蛮有意思。 一条简单的语句,从plan上来看也没有什么问题。 类似于这样的语句: SQL> explain plan for select * from test where rownum=1; Explained. SQL> @?/rdbms/admin/utlxpls PLAN_TABLE_OUTPUT --------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost | -------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 75 | 45 | |* 1 | COUNT STOPKEY | | | | | | 2 | TABLE ACCESS FULL | TEST | 23440 | 1716K| 45 | -------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter(ROWNUM=1) Note: cpu costing is off 15 rows selected. 可是执行时间确达到了15秒左右。 做10046 trace 结果如下: PARSING IN CURSOR #1 len=59 dep=0 uid=25 oct=3 lid=25 tim=1657038831 hv=37103042 ad='52cd5c98' select xxxxxxxx from xxxxxx where rownum=1 END OF STMT PARSE #1:c=0,e=1,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=3,tim=1657038831 EXEC #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=3,tim=1657038831 WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1650815232 p2=1 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='rdbms ipc reply' ela= 0 p1=5 p2=21474836 p3=0 WAIT #1: nam='enqueue' ela= 307 p1=1413677062 p2=65743 p3=0 WAIT #1: nam='enqueue' ela= 156 p1=1413677062 p2=65743 p3=0 WAIT #1: nam='file open' ela= 0 p1=0 p2=0 p3=0 WAIT #1: nam='direct path read' ela= 2 p1=26 p2=35843 p3=16 FETCH #1:c=8,e=474,p=64,cr=2,cu=5,mis=0,r=1,dep=0,og=3,tim=1657039305 WAIT #1: nam='SQL*Net message from client' ela= 0 p1=1650815232 p2=1 p3=0 FETCH #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=3,tim=1657039305 WAIT #1: nam='direct path read' ela= 1 p1=26 p2=35859 p3=16 WAIT #1: nam='direct path read' ela= 2 p1=26 p2=35875 p3=16 WAIT #1: nam='direct path read' ela= 0 p1=26 p2=35891 p3=16 WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1650815232 p2=1 p3=0 *** 2005-11-29 02:58:28.211 WAIT #1: nam='SQL*Net message from client' ela= 1817 p1=1650815232 p2=1 p3=0 STAT #1 id=1 cnt=1 pid=0 pos=0 obj=0 op='COUNT STOPKEY ' STAT #1 id=2 cnt=1 pid=1 pos=1 obj=0 op='PARTITION RANGE ALL PARTITION: START=1 STOP=25 ' STAT #1 id=3 cnt=1 pid=2 pos=1 obj=16071 op='INDEX FAST FULL SCAN PARTITION: START=1 STOP=25 ' 首先发现10046中出现了direct path read, 但是没有使用PQ的情况下默认是不会走direct path read的。去查看隐藏参数_serial_direct_read,果然设置为true。在这个参数设置为true时,执行全表扫描就会发生 direct path read。 但是direct path read并不是慢的原因,只能说是起因。 为什么会这么慢呢?trace文件中已经很清楚的显示了上面很多rdbms ipc reply。rdbms ipc reply是等待后台进程完成的意思。通过P1=5查看v$process后台进程为checkpoint进程。这个问题之前有遇到过,就是direct path read进行scatter read的时候如果有block在data buffer中首先会触发checkpoint,将buffer中的block写回到disk。所以时间主要是等待在checkpoint上。 问题找到了,解决方法有两种 1. 避免全表扫描 2. 修改参数_serial_direct_read=false 11月28日 On Call的一周结束了终于在周四晚上结束了on call的一周。其实on call期间电话倒接的不多,平均下来一天一两个的样子,但是周六周日不能外出很郁闷,另外感觉手机就是个炸弹,不知道什么时候会响,可能是第一次的原因吧。
结束后顿时轻松了很多,刚好这周是MM的生日。晚上先到同心路八号的玉麒麟搓了一顿。玉麒麟的环境很好,味道可以,菜价格也不贵,适合我,哈哈,赞一个。
然后去唱歌,发现自己功力还在阿,臭美一下
第二天睡了个好觉,不用担心手机响就是幸福啊:)
然后就是去买蛋糕了,最后挑了个水果狂多的,吃了半天也没吃下去,吃了一大半,剩下的要留到第二天做早餐了。
晚上看PLU的中国星际直播。第一次过了一个没有看oracle的周末(公司邮件还是忍不住看了一下),痛快。
感恩节压下了很多事情做不了,下一周事情要比较多了。
11月25日 HW enqueue 的问题(妖精指数:1)有一个系统在繁忙insert, update的时候常常会出现HW enqueue的现象。 解决方法如下: 1. 临时解决, bump HWM alter table HW_Test allocate extent (size 100M instance 1);
2. 修改_bump_highwater_mark_count , 当然这个需要测试和停机维护
3. 修改freelists 11月23日 file_id > db_files起源于在alert.log中发现错误: Corrupt block relative dba: 0x00828f0d (file 2002, block 167693) Bad header found during buffer read Data in bad block - type: 0 format: 2 rdba: 0x36028f0d last change scn: 0x0000.00000000 seq: 0x1 flg: 0x05 consistency value in tail: 0x00000001 check value in block header: 0xb809, computed block checksum: 0x0 spare1: 0x0, spare2: 0x0, spare3: 0x0 可是去查发现最大的file#才只有1367 SQL> select max(file#) from v$datafile; MAX(FILE#) ---------- 1367 dba看一把,发现file_id=2 MSGALERT-qsxdb27$> dba 0x00828f0d Oracle DBA convertor by Stephan Haisley, Center Of Expertise, Oracle Corporation RDBA: 0x828f0d (8556301) File#: 2 Block#: 167693 一开始还以为是千年虫问题,可是一想不对啊,2000年都过去这么久了,不会还有这个问题吧。 到metalink上查了一下,发现原来这个是temp file. temp file的file id为db_files + temp_file_id 果然db_files设定为2000 SQL> show parameter db_files NAME TYPE VALUE ------------------------------------ ------- ------------------------------ db_files integer 2000 SQL> select file# from v$tempfile; FILE# ---------- 1 2 3 4 所以corrupt的是temp file 2,而不是datafile 2(那是回滚段啊,寒一个) 11月19日 冬天----写作的季节今天打开gmail信箱,发现eygle在google oracle群组上发的信 "俺最近开始写<Oracle初学者入门指南>一个系列的东西,希望大家多多指教" 看来冬天真的是一个写作的季节。也许是大家都有到年底总结的习惯,也许是冬天太冷,坐在那儿就不想起来的原因,也许是泡一杯绿茶看着热气升腾而起会将思绪一并带出的原因,总之冬天就是让人想写一点东西出来。 去年冬天也写了一点东西,封存在自己的电脑里面,大部分是关于公司内系统的一些数据库和server的操作手册。现在看起来有一点简陋,看来自己这一年虽然懒散但究竟还是成长了不少。 今年冬天打算也写点东西,究竟写多少,自己也不知道。写一点算一点吧 |
|||||||||
|
|