分类: Oracle
2016-09-12 11:30:59
客户反映前端系统反映很慢,自己通过sqlplus登录发现时而正常时而卡顿,登录之后有没有明显症状,需要诊断原因。
因为客户反映登录之后并没有异常,所以先不怀疑是db端出现了性能问题,必须先从客户端程序下手,对于诊断登录问
题,需要调查登录阶段时间都花费在了那些调用上, 于是需要可以提供strace 输出:
strace -f -ttt -o sqlplus.trc sqlplus / as sysdba
收集信息如下:
+ sqlplus.trc
11114 1468996741.620272 execve("/u01/app/oracle/product/11.2.0/bin/sqlplus", ["sqlplus", "system/spring"], [/* 29 vars */]) = 0
11114 1468996741.849734 read(11,
11115 1468996741.849800 getrusage(RUSAGE_SELF, {ru_utime={0, 8998}, ru_stime={0, 28995}, ...}) = 0
11115
1468996741.871284
open("/u01/app/oracle/admin/orcl/adump/orcl_ora_11111_1.aud",
O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
11115
1468996741.871284
open("/u01/app/oracle/admin/orcl/adump/orcl_ora_11112_1.aud",
O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
11115
1468996741.871284
open("/u01/app/oracle/admin/orcl/adump/orcl_ora_11113_1.aud",
O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
11115
1468996741.871284
open("/u01/app/oracle/admin/orcl/adump/orcl_ora_11114_1.aud",
O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
11115
1468996741.871284
open("/u01/app/oracle/admin/orcl/adump/orcl_ora_11115_1.aud",
O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
11115
1468996741.871284
open("/u01/app/oracle/admin/orcl/adump/orcl_ora_11116_1.aud",
O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
11115
1468996741.871284
open("/u01/app/oracle/admin/orcl/adump/orcl_ora_11117_1.aud",
O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
11115
1468996741.871284
open("/u01/app/oracle/admin/orcl/adump/orcl_ora_11118_1.aud",
O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
11115
1468996743.559319
open("/u01/app/oracle/admin/orcl/adump/orcl_ora_11115_122.aud",
O_RDWR|O_CREAT|O_EXCL, 0660) = 8 <<<1.7s
11114 1468996743.579234 read(0, "exit\n", 1024) = 5
11114 1468996747.659642 write(10, "\0\r\0\0\6\0\0\0\0\0\3\t\10", 13
11115 1468996747.659687 <... read resumed> "\0\r\0\0\6\0\0\0\0\0\3\t\10", 8208) = 13
11114 1468996747.659702 <... write resumed> ) = 13