index block dump

b-tree indexes are an important access path structure in database and file systems
key property: each possible search path has the same length.

oracle index block splits

index是一个逻辑有顺序的结构并非物理存储block上排序,它总是可以把每个键值有顺序的逻辑排放,索引的高度总是平衡的,并且index leaf block就像一个双向链表,在index leaf block上会记录前一块的地址和后一块的地址,这样在index range scan 是就可以很方便的横向扫描..

,

oracle 消除块竞争(hot blocks)

SELECT p1 “file#”, p2 “block#”, p3 “class#”
FROM v$session_wait
WHERE event = ‘read by other session’;

oracle high load案例及AWR分析过程

Begin Snap: 18125 20-Apr-12 11:01:00 337 1.0
End Snap: 18126 20-Apr-12 12:00:28 490 1.0
Elapsed: 59.46 (mins)
DB Time: 12,979.44 (mins)

ssh 端口转发 助TOAD,PL/SQL DEV窗口程序连接不能直接访问的数据库

SecureCRT ssh 端口转发功能

toad—>127.0.0.1:3000—ssh –>web server—ssh—>db server:1521

in version 10.2 oracle does not support quota on temporary tablespaces,ora-30041

如果在10gr1及以前的版本,在temp tablespace设quota是可以的,但真正的不应该在temp 上设限额,本身就是一个bug,在10gr2中被修复,所以10gr2及以后的版本不在允许

Initializing the Oracle ASMLib driver: [FAILED] on RHEL5.1 asmlib安装详情

Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [FAILED]
log:modprobe: FATAL: Module oracleasm not found.

,

sql script: 找出stale statistics的对象

Using the code below one can find the tables/indexes that have stale statistics in a schema, when options=>’GATHER AUTO’ is used oracle gathers statistics analyzes the tables/indexes that have stale statistics.

, ,

exp EXP-00056 ora-00932 导出异常

[oracle@dev-db backup]$ exp icme3/icme3 file=icme3_20120409.dmp
. exporting sequence numbers
. exporting cluster definitions
EXP-00056: ORACLE error 932 encountered
ORA-00932: inconsistent datatypes: expected BLOB, CLOB got CHAR
EXP-00000: Export terminated unsuccessfully

ORA-00600: internal error code, arguments: [qcsgpvc3] Bug:7172752

when compile package body,
ORA-00600: internal error code, arguments: [qcsgpvc3], [], [], [], [], [], [], []

truncate empty table ora-02266, why? cause

oracle 不允许truncate 一个启用外键引用的父表,因为truncate 不会触发任何trigger和任何constraint验证,当然它也不会关心子表是不是真的为空或是不是没有参照。

DBMS_SHARED_POOL包 创建与使用

DBMS_SHARED_POOL 是从10.2开始提供的包,可以访问shared_pool中的对象,功能检查大于批定大小的对象,加入/移除shared_pool对象,11.1再完善..

Script: Procedure 启用/禁用表上全部外键

一个充满外键的表中DML,因为验证的原因会浪费很多额外时间,如果在确保数据的合法性的前提下先禁用外键约束,操作完后再启用,可以提高你的DML速度,下面一个procedure启用/禁用表上的全部外键。

ORA-600 [25016] internal error when ALTER DATABASE OPEN ORA-01092

sql>ALTER DATABASE OPEN;
ALTER DATABASE OPEN
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced

Script: tom’s printtab code你值得拥有

–Tom Kyte’s printtab code
比如一个查询的列很多,在命令行窗口下看的很乱,就可以用tom的printtab转换成列打印出来

10046跟踪drop tablespace

这两天一个库因操作了基表的dictionary出错,测试一下正常的drop tablespace做了哪些操作

ORA-00600 [kghfrempty:ds] internal error issue

—- Error Stack Dump —–
ORA-00600: 内部错误代码, 参数: [kghrcdepth:ds], [0x7FFE37407008], [], [], [], [], [], [], [], [], [], []
—– SQL Statement (None) —–
Current SQL information unavailable – no cursor.

Script: oracle procedure error 生成txt日志文件

前天有网友问题这个问题,今天测试一把,需求应该是如果producre存储过程运行出错,可以写错误日志到OS的文本文件,这样系统管理员就可以看到,无需分配数据库权限.

AWR 之table scans (short tables)

Verify that your KEEP pool is sized properly to cache frequently referenced tables and indexes. Moving frequently-referenced tables and indexes to SSD or the WriteAccelerator will significantly increase the speed of small-table full-table scans.

impdp 挂起 tatement suspended, wait error to be cleared

ORA-39083: Object type INDEX failed to create with error:
ORA-30032: the suspended (resumable) statement has timed out
ORA-01659: unable to allocate MINEXTENTS beyond 59 in tablespace ICMETBS
ORA-39125: Worker unexpected fatal error in KUPW$WORKER.UNLOAD_METADATA while calling DBMS_METADATA.FETCH_XML_CLOB