数据库巡检方案

上传人:小** 文档编号:91129263 上传时间:2019-06-26 格式:PDF 页数:9 大小:571.27KB
返回 下载 相关 举报
数据库巡检方案_第1页
第1页 / 共9页
数据库巡检方案_第2页
第2页 / 共9页
数据库巡检方案_第3页
第3页 / 共9页
数据库巡检方案_第4页
第4页 / 共9页
数据库巡检方案_第5页
第5页 / 共9页
点击查看更多>>
资源描述

《数据库巡检方案》由会员分享,可在线阅读,更多相关《数据库巡检方案(9页珍藏版)》请在金锄头文库上搜索。

1、Oracle 数据库数据库日常日常检查检查 A. 查看所有的实例查看所有的实例及其后台进程及其后台进程是否是否正常正常 确认所有的 instance 工作正常,登陆到所有的数据库或 instance 上,检测 oracle 后台进程 $env | grep SID ORACLE_SID=UWNMS3 B检查文件系统的使用检查文件系统的使用情况情况 如果文件系统的剩余空间小于 10,则需要删除不必要的文件以释放空间。 $df -h Filesystem size used avail capacity Mounted on /dev/md/dsk/d0 20G 17G 3.1G 85% / /p

2、roc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% /etc/mnttab fd 0K 0K 0K 0% /dev/fd swap 85G 192K 85G 1% /var/run dmpfs 85G 0K 85G 0% /dev/vx/dmp dmpfs 85G 0K 85G 0% /dev/vx/rdmp swap 85G 213M 85G 1% /tmp /dev/vx/dsk/data10dg/Ora_File_Vol01 394G 292G 98G 75% /data05 /dev/vx/dsk/data1dg/vola0131 443G 156G 28

3、3G 36% /archivelog AIX: $df g or df k HP-UX $bdf or df k or df -h 注意:需要特别关注根目录,数据库软件和数据库备份所在目录的剩余空间情况! 备注:备注:数据库运行日志的及时清除数据库运行日志的及时清除 1). 可可清除清除 bdump,cdump,udump 下的相关日志下的相关日志 $ cd $ORACLE_BASE/admin/db_name/bdump $ ls -l total 174 -rwxrwxrwx 1 oracle dba 59047 Jul 30 22:02 alert_UWNMS1.log -rwxrwxr

4、wx 1 oracle dba 1000 Jul 14 22:00 uwnms1_j000_18128.trc -rw-r- 1 oracle dba 1000 Jul 22 22:00 uwnms1_j001_5369.trc -rwxrwxrwx 1 oracle dba 695 Jul 14 19:12 uwnms1_lgwr_18100.trc -rwxrwxrwx 1 oracle dba 2668 Jul 30 22:02 uwnms1_lgwr_19661.trc -rwxrwxrwx 1 oracle dba 983 Jul 14 17:36 uwnms1_lgwr_7816.

5、trc -rwxrwxrwx 1 oracle dba 955 Jul 14 19:11 uwnms1_lgwr_7883.trc -rwxrwxrwx 1 oracle dba 803 Jul 14 17:31 uwnms1_p000_7714.trc -rwxrwxrwx 1 oracle dba 801 Jul 14 17:31 uwnms1_p001_7716.trc $ cd /cdump $ ls -l total 4 drwxr-x- 2 oracle dba 512 Jul 25 14:12 core_18095 drwxr-x- 2 oracle dba 512 Jul 25

6、 19:17 core_25934 $ cd /udump $ ls -l total 20042 -rw-r- 1 oracle dba 505 Jul 16 16:33 uwnms1_ora_14771.trc -rw-r- 1 oracle dba 4516169 Jul 25 14:12 uwnms1_ora_18095.trc -rwxrwxrwx 1 oracle dba 644 Jul 14 19:12 uwnms1_ora_18119.trc -rw-r- 1 oracle dba 505 Jul 30 15:11 uwnms1_ora_18820.trc -rwxrwxrwx

7、 1 oracle dba 774 Jul 15 10:23 uwnms1_ora_19573.trc -rwxrwxrwx 1 oracle dba 587 Jul 15 10:23 uwnms1_ora_19645.trc -rwxrwxrwx 1 oracle dba 644 Jul 15 10:23 uwnms1_ora_19680.trc -rw-r- 1 oracle dba 720942 Jul 15 16:28 uwnms1_ora_24759.trc -rw-r- 1 oracle dba 4951562 Jul 25 19:17 uwnms1_ora_25934.trc -

