import groovy.sql.Sql sql = Sql.newInstance( "jdbc:oracle:thin:@localhost:1521:orcl", "system", "manager", "oracle.jdbc.driver.OracleDriver") query = ''' select sum(pins) as total_pins, sum(reloads) as total_reloads, (1 - sum(reloads) / sum(pins)) * 100 as hitratio from v$librarycache ''' // ライブラリキャッシュヒット率を表示 println "total_pins, total_reloads, hitratio" sql.eachRow(query){ println "${it.total_pins}, ${it.total_reloads}, ${it.hitratio}" }
動作環境
groovy 1.8.4, JDK6 Update29, Oracle11g R2
0 件のコメント:
コメントを投稿