Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Oracle processlist support

  • Loading branch information...
commit d6c5f85a243ff3e6b71e9f2ca4e64a8a6c959906 1 parent a280179
@helix84 authored vrana committed
Showing with 17 additions and 2 deletions.
  1. +10 −1 adminer/drivers/oracle.inc.php
  2. +7 −1 adminer/processlist.inc.php
View
11 adminer/drivers/oracle.inc.php
@@ -346,13 +346,22 @@ function show_variables() {
return get_key_vals('SELECT name, display_value FROM v$parameter');
}
+ function process_list() {
+ return get_rows('SELECT sess.process AS "process", sess.username AS "user", sess.schemaname AS "schema", sess.status AS "status", sess.wait_class AS "wait_class", sess.seconds_in_wait AS "seconds_in_wait", sql.sql_text AS "sql_text", sess.machine AS "machine", sess.port AS "port"
+FROM v$session sess LEFT OUTER JOIN v$sql sql
+ON sql.sql_id = sess.sql_id
+WHERE sess.type = \'USER\'
+ORDER BY PROCESS
+');
+ }
+
function show_status() {
$rows = get_rows('SELECT * FROM v$instance');
return reset($rows);
}
function support($feature) {
- return ereg("view|scheme|drop_col|variables|status", $feature); //!
+ return ereg("view|scheme|processlist|drop_col|variables|status", $feature); //!
}
$jush = "oracle";
View
8 adminer/processlist.inc.php
@@ -23,7 +23,13 @@
}
echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row["Id"], 0) : "");
foreach ($row as $key => $val) {
- echo "<td>" . (($jush == "sql" ? $key == "Info" && $val != "" : $key == "current_query" && $val != "<IDLE>") ? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Edit') . '</a>' : nbsp($val));
+ echo "<td>" . (
+ ($jush == "sql" && $key == "Info" && $val != "") ||
+ ($jush == "pgsql" && $key == "current_query" && $val != "<IDLE>") ||
+ ($jush == "oracle" && $key == "sql_text" && $val != "")
+ ? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Edit') . '</a>'
+ : nbsp($val)
+ );
}
echo "\n";
}
Please sign in to comment.
Something went wrong with that request. Please try again.