mysql 快速复制数据库

MyIsam 引擎复制相对容易,把库下面所有文件拷过去就好了。复制Innodb的做法相对复杂,下面是我在innodb 上复制数据库的方法,用mysqldump

where is null 走索引

普通了b树索引是对null不可能走索引的,不讨论cluster table,但是可以通过建立复合索引来使where is null 走索引,

What is “save undo”?

save undo is undo saved for offlined tablespaces. It is also known as deferred rollback

如何看待sql执行计划里的cost

cost 内部记算方法oracle也不会公开,oracle内部用来比较各个执行计划所耗费的代价的值,从而使优化器可以选择最好的执行计划。不同语句的cost值不具有可比性,只能对同一个语句的不同执行计划的cost值进行比较。

trace create user command, who is _next_user?

接着上一篇的问题,再来分析一下用户表,用10046跟踪一下create user

drop tablespace ORA-01561案例

今天遇到了一个奇怪的问题,有一个表空间无法删除,开始删除提示表空间内有对象,加上INCLUDING CONTENTS选项级连删除又报
ORA-01561: failed to remove all objects in the tablespace specified,查一些系统视图该对象还不存在

events errorstack 分析job失败一例

早接到电话说从sqlserver同步过来的数据在oracle 应用没查到,我查询同步job发现失败了,job所调用的procedure 生成了错误编号ORA-02291
procedre中代码较多,决定用errorstack快速定位一下sql

ORA-01461: can bind a LONG value only for insert into a LONG column解决

ERROR at line 1:
ORA-01461: can bind a LONG value only for insert into a LONG column
ORA-06512: at line 4

ORA-01144: File size (4194304 blocks) exceeds maximum of 4194303 blocks

Operating system dependent. Limited by maximum operating system file size; typically 2^22 or 4 MB blocks

ORA-01652: unable to extend temp segment by 8192 in tablespace

今天发现了这个问题,分析记录一下问题是这样子的,有一个表记录7亿,要在表上建索引,临时表空间已分配32G,DB DEFAULT BLOCK SIZE 8K,建索引时报了这个错误

exp,imp 产生错误数据46588.21 bug

exp,imp到其他9i数据库里出现部分数据变成了 46588.21 ,只因为指定了buffer

粗谈 Load_average 负载

linux/unit 系统中查看cpu系统负载,都会先看一下这个参数,这个值在uptime 或ps 中都有

性能诊断之视图V$SESSION_LONGOPS

该视图记录任何的是操作时间超过6秒的,但是要注意并不是所有的超过6秒的记录都会在这里

解决行迁移 案例

table_name chain_cnt sta
———————– ———– ——-
ICME_SIMULATE_QA_STATUS 501443 YES

DML returning into 用法,使用操作前的值

The RETURNING INTO clause allows us to return column values for rows affected by DML statements. The following test table is used to demonstrate this clause.

详解dump block trace file,找出行链接

block_row_dump:
tab 0, row 0, @0x819
tl: 2061 fb: –H-F–N lb: 0x0 cc: 3
nrid: 0x0180005e.0
col 0: [ 2] c1 02

关于ORACLE 行链接与行迁移

无论是行链接还是行迁移,都会影响数据库的性能。Oracle在读取这样的记录的时候,Oracle会扫描多个数据块,执行更多的I/O。

event 10046 简单使用

Level 0 停用SQL跟踪,相当于SQL_TRACE=FALSE
Level 1 标准SQL跟踪,相当于SQL_TRACE=TRUE
Level 4 在level 1的基础上增加绑定变量的信息
Level 8 在level 1的基础上增加等待事件的信息

Events latch: cache buffers chains

Top 5 Timed Events

Event Waits Time(s) Avg Wait(ms) % Total Call Time Wait Class
CPU time 26,173 42.3
latch: cache buffers chains 21,954 4,041 184 6.5 Concurrency

,

关于深入shared pool

shared pool 由perm,libary cache,row catch(dictionary catch),reserved area(保留),free area 组成。