Oracle Series Script 2: Lifesaving stored procedure emergency processing scripts

Source: Internet
Author: User
Tags session id
Background: The database has a long-term execution of stored procedures resulting in excessive resource consumption, the following is expected to quickly locate stored procedures, rapid intervention processing, restore database performance. Long-term operation through the following statements? T more than the database, a.

--Query the stored procedure being executed
SELECT * from V$db_object_cache where locks > 0 and pins > 0 and type= ' PROCEDURE ';

--Query activity execution stored procedure session ID
Select b.sid,b.serial#
From SYS. V$ACCESS A, SYS. V$session b
where A.type = ' PROCEDURE '
and (A.object like Upper ('%pr_sea_pad_jkf_lgk_goods_top% ') or
A.object like Lower ('%pr_sea_rtk_jkf_e_entry_count% '))
and A.sid = B.sid
and b.status = ' ACTIVE ';

--Stop session
Alter system kill session ' 539,2022 ';

Oracle Series Script 2: Lifesaving stored procedure emergency processing scripts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.