Oracle OS Watcher 安装与错误处理
使用oracle的osw工具,可以对系统的CPU和内存,磁盘等进行图形化的展示,对于把握和了解整体的资源使用情况,具有直观的效果。OS
1. 概述
--------------
使用Oracle的osw工具,可以对系统的CPU和内存,磁盘等进行图形化的展示,对于把握和了解整体的资源使用情况,具有直观的效果。
OSW工具由一系列shell脚本构成,
OSWatcher.sh是主调程序,派生出许多单个的shell进程,使用unix的操作系统诊断工具,来收集特定类型的数据
OSW调用特定的操作系统工具,每个工具作为一个特定的后台进程,进行数据收集。
一般而言支持下述工具:
ps
top
mpstat
iostat
netstat
traceroute
vmstat
输出结果可以进行图形化的展示,当然,也可以使用shell脚本对收集的archive信息进行处理。
--------------
2. 支持平台
--------------
OSW可以运行于下述平台之上:
AIX
Tru64
Solaris
HP-UX
Linux
这个工具要去METLINKE上下载 不过可以到LinuxIDC.COM的ftp资源上下载
下载在Linux公社的1号FTP服务器里,,下载地址:
FTP地址:ftp://www.linuxidc.com
用户名:
密码:
在 2012年LinuxIDC.com\9月\Oracle OS Watcher 安装与错误处理
下载方法见
这个工具可以在Oracle用户下安装,不必要在root下
Oracle] tar -xvf osw301.tar
>cd osw
4. 启动与停止
--------------
./startOSW.sh 60 10
./stopOSW.sh
nohup ./startOSW.sh 60 10 &
60:数据收集的间隔,以秒为单位
10: 数据收集多长时间,以小时为单位
5. 图形化输出展示
[oracle@node1 osw]$ java -jar oswg.jar -i archive/
Warning: -jar not understood. Ignoring.
Exception in thread "main" java.lang.NoClassDefFoundError: oswg.jar
at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
at __gcj_personality_v0 (/opt/oracle/database/admin/dbsrcipt/osw/java.version=1.4.2)
at __libc_start_main (/lib/tls/libc-2.3.4.so)
at _Jv_RegisterClasses (/opt/oracle/database/admin/dbsrcipt/osw/java.version=1.4.2)
先要检查JAVA版本
# java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM AIX build ca142-20050609 (JIT enabled: jitc))
[oracle@node11g ~]$ which java
/usr/bin/java
----10g运行前执行:
[oracle@node10g ~]$ export PATH=$ORACLE_HOME/jre/1.4.2/bin:$PATH
----11g运行前执行:
[oracle@node11g ~]$ export PATH=$ORACLE_HOME/jdk/jre/bin:$PATH
[oracle@node1 osw]$ java -jar oswg.jar -iarchive/
Starting OSWg V3.0.1
OSWatcher Graph Written by Oracle Centerof Expertise
Copyright (c) 2008 by Oracle Corporation
Parsing Data. Please Wait...
Parsing file node1_vmstat_12.09.28.1100.dat...
Invalid data found on line 8
Parsing file node1_vmstat_12.09.28.1700.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 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files
Enter L to Specify Alternate Location ofGif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently DisplayedGraphs
Enter P to Generate A Profile
Enter Q to Quit Program
Please Select an Option:6
Xlib: connection to ":0.0"refused by server
Xlib: No protocol specified
Exception in thread "main"java.lang.InternalError: Can't connect to X11 window server using ':0.0' as thevalue of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(UnknownSource)
at java.awt.Window.init(Unknown Source)
at java.awt.Window.
at java.awt.Frame.
at java.awt.Frame.
at OSWGraph.GraphObject.graphMetric(GraphObject.java:145)
at OSWGraph.OSWGraph.main(OSWGraph.java:616)
编辑环境变量
[root@node1 ~]# vi /home/oracle/.bash_profile
export DISPLAY=192.168.30.42:0.0 --指客户端IP
[root@node1 ~]# source /home/oracle/.bash_profile
[root@node1 ~]# su - oracle
[oracle@node1 osw]$ java -jar oswg.jar -iarchive/
Starting OSWg V3.0.1
OSWatcher Graph Written by Oracle Centerof Expertise
Copyright (c) 2008 by Oracle Corporation
Parsing Data. Please Wait...
Parsing file node1_vmstat_12.09.28.1100.dat...
Invalid data found on line 8
Parsing file node1_vmstat_12.09.28.1700.dat...
Parsing Completed.
--输入参数 分别输出不同类型的GIF
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 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files
Enter L to Specify Alternate Location ofGif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently DisplayedGraphs
Enter P to Generate A Profile
Enter Q to Quit Program
Please Select an Option:6
Generating filegif/Sep28171028_1348827319/OSWg_OS_Run_Queue.gif
Generating filegif/Sep28171028_1348827319/OSWg_OS_Block_Queue.gif
Generating filegif/Sep28171028_1348827319/OSWg_OS_Cpu_Idle.gif
Generating filegif/Sep28171028_1348827319/OSWg_OS_Cpu_System.gif
Generating filegif/Sep28171028_1348827319/OSWg_OS_Cpu_User.gif
Generating filegif/Sep28171028_1348827319/OSWg_OS_Cpu_Interrupts.gif
Generating filegif/Sep28171028_1348827319/OSWg_OS_Context_Switches.gif
在GIF目录下生成了GIF图形 要拖到WINDOWS来看
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 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files
Enter L to Specify Alternate Location ofGif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently DisplayedGraphs
Enter P to Generate A Profile
Enter Q to Quit Program

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.
