Good morning everyone ....
I am a trainee and I need a script to show the active and inactive processes of the bank ...... can anyone help me ??
grateful.
URGENT - Scripts Active and Inactive Processes
-
- Rank: DBA Júnior
- Posts: 193
- Joined: Thu, 24 Jan 2008 1:56 pm
- Location: SP
Dulima
DBA Oracle Jr
DBA Oracle Jr
Follow
What do you need?
col sid for 9999 head 'SID' justify right
col Serial for 99999 head 'Serial'
col user_ora for a13 head 'Oracle|User' justify left
col process for a5 head 'PID' justify right
col comando for a8 head 'Statment'
col hash_value for 9999999999 head 'Hash value'
col disk for 99999999 head 'Leituras|Fisicas' justify right
col changes for 99999999 head 'Blocos|Alterados' justify right
col OsUser for a16 head 'OS User' JUSTIFY left
col kinstance_name for a10 head "Instance"
col Evento for a64 head "Nome do Evento"
select a.sid SID,
a.serial# Serial,
b.spid PROCESS,
decode(a.lockwait,'','N','S') L,
a.username USER_ORA,
substr(a.osuser,1,16) OsUser,
a.sql_hash_value hash_value,
d.consistent_gets gets,
d.physical_reads disk,
d.block_changes changes,
c.name COMANDO,
g.instance_name kinstance_name,
h.event Evento
from gv$session a ,
gv$process b ,
audit_actions c ,
gv$sess_io d ,
gv$sesstat e ,
gv$statname f ,
gv$instance g ,
gv$session_wait h
where a.paddr = b.addr
and a.username <> ' '
and a.sid not in (SELECT SID
FROM V$SESSION
WHERE audsid = userenv('SESSIONID'))
and a.status = 'ACTIVE'
and a.command = c.action
and a.sid = d.sid
and a.sid = e.sid
and e.STATISTIC# = f.STATISTIC#
and e.STATISTIC# = 12
and f.STATISTIC# = 12
and a.inst_id = g.inst_id
and h.event not like 'SQL*Net message%'
and h.event not like 'rdbms%'
and h.event not like 'pmon%'
and h.event not like 'smon%'
and a.sid = h.sid
order by DISK
/
-
- Moderador
- Posts: 1177
- Joined: Thu, 15 Oct 2009 10:28 am
- Location: Recife
-
- Rank: Estagiário Pleno
- Posts: 3
- Joined: Mon, 03 May 2010 11:54 am
- Location: SP
Dulima, I'm going to try to explain to you ......
A script that gives the active and inactive process information from the bank, it will run at a certain time, type to each One hour, then it generates a txt and at the end of the month I need to set up a chart through this information ......
A script that gives the active and inactive process information from the bank, it will run at a certain time, type to each One hour, then it generates a txt and at the end of the month I need to set up a chart through this information ......
-
- Rank: Estagiário Pleno
- Posts: 3
- Joined: Mon, 03 May 2010 11:54 am
- Location: SP
Can no more help me ???
-
- Moderador
- Posts: 1177
- Joined: Thu, 15 Oct 2009 10:28 am
- Location: Recife
Now that you explained it gets easier, in reality the select in v $ session has everything you need,
just create a job or schedule, use the utl_file to generate the file text ..
Have you considered using Enterprise Manager information?
just create a job or schedule, use the utl_file to generate the file text ..
Have you considered using Enterprise Manager information?
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest