Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common commands used by linux to deal with oracle problems

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What are the common commands used by linux to deal with oracle problems? in view of this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

1. Press oracleSID to query the client IP that connects to the database

Netstat-anpT | grep oracleSID | awk'{print $5}'| grep-o-E'1. Collect charge'| awk-F':'{print $1}'| sort

two。 Press listening port 1521 to query the client IP that connects to the database

Netstat-anpT | grep 1521 | awk'{print $5}'| grep-o-E'1. Print $1}'| awk-F':'{print $1}'| sort

3. Kill the process of the client that connects to the database oracleSID on the database server

Kill-9 `ps-ef | grep oracleSID | grep LOCAL=NO | grep-v grep | awk'{print $2}'`

4. Delete all processes under a user's userA

Pkill-9-u userA

5. Query the number of process processes connected to port 1521

Netstat-pan | grep 1521 | wc-l

6. Query the number of process processes connected from a server 192.168.21.15

Netstat-pan | grep 192.168.21.15 | wc-l

7. Summarize the number of connections per client IP connected to port 1521

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.collect nr' | awk-F':'{print $1}'| sort | uniq-c | sort-nr

8. Show the top 10 files or directories that take up the most space

Du-s * | sort-nr | head

9. Count the total size of all files on a given day

Ls-- full-time `find. / *-name "log_*.bak" `| grep '2016-05-09' | awk' {print $9}'| xargs du-ck

10. Delete files from a few days ago

Find / mitac/mds/arch/-ctime + 150-exec rm-rf {}\;

Find / mitac/mds/arch/-name'* 836701255.dbf'-ctime + 150-exec rm-rf {}\;-Delete files that ended with 836701255.dbf and were modified 150 days ago

11. The top 10 processes occupied by CPU:

Ps auxw | head-1 | PS auxw | sort-rn-K3 | head-10

twelve。 Top 10 processes with the most memory consumption

Ps auxw | head-1 | PS auxw | sort-rn-K4 | head-10

13. Top 10 processes with the most virtual memory usage

Ps auxw | head-1 | PS auxw | sort-rn-K5 | head-10

Press 1 after top to see how many cpu, sorted by cpu by shift+p, and sorted by memory by shift+m

14. Vi replaces all strings, as follows, replace 1 with 2

:% sAccord 1Compact 2Compact g

15. Check the IO information, which is displayed as follows every 1 second, for a total of 3 times, as MB

Iostat-d-x-m 1 3

16. Check how long it takes for a cp file to file1 to the / U01 directory

Time cp file1 / u01/

17. Check the usage of CPU during a certain period of time, such as 7:00 to 9:00

Sar-s 07:00:00-e 10:00:00

This is the answer to the questions about the commands commonly used by linux to deal with oracle problems. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report