Ndba

ndba.egloos.com

포토로그 마이가든



truss ( 디버깅 ) 사용 법 UNIX

출처 : 
http://blog.naver.com/PostView.nhn?blogId=saakan&logNo=40020221825&redirect=Dlog&widgetTypeCall=true


TRUSS 사용법
============
PURPOSE
-------
    System hang  이 걸리는 경우 oradebug 나, truss 를 통해 찾는 방안이다

Explanation
-----------
1. Oracle server process의 activity를 oradebug를 이용하여 trace
1) oracle process의 unix pid를 찾는다.
   $ps -ef|grep sqlplus 를 이용하여 sqlplus의 ip를 찾는다
   $ps -ef|grep pid 
 
즉 child process(oracle) pid를 찾는다.

2) 기존의 svrmgrl session에서 oradebug를 이용하여 event 10046을 set함
  
      svrmgr>oradebug setospid 1234
      svrmgr>oradebug event 10046 trace name context forever, level 12
3) user_dump_dest에서 trace file 내용을 확인(wait event확인)하여 문제를
찾는다.

2. TRUSS
 truss는  unix platform에 있는 utility로서(모든 platform에 있는 것은 
아니며 platform 별로 이름이 틀리기도 하다. truss,trace,
strace,par등으로) 특정 실행 file이 실행 시 수행한 system call과 
다른 곳으로 전달하기 위한 argument를 보여 주는 것이다.
excutable program이 user code에서 system code로 변하는 시점의 system 
call을 보여 주는 것으로 file 또는 i/o device의 open이나 
또는 file,i/o device를 이용한 read또는 write시 또는 signal handling시
그외에도 child process의 spawning 등을 추적하고 보여 주는 것이다.
이의 사용을 위한 command 는
  truss -o /tmp/mytruss <program> <any arguments>
  truss -o /tmp/mytruss -p <pid of process>
  truss -o /tmp/mytruss -fae -p <pid of process> 이다
 RS6000(AIX)경우는 truss command를 이용할 수 없고 smit admin tool에서
process 의 sys call을 trace 할 수 있다.
 
1) truss는 다음과 같은 경우에 이용하면 효과적입니다.
     (1) process에 의해 open 된 file을 확인하거나 그 file을 access서
         발생하는 error를 확인하는 데 
     (2) read나 wrote를 위해 open한 file의 contents를 확인하는 데
     (3) 어떤 sub-process가 spawn되었는지 아는 데
     (4) sub-process의 운영 환경을 확인하는 데
     (5) 어떤 dynamic libraries가 load되는지 아는 데
     (6) process가 spinning하는지 확인할 때  등입니다.
2) 다음과 같은 경우엔 truss가 비효율적 입니다.
     (1) memory mgmt나 memory leakage issue에서
     (2) 어떤 oracle function이 running되는지 알고자 할 때.
     (3) stack information을 얻고자 할 때

[출처] TRUSS 사용법|작성자 사아칸

공유하기 버튼

 

DNS cache flush 리눅스

http://www.cyberciti.biz/faq/rhel-debian-ubuntu-flush-clear-dns-cache/

공유하기 버튼

 

AIX du max-depth 1 UNIX

du -k | perl -ne 'print if (tr#/#/# == 1)'

공유하기 버튼

 

[링크] AIX support for Power 7 UNIX

공유하기 버튼

 

[공유] 한글이 포함된 문자열을 특정 byte로 자르기 기타

공유하기 버튼

 

1 2 3 4 5 6 7 8 9 10 다음