Skip to content

Commit 04d92bd

Browse files
committed
ASH-Viewer for Oracle rewrited for PostgreSQL
ASH-Viewer for Oracle rewrited for PostgreSQL
1 parent 76b0845 commit 04d92bd

File tree

75 files changed

+8586
-25543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+8586
-25543
lines changed

README

Lines changed: 31 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,52 @@
1-
ASH Viewer
1+
PASH Viewer
22

33
What is it?
44
-----------
5-
ASH Viewer provides graphical view of active session history data within the Oracle instance.
6-
7-
Active Session History (ASH) is a view in Oracle that maps a circular buffer in the SGA.
8-
The name of the view is V$ACTIVE_SESSION_HISTORY. This view is populated every second
9-
and will only contain data for 'active' sessions, which are defined as sessions
10-
waiting on a non-idle event or on a CPU.
11-
12-
ASH Viewer provides graphical Top Activity, similar Top Activity analysis and Drilldown
13-
of Oracle Enterprise Manager performance page. ASH Viewer store ASH data locally using
14-
embedded database Oracle Berkeley DB Java Edition. The default capture rate is one snapshot
15-
every 30 seconds. ASH Viewer support 10g, 11g version of Oracle DB. Use SYSTEM database user
16-
to connect to Oracle DB. Please note that v$active_session_history is a part of the Oracle Diagnostic Pack
17-
and requires a purchase of the ODP license.
18-
19-
For Oracle 9i(8i) DB, ASH Viewer emulate ASH, storing active session data on local storage.
20-
The default capture rate is one snapshot every 1 second. For Oracle 9i(8i) DB,
21-
user SYSTEM must have access rights to the views sys.x_$ksuse, sys.x_$ksusecst
22-
23-
create view x_$ksuse as select * from x$ksuse;
24-
create view x_$ksusecst as select * from x$ksusecst;
25-
26-
grant select on sys.x_$ksuse to system;
27-
grant select on sys.x_$ksusecst to system;
5+
PosetgreSQL ASH Viewer (PASH Viewer) provides graphical view of active session history data within the PostgreSQL database.
6+
7+
PASH Viewer provides graphical Top Activity, similar Top Activity analysis of Oracle Enterprise Manager performance page.
8+
PASH Viewer store ASH data locally using embedded database Oracle Berkeley DB Java Edition.
9+
The default capture rate is one snapshot every 1 seconds.
10+
PASH Viewer support PostgreSQL 10 (and 9.4 - 9.6 with limited functions).
11+
12+
Use superuser (postgres) to connect to DB, if you want to see query plans.
13+
Or use your special user for monitoring:
14+
15+
CREATE USER pgmonuser WITH password 'pgmonuser';
16+
GRANT pg_monitor TO pgmonuser;
17+
2818

2919
System Requirements
3020
-------------------
31-
JDK:
32-
1.5u11 or above.
33-
Memory:
34-
Minimum 128 Mb. Recommended 192 Mb.
35-
Disk:
36-
It depends on Oracle workload.
37-
Operating System:
38-
No minimum requirement.
39-
40-
Building ASH Viewer
21+
JDK 1.7+
22+
23+
24+
Building PASH Viewer
4125
----------------
42-
1) Download JDBC driver ojdbc6.jar from http://otn.oracle.com and put it to ashv-<<version>>-bin/lib directory.
26+
1) Run ./gradlew assembleDist (gradlew.bat for Windows)
4327

44-
2) Run ./gradlew assembleDist (gradlew.bat for Windows)
28+
2) Binary archive will be created in build/distributions directory
4529

46-
3) Binary archive will be created in build/distributions directory
4730

48-
Running ASH Viewer
31+
Running PASH Viewer
4932
----------------
5033
1) Unpack the archive, eg:
51-
unzip ashv-<<version>>-bin.zip
34+
unzip PASH-Viewer-0.3.zip
5235

53-
2) A directory called "ashv-<<version>>-bin" will be created.
36+
2) A directory called "PASH-Viewer-0.3" will be created.
5437

55-
3) Download JDBC driver ojdbc6.jar from http://otn.oracle.com and put it to ashv-<<version>>-bin/lib directory.
56-
57-
4) Make sure JAVA_HOME is set to the location of your JDK,
38+
3) Make sure JAVA_HOME is set to the location of your JDK,
5839
see run.cmd/run.sh (on Windows/Unix platform).
5940

60-
5) Create monitor user in Oracle DB and grant select and execute priviliges using user_privs.sql file.
41+
4) Run bin/PASH-Viewer.bat or bin/PASH-Viewer (on Window/Unix).
6142

62-
6) Run bin/ASH-Viewer.bat or bin/ASH-Viewer (on Window/Unix).
6343

64-
Known issues
65-
--------------
66-
Problem: When running ASH Viewer on JRE6, dragging window slider on Top Activity is too slow
67-
Workaround: use JDK5+ or JRE5 to run ASH Viewer
68-
69-
Problem: On Oracle 9i, select from v$sql_plan, cause extreme library cache latch contention
70-
Workaround: collect statistics on fixed table x$kqlfxpl to resolve this issue:
71-
SQL> exec dbms_stats.gather_table_stats('SYS','X$KQLFXPL');
72-
7344
Licensing
74-
---------
45+
---------
7546
Please see the file called LICENSE
7647

