文档编号Oracle 数据库日常维护工作凌群电脑有限公司 凌群电脑有限公司 2004 年 12 月 15 日数据库日常维护工作》 《Oracle 数据库日常维护工作》目1.1 1.2 1.3 1.4 1.5 1.6录1. DBA 日常维护工作 ..................................................................................................................... 3 检查已经打开的所有实例 .................................................................................................... 3 检查最新的警告日志 ............................................................................................................ 7 检查数据库备份是否正确 .................................................................................................... 8 检查备份到磁带中的文件是否正确 .................................................................................... 9 检查数据库的性能是否合理,系统资源是否充足 ............................................................ 9 仔细阅读 ORACLE 标准文档 ............................................................................................... 102.晚间维护工作 晚间维护工作.............................................................................................................................. 10 晚间维护工作 2.1 收集相关表的统计数据 ....................................................................................................... 10 3.每周维护工作 每周维护工作.............................................................................................................................. 10 每周维护工作 3.1 检查异常的对象................................................................................................................... 10 3.1.1 检查现有的 NEXT_EXTENT 情况:............................................................................ 10 3.1.2 检查已有的 EXTENTS: .............................................................................................. 11 3.1.3 查看哪些表没有主键 .................................................................................................... 11 3.1.4 查找哪些主键是没有发挥作用的 ................................................................................ 12 3.1.5 所有作索引的主键都应是唯一的 ................................................................................ 12 3.2 检查是否有不安全的问题 ................................................................................................... 12 3.3 检查是否有错误 SQL*NET 日志 ....................................................................................... 13 3.4 归档当前告警日志 ............................................................................................................... 13 3.5 访问供应商站点................................................................................................................... 13 4.月维护工作 月维护工作.................................................................................................................................. 13 月维护工作 4.1 检查是否有异常的空间增长 ............................................................................................... 13 4.2 回顾以前数据库性能优化的调整 ....................................................................................... 14 4.3 检查 IO 瓶颈 ........................................................................................................................ 14 4.4 检查碎片的问题(8I 系统) ............................................................................................... 152数据库日常维护工作》 《Oracle 数据库日常维护工作》1. DBA 日常维护工作1.1 检查 ORACLE 进程ps -ef|grep "ora_" |grep -v grep oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle 5827 5829 5831 5833 5835 5838 5840 5842 5844 5846 5848 5850 5852 5855 5948 5950 5957 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:24 ? 1 0 10:25 ? 1 0 10:25 ? 1 0 10:25 ? 00:00:00 ora_pmon_test 00:00:00 ora_psp0_test 00:00:00 ora_mman_test 00:00:00 ora_dbw0_test 00:00:01 ora_lgwr_test 00:00:02 ora_ckpt_test 00:00:02 ora_smon_test 00:00:00 ora_reco_test 00:00:01 ora_cjq0_test 00:00:03 ora_mmon_test 00:00:00 ora_mmnl_test 00:00:00 ora_d000_test 00:00:00 ora_s000_test 00:00:00 ora_rvwr_test 00:00:00 ora_arc0_test 00:00:00 ora_arc1_test 00:00:00 ora_qmnc_test3数据库日常维护工作》 《Oracle 数据库日常维护工作》oracle oracle oracle 5989 5991 9679 1 0 10:25 ? 1 0 10:25 ? 1 0 12:26 ? 00:00:00 ora_q000_test 00:00:00 ora_q001_test 00:00:00 ora_j000_test在检查 Oracle 的进程命令输出后,输出显示至少应包括以下一些进程: • Oracle写数据文件的进程,输出显示为:“ora_dbw0_test • Oracle写日志文件的进程,输出显示为:“ora_lgwr_test • Oracle监听实例状态的进程,输出显示为:“ora_smon_test • Oracle监听客户端连接进程状态的进程,输出显示为:“ora_pmon_test • Oracle进行归档的进程,输出显示为:“ora_arc0_test • Oracle进行检查点的进程,输出显示为:“ora_ckpt_test • Oracle 进行恢复的进程,输出显示为:“ora_reco_test1.2 检查 ORACLE 监听进程lsnrctl status LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 08-MAY-2008 12:37:32 Copyright (c) 1991, 2005, Oracle. All rights reserved. toConnecting (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=eim)(PORT=1521))) STATUS of the LISTENER -----------------------Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production Start Date 06-MAY-2008 15:52:19 Uptime 1 days 20 hr. 45 min. 12 sec Trace Level off Security ON: Local OS Authentication4数据库日常维护工作》 《Oracle 数据库日常维护工作》SNMP ON Listener Parameter File /oracle/product/10.2.0.1/db_1/network/admin/listener.ora Listener Log File /oracle/product/10.2.0.1/db_1/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=EIM)(PORT=1521))) Services Summary... Service "test" has 1 instance(s). Instance "test", status READY, has 1 handler(s) for this service... Service "testXDB" has 1 instance(s). Instance "test", status READY, has 1 handler(s) for this service... Service "test_XPT" has 1 instance(s). Instance "test", status READY, has 1 handler(s) for this service... The command completed successfully “Services Summary”项表示 Oracle 的监听进程正在监听哪些数据库实例, 输出显示中至 少应该有“TEST”.1.3 检查 ORACLE 实例状态SQL> connect / as sysdba; Connected. SQL> select instance_name,version,status,database_status 2 from v$instance;INSTANCE_NAMEVERSIONSTATUSDATABASE_STATUS---------------- ----------------- ------------ ----------------test 10.2.0.1.0 OPEN ACTIVE5数据库日常维护工作》 《Oracle 数据库日常维护工作》其 中 “STATUS” 表 示 Oracle 当 前 的 实 例 状 态 , 必 须 为 “OPEN” ; “DATABASE_STATUS”表示 Oracle 当前数据库的状态,必须为“ACTIVE”。