-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpg_grafana_mk_tables_p1.sql
More file actions
55 lines (44 loc) · 1.19 KB
/
pg_grafana_mk_tables_p1.sql
File metadata and controls
55 lines (44 loc) · 1.19 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
create monitoring tables in PostgreSQL to hold Oracle performance metrics
created by Graham Thornton - oraclejedi@gmail.com - gruffdba.wordpress.com
November 2023
*/
create table if not exists ORA_SESSIONS_NOTIME(
dbid varchar(50) not null,
inst_id varchar(50) not null,
users int not null
);
alter table ORA_SESSIONS_NOTIME add primary key ( dbid, inst_id );
create table if not exists ORA_OSSTATS(
dbid varchar(50) not null,
inst_id varchar(50) not null,
ts timestamptz not null,
sys_val real not null,
usr_val real not null,
iow_val real not null,
idl_val real not null,
bsy_val real not null,
sockets int not null,
cores int not null,
cpus int not null,
load real not null,
total_ram bigint not null,
free_ram bigint not null
);
create table if not exists ORA_OSSTATS_DELTA(
dbid varchar(50) not null,
inst_id varchar(50) not null,
ts timestamptz not null,
elapsed real not null,
sys_val real not null,
usr_val real not null,
iow_val real not null,
idl_val real not null,
bsy_val real not null,
sockets int not null,
cores int not null,
cpus int not null,
load real not null,
total_ram bigint not null,
free_ram bigint not null
);