There are some sqls which is used for check the oracle database's health condition.

------numbers of process
select count(*) process_num from v$process;
select SESSIONS_MAX,SESSIONS_CURRENT,SESSIONS_HIGHWATER from v$license;
--parameters:
show parameter processes select count(*) datafile_num from v$datafile; show parameter db_files; col comp_name for a40
col version for a16
col status for a10
set pagesize 1000
set line 100
select comp_name,version,status from dba_registry; select count(*) datafile_num from dba_data_files; select count(*) tablespace_num from dba_tablespaces; select sum(bytes)/1024/1024/1024 datafile_size from v$datafile; col name for a30
col type for a10
col value for a40
show parameter show sga col pool for a20
col name for a40
set line 100
set pagesize 1000
SELECT * FROM V$SGASTAT; col value for 999999999
col name for a40
set line 100
SELECT * FROM V$PGASTAT; col value$ for a30
col name for a30
select name,value$ from props$ where name like '%CHARACTERSET%'; ARCHIVE LOG LIST; SELECT COUNT(*) ctl_num FROM V$CONTROLFILE; col name for a30
set line 100
select * from v$controlfile; set linesize 120
col first_change# for 9999999999999
col status for a10
alter session set nls_date_format='yyyymmdd hh24miss';
select * from v$log; col member for a40
select * from v$logfile; show parameter db_block_size set linesize 120 pagesize 50
col file_name for a40
col ts_name for a18
col cur_mb for 99999
col max_mb for 99999
select status, file_id, file_name, tablespace_name ts_name, autoextensible,
bytes/1048576 cur_mb, maxbytes/1048576 max_mb
from dba_data_files order by file_name; select status, file_id, file_name, tablespace_name ts_name, autoextensible,
bytes/1048576 cur_mb, maxbytes/1048576 max_mb
from dba_temp_files order by file_name; set linesize 120 pagesize 50
col tablespace_name format a20
col contents for a9
col ext_mgmt for a10
col alloc_type for a9
col ext_kb format 999999
col ssm for a6
col total_mb format a13
col free_mb format a10
col free_pct format a7
select c.tablespace_name, c.contents, c.extent_management ext_mgmt,
c.allocation_type alloc_type, c.initial_extent/1024 ext_kb,
c.segment_space_management SSM, a.total_mb, b.free_mb,
to_char(100*b.free_mb/a.total_mb, '999.99') free_pct
from
(select tablespace_name, to_char(sum(bytes)/1048576, '99999999.99') total_mb
from dba_data_files group by tablespace_name) a,
(select tablespace_name, to_char(sum(bytes)/1048576, '999999.99') free_mb,
count(*) free_exts, to_char(max(bytes)/1048576, '999999') max_mb,
to_char(min(bytes)/1048576, '999999') min_mb
from dba_free_space group by tablespace_name) b,
dba_tablespaces c
where a.tablespace_name=b.tablespace_name(+) and c.tablespace_name=b.tablespace_name
order by free_pct, tablespace_name; select owner,count(*) seg_num_system from dba_segments where tablespace_name='SYSTEM' group by owner; col username for a16
col default_tablespace for a20
col temporary_tablespace for a20
select username, default_tablespace, temporary_tablespace from dba_users
where default_tablespace='SYSTEM' or temporary_tablespace='SYSTEM'; select count(*) invalid_num from dba_objects where status='INVALID'; col owner for a16
col object_name for a30
col object_type for a16
set line 100
set pagesize 10000
select owner,object_name,object_type from dba_objects where status='INVALID'; col table_name for a30
col tablespace_name for a20
set line 100
select owner, table_name, tablespace_name, chain_cnt from dba_tables where chain_cnt >0; select OWNER||'.'||index_name as "OWNER.INDEX_NAME", blevel from dba_indexes where blevel>=4 order by 2 desc; col username for a16
select * from v$pwfile_users; col GRANTEE for a20
col GRANTED_ROLE for a20
Select * from dba_role_privs where granted_role='DBA'; select event,count(*) from v$session_wait group by event;

