ITPub博客

首页 > 数据库 > Oracle > adaptive log file sync

adaptive log file sync

原创 Oracle 作者:warmbreeze 时间:2015-12-07 18:32:01 0 删除 编辑
看看polling方式下系统调用情况

SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

SQL> SELECT 
  2     VALUE_KSPVLD_VALUES     
  3  FROM 
  4     X$KSPVLD_VALUES 
  5  WHERE 
  6     LOWER(NAME_KSPVLD_VALUES) ='_use_adaptive_log_file_sync';

VALUE_KSPVLD_VALUES
--------------------------------------------------------------------------------
TRUE
FALSE
POLLING_ONLY

_use_adaptive_log_file_sync有三个值,如果指定为POLLING_ONLY, log file sync就是纯粹的polling方式

1.修改参数
 alter system set "_use_adaptive_log_file_sync"=POLLING_ONLY;

2.suspend lgwr进程
SQL> oradebug setospid 21008
Oracle pid: 17, Unix process pid: 21008, image: oracle@node1 (LGWR)
SQL> oradebug suspend
Statement processed.

3.提交事物
SQL> insert into a values(123);
1 row created.
SQL> commit;
这里hang了
本process的spid是21083

4.strace一下

strace -rp 21083 | more
     0.001526 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.000785 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.001589 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.000923 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.001608 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.001090 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.003045 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.000986 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.000888 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.000990 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.001378 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.000792 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.000951 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.001002 nanosleep({0, 456000}, {1, 202328316}) = 0
     0.000901 nanosleep({0, 456000}, {1, 202328316}) = 0

看看21083的cpu情况
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND 
21083 oracle    20   0 1047m  75m  71m S  3.6  3.8   0:28.81 oracle    
和传统的post/wait方式已经不能同日而语了


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/37279/viewspace-1867723/,如需转载,请注明出处,否则将追究法律责任。

上一篇: event 10261 and pga
请登录后发表评论 登录
全部评论

注册时间:2012-02-15

  • 博文量
    45
  • 访问量
    42544