摘要:
数据库执行drop table XXX后,查看du -sh 已下降,但df -h /pgdb没有减少,是有还有进程使用对应的文件句柄 1.通过表名确认文件ID 2.确认使用文件ID的进程是否可以删除 3.删除对应进程 4.数据库drop 对应的表 1 drop table table_name; 1 阅读全文
摘要:
select s.oid,s.relname,t.stausename,t.stasubtype from pg_class s,pg_stat_last_operation t where s.relname='XXXX' and t.objid=s.oid; 阅读全文
摘要:
kill方式是杀掉进程,但是有时候需要取消相关SQL语句,采用以下方式 一、查看哪些SQL语句正在执行 语句如下:SELECT datname,procpid,query_start, current_query,waiting,client_addr FROM pg_stat_activity W 阅读全文
摘要:
1.CPU占用最多的前10个进程: ps auxw|head -1;ps auxw|sort -rn -k3|head -10 2.内存消耗最多的前10个进程 ps auxw|head -1;ps auxw|sort -rn -k4|head -10 3.虚拟内存使用最多的前10个进程 ps aux 阅读全文