c 语言写的高级Oracle®数据库调优及监控工具
http://www.lab128.com.cn/lab128_why.html
###另外一款ORALCE Monitor tool freee
https://www.myorasql.com/
需要注意的是 执行时候需要 ojdbc6.jar或者ojdbc5.jar copy ( $ORACLE_HOME下有)到这个执行文件的目录 。就可以了 。
展示如下 :
https://www.myorasql.com/screenshots.html
####more info about db monitor
https://dba.stackexchange.com/questions/7430/tools-to-monitor-oracle-database-performance-on-standard-edition
###############0 (notest)
W-ASH is free, works on Standard Edition as well as Enterprise (i.e. it doesn't need Oracle's v$active_session_history) and runs in a web browser window.
http://www.oraclerealworld.com/web-ash-w-ash/
monitor
I'm the creator of W-ASH. I'm also the principal designer of Enterprise Managers performance screens. The "Top Activity" screen has been called the "Kyle Screen". I designed Embarcadero's DB Optimizer with similar interface and I've advised on Lab128 for free just because I think it's a super cool tool. I worked at Quest and tried to gear Spotlight more like Top Activity but Quest disagreed, so I went to Oracle and created Top Activity. I also have a free tool in TCL/TK called ASHMON
###########1 (no free)
MindArray IPM by MindArray Systems
Pros:
Response time analysis
Server Based
RAC support
Free Version for basic info
Allows a specific time range selection
Easy To Use
Cons:
Not a Open Source
##################2 (OK test )
https://sourceforge.net/p/ashv/code/HEAD/tree/trunk/ashv/
ASHViewer is a free alternative. Description from the readme:
ASH Viewer provides graphical Top Activity, similar Top Activity analysis and Drilldown of Oracle Enterprise Manager performance page. ASH Viewer store ASH data locally using embedded database Oracle Berkeley DB Java Edition.
ASHViewer Screenshot
It may seem that an application called ASH Viewer wouldn't work with Standard Edition because it does not have the Diagnostic pack and therefore does not have v$Active_Session_History, but it does. When a new connection is created it asks whether the target is Standard Edition or Enterprise Edition. If Standard Edition is selected it does not use v$Active_Session_History. This can be demonstrated by querying the view with control_management_pack_access set to NONE, which among other things causes the view to return no records.
Pros:
Free
Allows a specific time range selection (OEM can't do this)
Cons:
Not server based (Statistics collection is repeated for each user)
No web interface
Requires the equivalent of System level privileges
Interface isn't very polished (Font stretching, OS integration, etc.)
Not RAC aware (must run separately for each instance)
-> Only pl/sql unit no details sql .
--install guide
Running ASH Viewer
----------------
1) Unpack the archive, eg:
unzip ashv-<<version>>-bin.zip
2) A directory called "ashv-<<version>>-bin" will be created.
3) Download JDBC driver ojdbc14.jar/ ojdbc6.jar from http://otn.oracle.com and put it to ashv-<<version>>-bin/lib directory.
4) Make sure JAVA_HOME is set to the location of your JDK,
see run.cmd/run.sh (on Windows/Unix platform).
5) Run run.cmd/run.sh (on Window/Unix).
##########2 (NO free)
Ignite by Confio Softwar.e From their website:
Ignite for Oracle is the one Oracle database performance monitoring solution that identifies, analyzes and resolves all of the performance problems affecting applications and users depending on an Oracle database.
Ignite doesn’t just show health metrics, it correlates the most important performance data to build a complete picture of Oracle database performance for the DBA, Developer and DBA manager. Response time, queries, sessions and server resources, are all analyzed by Ignite Performance Intelligence to show both historical and real-time conditions affecting database applications.
enter image description here
Pros:
Response Time Analysis
Agentless
Server Based
Web interface
Free Version for basic info
Can be RAC and/or VMWare aware
Cons:
Drilldowns not as in depth as OEM
Users must be maintained independently
Cost
shareimprove th
#########5
http://datavirtualizer.com/web-ash-w-ash/
Web ASH : W-ASH
February 23rd, 2014Goto commentsLeave a comment
I’m excited about the ease of creating rich user applications that are web enabled given the state of technology now. JavaScript and JQuery have gone from being disdained as “not a very serious” language to moving towards the limelight of front and center.
Here is a small example.
Download the following file: W-ASH (web enabled ASH, file is wash.tar.gz )
Source is also on github at https://github.com/khailey/wash
Go to your apache web server root, in my case on redhat Linux is
# cd /usr/local/apache2
# gzip -d wash.tar.gz
# tar xvf wash.tar
-rwxr-xr-x 21956 14:08:21 cash.sh
-rw-r--r-- 30881 11:52:10 htdocs/ash.html
drwxr-xr-x 0 15:40:52 htdocs/js/
-rwxr-xr-x 10958 14:04:42 cgi-bin/json_ash.sh
(the directory htdocs/js has a number of files put into it from Highcharts. I edited them out to make the output cleaner)
There are 3 basic files
cash.sh – collect ASH like data from Oracle into a flat file, it runs in a continual loop
ash.html – basic web page using Highcharts
json_ash.sh – cgi to read ASH like data and give it to the web page via JSON
Now you are almost ready to go. You just need to start the data collection with “cash.sh” (collect ASH)
./cash.sh
Usage: usage <username> <password> <host> [sid] [port]
The script “cash.sh” requires “sqlplus” be in the path and that is all. It’s probably easiest to
move/copy cash.sh to an ORACLE_HOME/bin
su oracle
kick it off as in:
nohup cash.sh system change_on_install 172.16.100.250 orcl &
The script “cash.sh” will create a directory in /tmp/MONITOR/day_of_the_week for each day of the week, clearing out any old files, so there are only maximum 7 days of data. (to stop the collection run “rm /tmp/MONITOR/clean/*end” )
To view the data go to your web server address and add “ash.html?q=machine:sid”
For example my web server is on 172.16.100.250
The database I am monitoring is on host 172.16.100.250 with Oracle SID “orcl”
http://172.16.100.250/ash.html?q=172.16.100.250:orcl
See video at : http://screencast.com/t/sZrFxZkTrmn
############7 ( test , no history data )
http://datavirtualizer.com/ash-masters/ashmon/
Unzip ashmon.zip
Run ashmon.bat with ashmon\bin\ as the starting directory
Login as “system” , or user with select any dictionary priviledge, your connect id has to be in tnsnames.ora
Supports 10g or 11can run on earlier versions of Oracle with S-ASH repository S-ASH but need to create some veiws on SASH as well as wait groups
Notices
- 10.1 ASHMON gets errors because v$active_session_history is missing wait_class. workaround
- if copying ashmon.bat to your desktop or elsewhere, use a “shortcut” instead of moving the file. The file needs to be located in ashmon/bin
- only connect to Oracle 10g or 11 unless you have set up the S-ASH repository
- only connect as system or someone who has select on v$ tables unless you have set up the S-ASH repository. script to grant select on v$ views or grant “SELECT_CATALOG_ROLE” to the user.
- All connect errors return “invalid username/password” in Oratcl, thus to debug connection problems you need to test with sqlplus. If sqlplus connects, then the monitor will connect with the same connection string ie username, password and tnsnames.ora entry
- ashmon will use the tnsnames.ora located in ORACLE_HOME found in the PATH variable on windows. IE if sqlplus executes C:\oracle\bin\sqlplus then ashmon will use C:\oracle\network\admin\tnsnames.ora
- ashmon comes with a default oracle client libraries and will use these if it does not find Oracle already installed on the PC, and will use ashmon/oracle/network/admin/tnsnames.ora for tns alias lookups
############## more info:
http://datavirtualizer.com/best-oracle-performance-tools/
Sorry, http://rammpeter.github.io/panorama.html is the right link ( use , for history data analyst )
download:
https://www.dropbox.com/s/dwrks48qymlurd3/Panorama.war?dl=0
installer:
How to run it?
Start running quickly need java 7 version or higher
- Download file Panorama.war
- Open a terminal window, navigate to the directory containing Panorama.war and type
java -jar Panorama.war
or
- set PANORAMA_VAR_HOME=d:\tmp
java -Djava.io.tmpdir=C:\TEMP -jar Panorama.war
-
no matter if your are running Windows, Linux or Mac-OS
- This starts the embedded Jetty application server within one or two minutes, accessible at port 8080 via
http://<your server ip>:8080
- Now you can connect to Panorama's login screen in your browser via
http://<your server ip>:8080/Panorama
https://github.com/rammpeter/Panorama/issues/1
Panorama: User is enabled to add personal SQL to dragnet list
This SQLs are stored at Panorama’s server instance and are available for your personal browser instance only.
Choose ‘Add personal selection’ from menu ‘≡’ and customize the JSON template for your purpose.
You will get a new menu ‘Personal extensions’ in your list of SQLs then.
If you want to persist this SQLs and provide them to all users of your Panorama instance, you can store them as JSON-array in a file ‘predefined_dragnet_selections.json’ stored at PANORAMA_VAR_HOME.
The content of file ‘predefined_dragnet_selections.json’ is shown in list of dragnet SQLs if it exists in PANORAMA_VAR_HOME directory.
Click here to show all opportunities for your personal or global extensions to dragnet list.
-> In menu ‘Spec. additions’ / ‘Dragnet investigation’
########sapmple 0 one instance level need add \ before ", to esacape "
{
name: "Select tablespace_v1",
desc: "Select tablespace_v1",
sql: "SELECT a.tablespace_name ,b.maxbytes/1024/1024/1024 \"maxbyes_GB\",total/1024/1024/1024 \"bytes_GB\",free/1024/1024/1024 \"free_GB\",(total-free) /1024/1024/1024 \"use_GB\",
ROUND((total-free)/total,4)*100 \"use_%\",ROUND((total-free)/b.maxbytes,4)*100 \"maxuse_%\"
FROM
(SELECT tablespace_name,SUM(bytes) free FROM DBA_FREE_SPACE
GROUP BY tablespace_name
) a,
(SELECT tablespace_name,sum(case autoextensible when 'YES' then maxbytes else bytes end) maxbytes,SUM(bytes) total FROM DBA_DATA_FILES
GROUP BY tablespace_name
) b
WHERE a.tablespace_name=b.tablespace_name
order by \"maxuse_%\" desc"
}
#####all instnace level
predefined_dragnet_selections.json
[
{
name: "Name of tablespaec usage in list 2",
desc: "Explanation of selection 2 in right dialog",
sql: "SELECT a.tablespace_name ,b.maxbytes/1024/1024/1024 \"maxbyes_GB\",total/1024/1024/1024 \"bytes_GB\",free/1024/1024/1024 \"free_GB\",(total-free) /1024/1024/1024 \"use_GB\",
ROUND((total-free)/total,4)*100 \"use_%\",ROUND((total-free)/b.maxbytes,4)*100 \"maxuse_%\"
FROM
(SELECT tablespace_name,SUM(bytes) free FROM DBA_FREE_SPACE
GROUP BY tablespace_name
) a,
(SELECT tablespace_name,sum(case autoextensible when 'YES' then maxbytes else bytes end) maxbytes,SUM(bytes) total FROM DBA_DATA_FILES
GROUP BY tablespace_name
) b
WHERE a.tablespace_name=b.tablespace_name
order by \"maxuse_%\" desc"
}
]
#######sample 2 : add more statment checking 注意,‘’ 的位置
[
{
name: "Name of tablespaec usage in list 2",
desc: "Explanation of selection 2 in right dialog",
sql: "SELECT a.tablespace_name ,b.maxbytes/1024/1024/1024 \"maxbyes_GB\",total/1024/1024/1024 \"bytes_GB\",free/1024/1024/1024 \"free_GB\",(total-free) /1024/1024/1024 \"use_GB\",
ROUND((total-free)/total,4)*100 \"use_%\",ROUND((total-free)/b.maxbytes,4)*100 \"maxuse_%\"
FROM
(SELECT tablespace_name,SUM(bytes) free FROM DBA_FREE_SPACE
GROUP BY tablespace_name
) a,
(SELECT tablespace_name,sum(case autoextensible when 'YES' then maxbytes else bytes end) maxbytes,SUM(bytes) total FROM DBA_DATA_FILES
GROUP BY tablespace_name
) b
WHERE a.tablespace_name=b.tablespace_name
order by \"maxuse_%\" desc"
},
{
name: "Name of datafile usage in list 3",
desc: "Explanation of datafile path in right dialog",
sql: "SELECT file_id,file_name,tablespace_name,autoextensible,increment_by,bytes/1024/1024 from dba_data_files where tablespace_name=UPPER(?)",
parameter: [
{
name: "Owner",
title: "Name of tablespace",
size: 30,
default: "SYSAUX"
},
]
},
{
name: "Name of tempfile usage in list 3",
desc: "Explanation of datafile path in right dialog",
sql: " SELECT TMP.NAME FILENAME, BYTES, TS.NAME TABLESPACE FROM V$TEMPFILE TMP, V$TABLESPACE TS WHERE TMP.TS#=TS.TS#"
},
{
name: "Name of frausage usage in list 3",
desc: "Explanation of frausage path in right dialog",
sql: " Select file_type, percent_space_used as used,percent_space_reclaimable as reclaimable,number_of_files as \"number\" from v$flash_recovery_area_usage"
},
{
name: "Name of log usage in list 3",
desc: "Explanation of log path in right dialog",
sql: " select * from v$logfile"
},
{
name: "Name of scn usage in list 3",
desc: "Explanation of scn path in right dialog",
sql: " select to_char(CURRENT_SCN,999999999999999999999999) from v$database"
},
{
name: "Name of scn usage in archivelog in list 3",
desc: "Explanation of scn in archivelog in right dialog",
sql: " select recid,thread#,sequence#,first_change#,next_change# from v$log_history where first_change > (?) and next_change# < (?)"
}
]
###awr 趋势分析
https://www.cnblogs.com/wenjiewang/p/6120549.html
Awrcrt的使用方法和技巧
用法和awrrpt类似
sqlplus / as sysdba
@awrcrt.sql
--4个参数
--参数1 显示多少天的awr snap list
--参数2 开始snap id
--参数3 结束snap id
--参数3 输入80(显示图像相关的)
--参数4实例id
5~60秒后,在当前目录生成一个 AWRCRT*html的报告
Tip1: 只支持11.2 以及之后的数据库(由于使了聚合字符串函数)。
Tip2: 一般选择5~7天的snap来出趋势,但是有的库启动时间太长,统计的值特别大,可能导致脚本里面字符串超出最大长度,这个时候,只能缩短区间的,比如5天或者更短
Tip3:为什么我看不到图表?
在报告生成结束后,注意有没有ORA-错误。也可以报告出来以后, cat一下html,看有没有ORA- , 需要确保没有ORA-错误。 老版本的IE支持html5很差,建议用firefox chrome ie10 等浏览器看报告,生成的html报告需要和crt.js放在一个目录才能看到图表报告. 如果仍然看不到图表, 把html发送到valen点wang@oracle点com 我会抽时间看。
Tip4: awrcrt.sql 放在服务器上,如果采用vi 粘贴, 注意检查大小行数, 经常有的环境,copy大文件要丢了字符。最好ftp上去。
Tip5: 没有刻意去处理数据库发生过重启的时间点,也许会看到比较奇怪的数据,注意检查数据库是否重启过
c 语言写的高级Oracle®数据库调优及监控工具的更多相关文章
- Oracle数据库调优总结
oracle采用物理读和逻辑读,第一次查询数据库采用的是物理读,以后如果使用相同的sql语句查询,那么它会采用逻辑读,直接从内存中读取数据. 采用执行计划查看执行顺序和耗时:一般查看object na ...
- Mysql数据库调优和性能优化的21条最佳实践
Mysql数据库调优和性能优化的21条最佳实践 1. 简介 在Web应用程序体系架构中,数据持久层(通常是一个关系数据库)是关键的核心部分,它对系统的性能有非常重要的影响.MySQL是目前使用最多的开 ...
- Oracle SQL 调优健康检查脚本
Oracle SQL 调优健康检查脚本 我们关注数据库系统的性能,进行数据库调优的主要工作就是进行SQL的优化.良好的数据架构设计.配合应用系统中间件和写一手漂亮的SQL,是未来系统上线后不出现致命性 ...
- MySQL面试必考知识点:揭秘亿级高并发数据库调优与最佳实践法则
做业务,要懂基本的SQL语句: 做性能优化,要懂索引,懂引擎: 做分库分表,要懂主从,懂读写分离... 数据库的使用,是开发人员的基本功,对它掌握越清晰越深入,你能做的事情就越多. 今天我们用10分钟 ...
- Oracle SQL调优记录
目录 一.前言 二.注意点 三.Oracle执行计划 四.调优记录 @ 一.前言 本博客只记录工作中的一次oracle sql调优记录,因为数据量过多导致的查询缓慢,一方面是因为业务太过繁杂,关联了太 ...
- [转]10分钟梳理MySQL知识点:揭秘亿级高并发数据库调优与最佳实践法则
转:https://mp.weixin.qq.com/s/RYIiHAHHStIMftQT6lQSgA 做业务,要懂基本的SQL语句: 做性能优化,要懂索引,懂引擎: 做分库分表,要懂主从,懂读写分离 ...
- 记一次数据库调优过程(IIS发过来SQLSERVER 的FETCH API_CURSOR语句是神马?)
记一次数据库调优过程(IIS发过来SQLSERVER 的FETCH API_CURSOR语句是神马?) 前几天帮客户优化一个数据库,那个数据库的大小是6G 这麽小的数据库按道理不会有太大的性能问题的, ...
- Mysql数据库调优和性能优化
1. 简介 在Web应用程序体系架构中,数据持久层(通常是一个关系数据库)是关键的核心部分,它对系统的性能有非常重要的影响.MySQL是目前使用最多的开源数据库,但是mysql数据库的默认设置性能非常 ...
- oracle系统调优
在Oracle数据库系统中,起到调节作用的参数叫初始化参数,在Oracle 8i及以前的版本中,这些初始化参数记录在INITsid.ora文件中:而Oracle 9i/10g/11g中将这些参数记录在 ...
随机推荐
- codeforces A. Point on Spiral 解题报告
题目链接:http://codeforces.com/problemset/problem/279/A 题目意思:给出一个坐标点(x, y),问当从(0, 0) 开始到达该点转过的拐角有多少个.(拐角 ...
- 【转载】String和StringBuffer的区别,以及StringBuffer的常用方法介绍
String与StringBuffer的区别简单地说,就是一个变量和常量的关系.StringBuffer对象的内容可以修改:而String对象一旦产生后就不可以被修改,重新赋值其实是两个对象.Stri ...
- linux应用之vsftp服务的安装及配置(centos)
1.centos中vsftp服务的安装 方法1:rpm方式 #rpm –ivh vsftpd-2.0.5-10.el5.i386.rpm 安装rpm程序包(网上下载的rpm包) 方法2:yum方式 ...
- Linux下C语音实现socket发送和接收的小程序
1.什么是socket套接字 socket其实就是计算机通信的端口,可以实现两个计算机之间的通信的一个接口,应用程序在网络上传输就是通过这个借口实现. socket分为三种类型: 字节流套接字(Str ...
- Opencv— — Circle Filter
// define head function #ifndef PS_ALGORITHM_H_INCLUDED #define PS_ALGORITHM_H_INCLUDED #include < ...
- shell之cut和tr 的命令的使用
[root@data-1-3 ~]# head /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin ...
- Git 常用命令学习
本文转载自:https://buptldy.github.io/2016/03/02/2016-03-02-Git%20Cheat%20Sheet/ 文章 创建版本库 初始化一个Git仓库,使用git ...
- bzoj 4756 [Usaco2017 Jan]Promotion Counting——线段树合并
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4756 线段树合并裸题.那种返回 int 的与传引用的 merge 都能过.不知别的题是不是这 ...
- bzoj4540
莫队+st表 据说这是经典问题,但是我不会... 问题在于莫队怎么算贡献,每次移动一个位置,现在为[l,r],那么就增加了[l-1,r),r的贡献,怎么算呢?我们预处理fl,fr,fl[i]表示以i为 ...
- .net使用DotNetCharting控件生成报表统计图总结
最近在做项目时要对数据进行统计分析,所以必须生成一些报表统计图(如柱形图.饼图.曲线图等),网上强烈推荐了使用DotNetCharting控件来实现,于是自己对DotNetCharting控件进行了简 ...