JAKARTAPROJECT
JAKARTA TIPJSP TIPJSP 질문&답변DATABASE TIPJAVASCRIPT TIPWEBHACKING TIP기타 TIP
잡동사니 팁
잡동사니 팁
알고게신 여러가지 팁들을 올려주세요
DBA가 알아야 하는 유닉스 명령어
kaiser
이미지 슬라이더 보기

            General Performance

vmstat

$ vmstat 5 3
Displays system statistics (5 seconds apart; 3 times):


 

procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr s0 s1 s2 s3 in sy cs us sy id
0 0 0 28872 8792 8 5 172 142 210 0 24 3 11 17 2 289 1081 201 14 6 80
0 0 0 102920 1936 1 95 193 6 302 1264 235 12 1 0 3 240 459 211 0 2 97
0 0 0 102800 1960 0 0 0 0 0 464 0 0 0 0 0 107 146 29 0 0 100

Having any processes in the b or w columns is a sign of a problem system.
Having an id of 0 is a sign that the cpu is overburdoned.
Having high values in pi and po show excessive paging.
  • procs (Reports the number of processes in each of the following states)
    • r : in run queue
    • b : blocked for resources (I/O, paging etc.)
    • w : runnable but swapped
  • memory (Reports on usage of virtual and real memory)
    • swap : swap space currently available (Kbytes)
    • free : size of free list (Kbytes)
  • page (Reports information about page faults and paging activity (units per second)
    • re : page reclaims
    • mf : minor faults
    • pi : Kbytes paged in
    • po : Kbytes paged out
    • fr : Kbytes freed
    • de : anticipated short-term memory shortfall (Kbytes)
    • sr : pages scanned by clock algorith
  • disk (Reports the number of disk operations per second for up to 4 disks
  • faults (Reports the trap/interupt rates (per second)
    • in : (non clock) device interupts
    • si : system calls
    • cs : CPU context switches
  • cpu (Reports the breakdown of percentage usage of CPU time (averaged across all CPUs)
    • us : user time
    • si : system time
    • cs : idle time

CPU Usage

sar

$ sar -u 10 8
Reports CPU Utilization (10 seconds apart; 8 times):


 

Time %usr %sys %wio %idle
11:57:31 72 28 0 0
11:57:41 70 30 0 0
11:57:51 70 30 0 0
11:58:01 68 32 0 0
11:58:11 67 33 0 0
11:58:21 65 28 0 7
11:58:31 73 27 0 0
11:58:41 69 31 0 0
Average 69 30 0 1

%usr: Percent of CPU in user mode
%sys: Percent of CPU in system mode
%wio: Percent of CPU running idle with a process waiting for block I/O
%idle: Percent of CPU that is idle

mpstat

$ mpstat 10 2
Reports per-processor statistics on Sun Solaris (10 seconds apart; 8 times):


 

CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 6 8 0 438 237 246 85 0 0 21 8542 23 9 9 59
0 0 29 0 744 544 494 206 0 0 95 110911 65 29 6 0

ps

$ ps -e -o pcpu -o pid -o user -o args | sort -k 1 | tail -21r
Displays the top 20 CPU users on the system.
%CPU PID USER COMMAND
78.1 4789 oracle ora_dbwr_DDDS2
8.5 4793 oracle ora_lgwr_DDDS2
2.4 6206 oracle oracleDDDS2 (LOCAL=NO)
0.1 4797 oracle ora_smon_DDDS2
0.1 6207 oracle oracleDDDS2 (LOCAL=NO)
etc. etc. etc. etc.

The PID column can then be matched with the SPID column on the V$PROCESS view to provide more information on the process:
SELECT a.username, 
       a.osuser, 
       a.program, 
       spid, 
       sid, 
       a.serial#
FROM   v$session a,
       v$process b
WHERE  a.paddr = b.addr
AND    spid = '&pid';

 

Error Lines in Files

You can return the error lines in a file using:

root> cat alert_LIN1.log | grep -i ORA-

The "grep -i ORA-" command limits the output to lines containing "ORA-". The "-i" flag makes the comparison case insensitive. A count of the error lines can be returned using the "wc" command. This normally give a word count, but the "-l" flag alteres it to give a line count:

root> cat alert_LIN1.log | grep -i ORA- | wc -l
 

Remove DOS CR/LFs (^M)

 

Remove DOS style CR/LF characters (^M) from UNIX files using:
sed -e 's/^M$//' filename > tempfile
The newly created tempfile should have the ^M character removed.
from : http://www.oracle-base.com/articles/misc/UNIXForDBAs.php
2007-02-28 08:46:50
211.189.124.***

서현사랑~ 안녕 안녕 나의 아기별~~

0점 (0명)
덧글 0개 | 태그 1개 | 관련글보기
태그입력
쉽표(,)구분으로 한번에 여러 태그를 입력할수 있습니다
unix (2)
이름 비밀번호
잡동사니 팁
알고게신 여러가지 팁들을 올려주세요
! 번호 제목 글쓴이 일자 조회
기타 툴이나 시스템에 관련된 TIP 게시판 입니다 GoodBug 2005-04-22 5,764
73 좋은레포트 쓰기 kaiser 2009-01-01 6,056
72 이클립스 실행때 에러나는 것 해결방법-Eclipse Ganymede kaiser 2008-10-21 6,784
71 CPU 개수 확인 명령어 kaiser 2008-06-17 7,910
70 svmon svmon 명령어 1 GoodBug 2008-04-11 6,933
69 find grep find 에 정규식 포함한 예제 1 kaiser 2008-04-08 10,372
68 UNIX에서 날짜 가져오기 lkwww 2008-01-29 9,951
67 개행문자 시스템별 개행문자 1 GoodBug 2008-01-07 8,552
66 JDBC 오라클에서 jdbc 드라이버를 10g 이상 사용하라고 하네요 1 1 kaiser 2008-01-03 8,238
65 java에서 properties 활용 가이드 라인 kaiser 2007-12-21 10,522
64 MSTR MicroStrategy (MSTR) 용어 1 GoodBug 2007-11-28 7,647
63 svn 윈도우용 Subvision 설치와 활용(v1.4.5) with subclipse 초간단 버전 2 2 pearl짓거리 전문 2007-11-16 7,192
62 port Unix 시스템 포트번호 2 GoodBug 2007-11-16 6,037
61 MIME MIME 타입 총정리 1 GoodBug 2007-10-27 6,778
60 쉘 스크립트 파일식 GoodBug 2007-09-07 6,926
59 터미널서비스 터미널서비스 원격 접속 로그 확인하는 방법 1 GoodBug 2007-08-20 17,687
unix DBA가 알아야 하는 유닉스 명령어 1 kaiser 2007-02-28 6,751
57 shell 수 비교 GoodBug 2007-01-09 5,517
56 네트워크 드라이브 dos에서 잡는 방법 kaiser 2006-11-09 7,853
55 windows xp 시디키 변경 1 kaiser 2006-11-08 10,868
copyright 2005-2018 by Unicorn