Using Oracle storage to analyze the performance of Unix systems (2)

Source: Internet
Author: User
Article Title: using Oracle storage to analyze Unix system performance (2 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

4. Create the get_vmstat.ksh script

The script is used to regularly execute the vmstat command and save the result to the database.

# Get_vmstat.ksh

#! /Bin/ksh

#----------------------------------------

# First set the environment variable and modify it according to the actual environment ....

#----------------------------------------

ORACLE_SID = kamusdb

Export ORACLE_SID

ORACLE_HOME = 'cat/var/opt/oracle/oratab | grep

^ $ ORACLE_SID: | cut-f2-d ':''

Export ORACLE_HOME

PATH = $ ORACLE_HOME/bin: $ PATH

Export PATH

SERVER_NAME = 'uname-a | awk '{print $2 }''

Typeset-u SERVER_NAME

Export SERVER_NAME

#----------------------------------------

# Run vmstat every 5 minutes (300 seconds). You can modify it according to the actual situation ....

#----------------------------------------

SAMPLE_TIME = 300.

#----------------------------------------

# Once the script is run, it will not stop unless the operating system is closed ....

# The-S parameter indicates the condition of monitoring the swap space and reports the si and so columns.

# $ In msg $ indicates an arbitrary 2-digit number, which is automatically generated by the system.

#----------------------------------------

While true

Do

Vmstat? S $ {SAMPLE_TIME} 2>/tmp/msg $

[1] [2] [3] Next page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.