Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Thursday, September 01, 2011

Unix Notes - System / Kernel Parameters

sysdef -i
pending

Wednesday, August 31, 2011

Unix Notes - iostat

iostat -x 5 100
                 extended device statistics
device    r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b
md10      1.2   15.2    9.6   19.7  0.1  0.5   35.9   8   8
md11      0.6   15.2    4.8   19.7  0.0  0.5   29.9   0   7
md12      0.6   15.2    4.8   19.7  0.0  0.4   28.1   0   7
md20      0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
md21      0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0

Tuesday, August 16, 2011

Unix Notes - Server Performance Monitoring with TOP

/usr/local/bin/top
load averages:  1.49,  1.43,  1.52;                    up 0+03:4211:08:29
344 processes: 341 sleeping, 3 on cpu
CPU: 93.9% idle,  5.6% user,  0.5% kernel,  0.0% iowait,  0.0% swap
Memory: 128G phys mem, 33G free mem, 63G swap, 63G free swap

   PID USERNAME LWP PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND
 26167 oracle     1   0    0   64G   64G cpu      0:02 52.42% oracle
 26175 oracle     1   0    0   64G   64G cpu      0:01 24.22% oracle
  4884 oracle     1  59    0 1157M 1153M sleep    4:56 17.69% oracle
 14457 oracle    11  59    0   64G   64G sleep    0:06  7.65% oracle
 14329 oracle    11  59    0   64G   64G sleep    0:12  6.31% oracle
 12036 oracle     1  59    0   64G   64G sleep    0:24  2.34% oracle
  4093 oracle     1  59    0   64G   64G sleep    2:20  1.47% oracle
 12034 oracle    11  59    0   64G   64G sleep    0:05  1.24% oracle
 24352 oracle     1  59    0   64G   64G sleep    0:00  1.08% oracle
 10318 oracle     1  59    0   64G   64G sleep    0:12  1.06% oracle
  4995 oracle     3  43    0   46M   34M sleep    0:33  0.71% tnslsnr
  4527 oracle     1  59    0   64G   64G sleep    0:21  0.55% oracle
  5939 oracle     1  59    0   64G   64G sleep    0:00  0.47% oracle
  8863 oracle     1  59    0   64G   64G sleep    0:07  0.42% oracle
 23943 jvogel     1  59    0 3816K 2832K cpu      0:02  0.38% top

Tuesday, August 02, 2011

Unit Notes - vmstat (virtual memory statistics)

Reference: http://en.wikipedia.org/wiki/Vmstat

I've formatted the following example to make it a little easier to read.

$ vmstat 5
  kthr      memory            page             disk            faults        cpu
 r  b w   swap    free   re   mf   pi  po fr de sr m0 m2 m3 m4  in    sy     cs  us sy id
 3  6 0 9901864 4988152 1312 1293 2295 22 47  0  9  1  0  9  1  831    877    90 49 11 40
 0 10 0 6819504 2078880 1153 5777 4383  5  3  0  0  0  0  1  1 4642 188881 18478 32 12 57
 0  9 0 6813976 2075208 1350 7623 4380  6  6  0  0  0  0  2 18 5293 171861 18412 32 15 53
 0 10 0 6793096 2060464 1587 5025 4361 16 14  0  0  0  0  2  0 5773 192402 19898 31  9 59
 0 12 0 6781504 2046376 1865 8465 4436 16 16  0  0  0  0  7  0 6014 185604 17696 48 11 41
 0  6 0 6786576 2049600 1269 5981 4369  8  8  0  0  2  0  2  0 5592 203470 21790 35 10 55 
In this specific example, we are having issues with blocking.

Thursday, June 23, 2011

Unix Notes - Find a File

Related Posting: To find a string within a file list, see this post.

Find all the SQL (*.sql) files in the current directory:

find . -name '*.sql'

To hide any [access] errors, include 2>/dev/null at the end of the line.

find . -name '*.sql' 2>/dev/null

To list only files and avoid all directories:

find . -type f -name '*.sql' 2>/dev/null

Search all directories ('/' is the top level directory reference):

find / -type f -name '*.sql' 2>/dev/null

Unix Notes - Find Text / String in Files

From the current directory and down, search for "ldapDelete" explicitly. Hide any read/access errors (2>/dev/null).

find . -exec grep "ldapDelete" '{}' \; -print 2>/dev/null
From the current directory and down, search for "ldapdelete" WITHOUT case sensitivity.
find . -exec grep -i "ldapdelete" '{}' \; -print 2>/dev/null

Friday, June 25, 2010

Execute Shell Commands from Oracle

Excellent article on executing command line functionality from within Oracle.

Be aware!

  • Requires special permissions to execute 
  • Security risk

http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php

Monday, June 21, 2010

Unix Notes - CRON

-- Location of cron jobs
/var/spool/cron/crontabs

Monday, June 07, 2010

Unix Notes - Root and sudo access

-- sudo access
/usr/local/bin/sudo su -

Wednesday, May 05, 2010

Unix Notes - Change Password

-- Change Password
passwd <username>

Unix Notes - Disk Utilization

 
-- Show Disk Space Utilization by Directory 
du -sk * | sort -rn | more

-- Show Disk Space Free for the current directory
df -h

-- Show Disk Space Free for /export/home
df -h /export/home

Thursday, April 29, 2010

Unix Notes - Wide display for ps

/usr/ucb/ps auxw