Find the program corresponding to the oracle session based on memory usage

Source: Internet
Author: User
??? Generally, the oracle database is slower. First, you need to find the process with the largest memory and CPU occupied by the AIX operating system, and then find the corresponding oraclesession and program by the process ID, to optimize .??? Do the following :???? AIX operating system operation: Memory sorting :??? Ps-ealf | head-1; p

? ? ? Generally, when the oracle database is slow, the system first looks for the process with the largest memory and CPU occupied by the AIX operating system, and then finds the corresponding oracle session and program by the process ID, to optimize. ? ? ? Do the following :? ?? ? AIX operating system operation: Memory sorting :? ? ? Ps-ealf | head-1; p

? ? ? Generally, when the oracle database is slow, the system first looks for the process with the largest memory and CPU occupied by the AIX operating system, and then finds the corresponding oracle session and program by the process ID, to optimize.

? ? ? Do the following:


? ??? Operating System of AIX:

  1. Memory sorting :? ? ? Ps-ealf | head-1; ps-ealf | sort-rn + 9 | head-50
  2. CPU sorting :? ? ?? Ps aux | head-1; ps aux | sort-rn + 2 | head-20
  3. Find the maximum resource: ps aux | sort-rn + 2 | head-20
? ? ? Two Dynamic views of Oracle:
  1. Gv $ process: the process here is at the operating system level and the portal for debugging the oracle database;
  2. Gv $ session: Enter the oracle session, view the corresponding program, and so on.
? ? ? ? ? Note: g in front of v indicates the cluster. If multiple instances exist, you can use the gv $ view to conveniently view the instances where the program runs.

?? ? ? Procedure:


? ?? ? ?? First, find the address of the Process corresponding to the largest resource PID: select addr from gv $ process where spid in (6423194)

? ? ?? ? ?? Select? Addr? From? Gv $ process? Where? Spid? In? (1880090 ?)

? ??? ? ? Search for the session corresponding to the process and view the corresponding username, machine, program, and so on.

? ??? ? ?? Select? *? From? Gv $ session ?? Where? Paddr? In? (Select? Addr? From? Gv $ process? Where? Spid? In? (? 1880090 ))




Author: yichangzyh posted on 20:19:35 Original article link

Read: 83 comments: 0 view comments

Original article address: Find the program corresponding to the oracle session based on memory usage. Thank you for sharing it with the original author.

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.