OSW工具-Oracle的OS watcher
Metalink Note:301137.1
?
在OSW 4.0 之前是:OSWatcher 和 OSWg的關(guān)系。OSW 4.0 后變成了: OSWbb 與 OSWbba 的關(guān)系。
?
安裝及啟動
下載解包以后即可使用:
下面用osw4.0做為例子,4.0以前的版本是一樣的
下載好之后,可以 直接解壓使用 [oracle@test10 osw]$ tar -xvf oswbb4.0.tar? oswbb/ oswbb/htop.sh oswbb/docs/ oswbb/docs/OSWbba_README.txt oswbb/docs/OSW_bb_README.txt oswbb/docs/OSW_Black_Box_Analyzer_Overview.pdf oswbb/docs/OSWatcher_Black_Box_UG.pdf oswbb/docs/OSWatcher_Black_Box_Analyzer_UG.pdf oswbb/Exampleprivate.net oswbb/stopOSWbb.sh ? ? --關(guān)閉osw oswbb/iosub.sh oswbb/profile/ oswbb/OSWatcherFM.sh oswbb/mpsub.sh oswbb/gif/ ? ? ? ? ? ? --生成的圖片放在這里 oswbb/pssub.sh oswbb/oswnet.sh oswbb/vmsub.sh oswbb/oswlnxio.sh oswbb/oswib.sh oswbb/startOSWbb.sh ? ? --開始osw 后面有兩個參加,第一個是間隔時間(S),第二個是保存時間(HH),不帶參數(shù)為每30秒采樣一樣,保存48小時 oswbb/oswsub.sh oswbb/analysis/ oswbb/oswbba.jar ? ? ? --生成圖片時運行這個jar包 oswbb/locks/ oswbb/tmp/ oswbb/OSWatcher.sh oswbb/topaix.sh oswbb/tarupfiles.sh oswbb/xtop.sh oswbb/src/ oswbb/src/Thumbs.db oswbb/src/OSW_profile.htm oswbb/src/tombody.gif oswbb/src/missing_graphic.gif oswbb/src/coe_logo.gif oswbb/src/watch.gif oswbb/src/oswbba_input.txt oswbb/oswrds.sh開始osw: [oracle@test10 oswbb]$ ./startOSWbb.sh? [oracle@test10 oswbb]$? Info...You did not enter a value for snapshotInterval. Info...Using default value = 30 Info...You did not enter a value for archiveInterval. Info...Using default value = 48
Testing for discovery of OS Utilities... VMSTAT found on your system. IOSTAT found on your system. MPSTAT found on your system. NETSTAT found on your system. TOP found on your system.
Testing for discovery of OS CPU COUNT OSWbb is looking for the CPU COUNT on your system CPU COUNT will be used by oswbba to automatically look for cpu problems
CPU COUNT found on your system. CPU COUNT = 1
Discovery completed.
Starting OSWatcher Black Box v4.0 ? on Wed Oct 10 12:19:25 EDT 2012 With SnapshotInterval = 30 With ArchiveInterval = 48
OSWatcher Black Box - Written by Carl Davis, Center of Expertise, Oracle Corporation For questions on install/usage please go to MOS (Note:301137.1) If you need further assistance or have comments or enhancement requests you can email me Carl.Davis@Oracle.com
Starting Data Collection...
oswbb heartbeat:Wed Oct 10 12:19:30 EDT 2012 產(chǎn)生的數(shù)據(jù)保存在archive里。 但這里的數(shù)據(jù)是.dat的文件,不易看,可以使用OSWbba 生成圖像。 使用OSWbba前先設置jdk,安裝 oracle時會默認安裝jdk? PATH=$ORACLE_HOME/jdk/bin:$PATH ? ? ? ?--設置jdk
java -jar oswbba.jar -i /oracle/osw/osw/osw/oswbb4.0/oswbb/archive???? ?--生成圖片,后面的路徑為osw收集的數(shù)據(jù)保存的路徑
[oracle@test10 oswbb]$ java -jar oswbba.jar -i /oracle/osw/osw/osw/oswbb4.0/oswbb/archive
Starting OSW Black Box Analyzer V4.0 OSWatcher Black Box Analyzer Written by Oracle Center of Expertise Copyright (c) ? 2012 by Oracle Corporation
Parsing Data. Please Wait...
Parsing file test10.com.cn_iostat_12.10.10.1200.dat ...
Parsing file test10.com.cn_vmstat_12.10.10.1200.dat ...
Parsing file test10.com.cn_top_12.10.10.1200.dat ...
Parsing Completed.
Enter 1 to Display CPU Process Queue Graphs Enter 2 to Display CPU Utilization Graphs Enter 3 to Display CPU Other Graphs Enter 4 to Display Memory Graphs Enter 5 to Display Disk IO Graphs
Enter 6 to Generate All CPU Gif Files Enter 7 to Generate All Memory Gif Files Enter 8 to Generate All Disk Gif Files
Enter L to Specify Alternate Location of Gif Directory Enter T to Specify Different Time Scale Enter D to Return to Default Time Scale Enter R to Remove Currently Displayed Graphs Enter P to Generate A Profile Enter A to Analyze Data Enter Q to Quit Program
Please Select an Option:8 device=dm-0 Generating file gif/Oct10120543_1349886246/OSWg_dm-0_OS_IO_RPS.gif Generating file gif/Oct10120543_1349886246/OSWg_dm-0_OS_IO_WPS.gif Generating file gif/Oct10120543_1349886246/OSWg_dm-0_OS_IO_ST.gif Generating file gif/Oct10120543_1349886246/OSWg_dm-0_OS_IO_PB.gif device=sda Generating file gif/Oct10120543_1349886246/OSWg_sda_OS_IO_RPS.gif Generating file gif/Oct10120543_1349886246/OSWg_sda_OS_IO_WPS.gif Generating file gif/Oct10120543_1349886246/OSWg_sda_OS_IO_ST.gif Generating file gif/Oct10120543_1349886246/OSWg_sda_OS_IO_PB.gif device=sda1 Generating file gif/Oct10120543_1349886246/OSWg_sda1_OS_IO_RPS.gif Generating file gif/Oct10120543_1349886246/OSWg_sda1_OS_IO_WPS.gif Generating file gif/Oct10120543_1349886246/OSWg_sda1_OS_IO_ST.gif Generating file gif/Oct10120543_1349886246/OSWg_sda1_OS_IO_PB.gif device=dm-1 Generating file gif/Oct10120543_1349886246/OSWg_dm-1_OS_IO_RPS.gif Generating file gif/Oct10120543_1349886246/OSWg_dm-1_OS_IO_WPS.gif Generating file gif/Oct10120543_1349886246/OSWg_dm-1_OS_IO_ST.gif Generating file gif/Oct10120543_1349886246/OSWg_dm-1_OS_IO_PB.gif device=sda2 Generating file gif/Oct10120543_1349886246/OSWg_sda2_OS_IO_RPS.gif Generating file gif/Oct10120543_1349886246/OSWg_sda2_OS_IO_WPS.gif Generating file gif/Oct10120543_1349886246/OSWg_sda2_OS_IO_ST.gif Generating file gif/Oct10120543_1349886246/OSWg_sda2_OS_IO_PB.gif
根據(jù)需要生成圖片,圖片保存在gif文件夾下。
[oracle@test10 oswbb]$ ./stopOSWbb.sh ? --停止osw
osw4.0前的版本是一樣的, 生成圖片時用的是 oswg.jar 這個jar包 java -jar oswg.jar -i /oracle/osw/osw/osw/oswbb4.0/oswbb/archive
?
OSW的診斷信息字段含義說明
?
| 字段 | 描述 |
| oswiostat | |
| tin | Shows the total number of characters read by the system for all ttys |
| tout | Shows the total number of characters written by the system to all ttys. |
| kps | indicates the amount of data transferred (read or written) to the drive in KB per second |
| tps | Indicates the number of transfers per second that were issued to the physical disk. A transfer is an I/O request to the physical disk. Multiple logical requests can be combined into a single I/O request to the disk. |
| serv | average response time of transactions, in milliseconds |
| us | Percentage of CPU cycles spent on user processes |
| sy | Percentage of CPU cycles spent on system processes wt |
| wt | Shows the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request |
| id | Percentage of unused CPU cycles or idle time when the CPU is basically doing nothing . |
| oswmpstat | |
| cpu | Processor ID |
| minf | Minor faults |
| mif | Major Faults |
| xcal | Processor cross-calls (when one CPU wakes up another by interrupting it). |
| intr | Interrupts |
| ithr | Interrupts as threads (except clock) |
| csw | Context switches |
| icsw | Involuntary context switches |
| migr | Thread migrations to another processor |
| smtx | Number of times a CPU failed to obtain a mutex |
| srw | Number of times a CPU failed to obtain a read/write lock on the first try |
| syscl | Number of system calls |
| usr | Percentage of CPU cycles spent on user processes |
| sys | Percentage of CPU cycles spent on system processes |
| wt | Percentage of CPU cycles spent waiting on event |
| idl | Percentage of unused CPU cycles or idle time when the CPU is basically doing nothing |
| oswnetstat | |
| name | Device name of interface |
| Mtu | Maximum transmission unit |
| Net | Network Segment Address |
| address | Network address of the device |
| ipkts | Input packets |
| Ierrs | Input errors |
| opkts | Output Packets |
| Oerrs | Output errors |
| collis | Collisions |
| queue | Number in the Queue |
| oswps | |
| f | Flags s State of the process |
| uid | The effective user ID number of the process |
| pid | The process ID of the process |
| ppid | The process ID of the parent process. |
| d | Processor utilization for scheduling (obsolete). |
| pri | The priority of the process. |
| ni | Nice value, used in priority computation. |
| addr | The memory address of the process. |
| sz | The total size of the process in virtual memory, including all mapped files and devices, in pages. |
| wchan | The address of an event for which the process is sleeping (if blank, the process is running). |
| stime | The starting time of the process, given in hours, minutes, and seconds. |
| tty | The controlling terminal for the process (the message ?, is printed when there is no controlling terminal). |
| time | The cumulative execution time for the process. |
| cmd | The command name process is executing. |
| oswtop | |
| PID | Process ID of process |
| USERNAME | Username of process |
| THR | Process thread PRI Priority of process |
| NICE | Nice value of process |
| SIZE | Total size of a process, including code and data, plus the stack space in kilobytes |
| RES | Amount of physical memory used by the process |
| STATE | Current CPU state of process. The states can be S for sleeping, D for uninterrupted, R for running, T for stopped/traced, and Z for zombied |
| TIME | The CPU time that a process has used since it started |
| %CPU | The CPU time that a process has used since the last update |
| COMMAND | The task's command name |
| oswvmstat | |
| PROCS | |
| r | Number of processes that are in a wait state and basically not doing anything but waiting to run |
| b | Number of processes that were in sleep mode and were interrupted since the last update |
| w | Number of processes that have been swapped out by mm and vm subsystems and have yet to run |
| MEMORY | |
| swap | The amount of swap space currently available free The size of the free list |
| PAGE | |
| re | page reclaims |
| mf | minor faults |
| pi | kilobytes paged in |
| po | kilobytes paged out |
| fr | kilobytes freed |
| de | anticipated short-term memory shortfall (Kbytes) |
| sr | pages scanned by clock algorithm |
| DISK | |
| Bi | Disk blocks sent to disk devices in blocks per second |
| FAULTS | |
| In | Interrupts per second, including the CPU clocks |
| Sy | System calls |
| Cs | Context switches per second within the kernel |
| CPU | |
| Us | Percentage of CPU cycles spent on user processes |
| Sy | Percentage of CPU cycles spent on system processes |
| Id | Percentage of unused CPU cycles or idle time when the CPU is basically doing nothing |
?
OSW的設置
當OSW安裝完畢后,OSW的解壓縮腳本里就提供了管理osw的啟動和停止的scripts。當?shù)谝淮芜\行OSW的時候,系統(tǒng)會自動在osw的目錄下創(chuàng)建一個子目錄archive,并在archive目錄下再創(chuàng)建7個子目錄。
[cs1] /oracle/osw> cd archive
[cs1] /oracle/osw/archive> ls -ltr
total 0
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswprvtnet
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswvmstat
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswtop
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswps
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswnetstat
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswmpstat
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswiostat
[cs1] /oracle/osw/archive>
如果要收集private networks 信息,必須要手工創(chuàng)建一個可執(zhí)行文件在osw目錄下,并且命名為private.net。這個文件的設置可以參考osw目錄下提供的Exampleprivate.net.這個文件中包含了用來檢查RAC private networks 運行traceroute的命令.
比如:
traceroute -r -F node1
traceroute -r -F node2
?
報錯及處理:
報錯一:
[oracle@test oswbb]$ java -jar oswbba.jar -i archive
Starting OSW Black Box Analyzer V4.0.1
OSWatcher Black Box Analyzer Written by Oracle Center of Expertise
Copyright (c)? 2012 by Oracle Corporation
Parsing Data. Please Wait...
Parsing file TEST_iostat_13.10.19.1700.dat ...
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:10:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:11:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:12:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:13:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:14:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:15:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:16:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:25:59 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:26:29 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:26:59 2012
Parsing file TEST_vmstat_13.10.19.1700.dat ...
An exception occured in insertVmstatLists on line 8
An exception occured in insertVmstatLists on line 14
An exception occured in insertVmstatLists on line 20
An exception occured in insertVmstatLists on line 26
An exception occured in insertVmstatLists on line 32
An exception occured in insertVmstatLists on line 38
An exception occured in insertVmstatLists on line 44
An exception occured in insertVmstatLists on line 53
An exception occured in insertVmstatLists on line 59
An exception occured in insertVmstatLists on line 65
Parsing file TEST_top_13.10.19.1700.dat ...
No data found in input archive directory archive
Please rerun OSWbba with proper input directory containing OSW archive data.
Program aborting...
?
在生成圖形界面的時候報錯,注意Timestamp Error報錯信息, 產(chǎn)生這個錯誤的原因就是我的操作系統(tǒng)是中文環(huán)境,osw要英文日期格式才可以。
?
解決辦法:
[oracle@TEST archive]$ echo $LANG?
zh_CN.UTF-8
[oracle@TEST ~]$ LANG=en
[oracle@TEST ~]$ echo $LANG
en
?
報錯二:
?
[oracle@TEST oswbb]$ java -jar oswbba.jar -i archive
Starting OSW Black Box Analyzer V4.0.1
OSWatcher Black Box Analyzer Written by Oracle Center of Expertise
Copyright (c)? 2012 by Oracle Corporation
Parsing Data. Please Wait...
Parsing file TEST_iostat_13.10.19.1700.dat ...
Parsing file TEST_iostat_13.10.19.1800.dat ...
Parsing file TEST_vmstat_13.10.19.1700.dat ...
Parsing file TEST_vmstat_13.10.19.1800.dat ...
Parsing file TEST_top_13.10.19.1700.dat ...
Parsing file TEST_top_13.10.19.1800.dat ...
Parsing Completed.
?
?
Enter 1 to Display CPU Process Queue Graphs
Enter 2 to Display CPU Utilization Graphs
Enter 3 to Display CPU Other Graphs
Enter 4 to Display Memory Graphs
Enter 5 to Display Disk IO Graphs
Enter 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files
Enter 8 to Generate All Disk Gif Files
Enter L to Specify Alternate Location of Gif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently Displayed Graphs
Enter P to Generate A Profile
Enter A to Analyze Data
Enter Q to Quit Program
Please Select an Option:2
>>> Input Error:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
??????? at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
??????? at java.awt.Window.<init>(Window.java:318)
??????? at java.awt.Frame.<init>(Frame.java:419)
??????? at java.awt.Frame.<init>(Frame.java:384)
??????? at e.a(Unknown Source)
??????? at OSWGraph.OSWGraph.main(Unknown Source)
[oracle@TEST oswbb]$
?
原因:無法通過X11圖形界面顯示,因為我用的SecureCRT,沒有圖形界面,故報錯。
?
解決辦法:
如果能訪問服務器的圖形界面最好,如何條件不允許,可以使用工具Xmanager或者VNC
?VNC的安裝配置詳見:http://blog.csdn.net/langkeziju/article/details/9832879
?
總結(jié)
以上是生活随笔為你收集整理的OSW工具-Oracle的OS watcher的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 算法- C语言实现侏儒(地精)排序(Gn
- 下一篇: 判断标题不为空(包含空格)