Unix system performance monitoring tools-SAR

Source: Internet
Author: User

Unix system performance monitoring tools-SAR

System Environment:

Operating System: AIX 5.3.9

Oracle: Oracle 10gR2

SAR can be used to monitor Unix system performance and help us analyze performance bottlenecks. The sar tool is used in the form of "sar [Option] intervar [count]", where interval is the statistical information sampling time, and count is the number of samples.

RH442 strategy SAR

Understanding of Linux from SAR to SAR2html

Linux SAR performance counter Tool

Linux SAR usage

Detailed use of SAR commands in UNIX

Linux certification guide: Linux SAR commands

The following describes how to use sar to obtain the following performance analysis data:

  1. Overall CPU usage statistics
  2. CPU usage statistics
  3. Memory usage statistics
  4. Overall I/O
  5. Various I/O devices
  6. Network statistics

Common options include:

-B: report I/O usage and transmission rate. (This option is only applicable to 2.5 and earlier kernels. Therefore, the new kernel may not support this option)

-B: Report "page" Usage

-C: Report Process Creation status

-D: report the usage of each block Device

(When you use it, you will find a string similar to the dev1-7 format in the DEV column,

1 indicates the master sequence number of the device, and n indicates the slave sequence number of the device,

In addition, the Unit of the rd_sec/s column and wr_sec/s column is 512 bytes, that is, 512B, that is, KB)

-I: Report interruptions

-N: Report Network Conditions

-P: Set the CPU

-Q: Report queue length and load information

-R: Report memory and swap zone usage

-R: Reports memory usage

-U: CPU usage report

-V: reports information about I nodes, files, and other kernel tables.

-W: Reporting System context switching

-X: Provides statistics for a specific PID,

You can directly specify the process ID;

You can also specify it as SELF to detect the sar process itself;

If this parameter is set to ALL, ALL system processes are reported.

-X: Report the sub-process information of a specific PID.

-Y: Set TTY device information.


Case Analysis:

1. System Environment

 

[Root @ aix211/] # lspv

 

Hdisk0 00040f8aaa29d28e rootvg active

Hdisk1 000e1a6ce663b4af asmvg active


[Root @ aix211/] # lsvg-l asmvg

 

 

Asmvg:

Lv name type LPs PPs PVs LV STATE MOUNT POINT

Lv_asm1 jfs 64 64 1 open/syncd N/

Lv_asm2 jfs 64 64 1 open/syncd N/

Lv_asm3 jfs 64 64 1 open/syncd N/

Lv_asm4 jfs 64 64 1 open/syncd N/

 


SQL> set linesize 120

SQL> select group_number, name, state from v $ asm_diskgroup;

 

 

GROUP_NUMBER NAME STATE

-----------------------------------------------------

1 DG1 MOUNTED

2 RCY1 MOUNTED


SQL> select GROUP_NUMBER, DISK_NUMBER, STATE, NAME, PATH from v $ asm_disk;

 

 

GROUP_NUMBER DISK_NUMBER STATE NAME PATH

-------------------------------------------------------------------------------------

1 0 NORMAL DG1_0000/dev/rlv_asm1

1 1 NORMAL DG1_0001/dev/rlv_asm2

2 0 NORMAL rcy00000000/dev/rlv_asm3

2 1 NORMAL rcy00000001/dev/rlv_asm4


Create an ASMVG disk on the hdisk1 disk and a logical volume. Create an ASM disk Based on the logical volume;

2. database environment

SQL> set linesize 120

SQL> select file_id, file_name, tablespace_name from dba_data_files

 

FILE_ID FILE_NAME TABLESPACE_NAME

---------------------------------------------------------------------------------------

6 + DG1/prod/datafile/tbs2.265.853498689 TBS2

4 + DG1/prod/datafile/users.261.848857443 USERS

3 + DG1/prod/datafile/sysaux.258.848857287 SYSAUX

2 + DG1/prod/datafile/undotbs1.260.848857407 UNDOTBS1

1 + DG1/prod/datafile/system.257.848857161 SYSTEM

5 + DG1/prod/datafile/example.259.848857363 EXAMPLE


SQL> select file_id, file_name, tablespace_name from dba_temp_files;

 


FILE_ID FILE_NAME TABLESPACE_NAME

---------------------------------------------------------------------------------------

2 + DG1/prod/tempfile/temp.262.848858041 TEMP


SQL> col member for a50

SQL> select group #, member from v $ logfile order by 1;

 

GROUP # MEMBER

------------------------------------------------------------

5 + DG1/prod/onlinelog/group_5.263.848858213

5 + RCY1/prod/onlinelog/group_5.256.848858217

6 + DG1/prod/onlinelog/group_6.264.848858253

6 + RCY1/prod/onlinelog/group_6.257.848858259


SQL> show parameter log

 

 

123


NAME TYPE VALUE

-----------------------------------------------------------------------------

Log_archive_dest_1 string location =/arch/arch_prod


2. Case (execute data insertion)

SQL> select * from tab;

TNAME TABTYPE CLUSTERID

-----------------------------------------------

DEPT TABLE

EMP TABLE

BONUS TABLE

SALGRADE TABLE

EMP1 TABLE

DEPT1 TABLE

6 rows selected.

SQL> create table t1 (id int );

Table created.

SQL> begin

2 for I in 1 .. 100000 loop

3 execute immediate 'insert into t1 values ('| I | ')';

4 end loop;

5 end;

6/

PL/SQL procedure successfully completed.

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.