FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Oracle-Database-Scripts/cpuusage.sql at main · co360/Oracle-Database-Scripts · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
co360
/
Oracle-Database-Scripts
Public
forked from
fatdba/Oracle-Database-Scripts
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Oracle-Database-Scripts
/
cpuusage.sql
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (52 loc) · 1.52 KB
Breadcrumbs
Oracle-Database-Scripts
/
cpuusage.sql
Copy path
File metadata and controls
53 lines (52 loc) · 1.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
PROMPT
PROMPT
PROMPT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PROMPT
--
---- /) (\
PROMPT
--
---- .-._((,~~.))_.-,
PROMPT
--
---- `-. @@ ,-'
PROMPT
--
---- / ,o--o. \
PROMPT
--
---- ( ( .__. ) )
PROMPT
--
---- ) `----' (
PROMPT
--
---- / \
PROMPT
--
---- / \
PROMPT
--
---- / \
PROMPT
--
---- "The Silly Cow"
PROMPT
--
--- Script: cpuusage.sql
PROMPT
--
--- Author: Prashant 'The FatDBA'
PROMPT
--
--- Cat: Performance Management and Issue Identification
PROMPT
--
--- Version: V1.1 (Date: 23-7-2018)
PROMPT
--
---
PROMPT
--
---
PROMPT
--
---
PROMPT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set
pages
1000
set
lines
1000
col OSPID for a06
col SID for
99999
col
SERIAL
#
for 999999
col SQL_ID for a14
col USERNAME for a15
col PROGRAM for a20
col MODULE for a18
col OSUSER for a10
col MACHINE for a25
select
*
from
(
select
ss
.
inst_id
,
p
.
spid
"
ospid
"
,
(
se
.
SID
),
ss
.
serial
#
,ss.SQL_ID,ss.username,ss.program,ss.module,ss.osuser,ss.MACHINE,ss.status,
se
.
VALUE
/
100
cpu_usage_seconds
from
gv$session ss,
gv$sesstat se,
gv$statname sn,
gv$process p
where
se
.
STATISTIC
#
= sn.STATISTIC#
and
NAME
like
'
%CPU used by this session%
'
and
se
.
SID
=
ss
.
SID
and
ss
.
username
!=
'
SYS
'
and
ss
.
status
=
'
ACTIVE
'
and
ss
.
username
is not null
and
ss
.
paddr
=
p
.
addr
and
value
>
0
order by
se
.
VALUE
desc
)
where
rownum
<
16
;
Back
|
FazBrowse Home
|
New Git URL