forked from ikzelf/zbxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstandby.11.cfg
89 lines (86 loc) · 4.18 KB
/
standby.11.cfg
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# vim: syntax=sql
[auto_discovery_60]
minutes: 60
inst.lld: select distinct(inst_name) "{#INST_NAME}"
from (select rtrim(substr(regexp_replace(inst_name, '[^[:print:]]', ''), instr(inst_name, ':')+1)) inst_name from v$active_instances
union
select instance_name from gv$instance)
db.lld: select name "{#PDB}" from v$database
parm.lld: select i.instance_name "{#INST_NAME}", p.name "{#PARAMETER}"
from gv$instance i, gv$parameter p
where i.instance_number = p.inst_id
and p.type in (3, 6) and p.isdefault = 'FALSE'
service.lld: select '' "{#PDB}", i.instance_name "{#INST_NAME}", s.name "{#SERVICE_NAME}"
from gv$services s join gv$instance i
on(s.inst_id=i.inst_id)
[startup]
minutes: 0
version: select 'inst[' | |instance_name | |',version]', version from v$instance
lastpatch: select 'db[last_patch_hist]', ACTION | |':' | |NAMESPACE | |':' | |VERSION | |':' | |ID | |':' | |COMMENTS | |':' | |BUNDLE_series status
from sys.registry$history
where action_time = (select max(action_time) from sys.registry$history)
[checks_01m]
minutes: 1
inst.uptime: select 'inst[' | |instance_name | |',uptime]' key, (sysdate - startup_time)*60*60*24 val from gv$instance
db.openmode: select 'db[' | |name | |',openstatus]', decode(open_mode, 'MOUNTED', 1, 'READ ONLY', 2, 'READ WRITE', 3, 'READ ONLY WITH APPLY', 4, 0) from v$database
scn: select 'db[current_scn]', current_scn from v$database
union all
select 'db[delta_scn]', current_scn from v$database
sysstat: select 'inst[' | |i.instance_name | |',' | |s.name | |']', s.value
from (
select inst_id, name, value from gv$sysstat
where name in ('execute count', 'DB time', 'user calls')
union all
select inst_id, 'processes' item, count(*) cnt
from gv$process
group by inst_id
union all
select inst_id, 'sessions', count(*)
from gv$session
group by inst_id
) s,
gv$instance i
where i.inst_id = s.inst_id
[checks_05m]
minutes: 5
parm.val: select 'parm[' | |i.instance_name | |',' | |p.name | |',value]' key, p.value
from gv$instance i, gv$parameter p
where i.instance_number = p.inst_id
and p.type in (3, 6) and p.isdefault = 'FALSE'
and upper(p.description) not like '%SIZE%'
union all
select 'parm[' | |i.instance_name | |',' | |p.name | |',size]' key, p.value
from gv$instance i, gv$parameter p
where i.instance_number = p.inst_id
and p.type in (3, 6) and p.isdefault = 'FALSE'
and upper(p.description) like '%SIZE%'
service.cnt: select 'service[,' | |i.instance_name | |',' | | s.service_name | |',sess]', count(*)
from gv$session s join gv$instance i
on(s.inst_id=i.inst_id)
group by i.instance_name, s.service_name
[checks_20m]
minutes: 5
fra: select 'fra[limit]', space_limit from v$recovery_file_dest def
union all
select 'fra[used]', space_used from v$recovery_file_dest def
union all
select 'fra[reclaimable]', space_reclaimable from v$recovery_file_dest def
union all
select 'fra[files]', number_of_files from v$recovery_file_dest def
union all
select 'fra[usable,pct]',decode(space_limit, 0,0,(100-(100*(space_used - space_reclaimable)/space_limit)))
from v$recovery_file_dest
union all
select 'rp', count(*) from v$restore_point
[checks_60m]
minutes: 60
alertlog: select 'inst['||i.instance_name||',log]', d.value||'/alert_'||i.instance_name||'.log' from gv$instance i, gv$diag_info d
where i.inst_id = d.inst_id and d.name = 'Diag Trace'
db.size: select 'db[filesize]',(
(select sum(bytes) from v$datafile) +
(select sum(bytes) from v$tempfile) +
(select sum(file_size_blks*block_size) from v$controlfile) +
(select sum(bytes * members) from v$log)
) totalsize from dual
instname: select 'zbxdb[connect,instance_name]', instance_name from v$instance
fullversion: select 'full_version', banner from v$version where banner like 'Oracle Database%'