col name format a30
Select name,status from v$datafile
或
SELECT file#, ts#, NAME, status, BYTES / 1024 / 1024 size_mb FROM v$datafile UNION ALL SELECT file#, ts#, NAME, status, BYTES / 1024 / 1024 size_mb FROM v$tempfile;
<wbr></wbr>
8. Redo log多元性检查和可用性检查。
select * from v$log;
9. 控制文件多元性检查。
Select * from v$controlfile;
10. 归档检查和归档空间检查。
LOCATION=/oracle/product/10.1.0/db/dbs/arc
11. 磁盘状态检查;ASM
<wbr><wbr><wbr> 11.1</wbr></wbr></wbr> 磁盘可用性检查
<wbr><wbr><wbr> 11.2</wbr></wbr></wbr> 文件系统可用性检查
<wbr><wbr><wbr> 11.3</wbr></wbr></wbr> 文件系统空间检查
<wbr><wbr><wbr> 11.4</wbr></wbr></wbr> 根据几次检查的统计信息估计表空间的增长情况,并且据此为管理人员提供空间升级建议
<wbr><wbr><wbr> 11.5</wbr></wbr></wbr> 根据系统情况为管理人员提供空间清理建议
<wbr></wbr>
12. 数据库备份检查。
14. crs状态检查
/crs/bin/crs_stat -t
<wbr><wbr><wbr> 14.1 crs</wbr></wbr></wbr>日志检查
<wbr><wbr><wbr> 14.2 Global</wbr></wbr></wbr>设备信息检查
15. Listener状态检查
<wbr><wbr><wbr> 15.1 listener</wbr></wbr></wbr>可用性检查
Lsnrctl status
<wbr><wbr><wbr> 15.2 listener</wbr></wbr></wbr>日志检查
/u01/app/oracle/product/9.2.0/network/log/listener.log
/u01/app/oracle/product/9.2.0/network/log/listener.log
16. 数据库共享池性能检查
SELECT request_misses, request_failures <wbr>FROM v$shared_pool_reserved;</wbr>
期望结果:request_misses和request_failures应该接近于0。
巡检说明:request_misses是保留列表没有满足请求的可用内存片从而开始利用LRU列表刷新对象的次数;request_failures是未找到满足请求的内存次数。
18. 数据库redo log缓冲区检查
SELECT<wbr><wbr><wbr> TO_CHAR (ROUND ((r.VALUE / e.VALUE) * 100, 2), '990.99' ) || '%' "redolog buffer retry ratio" FROM v$sysstat r, v$sysstat e WHERE r.NAME = 'redo buffer allocation retries' AND e.NAME = 'redo entries';</wbr></wbr></wbr>
期望结果:应该小于5%。
巡检说明:由于数据库的所有DML和DLL操作在执行之前必须在重做日志缓冲区生成一条记录,故重做日志缓冲区内的竞争将严重影响数据库的性能。在重做日志缓冲区内的竞争主要有两类,latch竞争和过量请求竞争。
<wbr></wbr>
19、检查无效的对象
select owner,object_name,object_type,status from dba_objects where owner like 'FOUNDER' and status not like 'VALID';
<wbr></wbr>
SELECT object_id, owner || '.' || object_name object_name, object_type, status, TO_CHAR (created, 'yy-mm-dd hh24:mi:ss') created, TO_CHAR (last_ddl_time, 'yy-mm-dd hh24:mi:ss') last_ddl_time FROM all_objects WHERE status != 'VALID';
<wbr></wbr>
20、检查JOB状态
Select job, BROKEN,
WHAT from dba_jobs;
21、监控表的增长
select segment_name,segment_type,bytes/1024/1024 from dba_segments where owner='FOUNDER' ORDER BY bytes/1024/1024 desc;
22、表和索引分析信息
SELECT<wbr><wbr> 'table', COUNT (*) FROM dba_tables WHERE last_analyzed IS NOT NULL GROUP BY 'table'</wbr></wbr>
UNION ALL
SELECT<wbr><wbr> 'index', COUNT (*) FROM dba_indexes WHERE last_analyzed IS NOT NULL GROUP BY 'index';</wbr></wbr>
23、资源限制信息
SELECT * FROM v$resource_limit;
期望结果:max_utilization与limit_value的差值,应至少相差10。
24、未建索引的表
<wbr><wbr><wbr><wbr><wbr><wbr> SELECT<wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> owner, segment_name, segment_type, tablespace_name,</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> TRUNC (BYTES / 1024 / 1024, 1) size_mb</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> FROM dba_segments t</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> WHERE NOT EXISTS (</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>SELECT 'x'</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> FROM dba_indexes i</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> WHERE t.owner = i.table_owner</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> AND t.segment_name = i.table_name)</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> AND t.segment_type IN ('TABLE', 'TABLE PARTITION')</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> AND t.owner NOT IN ('SYS', 'SYSTEM')</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr> ORDER BY 5 DESC;</wbr></wbr></wbr></wbr></wbr></wbr>
升序用ASC
期望结果:不应该含有比较大的而又不含索引的正式表。