Oracle数据库日常管理_项目现场篇修改:2010/2/8A.查看所有的实例及其后台进程是否正常确认所有的instance工作正常,登陆到所有的数据库或instance上,检测oracle后台进程GDDB4-/export/home/oracleenv|grepSIDORACLE_SID=UWNMS3GDDB4-/export/home/oracleps-ef|grepUWNMS3|grep-vgrep|greporaoracle2511910Jun24?0:04ora_dbw4_UWNMS3oracle2511010Jun24?3:20ora_dbw1_UWNMS3oracle2514610Jun24?0:00ora_reco_UWNMS3oracle2512510Jun24?0:09ora_dbw5_UWNMS3oracle2514210Jun24?5:41ora_smon_UWNMS3oracle2515510Jun24?1:17ora_mmon_UWNMS3oracle2515210Jun24?101:32ora_cjq0_UWNMS3oracle2510210Jun24?0:02ora_mman_UWNMS3oracle2510810Jun24?7:37ora_dbw0_UWNMS3oracle2547810Jun24?0:45ora_arc1_UWNMS3oracle2547010Jun24?0:47ora_arc0_UWNMS3oracle2515910Jun24?84:02ora_mmnl_UWNMS3oracle2509410Jun24?17:30ora_pmon_UWNMS3oracle2511710Jun24?0:41ora_dbw3_UWNMS3oracle2513110Jun24?13:12ora_lgwr_UWNMS3oracle201751018:27:25?0:00ora_j000_UWNMS3oracle2510010Jun24?1:10ora_psp0_UWNMS3oracle2511310Jun24?0:14ora_dbw2_UWNMS3oracle2513510Jun24?23:50ora_ckpt_UWNMS3B.检查文件系统的使用情况如果文件系统的剩余空间小于10%,则需要删除不必要的文件以释放空间。GDDB4-/export/home/oracledf-hFilesystemsizeusedavailcapacityMountedon/dev/md/dsk/d020G17G3.1G85%//proc0K0K0K0%/procmnttab0K0K0K0%/etc/mnttabfd0K0K0K0%/dev/fdswap85G192K85G1%/var/rundmpfs85G0K85G0%/dev/vx/dmpdmpfs85G0K85G0%/dev/vx/rdmpswap85G213M85G1%/tmp/dev/vx/dsk/data10dg/Ora_File_Vol01394G292G98G75%/data05/dev/vx/dsk/data1dg/vola0131443G156G283G36%/archivelog注意:需要特别关注根目录,数据库软件和数据库备份所在目录的剩余空间情况!备注:数据库运行日志的及时清除1).可清除bdump,cdump,udump下的相关日志$cdbdump$ls-ltotal174-rwxrwxrwx1oracledba59047Jul3022:02alert_UWNMS1.log-rwxrwxrwx1oracledba1000Jul1422:00uwnms1_j000_18128.trc-rw-r-----1oracledba1000Jul2222:00uwnms1_j001_5369.trc-rwxrwxrwx1oracledba695Jul1419:12uwnms1_lgwr_18100.trc-rwxrwxrwx1oracledba2668Jul3022:02uwnms1_lgwr_19661.trc-rwxrwxrwx1oracledba983Jul1417:36uwnms1_lgwr_7816.trc-rwxrwxrwx1oracledba955Jul1419:11uwnms1_lgwr_7883.trc-rwxrwxrwx1oracledba803Jul1417:31uwnms1_p000_7714.trc-rwxrwxrwx1oracledba801Jul1417:31uwnms1_p001_7716.trc$cp/dev/nullalert_UWNMS1.log$rm*.trc$cd../cdump$ls-ltotal4drwxr-x---2oracledba512Jul2514:12core_18095drwxr-x---2oracledba512Jul2519:17core_25934$cd../udump$ls-ltotal20042-rw-r-----1oracledba505Jul1616:33uwnms1_ora_14771.trc-rw-r-----1oracledba4516169Jul2514:12uwnms1_ora_18095.trc-rwxrwxrwx1oracledba644Jul1419:12uwnms1_ora_18119.trc-rw-r-----1oracledba505Jul3015:11uwnms1_ora_18820.trc-rwxrwxrwx1oracledba774Jul1510:23uwnms1_ora_19573.trc-rwxrwxrwx1oracledba587Jul1510:23uwnms1_ora_19645.trc-rwxrwxrwx1oracledba644Jul1510:23uwnms1_ora_19680.trc-rw-r-----1oracledba720942Jul1516:28uwnms1_ora_24759.trc-rw-r-----1oracledba4951562Jul2519:17uwnms1_ora_25934.trc-rw-r-----1oracledba505Jul1517:21uwnms1_ora_27326.trc-rw-r-----1oracledba503Jul3016:54uwnms1_ora_6612.trc-rwxrwxrwx1oracledba585Jul1417:12uwnms1_ora_7523.trc-rwxrwxrwx1oracledba767Jul1417:30uwnms1_ora_7566.trc2).可清除oracle的监听日志$cd$ORACLE_HOME/network/log$ls-ltotal533072-rwxrwxrwx1oracledba272507851Jul3111:28listener.log-rw-r--r--1oracledba257876Jul3108:48sqlnet.log$cp/dev/nulllistener.logC.查找警告日志文件1.联接每一个操作管理系统2.使用‘TELNET’或是可比较程序3.对每一个管理实例,经常的执行$ORACLE_BASE/SID/bdump操作,并使其能回退到控制数据库的SID。4.在提示下,使用UNIX中的‘TAIL’命令查看alert_SID.log,或是用其他方式检查文件中最近时期的警告日志5.如果发现任何ORA_ERRORS(ORA-XXX)的错误,将它记录并且仔细的研究它们,或反馈给DB组如何确定警告日志文件的路径?通过参看起始参数文件initSID.ora,而起始参数文件一般存储在$ORACLE_HOME/dbs下$cd$ORACLE_HOME/dbs$catinitUWNMS1.ora*.background_dump_dest='/opt/oracle/product/10g/admin/UWNMS1/bdump'*.core_dump_dest='/opt/oracle/product/10g/admin/UWNMS1/cdump'*.user_dump_dest='/opt/oracle/product/10g/admin/UWNMS1/udump'D.检查数据库备份是否成功※对RMAN备份方式:检查第三方备份工具的备份日志以确定备份是否成功如果具备恢复目录的,可直接登陆到rman环境下,发命令listbackup查看具体备份集合的情况;GDDB4-/rmantarget=sys/xxx@uwnms3catalog=rman/rman@uwnms3RecoveryManager:Release10.2.0.3.0-ProductiononThuJul3111:39:372008Copyright(c)1982,2005,Oracle.Allrightsreserved.connectedtotargetdatabase:UWNMS3(DBID=2229785441)connectedtorecoverycatalogdatabaseRMANlistbackup;ListofBackupSets===================BSKeyTypeLVSizeDeviceTypeElapsedTimeCompletionTime-----------------------------------------------------------------422624Incr012.59MDISK00:00:072008-07-2803:15:21BPKey:422631Status:AVAILABLECompressed:YESTag:BK0PieceName:/export/home/oracle/rman3/bk0_UWNMS3_20080728_2393ListofDatafilesinbackupset422624FileLVTypeCkpSCNCkpTimeName-------------------------------------------20Incr353210962008-07-2803:15:14/archivelog/oradata/UWNMS3/undo01.dbf50Incr353210962008-07-2803:15:14/archivelog/oradata/UWNMS3/system2.dbf※对EXPORT,EXPDP逻辑备份方式:检查exp,expdp日志文件以确定备份是否成功※对其他备份方式:检查相应的日志文件E.检查表空间的使用情况1.检查在表空间中有没有剩余空间。对每一个实例来说,检查在表空间中是否存在有剩余空间来满足当天的预期的需要。当数据库中已有的数据是稳定的,数据日增长的平均数也是可以计算出来,最小的剩余空间至少要能满足每天数据的增长。脚本:selectt.tablespace_name,total,free,round(100*(1-(free/total)),3)||'%'as已使用的空间比例from(selecttablespace_name,sum(bytes)/1024/1024totalfromdba_data_filesgroupbytablespace_name)t,(selecttablespace_name,sum(bytes)/1024/1024freefromdba_free_spacegroupbytablespace_name)fwheret.tablespace_name=f.tablespace_name(+)andt.tablespace_namenotin('DRSYS','ORDIM','SPATIAL','USERS','TOOLS','XDB')orderbyround(100*(1-(free/