lgwr的作用:
the redo log buffer. LGWR writes one contiguous portion of the buffer to the online redo log
1.A user commits a transaction (see “Committing Transactions”).
2.An online redo log switch occurs.
3.Three seconds have passed since LGWR last wrote.
4.The redo log buffer is one-third full or contains 1 MB of buffered data.
5.DBWn must write modified buffers to disk.
观察上面的情况:
strace的基本使用
可以用户strace查看使用方法:
strace -tt -T -v -f -e trace=file -o /data/log/strace.log -s 1024 -p 23489
主要的如下:
-tt 在每行输出的前面,显示毫秒级别的时间
-T 显示每次系统调用所花费的时间
-v 对于某些相关调用,把完整的环境变量,文件stat结构等打出来。
-f 跟踪目标进程,以及目标进程创建的所有子进程
-e 控制要跟踪的事件和跟踪行为,比如指定要跟踪的系统调用名称
-o 把strace的输出单独写到指定的文件
-s 当系统调用的某个参数是字符串时,最多输出指定长度的内容,默认是32个字节
-p 指定要跟踪的进程pid, 要同时跟踪多个pid, 重复多次-p选项即可。
每1M写:
窗口1:准备数据:
begin
for i in 1 .. 1000000000
loop
insert into test values(i,'AAAAAAAAAAA'||i);
end loop;
commit;
end;
/
窗口2:
查看oracle进程:
[oracle@db-test1 ~]$ ps -ef|grep ora_
oracle 5553 1 0 19:28 ? 00:00:01 ora_pmon_study
oracle 5555 1 0 19:28 ? 00:00:01 ora_psp0_study
oracle 5557 1 0 19:28 ? 00:00:02 ora_vktm_study
oracle 5561 1 0 19:28 ? 00:00:00 ora_gen0_study
oracle 5563 1 0 19:28 ? 00:00:00 ora_diag_study
oracle 5565 1 0 19:28 ? 00:00:00 ora_dbrm_study
oracle 5567 1 0 19:28 ? 00:00:07 ora_dia0_study
oracle 5569 1 0 19:28 ? 00:00:00 ora_mman_study
oracle 5571 1 0 19:28 ? 00:00:01 ora_dbw0_study
oracle 5573 1 0 19:28 ? 00:00:01 ora_lgwr_study
oracle 5575 1 0 19:28 ? 00:00:02 ora_ckpt_study
oracle 5577 1 0 19:28 ? 00:00:00 ora_smon_study
oracle 5579 1 0 19:28 ? 00:00:00 ora_reco_study
oracle 5581 1 0 19:28 ? 00:00:02 ora_mmon_study
oracle 5583 1 0 19:28 ? 00:00:05 ora_mmnl_study
oracle 5594 1 0 19:28 ? 00:00:00 ora_qmnc_study
oracle 5624 1 0 19:28 ? 00:00:00 ora_q000_study
oracle 5626 1 0 19:29 ? 00:00:00 ora_q001_study
oracle 5795 1 0 19:33 ? 00:00:00 ora_smco_study
oracle 10773 1 0 21:05 ? 00:00:00 ora_w002_study
找到进程strace:
strace -tf -o /