In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "what is the DBA fire fighting and killing script". In the daily operation, I believe that many people have doubts about what the DBA fire fighting and killing script is. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what is the DBA fire fighting and killing script?" Next, please follow the editor to study!
As a stressful DBA, you often have to deal with some emergency fire-fighting tasks. When the business is abnormal and the performance is close to paralysis, you need to act decisively to minimize the impact of the system business. As for the cause analysis, you can submit it to the follow-up analysis. The following will deal with different difficulties:
1. Kill the oracle connection process in batches: this is the ultimate trick. In the face of performance paralysis, the problem can be solved immediately, but the waiting business or transaction will be forcibly terminated and need to be re-requested!
Ps-ef | grep LOCAL=NO | awk'{print $2}'| xargs kill-9
2DBA can locate the SQL that causes abnormal performance, and generate batch SQL kill scripts of kill-9 when the database can still connect to the response:
Select 'kill-9' | | spid from v$process where addr in (select paddr from v$session where sid in (select c.sid from v$session c Where username = 'MBS7_OMS' and event='SQL*Net message from dblink'))
3Gravity schema can locate the DBA that causes abnormal performance, and the impact is on the entire schema-level business. If the database can still connect to the response, kill the session of the same user:
Select 'alter system kill session''| | c.sid | |','| | c.SERIAL# | |''; 'from v$session c Where username =' RRJC'
3. This is similar to the second point above, checking and killing the same SQLID session:
Select 'alter system kill session''| | c.sid | |','| | c.SERIAL# | |''immediate;' from v$session c where sql_id='1vnbgy700u1cu'
4. Sometimes you need to troubleshoot some connection processes to facilitate tracking performance problems. The following is to view the login request information of the same SQL_iD:
Select sql_id,logon_time,machine,terminal,osuser from v$session where sql_id='1vnbgy700u1cu' order by logon_time desc
-remember to add the immediate parameter after kill, otherwise it will make pmon recycle for a long time! If you unfortunately use traditional kill, you can release it again by the following methods:
Select 'alter system kill session''| | c.sid | |','| | c.SERIAL# | |''immediate;' from v$session c Where username =' FRNT' and machine in ('jk2','biweb2') and status='KILLED'
If the session is already killed in DB, the above SQL can no longer find the spid. You can use the following SQL to find the SPID.
Select addr, pid, spid FROM v$process p where addr in (select p.addr from v$process p where pid 1 minus select s.paddr from v$session s); at this point, the study of "what is the DBA fire fighting and killing script" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.