One simple health check for oracle with sql的更多相关文章

  1. 转://Oracle PL/SQL 优化与调整 -- Bulk 说明

    一. Bulk 概述 本来只想测试一下Bulk Collect 和update性能的,但发现Bulk 的东西还是很多的,在OTN上搜了一些,整理如下. 1.1 Bulk Binding 和 Bulk ...

  2. 转 安装EBS前期检查工具 - RDA - Health Check / Validation Engine Guide

    http://blog.itpub.net/35489/viewspace-1295028/ 参考文档        RDA - Health Check / Validation Engine Gu ...

  3. [转载]—Health Check Reports Problem: Dependency$ p_timestamp mismatch for VALID objects (文档 ID 781959.1)

    Health Check Reports Problem: Dependency$ p_timestamp mismatch for VALID objects (文档 ID 781959.1) AP ...

  4. ORACLE PL/SQL编程详解

    ORACLE PL/SQL编程详解 编程详解 SQL语言只是访问.操作数据库的语言,并不是一种具有流程控制的程序设计语言,而只有程序设计语言才能用于应用软件的开发.PL /SQL是一种高级数据库程序设 ...

  5. Oracle - PL/SQL Commands

    第一章:日志管理 1.forcing log switches sql> alter system switch logfile; 2.forcing checkpoints sql> a ...

  6. oracle常用SQL语句(汇总版)

    Oracle数据库常用sql语句 ORACLE 常用的SQL语法和数据对象一.数据控制语句 (DML) 部分 1.INSERT (往数据表里插入记录的语句) INSERT INTO 表名(字段名1, ...

  7. ORACLE PL/SQL编程之八:把触发器说透

    原文:ORACLE PL/SQL编程之八:把触发器说透 ORACLE PL/SQL编程之八: 把触发器说透 大家一定要评论呀,感谢!光发表就花了我将近一个下午. 本篇主要内容如下: 8.1 触发器类型 ...

  8. 在 Scale Up 中使用 Health Check - 每天5分钟玩转 Docker 容器技术(145)

    对于多副本应用,当执行 Scale Up 操作时,新副本会作为 backend 被添加到 Service 的负责均衡中,与已有副本一起处理客户的请求.考虑到应用启动通常都需要一个准备阶段,比如加载缓存 ...

  9. Oracle PL/SQL Articles

    我是搬运工....http://www.oracle-base.com/articles/plsql/articles-plsql.php Oracle 8i Oracle 9i Oracle 10g ...

随机推荐

  1. 英文:known good assembly(KGA) / 中文:确认好的组装件,已知好组装件

    英文:known good assembly(KGA) / 中文:确认好的组装件,已知好组装件 正确地操作印制板装配,并可作为标准件与其它同类型装配件比较的组装.也称黄金组装.

  2. HttpGet()和HttpPost()

    转 http://www.cnblogs.com/hyddd/archive/2009/03/31/1426026.html Http定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET,P ...

  3. android 调出显示标题栏(title bar)

    无法同时继承fragmentactivity和actionbaractivity 解决方法 import android.support.v7.app.ActionBarActivity; 将exte ...

  4. poj 1979 Red and Black(dfs)

    题目链接:http://poj.org/problem?id=1979 思路分析:使用DFS解决,与迷宫问题相似:迷宫由于搜索方向只往左或右一个方向,往上或下一个方向,不会出现重复搜索: 在该问题中往 ...

  5. Android 自定义view实现水波纹效果

    http://blog.csdn.net/tianjian4592/article/details/44222565 在实际的开发中,很多时候还会遇到相对比较复杂的需求,比如产品妹纸或UI妹纸在哪看了 ...

  6. TCP/IP之DNS域名解析系统

    DNS系统是一个分布式的数据库,当一个数据库发现自己并没有某查询所需要的数据的时候,它将把查询转发出去,而转发的目的地通常是根服务器,根服 务器从上至下层层转发查询,直到找到目标为止.DNS还有一个特 ...

  7. windows简单杀死进程的批处理程序

    新建一个txt文档,命令为taskkill.bat,复制下面的命令保存 @echo offtaskkill /F /IM vm* /Ttaskkill /F /IM apple* /Ttaskkill ...

  8. struts2总结【转载】

    1,struts2的form表单里面和url里面的传值以及Action所继承的父类都可以自动set属性注入action中,及继承的action中. 2,凡是url和form表单传值,在action方法 ...

  9. Vedis - An Embeddable Datastore Engine

    Vedis - An Embeddable Datastore Engine     An Embeddable Datastore Engine         Tweet        Follo ...

  10. Google Map Android api V2 中使用MapView遇到CameraUpdateFactory is not initialized!的解决办法

    先说一下 Map V2 API Key 的问题吧: 在打包APP时需要自己生成一个XXX.keystore 用这个密室库生成的SHA1去申请的key 作为AndroidManifest.xml 中的K ...