Unix for the DBA

How to kill all similar processes with single command (in this case opmn)

 


ps -ef | grep opmn |grep -v grep | awk ‘{print $2}’ |xargs -i kill -9 {}

 

Locating Files under a particular directory
find . -print |grep -i test.sql
 Using AWK in UNIX

To remove a specific column of output from a UNIX command – for example to determine the UNIX process Ids for all Oracle processes on server (second column)

ps -ef |grep -i oracle |awk '{ print $2 }'
Changing the standard prompt for Oracle Users

Edit the .profile for the oracle user

PS1="`hostname`*$ORACLE_SID:$PWD>"
 Display top 10 CPU consumers using the ps command
/usr/ucb/ps auxgw | head -11
 Show number of active Oracle dedicated connection users for a particular ORACLE_SID
ps -ef | grep $ORACLE_SID|grep -v grep|grep -v ora_|wc -l
 Display the number of CPU’s in Solaris
psrinfo -v | grep "Status of processor"|wc -l
Display the number of CPU’s in AIX
lsdev -C | grep Process|wc -l
Display RAM Memory size on Solaris
prtconf |grep -i mem
Display RAM memory size on AIX

First determine name of memory device

lsdev -C |grep mem

then assuming the name of the memory device is ‘mem0’

lsattr -El mem0
Swap space allocation and usage
Solaris : swap -s or swap -l
Aix : lsps -a
 Total number of semaphores held by all instances on server
ipcs -as | awk '{sum += $9} END {print sum}'
View allocated RAM memory segments
ipcs -pmb
Manually deallocate shared memeory segments
ipcrm -m '<ID>'
 Show mount points for a disk in AIX
lspv -l hdisk13
 Display amount of occupied space (in KB) for a file or collection of files in a directory or sub-directory
du -ks * | sort -n| tail
Display total file space in a directory
du -ks .
 Cleanup any unwanted trace files more than seven days old
find . *.trc -mtime +7 -exec rm {} /;
 Locate Oracle files that contain certain strings
find . -print | xargs grep rollback
 Locate recently created UNIX files (in the past one day)
find . -mtime -1 -print
 Finding large files on the server (more than 100MB in size)
find . -size +102400 -print
Crontab :

To submit a task every Tuesday (day 2) at 2:45PM

45 14 2 * * /opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1

To submit a task to run every 15 minutes on weekdays (days 1-5)

15,30,45 * 1-5 * * /opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1

To submit a task to run every hour at 15 minutes past the hour on weekends (days 6 and 0)

15 * 0,6 * * opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1

注明:原文请参见http://gavinsoorma.com/unix-for-the-dba/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Unix操作系统的设计》是一本经典的计算机科学书籍,由Maurice J. Bach编写。这本书的设计是为了帮助读者深入理解Unix操作系统的设计原理和实现方式。 这本书首先介绍了Unix操作系统的历史和演变过程,从早期的多道程序设计系统到现代的分时操作系统,展示了Unix系统的发展轨迹。然后,作者解释了Unix系统的设计哲学,强调了其简单、模块化、可扩展的特点。通过透彻的解析,读者可以理解Unix系统为什么如此流行和成功。 接下来,书中详细介绍了Unix系统的各个核心组件,如进程管理、文件系统、内存管理和设备驱动等。通过描述这些组件的设计思想和实现方法,读者可以深入了解Unix系统的内部机制和工作原理。这对于计算机科学专业的学生和软件开发人员来说是非常宝贵的。 此外,《Unix操作系统的设计》还讨论了Unix系统的用户接口和工具,包括命令行界面、Shell编程、程序调试和系统管理等。这些内容使得读者可以全面了解Unix系统的使用方法和应用领域,对于想要成为Unix专家或者从事Unix相关工作的读者来说是非常有帮助的。 总的来说,《Unix操作系统的设计》是一本经典的计算机科学教材,通过对Unix操作系统的设计原理和实现方式的详细介绍,帮助读者深入理解Unix系统的内部工作机制和使用方法。无论是学生还是从事Unix相关工作的专业人士,都会从中受益匪浅。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值