Ask The Real Tom

July 30, 2009



Solaris System Commands for Oracle DBA’s

Filed under: operating system, oracle — Tags: , , , , , — admin @ 8:21 am

During my work as Oracle DBA with the focus on performance tuning I have to check often stuff on the system level.

Here I like to share my command list for checking importent stuff on solaris 10.

cpu count

psrinfo -v

cpu info

 mpstat  #report per-processor statistics

Memory

/usr/sbin/prtconf | grep Mem
Memory size: 16384 Megabytes

64 or 32 bit

isainfo -v # available
uname -a   # running
isainfo -kv #active

show system error codes

man -s2 intro

Edit / Show process priority

priocntl

Installed Software

 pkginfo | grep VERITAS

ACL (http://www.softpanorama.org/Solaris/ACL/index.shtml)

getfacl foo
setfacl -m user:jeff:rw- foo

Trace process

truss -p <pid>

Summary about system calls

truss -c -p <pid>

Follow forked childs

truss -f <cmd>

Prozess wait statistics

truss -c -p <pid>

DTrace dynamic tracing compiler and tracing utility

    dtrace

Examples dtrace

# New processes with arguments,
dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }'

# Files opened by process,
dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'

# Syscall count by program,
dtrace -n 'syscall:::entry { @num[execname] = count(); }'

# Syscall count by syscall,
dtrace -n 'syscall:::entry { @num[probefunc] = count(); }'

# Syscall count by process,
dtrace -n 'syscall:::entry { @num[pid,execname] = count(); }'

# Disk size by process,
dtrace -n 'io:::start { printf("%d %s %d",pid,execname,args[0]->b_bcount); }'   

# Pages paged in by process,
dtrace -n 'vminfo:::pgpgin { @pg[execname] = sum(arg0); }'

Dtrace References

report user-level lock statistics

plockstat

report kernel lock and profiling statistics

lockstat

Print the /proc tracing flags, the pending and held signals, and other /proc status information for each lwp in each process.

pflags

process tree

ptree

sysdef - output system definition

sysdef -i

ex. max processe kernel parameter

user@abc:/tmp $ sysdef -i |grep proc
fs/procfs
fs/sparcv9/procfs
  30000        maximum number of processes (v.v_proc)
  29995        maximum processes per user id (v.v_maxup)
  100  max undo entries per process (SEMUME)
  250  max attached shm segments per process (SHMSEG)
% prtconf | grep Mem
Memory size: 32760 Megabytes

% id -p
uid=59008(oracle) gid=10001(dba) projid=3(default)

% prctl -n project.max-shm-memory -i project 3
project: 3: default
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
project.max-shm-memory
        privileged      7.84GB      -   deny                                 -
        system          16.0EB    max   deny                                 -
 prctl -n project.max-shm-memory -i project oracle

solaris 10

kernel parameter check

Take a userprocess id (ps -ef |grep ..)

prctl  <pid>

all parameter

prctl -i project oracle

Management Commands

Commands for managing project attributes include the following:

   * projects: Displays project memberships for users, lists projects from the project database, prings information on given projects.
   * newtask: Executes the shell or command in a new task in the current project.
   * projadd: Adds a new entry to the /etc/project entry.
   * projmod: Modifies information for a project in /etc/project.
   * projdel: Deletes a project from /etc/project.
   * rctladm: Displays/modifies global state of active resource controls, sets logging or actions.
   * prctl: Displays/modifies local resource controls.
   * ipcs: Identifies which IPC objects are being used in a project.
   * rcapadm: Manages rcapd memory-capping daemon.
   * prstat -J: Displays resource consumption on a per-project basis
   * priocntl -i project-name: Sets/displays scheduling parameters of the project.
   * poolbind -i project-name: Assigns a project to a resource pool.

process info

Memory by process (rss in kb)

ps -e -o pid,vsz,rss,comm |grep <cmdname>

Sumarize memory of a set of processes

ps -e -o pid,vsz,rss,comm |grep java|awk '{sum = sum + $2} END {print sum}'
ps -ly

GUI - top

sdtprocess

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress