小花狸监控设计之初,没有考虑Golang连接Oracle特别麻烦.
但是如果不监控Oracle,感觉又是很大的缺失.
现在计划采用Golang调用sqlplus命令的方式,采集数据.
但是sqlplus的结果怎么采集和分析呢?
这里面涉及很多格式的问题,也很麻烦.如果有类似mysql 查询\G的方式就好了
可以由tom提供的print_table.sql脚本进行改造
原脚本如下:
create or replace procedure print_table
( p_query in varchar2,
p_date_fmt in varchar2 default 'yyyy-mm-dd hh24:mi:ss' )
-- This utility is designedto be installed ONCE in a database and used
-- by all. Also, it is nice to have roles enabled so that queries by
-- DBAs who use a role to gain access to the DBA_* views still work.
-- That is the purpose of AUTHID CURRENT_USER.
authid current_user
is
l_thecursor integer default dbms_sql.open_cursor;
l_columnvalue varchar2(4000);
l_status integer;
l_d
但是如果不监控Oracle,感觉又是很大的缺失.
现在计划采用Golang调用sqlplus命令的方式,采集数据.
但是sqlplus的结果怎么采集和分析呢?
这里面涉及很多格式的问题,也很麻烦.如果有类似mysql 查询\G的方式就好了
可以由tom提供的print_table.sql脚本进行改造
原脚本如下:
create or replace procedure print_table
( p_query in varchar2,
p_date_fmt in varchar2 default 'yyyy-mm-dd hh24:mi:ss' )
-- This utility is designedto be installed ONCE in a database and used
-- by all. Also, it is nice to have roles enabled so that queries by
-- DBAs who use a role to gain access to the DBA_* views still work.
-- That is the purpose of AUTHID CURRENT_USER.
authid current_user
is
l_thecursor integer default dbms_sql.open_cursor;
l_columnvalue varchar2(4000);
l_status integer;
l_d