In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
这篇文章主要介绍"DBA常用的linux命令介绍",在日常操作中,相信很多人在DBA常用的linux命令介绍问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"DBA常用的linux命令介绍"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
按oracleSID来查询连接数据库的客户端IP
netstat -anpT | grep oracleSID | awk '{print $5}' | grep -o -E '1.*:' | awk -F ':' '{print $1}' | sort
按监听端口1521来查询连接数据库的客户端IP
netstat -anpT | grep 1521 | awk '{print $5}' | grep -o -E '1.*:' | awk -F ':' '{print $1}' | sort
杀掉数据库服务器上连接数据库oracleSID的客户端的进程
kill -9 `ps -ef | grep oracleSID | grep LOCAL=NO | grep -v grep | awk '{print $2}'`
删掉某个用户userA下面的所有进程
pkill -9 -u userA
查询连接1521端口的process进程数
netstat -pan |grep 1521 |wc -l
查询来自某台服务器192.168.21.15的连接的process进程数
netstat -pan |grep 192.168.21.15 |wc -l
汇总连接1521端口的每个客户端IP的连接数
netstat -apnT|grep 1521 |awk '{print $5}'|sort -u |grep -v 1521 |grep -v '*' |awk -F ':' '{print $4}'|uniq -c |sort -nr
netstat -anpT|grep 1521 |awk '{print $5}'|grep -o -E '1.*:' |awk -F ':' '{print $1}' | sort |uniq -c |sort -nr
显示前10个占用空间最大的文件或目录
du -s * | sort -nr | head
统计某一天的所有文件的总量大小
ls --full-time `find ./* -name "log_*.bak"` | grep '2016-05-09' | awk '{print $9}' | xargs du -ck
删除几天前的文件
find /mitac/mds/arch/ -ctime +150 -exec rm -rf {} \;--常用
find /mitac/mds/arch/ -name '*836701255.dbf' -ctime +150 -exec rm -rf {} \;--删除以836701255.dbf结尾,150天前被修改过的文件
CPU占用最多的前10个进程:
ps auxw|head -1;ps auxw|sort -rn -k3|head -10
内存消耗最多的前10个进程
ps auxw|head -1;ps auxw|sort -rn -k4|head -10
虚拟内存使用最多的前10个进程
ps auxw|head -1;ps auxw|sort -rn -k5|head -10
top后按1,可以看到多少个cpu,按shift+p则按cpu排序,按shift+m则按内存排序
vi替换所有字符串,如下把1都换成2
:%s/1/2/g
查看IO信息,如下每1秒显示一次,一共显示3次,显示为MB
iostat -d -x -m 1 3
查看cp一个文件file1到/u01目录下需要多长时间
time cp file1 /u01/
查看CPU某段时间比如7:00到9:00期间的使用率
sar -s 07:00:00 -e 10:00:00
到此,关于"DBA常用的linux命令介绍"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.