8、rw-r- 1 oracle dba 505 Jul 15 17:21 uwnms1_ora_27326.trc -rw-r- 1 oracle dba 503 Jul 30 16:54 uwnms1_ora_6612.trc -rwxrwxrwx 1 oracle dba 585 Jul 14 17:12 uwnms1_ora_7523.trc -rwxrwxrwx 1 oracle dba 767 Jul 14 17:30 uwnms1_ora_7566.trc 2). 可清除可清除 oracle 的监听日志的监听日志 $ cd $ORACLE_HOME/network/log $ ls

9、-l total 533072 -rwxrwxrwx 1 oracle dba 272507851 Jul 31 11:28 listener.log -rw-r-r- 1 oracle dba 257876 Jul 31 08:48 sqlnet.log $ cp /dev/null listener.log C查找查找警告日志文件警告日志文件 1. 联接每一个操作管理系统 2. 使用TELNET或是可比较程序 3. 对每一个管理实例,经常的执行$ORACLE_BASE/bdump 操作,并使其能回退到控 制数据库的 SID。 4. 在提示下,使用 UNIX 中的TAIL命令查看 alert

10、_.log,或是用其他方式检查文件中最 近时期的警告日志 5. 如果发现任何 ORA_ERRORS (ORA-XXX) 的错误,将它记录并且仔细的研究它们,或反馈给 DB 组 如何确定警告日志文件的路径? 通过参看起始参数文件 init.ora,而起始参数文件一般存储在$ORACLE_HOME/dbs 下 D检查检查数据库备份是否成功数据库备份是否成功 对对 RMAN 备份方式备份方式: 检查第三方备份工具的备份日志以确定备份是否成功 如果具备恢复目录的,可直接登陆到 rman 环境下,发命令 list backup 查看具体备份集合的 情况; $rman target / nocatalog

11、 Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jul 31 11:39:37 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: UWNMS3 (DBID=2229785441) connected to recovery catalog database RMAN list backup; List of Backup Sets = BS Key Type LV Size Device Type

12、Elapsed Time Completion Time - - - - - - - 422624 Incr 0 12.59M DISK 00:00:07 2008-07-28 03:15:21 BP Key: 422631 Status: AVAILABLE Compressed: YES Tag: BK0 Piece Name: /export/home/oracle/rman3/bk0_UWNMS3_20080728_2393 List of Datafiles in backup set 422624 File LV Type Ckp SCN Ckp Time Name - - - -

13、 - - 2 0 Incr 35321096 2008-07-28 03:15:14 /archivelog/oradata/UWNMS3/undo01.dbf 5 0 Incr 35321096 2008-07-28 03:15:14 /archivelog/oradata/UWNMS3/system2.dbf 对对 EXPORT,EXPDP 逻辑逻辑备份方式备份方式: 检查 exp,expdp 日志文件以确定备份是否成功 对其他备份方式对其他备份方式: 检查相应的日志文件 E检查检查表空间表空间的使用情况的使用情况 1. 检查在表空间中有没有剩余空间。检查在表空间中有没有剩余空间。 对每一

14、个实例来说,检查在表空间中是否存在有剩余空间来满足当天的预期的需要。当数据库 中已有的数据是稳定的,数据日增长的平均数也是可以计算出来,最小的剩余空间至少要能满足每 天数据的增长。 脚本: select t.tablespace_name, total, free, round(100*(1-(free/total),3)|% as已使用的空间 比例 from (select tablespace_name, sum(bytes)/1024/1024 total from dba_data_files group by tablespace_name) t,(select tablespace

15、_name, sum(bytes)/1024/1024 free from dba_free_space group by tablespace_name) f where t.tablespace_name=f.tablespace_name(+) and t.tablespace_name not in (DRSYS,ORDIM,SPATIAL,USERS,TOOLS,XDB) order by round(100*(1-(free/total),3) desc; 2. 检查失效索引检查失效索引 /* - 以下脚本用于检查失效的索引 select * from dba_indexes wh

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 管理学资料

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号