(c) 1982, 2013, Oracle.? All rights reserved.
--差异部分
14:29:30 open("/u01/app/oracle/dbs/cm_xxxdb.dat", O_RDONLY|O_DSYNC) = -1 ENOENT (No such file or directory)
14:29:30 getcwd("/home/oracle", 256)? ? = 13
14:29:30 open("/proc/self/cmdline", O_RDONLY) = 7
14:29:30 open("/etc/nsswitch.conf", O_RDONLY) = 7
14:29:30 open("/u01/app/oracle/lib/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
14:29:30 open("/etc/ld.so.cache", O_RDONLY) = 7
14:29:30 open("/lib64/libnss_files.so.2", O_RDONLY) = 7
14:29:30 open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 7
14:29:30 open("/u01/app/oracle/lib/libnque11.so", O_RDONLY) = 7
14:29:30 getcwd("/home/oracle", 256)? ? = 13
14:29:30 open("/u01/app/oracle/nls/data/lx20369.nlb", O_RDONLY) = 7
14:29:30 open("/u01/app/oracle/nls/data/lx207d0.nlb", O_RDONLY) = 7
14:29:30 readlink("/proc/self/fd/0", "/dev/pts/0", 254) = 10
14:29:30 open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 7
14:29:30 open("/etc/host.conf", O_RDONLY) = 7
14:29:30 open("/etc/resolv.conf", O_RDONLY) = 7
14:29:30 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 7
14:29:30 open("/etc/hostid", O_RDONLY)? = -1 ENOENT (No such file or directory)
14:29:30 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 7
14:29:30 open("/u01/app/oracle/rdbms/mesg/oraus.msb", O_RDONLY) = 7
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
14:29:30 stat("login.sql", 0x7fff0a822b10) = -1 ENOENT (No such file or directory)
14:29:30 stat("/u01/app/oracle/sqlplus/admin/glogin.sql", {st_mode=S_IFREG|0644, st_size=368, ...}) = 0
14:29:30 access("/u01/app/oracle/sqlplus/admin/glogin.sql", F_OK) = 0
14:29:30 statfs("/u01/app/oracle/sqlplus/admin/glogin.sql", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=174170552, f_bfree=147038317, f_bavail=138190970, f_files=44236800, f_ffree=44019066, f_fsid={1821877354, 763674030}, f_namelen=255, f_frsize=4096}) = 0
14:29:30 open("/u01/app/oracle/sqlplus/admin/glogin.sql", O_RDONLY) = 7
4、跟踪执行进程方式
除了上面介绍的方法外,strace还可以直接跟踪监控正在执行的系统进程。下面我们来观察一下strace对Oracle后台CKPT进程的监控。
[oracle@XXX-Standby-Asm ~]$ ps -ef | grep ckpt
grid? ? 15950? ? 1? 0 Jun05 ?? ? ? ? 00:01:02 asm_ckpt_+ASM
oracle? 18608 17848? 0 17:35 pts/0? ? 00:00:00 grep ckpt
oracle? 21395? ? 1? 0 Jun08 ?? ? ? ? 00:04:27 ora_ckpt_xxxstb
从root角度,跟踪进程编号21395的后台进程。
[root@XXX-Standby-Asm ~]# strace -t -p 21395
Process 21395 attached - interrupt to quit
17:36:42 times({tms_utime=12512, tms_stime=14273, tms_cutime=0, tms_cstime=0}) = 645608271
17:36:42 semtimedop(6062085, {{16, -1, 0}}, 1, {1, 840000000}) = -1 EAGAIN (Resource temporarily unavailable)
17:36:44 getrusage(RUSAGE_SELF, {ru_utime={125, 122978}, ru_stime={142, 730301}, ...}) = 0
17:36:44 getrusage(RUSAGE_SELF, {ru_utime={125, 122978}, ru_stime={142, 730301}, ...}) = 0
17:36:44 times({tms_utime=12512, tms_stime=14273, tms_cutime=0, tms_cstime=0}) = 645608455
17:36:44 times({tms_utime=12512, tms_stime=14273, tms_cutime=0, tms_cstime=0}) = 645608455
17:36:44 read(16, "MSA\0\2\0\10\0P\0\0\0\0\0\0\0\20?P\r\0\0\0\0\0\200\330\266\177\177\0\0"..., 80) = 80
17:36:44 read(16, "MSA\0\2\0\10\0P\0\0\0\0\0\0\0\20?P\r\0\0\0\0\0\200\330\266\177\177\0\0"..., 80) = 80
17:36:44 times({tms_utime=12512, tms_stime=14273, tms_cutime=0, tms_cstime=0}) = 645608455
17:3