2010-04-07

Solaris cheat sheet for DBA

There are some handy Unix commands for DBA. It was done on Solaris 10.

System Configuration
prtconf
Find physical memory
prtconf | grep Memory

Information about CPU
Physical processors
psrinfo -p
psrinfo -pv
Virtual processors
psrinfo
psrinfo -v

Information about swap
List all swap areas
swap -l
Show swap usage
swap -s
Swapping activity (3 seconds 5 samples)
vmstat -S 3 5

Performance Monitoring
top
prstat
top processes with totals per user
prstat -a
sorted by memory and totals per user (shared memory shown).
prstat -a -s rss

Archiving
zip (-r) recursively and (-y) with symbolic links
zip -vry file.zip target_dir
tar and compress (tar stores symbolic links)
tar -cvf - target_dir | gzip -c > destination_dir/file.tar.gz
Use RELATIVE path for target directory, unless you want to restore files to the same location.
Unpacking tar.gz
cd destination_dir
gunzip < file.tar.gz | tar xvf -

Checksum and digest
digest -va md5 file_name
digest -va sha1 file_name
cksum file_name

32 or 64?
Is my Solaris 64-bit or 32-bit?
/usr/bin/isainfo -kv
Is my Oracle 64-bit or 32-bit?
cd $ORACLE_HOME/bin
file oracle

Oracle files
cat /var/opt/oracle/oratab
cat /var/opt/oracle/oraInst.loc

Solaris files
/etc/vfstab File system mount table
/var/adm/loginlog Log of login attempts
/var/adm/messages Syslog location


No comments:

Post a Comment