77-
ASH Viewer URL
78-
----------
79-
http://ashv.sourceforge.net
80-
https://github.com/akardapolov/ASH-Viewer
81-
48+
49+
PASH Viewer URL
50+
----------
51+
https://sourceforge.net/projects/pash-viewer/
52+
https://github.com/dbacvetkov/PASH-Viewer

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
apply plugin: 'application'
1111
apply plugin: 'java'
1212

13-
version = '3.5.1'
14-
sourceCompatibility = 1.5
15-
targetCompatibility = 1.5
13+
version = '0.3'
14+
sourceCompatibility = 1.7
15+
targetCompatibility = 1.7
1616

1717
mainClassName = "org.ash.MainApp"
1818
applicationDefaultJvmArgs = ["-Xmx512m"]
1919

2020
//create a single Jar with all dependencies
2121
task fatJar(type: Jar) {
2222
manifest {
23-
attributes 'Implementation-Title': 'ASH Viewer',
23+
attributes 'Implementation-Title': 'PASH Viewer',
2424
'Implementation-Version': version,
2525
'Main-Class': mainClassName
2626
}

build.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
2-
<project default="run" name="ASHV">
2+
<project default="run" name="PASHV">
33
<description>
4-
ASH Viewer build file
4+
PASH Viewer build file
55
</description>
66

77
<property name="main.class" value="org.ash.MainApp"/>
@@ -32,8 +32,8 @@
3232
destdir="${build.dir}"
3333
debug="on"
3434
deprecation="false"
35-
source="1.5"
36-
target="1.5"
35+
source="1.7"
36+
target="1.7"
3737
classpath="${build.classpath}"
3838
includeantruntime="false">
3939
<include name="org/jfree/**"/>

lib/postgresql-42.2.2.jre7.jar

701 KB
Binary file not shown.

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
rootProject.name = 'ASH-Viewer'
1+
rootProject.name = 'PASH-Viewer'
22

src/ext/egantt/drawing/context/GradientColorContext.java

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,17 @@ public GradientColorContext()
6565
public static final GraphicsContext blue;
6666
public static final GraphicsContext BLUE;
6767

68-
public static final GraphicsContext OTHER0;
69-
public static final GraphicsContext CLUSTER11;
70-
public static final GraphicsContext QUEUEING12;
71-
public static final GraphicsContext NETWORK7;
72-
public static final GraphicsContext ADMINISTRATIVE3;
73-
public static final GraphicsContext CONFIGURATION2;
74-
public static final GraphicsContext COMMIT5;
75-
public static final GraphicsContext APPLICATION1;
76-
public static final GraphicsContext CONCURRENCY4;
77-
public static final GraphicsContext SYSTEMIO9;
78-
public static final GraphicsContext USERIO8;
79-
public static final GraphicsContext SCHEDULER10;
80-
public static final GraphicsContext CPU;
81-
68+
public static final GraphicsContext CPU0;
69+
public static final GraphicsContext IO1;
70+
public static final GraphicsContext LOCK2;
71+
public static final GraphicsContext LWLOCK3;
72+
public static final GraphicsContext BUFFERPIN4;
73+
public static final GraphicsContext ACTIVITY5;
74+
public static final GraphicsContext EXTENSION6;
75+
public static final GraphicsContext CLIENT7;
76+
public static final GraphicsContext IPC8;
77+
public static final GraphicsContext TIMEOUT9;
78+
8279
static
8380
{
8481
WHITE = new LocalColorContext(Color.white);
@@ -105,19 +102,16 @@ public GradientColorContext()
105102
CYAN = cyan;
106103
blue = new LocalColorContext(Color.blue);
107104
BLUE = blue;
108-
109-
OTHER0 = new LocalColorContext(new Color(255,87,143));
110-
CLUSTER11 = new LocalColorContext(new Color(117,117,117));
111-
QUEUEING12 = new LocalColorContext(new Color(232,232,232));
112-
NETWORK7 = new LocalColorContext(new Color(156,157,108));
113-
ADMINISTRATIVE3 = new LocalColorContext(new Color(84,84,29));
114-
CONFIGURATION2 = new LocalColorContext(new Color(84,56,28));
115-
COMMIT5 = new LocalColorContext(new Color(194,133,71));
116-
APPLICATION1 = new LocalColorContext(new Color(194,71,71));
117-
CONCURRENCY4 = new LocalColorContext(new Color(153,51,51));
118-
SYSTEMIO9 = new LocalColorContext(new Color(0,161,230));
119-
USERIO8 = new LocalColorContext(new Color(0,46,230));
120-
SCHEDULER10 = new LocalColorContext(new Color(133,255,133));
121-
CPU = new LocalColorContext(new Color(0,179,0));
105+
106+
CPU0 = new LocalColorContext(new Color(0,204,0));
107+
IO1 = new LocalColorContext(new Color(0,74,231));
108+
LOCK2 = new LocalColorContext(new Color(192,40,0));
109+
LWLOCK3 = new LocalColorContext(new Color(139,26,0));
110+
BUFFERPIN4 = new LocalColorContext(new Color(0,161,230));
111+
ACTIVITY5 = new LocalColorContext(new Color(255,165,0));
112+
EXTENSION6 = new LocalColorContext(new Color(0,123,20));
113+
CLIENT7 = new LocalColorContext(new Color(159,147,113));
114+
IPC8 = new LocalColorContext(new Color(240,110,170));
115+
TIMEOUT9 = new LocalColorContext(new Color(84,56,28));
122116
}
123117
}

0 commit comments

Comments
 (0)