Add Oracle processlist support
This commit is contained in:
parent
a280179bd5
commit
d6c5f85a24
|
@ -346,13 +346,22 @@ ORDER BY uc.constraint_type, uic.column_position", $connection2) as $row) {
|
||||||
return get_key_vals('SELECT name, display_value FROM v$parameter');
|
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() {
|
function show_status() {
|
||||||
$rows = get_rows('SELECT * FROM v$instance');
|
$rows = get_rows('SELECT * FROM v$instance');
|
||||||
return reset($rows);
|
return reset($rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
function support($feature) {
|
function support($feature) {
|
||||||
return ereg("view|scheme|drop_col|variables|status", $feature); //!
|
return ereg("view|scheme|processlist|drop_col|variables|status", $feature); //!
|
||||||
}
|
}
|
||||||
|
|
||||||
$jush = "oracle";
|
$jush = "oracle";
|
||||||
|
|
|
@ -23,7 +23,13 @@ foreach (process_list() as $i => $row) {
|
||||||
}
|
}
|
||||||
echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row["Id"], 0) : "");
|
echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row["Id"], 0) : "");
|
||||||
foreach ($row as $key => $val) {
|
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";
|
echo "\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue