forked from xtender/xt_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparams_changed.sql
More file actions
39 lines (39 loc) · 1.42 KB
/
params_changed.sql
File metadata and controls
39 lines (39 loc) · 1.42 KB
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
col beg_time format a16;
col PARAMETER_NAME format a50;
col PREV_VALUE format a30;
col VALUE format a30;
with v as (
select--+ leading(sn p) use_nl(p) no_merge
p.dbid
,p.snap_id
,to_char(sn.beg_time,'yyyy-mm-dd hh24:mi') beg_time
--,sn.end_time
,p.instance_number as inst_id
--,p.parameter_hash
,p.parameter_name
,lag(p.value) over(partition by p.dbid,p.instance_number,p.parameter_name order by p.snap_id) prev_value
,p.value
,p.isdefault
,p.ismodified
from
(select--+ no_merge
snap_id
,begin_interval_time beg_time
,end_interval_time end_time
from dba_hist_snapshot
where end_interval_time > systimestamp - interval '1' month
) sn
,dba_hist_parameter p
where p.dbid in (select/*+ precompute_subquery */ dbid from v$database)
and p.instance_number in (select/*+ precompute_subquery */ vi.INSTANCE_NUMBER from v$instance vi)
and p.snap_id = sn.snap_id
)
select *
from v
where value!=prev_value
order by parameter_name,snap_id
/
col beg_time clear;
col PARAMETER_NAME clear;
col PREV_VALUE clear;
col VALUE clear;