lgwr将log buffer中的日志写到redo log的触发条件之一是:每隔3秒钟。
我做了个实验,好像没有被触发啊?SQL> desc t;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NUMBER
NAME VARCHAR2(10)SQL> insert into t values(1,'bucunzai');1 row created.
SQL>--注意这里insert后不要提交
3秒钟后。
[oracle@localhost orcl]$ ll
total 1891108
-rwxrwxrwx 1 oracle oracle 1056768 Oct 11 00:27 assm01.dbf
-rwxrwxrwx 1 oracle oracle 7159808 Oct 11 04:18 control01.ctl
-rwxrwxrwx 1 oracle oracle 7159808 Oct 11 04:18 control02.ctl
-rwxrwxrwx 1 oracle oracle 7159808 Oct 11 04:18 control03.ctl
-rwxrwxrwx 1 oracle oracle 104865792 Oct 11 00:27 example01.dbf
-rwxrwxrwx 1 oracle oracle 5251072 Oct 11 00:27 mssm01.dbf
-rwxrwxrwx 1 oracle oracle 536879104 Oct 11 00:27 perfstat_01.dbf
-rwxrwxrwx 1 oracle oracle 52429312 Oct 11 00:27 redo01.log
-rwxrwxrwx 1 oracle oracle 52429312 Oct 11 00:27 redo02.log
-rwxrwxrwx 1 oracle oracle 52429312 Oct 11 04:18 redo03.log
-rwxrwxrwx 1 oracle oracle 272637952 Oct 11 04:18 sysaux01.dbf
-rwxrwxrwx 1 oracle oracle 513810432 Oct 11 04:16 system01.dbf
-rwxrwxrwx 1 oracle oracle 26222592 Oct 11 00:28 temp01.dbf
-rwxrwxrwx 1 oracle oracle 10493952 Oct 11 00:27 test.dbf
-rwxrwxrwx 1 oracle oracle 89137152 Oct 11 04:18 undotbs01.dbf
-rwxrwxrwx 1 oracle oracle 1056768 Oct 11 00:27 undo_test01.dbf
-rwxrwxrwx 1 oracle oracle 195305472 Oct 11 04:16 users01.dbf
[oracle@localhost orcl]$ strings redo0* | grep bucunzai
[oracle@localhost orcl]$
3 秒钟后,在联机重做日志文件找 我insert 的'bucunzai'字符串,居然没有找到,这么说,lgwr还没有把log buffer中的缓存写以redo log 中啊? 这是怎么回事? 请大是们帮忙指点一下,谢谢。
我做了个实验,好像没有被触发啊?SQL> desc t;
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NUMBER
NAME VARCHAR2(10)SQL> insert into t values(1,'bucunzai');1 row created.
SQL>--注意这里insert后不要提交
3秒钟后。
[oracle@localhost orcl]$ ll
total 1891108
-rwxrwxrwx 1 oracle oracle 1056768 Oct 11 00:27 assm01.dbf
-rwxrwxrwx 1 oracle oracle 7159808 Oct 11 04:18 control01.ctl
-rwxrwxrwx 1 oracle oracle 7159808 Oct 11 04:18 control02.ctl
-rwxrwxrwx 1 oracle oracle 7159808 Oct 11 04:18 control03.ctl
-rwxrwxrwx 1 oracle oracle 104865792 Oct 11 00:27 example01.dbf
-rwxrwxrwx 1 oracle oracle 5251072 Oct 11 00:27 mssm01.dbf
-rwxrwxrwx 1 oracle oracle 536879104 Oct 11 00:27 perfstat_01.dbf
-rwxrwxrwx 1 oracle oracle 52429312 Oct 11 00:27 redo01.log
-rwxrwxrwx 1 oracle oracle 52429312 Oct 11 00:27 redo02.log
-rwxrwxrwx 1 oracle oracle 52429312 Oct 11 04:18 redo03.log
-rwxrwxrwx 1 oracle oracle 272637952 Oct 11 04:18 sysaux01.dbf
-rwxrwxrwx 1 oracle oracle 513810432 Oct 11 04:16 system01.dbf
-rwxrwxrwx 1 oracle oracle 26222592 Oct 11 00:28 temp01.dbf
-rwxrwxrwx 1 oracle oracle 10493952 Oct 11 00:27 test.dbf
-rwxrwxrwx 1 oracle oracle 89137152 Oct 11 04:18 undotbs01.dbf
-rwxrwxrwx 1 oracle oracle 1056768 Oct 11 00:27 undo_test01.dbf
-rwxrwxrwx 1 oracle oracle 195305472 Oct 11 04:16 users01.dbf
[oracle@localhost orcl]$ strings redo0* | grep bucunzai
[oracle@localhost orcl]$
3 秒钟后,在联机重做日志文件找 我insert 的'bucunzai'字符串,居然没有找到,这么说,lgwr还没有把log buffer中的缓存写以redo log 中啊? 这是怎么回事? 请大是们帮忙指点一下,谢谢。
[oracle@localhost orcl]$ strings redo0* | grep bucunzai
strings 能把二进制文件变成字符串的,再用grep匹配,没找到,
后来又做了几次同样的操作,有时候能找到(时间长一点),有时候却找不到,难道oracle所说的3秒写一次,还不一定的?