Oracle数据库日常检查

合集下载

oracle日常维护巡检工作汇总

oracle日常维护巡检工作汇总

oracle 日常维护工作内容(1). 每天对ORACLE数据库的运行状态,日志文件,备份情况,数据库的空间使用情况,系统资源的使用情况进行检查,发现并解决问题。

(2). 每周对数据库对象的空间扩展情况,数据的增长情况进行监控,对数据库做健康检查,对数据库对象的状态做检查。

====================每天工作====================1.(1).确认所有的INSTANCE状态正常.登陆到所有数据库或例程,检测ORACLE后台进程:$ps –-ef|grep ora(2). 检查文件系统的使用(剩余空间)。

如果文件系统的剩余空间小于20%,需删除不用的文件以释放空间。

对于业务交易生产系统和数据库日志归档目录,当空间不足,请急时清理.$df -h(3). 检查日志文件和trace文件记录alert和trace文件中的错误.连接到数据库服务器cd 到bdump目录,通常是$ORACLE_BASE/admin/<SID>/bdump‘tail’命令来查看alert_<SID>.log文件如果发现任何新的ORA- 错误,记录并解决(4). 检查数据文件的状态记录状态不是“online”的数据文件,并做恢复。

Select file_name from dba_data_files where status=’OFFLINE’(5). 检查表空间的使用情况SELECT SUM(bytes) / (1024 * 1024) AS free_space, tablespace_nameFROM dba_free_spaceGROUP BY tablespace_name;SELECT a.tablespace_name,a.bytes total,b.bytes used,c.bytes free,(b.bytes * 100) / a.bytes "% USED ",(c.bytes * 100) / a.bytes "% FREE "FROM sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free cWHERE a.tablespace_name = b.tablespace_nameAND a.tablespace_name = c.tablespace_name;(6). 检查剩余表空间SELECT tablespace_name, SUM (blocks) AS free_blk,TRUNC (SUM (BYTES) / (1024 * 1024)) AS free_m,MAX (BYTES) / (1024) AS big_chunk_k, COUNT (*) AS num_chunks FROM dba_free_spaceGROUP BY tablespace_name;(7). 检查数据库性能,记录数据库的cpu使用、IO、buffer命中率等等使用vmstat,iostat,glance,top等命令====================每周工作====================(1). 监控数据库对象的空间扩展情况根据本周每天的检查情况找到空间扩展很快的数据库对象,并采取相应的措施alter tablespace 表空间名add datafile '/u1/oradata/userdata_002.ora' size *m;(2). 检查无效的数据库对象SELECT owner, object_name, object_typeFROM dba_objectsWHERE status = 'invalid';(3). 检查不起作用的约束SELECT owner, constraint_name, table_name, constraint_type, statusFROM dba_constraintsWHERE status = 'DISABLED' AND constraint_type = 'P' ;(4). 检查无效的triggerSELECT owner, trigger_name, table_name, statusFROM dba_triggersWHERE status = 'DISABLED';====================每月的工作====================(1). 检查表空间碎片根据本月每周的检查分析数据库碎片情况,找到相应的解决方法(2). 寻找数据库性能调整的机会比较每天对数据库性能的监控报告,确定是否有必要对数据库性能进行调整(3). 数据库性能调整如有必要,进行性能调整(4). 提出下一步空间管理计划根据每周的监控,提出空间管理的改进方法============================================================================|| ★★★Oracle DBA 日常管理★★★||============================================================================目的:这篇文档有很详细的资料记录着对一个甚至更多的ORACLE 数据库每天的,每月的,每年的运行的状态的结果及检查的结果,在文档的附录中你将会看到所有检查,修改的SQL和PL/SQL 代码。

oracle_日常检查相关资料

oracle_日常检查相关资料

内容数据库是否处于归档模式检查方法sqlplus sys/......SQL>archive log list;看数据库是否处于归档模式,并启动了自动归档进程检查结果◆正常□异常备注内容文件系统使用情况检查方法执行df –k,检查有没有使用率超过80%的文件系统,特别是存放归档日志的文件系统检查结果◆正常□异常备注内容alert_SID.log文件检查方法检查alert_SID.log有无报错信息(ORA-600、ORA-1578)、ORA-60检查结果◆正常□异常备注内容备份文件是否正常检查方法检查文件大小及生成日期检查export的日志文件用imp工具生成建表脚本,看能否正常完成imp system/.... file=backup.dmp rows=n indexfile=backup.sql检查结果◆正常□异常备注内容表空间使用情况检查方法col tablespace_name form a25select tablespace_name,count(*) chunks,max(bytes)/1024/1024 max_chunk,sum(bytes)/1024/1024 total_space from dba_free_space group by tablespace_name;如果最大可用块(max_chunk)与总大小(total_space)相比太小,要考虑接合表空间碎片或重建某些数据库对象。

碎片接合的方法:alter tablespace 表空间名 coalesce;检查结果◆正常□异常备注内容数据库对象的存储参数设置检查方法select segment_name,next_extent,tablespace_name from dba_segmentswhere next_extent;>[上一个检查中的最小的max_chunk]如果有结果返回,说明有些对象的下一次扩展(从表空间的空闲区中分配空间的操作)会失败检查结果◆正常□异常备注内容检查是否有超过200个extent的对象检查方法select segment_name,tablespace_name,extents from dba_segments where owner not in ('SYS','SYSTEM')and extents >200;如果有结果返回,说明这些对象分配了太多的extent,可以考虑重建这些对象。

Oracle数据库日常检查

Oracle数据库日常检查

Oracle 数据库日常检查A.查看所有的实例及其后台进程是否正常确认所有的instanee 工作正常,登陆到所有的数据库或instanee 上,检测oracle后台进程$env | grep SIDORACLE_SID=UWNMS3B .检查文件系统的使用情况如果文件系统的剩余空间小于10 %,则需要删除不必要的文件以释放空间。

$df -hFilesystem size/dev/md/dsk/dO 20G /proc 0K mn ttab 0K fd 0K swap 85G dmpfs 85G dmpfs 85G swap 85G/dev/vx/dsk/data10dg/Ora_File_Vol01394G/dev/vx/dsk/data1dg/vola0131443G used avail capacity Moun ted on 17G 3.1G 85% /0K 0K 0% /proc0K 0K 0% /etc/ mn ttab 0K 0K 0% /dev/fd192K 85G 1% /var/r un 0K 85G 0% /dev/vx/dmp0K 85G 0% /dev/vx/rdmp 213M 85G 1% /tmp292G 98G 75% /data05156G 283G 36% /archivelogAIX:$df -g or df -kHP-UX$bdf or df -k or df -h注意:需要特别关注根目录,数据库软件和数据库备份所在目录的剩余空间情况!备注:数据库运行日志的及时清除1). 可清除bdump,cdump,udump 下的相关日志$ cd $ORACLE_BASE/admi n/db_ name/bdump$ ls -ltotal 174-rwxrwxrwx 1 oracle dba 59047 Jul 30 22:02 alert_UWNMS1.log-rwxrwxrwx 1 oracle dba 1000 Jul 14 22:00 uwnms1_j000_18128.trc -rw-r— 1 oracle dba 1000 Jul 22 22:00 uwnms1_j 001_5369.trc-rwxrwxrwx 1 oracle dba 695 Jul 14 19:12 uwnm s1_lgwr_18100.trc -rwxrwxrwx 1 oracle dba2668 Jul 30 22:02 uwnms1」gwr_19661.trc -rwxrwxrwx 1 oracle dba 983 Jul 14 17:36 uwnm s1_lgwr_7816.trc -rwxrwxrwx 1 oracle dba 955 Jul 14 19:11 uwnm s1_lgwr_7883.trc -rwxrwxrwx 1 oracle dba 803 Jul 14 17:31 uwnm s1_p000_7714.trc -rwxrwxrwx 1 oracle dba 801 Jul 14 17:31 uwnm s1_p001_7716.trc$ cd ../cdump$ Is -ltotal 4drwxr-x--- 2 oracle dba 512 Jul 25 14:12 core_18095drwxr-x--- 2 oracle dba 512 Jul 25 19:17 core_25934$ cd ../udump$ ls -ltotal 20042-rw-r— 1 oracle dba 505 Jul 16 16:33 uwnm s1_ora_14771.trc -rw-r— 1 oracle dba 4516169 Jul 25 14:12 uwnm s1_ora_18095.trc-rwxrwxrwx 1 oracle dba 644 Jul 14 19:12 uwnm s1_ora_18119.trc -rw-r— 1 oracle dba 505 Jul 30 15:11 uwnm s1_ora_18820.trc -rwxrwxrwx 1 oracle dba 774 Jul 15 10:23 uwnm s1_ora_19573.trc -rwxrwxrwx 1 oracle dba 587 Jul 15 10:23 uwnm s1_ora_19645.trc -rwxrwxrwx 1 oracle dba 644 Jul 15 10:23 uwnm s1_ora_19680.trc -rw-r— 1 oracle dba 720942 Jul 15 16:28 uwnm s1_ora_24759.trc -rw-r— 1 oracle dba 4951562 Jul 25 19:17 uwnm s1_ora_25934.trc-rw-r— 1 oracle dba 505 Jul 15 17:21 uwnm s1_ora_27326.trc -rw-r— 1 oracle dba 503 Jul 30 16:54 uwnm s1_ora_6612.trc-rwxrwxrwx 1 oracle dba 585 Jul 14 17:12 uwnm s1_ora_7523.trc -rwxrwxrwx 1 oracle dba 767 Jul 14 17:30 uwnm s1_ora_7566.trc2).可清除oracle 的监听日志$ cd $ORACLE_HOME/network/log$ ls -ltotal 533072-rwxrwxrwx 1 oracle dba 272507851 Jul 31 11:28 liste ner 」og -rw-r--r-- 1 oracle dba 257876 Jul 31 08:48 sql net.log$ cp /dev/ nu II liste ner 」ogC .查找警告日志文件1. 联接每一个操作管理系统2. 使用’TELNETS是可比较程序3. 对每一个管理实例,经常的执行 $ORACLE_BASE/<SID>/bdump 操作,并使其能回退到控制数据库的 SID 。

oracle日常巡检内容

oracle日常巡检内容

oracle日常巡检内容Oracle日常巡检内容1. 数据库配置检查•确认数据库参数设置是否合理•检查数据库和实例的名称及归属•检查数据库初始化参数是否按照最佳实践进行了配置2. 存储检查•检查表空间的使用情况,确保没有存储空间不足的情况出现•检查数据库文件的大小和增长情况,是否需要进行调整•检查redo日志文件的大小和数量,是否满足数据库的需求3. 逻辑结构检查•检查表、索引及其关联的约束是否正常•检查视图、存储过程、函数和触发器的状态和有效性•检查数据库对象的权限和所有权是否正确4. 数据完整性检查•检查数据表的行完整性,是否存在脏数据或冗余数据•检查约束的有效性和唯一性,是否存在违反约束的数据5. 性能检查•检查数据库的运行性能,包括CPU利用率、内存使用和磁盘I/O 等指标•检查SQL的执行计划,优化可能存在的性能瓶颈•检查数据库连接数和会话数,是否超过系统的承载能力6. 安全性检查•检查用户权限,确保每个用户的权限不超过其所需•检查密码策略和账号锁定设置,防范未授权访问和暴力破解•检查数据库日志和审计功能的开启情况,以跟踪和监控潜在的安全风险7. 备份和恢复检查•检查数据库的备份策略是否合理,并进行备份的可行性验证•检查恢复策略和操作步骤,确认数据库故障时的可靠性和可恢复性•检查归档日志的生成和转储情况,确保数据库的连续性和完整性8. 资源利用检查•检查数据库的资源利用情况,包括SGA和PGA的大小及利用率•检查数据文件、临时文件和日志文件的大小和利用率•检查并发和批处理作业,以保障系统资源的合理分配与利用以上是Oracle日常巡检的一些常见内容,通过对数据库配置、存储、逻辑结构、数据完整性、性能、安全性、备份恢复和资源利用等方面的检查,可以确保数据库的稳定性、安全性和可靠性。

巡检内容的具体细节可以根据实际需求进行适当调整和补充。

9. 日志监控•检查数据库日志文件的大小和增长情况,是否超过了预设阈值•检查日志文件的生成和转储是否正常,确保日志的连续性和完整性•监控错误日志和警告日志,及时发现并解决潜在的问题10. 定期维护•执行定期维护任务,例如统计表和索引的信息,更新数据库统计信息•定期收集和分析数据库性能指标,并作出相应的调整和优化•检查数据库软件及补丁的更新情况,确保数据库系统的安全和稳定11. 连接和会话管理•检查数据库连接数和会话数的变化趋势,确保系统的可用性和稳定性•监控长时间运行的会话和阻塞会话,及时解决可能的问题•检查连接和会话的权限和资源限制,防止滥用和资源浪费12. 监控和告警•设置数据库的监控和告警机制,及时发现和解决潜在的问题•监控数据库的系统资源利用率,预测和避免系统性能下降•监控数据库对象的变化和异常操作,保障数据的安全性和完整性13. 灾备和容灾•检查灾备和容灾系统的配置和状态,确保备份和恢复的可靠性•定期测试灾备和容灾方案的可行性,并进行必要的调整和优化•监控主备数据库之间的数据同步情况,保证数据的一致性和可用性14. 文档和记录•维护数据库巡检的文档和记录,包括巡检日期、巡检内容和发现的问题•归档和备份巡检记录,以便日后的审查和比对•根据巡检结果制定和执行相应的改进措施,持续优化数据库的运行和管理巡检内容的详细执行方法和频率将根据数据库的特定需求和环境进行调整和规划。

Oracle小型机日常巡检

Oracle小型机日常巡检

Oracle小型机日常巡检Oracle小型机日常巡检企业的业务数据库系统是IT运维的重中之重,为使数据库长期稳定的运行,需要相关人员对数据库进行每日巡检和记录,下面对数据库日常巡检工作做一个全面详细的计划:一、小型机日常巡检:1. 检查小型机硬件健康状态1.1 显示内核启用的是32位还是64位# bootinfo -K641.2 显示硬件32位还是64位:# bootinfo -y641.3 显示以KB为单位的实际内存:# bootinfo -r325058561.4 显示系统上的硬盘数量# lspvhdisk0 00c7c505bc0669c5 rootvg activehdisk1 00c7c50592cdd77a rootvg activehdisk2 00cb9934c0a92e73 datavg activehdisk3 00c7c505ce5e6688 datavg active1.5 查看硬盘hdisk1的详细信息:# lspv hdisk1PHYSICAL VOLUME: hdisk1 VOLUME GROUP: rootvgPV IDENTIFIER: 00c7c50592cdd77a VG IDENTIFIER 00c7c50500004c0000000129bc06773fPV STATE: activeSTALE PARTITIONS: 0 ALLOCATABLE: yesPP SIZE: 512 megabyte(s) LOGICAL VOLUMES: 14TOTAL PPs: 558 (285696 megabytes) VG DESCRIPTORS: 2FREE PPs: 224 (114688 megabytes) HOT SPARE: noUSED PPs: 334 (171008 megabytes) MAX REQUEST: 1 megabyteFREE DISTRIBUTION: 01..00..00..111..112USED DISTRIBUTION: 111..112..111..00..00MIRROR POOL: None# smitty fs# smitty lvm1.6 查看处理器数量:# lscfg | grep proc+ proc0 Processor+ proc2 Processor+ proc4 Processor+ proc6 Processor1.7 查看一个CPU的详细信息:# lsattr -El proc0frequency 4204000000 Processor Speed Falsesmt_enabled true Processor SMT enabled Falsesmt_threads 2 Processor SMT threads Falsestate enable Processor state Falsetype PowerPC_POWER6 Processor type False#1.8 查看系统硬件资源列表:#lscfg1.9 查看芯片类型:# uname -ppowerpc1.10 查看操作系统版本号:oslevel1.11 显示系统名称:# uname -sAIX1.12 显示节点名称:# uname -nDL-DB-021.13 显示uname的很多信息(系统名称、节点名称、版本、计算机ID):# uname -aAIX DL-DB-02 1 6 00C7C5054C001.14 显示系统型号:# uname -MIBM,8204-E8A1.15 显示操作系统版本:# uname -v61.16 显示运行系统的硬件的计算机ID编号:# uname-m00C7C5054C001.17 显示系统ID编号:# uname -uIBM,02067C5051.18 显示AIX的主要版本、次要版本和维护级:# oslevel -r6100-04# lslpp -h bos.rteFileset Level Action Status Date Time----------------------------------------------------------------------------Path: /usr/lib/objreposbos.rte6.1.4.0 COMMIT COMPLETE 07/10/10 19:07:31Path: /etc/objreposbos.rte6.1.4.0 COMMIT COMPLETE 07/10/10 19:07:31#1.19 查看磁盘使用情况(参数k表示以k为单位,m表示以M为单位):# df -kFilesystem 1024-blocks Free %Used Iused %Iused Mounted on/dev/hd4 5242880 5039512 4% 14271 2% //dev/hd2 11534336 5382688 54% 52471 5% /usr/dev/hd9var 5242880 4544720 14% 7487 1% /var/dev/hd3 10485760 10397956 1% 4002 1% /tmp/dev/fwdump 1048576 1046932 1% 13 1% /var/adm/ras/platform/dev/hd1 5242880 5241708 1% 8 1% /home/dev/hd11admin 524288 523848 1% 5 1% /admin/proc - - - - - /proc/dev/hd10opt 10485760 5696856 46% 10713 1% /opt/dev/livedump 524288 523880 1% 4 1% /var/adm/ras/livedump/dev/oradmpbak 10485760 4488028 58% 28042 3% /orainstbak1/dev/oraclebak 62914560 9605248 85% 33 1% /oradatabak1 /dev/oradata 367001600 321016968 13% 33 1% /oradata/dev/orainst 20971520 14943512 29% 28707 1% /orainst1.20 查看文件大小# du -s tmp166552 tmp2. 检查系统报错信息2.1 显示简短报错信息# errpt | moreTIMESTAMP: MMDDHHMMYY (月日时分年)T(类型): P 永久; T 临时; U 未知(永久性的错误应引起重视)C(分类): H 硬件; S 软件; O 用户; U未知2.2 列出所有硬件出错信息:# errpt -d H2.3 列出所有软件出错信息:# errpt -d S2.4 查看具体某个ID的报错信息:# errpt -aj D666A8C7 > aaa.txtD666A8C7是简短报错信息中的ID号。

oracle日常运维操作总结

oracle日常运维操作总结

oracle日常运维操作总结一、硬件维护1.确保服务器硬件运行正常,定期检查硬件设备,如服务器、存储设备、网络设备等。

2.根据需要及时更新硬件设备,包括升级内存、硬盘等。

3.确保服务器周边设备运行正常,如UPS电源、空调等。

二、软件维护1.确保Oracle数据库软件运行正常,定期检查软件版本、补丁等。

2.更新Oracle数据库软件,包括升级Oracle版本、打补丁等。

3.定期清理无用文件,包括日志文件、临时文件等。

4.定期备份数据库,确保数据安全。

三、性能优化1.定期检查数据库性能,包括CPU使用率、内存使用率等。

2.根据性能检查结果,进行性能优化,如调整数据库参数、优化SQL语句等。

3.定期对数据库进行优化,包括重建索引、优化表空间等。

四、安全加固1.配置Oracle数据库的安全设置,如用户密码、权限管理等。

2.确保数据库账户的安全性,如定期修改密码、禁用无效账户等。

3.防止SQL注入等攻击行为,如使用参数化查询、限制用户输入等。

4.定期检查数据库的安全日志,包括登录日志、操作日志等。

五、数据备份1.制定数据备份计划,并按照计划执行备份操作。

2.采用多种备份方式,如全备份、增量备份等。

3.确保备份数据的可用性和完整性,如定期测试备份数据的恢复能力。

4.对备份数据进行存储和管理,确保数据安全。

六、故障处理1.建立故障处理流程,明确故障处理责任人和流程步骤。

2.对发生的故障进行及时处理,如系统崩溃、网络故障等。

3.对故障进行分类和总结,建立故障处理知识库。

4.定期对系统进行健康检查和性能测试,预防故障发生。

七、监控管理1.建立监控管理体系,包括监控指标、监控周期等。

2.使用监控工具,如OracleEnterpriseManager、Nagios等,对系统进行实时监控。

3.对监控数据进行分析和处理,及时发现和处理潜在问题。

4.定期对监控数据进行存储和管理,方便后续查询和分析。

八、应急预案1.制定应急预案,明确应急响应流程和责任人。

oracle-DBA日常检查

oracle-DBA日常检查

Oracle10g数据库日常维护手册目录1.检查数据库基本状况 (2)1.1. 检查O RACLE实例状态 (2)1.2. 检查O RACLE服务进程 (3)1.3. 检查O RACLE监听状态 (3)2.检查系统和ORACLE日志文件 (4)2.1. 检查操作系统日志文件 (4)2.2. 检查ORACLE日志文件 (4)2.3. 检查O RACLE核心转储目录 (5)2.4. 检查R OOT用户和O RACLE用户的EMAIL (5)3.检查ORACLE对象状态 (5)3.1. 检查O RACLE控制文件状态 (5)3.2. 检查O RACLE在线日志状态 (6)3.3. 检查O RACLE表空间的状态 (6)3.4. 检查O RACLE所有数据文件状态 (6)3.5. 检查无效对象 (7)3.6. 检查所有回滚段状态 (7)4.检查ORACLE相关资源的使用情况 (8)4.1. 检查O RACLE初始化文件中相关参数值 (8)4.2. 检查数据库连接情况 (9)4.3. 检查系统磁盘空间 (10)4.4. 检查表空间使用情况 (10)4.5. 检查一些扩展异常的对象 (10)4.6. 检查SYSTEM表空间内的内容 (11)4.7. 检查对象的下一扩展与表空间的最大扩展值 (11)5.检查ORACLE数据库备份结果 (11)5.1. 检查数据库备份日志信息 (11)5.2. 检查BACKUP卷中文件产生的时间 (12)5.3. 检查ORACLE用户的EMAIL (12)6.检查ORACLE数据库性能 (12)6.1. 检查数据库的等待事件 (12)6.2. D ISK R EAD最高的SQL语句的获取 (12)6.3. 查找前十条性能差的SQL (12)6.4. 等待时间最多的5个系统等待事件的获取 (12)6.5. 检查运行很久的SQL (13)6.6. 检查消耗CPU最高的进程 (13)6.7. 检查碎片程度高的表 (13)6.8. 检查表空间的I/O比例 (13)6.9. 检查文件系统的I/O比例 (13)6.10. 检查死锁及处理 (13)6.11. 检查数据库CPU、I/O、内存性能 (14)6.12. 查看是否有僵死进程 (15)6.13. 检查行链接/迁移 (15)6.14. 定期做统计分析 (15)6.15. 检查缓冲区命中率 (16)6.16. 检查共享池命中率 (16)6.17. 检查排序区 (16)6.18. 检查日志缓冲区 (16)7.检查数据库安全性 (17)7.1. 检查系统安全日志信息 (17)7.2. 检查用户修改密码 (17)8.其他检查 (17)8.1. 检查当前CRONTAB任务是否正常 (17)8.2. O RACLE J OB是否有失败 (18)8.3. 监控数据量的增长情况 (18)8.4. 检查失效的索引 (18)8.5. 检查不起作用的约束 (19)8.6. 检查无效的TRIGGER (19)巡检内容1.检查数据库基本状况在本节中主要对数据库的基本状况进行检查,其中包含:检查Oracle实例状态,检查Oracle服务进程,检查Oracle监听进程,共三个部分。

如何对Oracle数据库进行日常巡检

如何对Oracle数据库进行日常巡检

Subject:How to Perform a Healthcheck on theDatabaseDoc ID: Note:122669.1 Type: BULLETIN Last Revision Date: 20-MAR-2008 Status: PUBLISHEDTable of Contents-----------------1. Introduction2. Parameter file3. Controlfiles4. Redolog files5. Archiving6. Datafiles6.1 Autoextend6.2 Location7. Tablespaces7.1 SYSTEM Tablespace7.2 SYSAUX Tablespace7.3 Locally vs Dictionary Managed Tablespaces7.4 Temporary Tablespace7.5 Tablespace Fragmentation8. Objects8.1 Number of Extents8.2 Next extent8.3 Indexes9. AUTO vs MANUAL undo9.1 AUTO Undo9.2 Manual undo10. Memory Management10.1 Pre-Oracle 9i10.2 Oracle 9i10.3 Oracle 10g10.4 Oracle 11g11. Logging & Tracing11.1 Alert File11.2 Max_dump_file_size11.3 User and core dump size parameters11.4 Audit files11.5 Sqlnet1. Introduction---------------This article explains how to perform a health check on the database. General guidelines are given on what areas to investigate to get a better overview onhow the database is working and evolving. These guidelines will reveal common issues regarding configuration as well as problems that may occur in the future.The areas investigated here are mostly based on scripts and are brought to you without any warranty, these scripts may need to be adapted for next database releases and features. This article will probably need to be extended to serve specific application needs/checks.Although some performance areas are discussed in this article, it is not the intention of this article to give a full detailed explanation of optimizing the database performance.General scripts that help track information on the database:=)> Note 250262.1 Health Check / Validation Engine Guide=)> Note 136697.1“hcheck8i.sql” script to check for known problems in Oracle8i, Oracle9i, and Oracle10g2. Parameter file-----------------The parameter file can exists in 2 forms. First of all we have the text-based version, commonly referred to as init.ora or pfile, and a binary-based file, commonly referred to as spfile. The pfile can be adjusted using a standard Operating System editor, while the spfile needs to be managed through the instance itself.It is important to realize that the spfile takes presedence above the pfile, meaning whenever there is an spfile available this will be automatically taken unless specified otherwise.NOTE: Getting an RDA report after making changes to the database configuration is also a recommendation. Keeping historical RDA reports will ensure you havean overview of the database configuration as the database evolves.Reference:Note 249664.1: Pfile vs SPfile3. Controlfiles---------------It is highly recommended to have at least two copies of the controlfile. This can be done by mirroring the controlfile, strongly recommended on different physicaldisks. If a controlfile is lost, due to a disk crash for example, then you canuse the mirrored file to startup the database. In this way fast and easy recovery from controlfile loss is obtained.connect as sysdbaSQL> select status, name from v$controlfile;STATUS NAME------- ---------------------------------/u01/oradata/L102/control01.ctl/u02/oradata/L102/control02.ctlThe location and the number of controlfiles can be controlled by the 'control_files' initialization parameter.4. Redolog files----------------The Oracle server maintains online redo log files to minimize loss of data in the database. Redo log files are used in a situation such as instance failure to recover commited data that has not yet been written to the data files. Mirroring theredo log files, strongly recommended on different physical disks, makes recovery more easy in case one of the redo log files is lost due to a disk crash, user delete, etc.connect as sysdbaSQL> select * from v$logfile;GROUP# STATUS TYPE MEMBER--------- ------- ------ -----------------------------------1 ONLINE /u01/oradata/L102/redo01_A.log1 ONLINE /u02/oradata/L102/redo01_B.log2 ONLINE /u01/oradata/L102/redo02_A.log2 ONLINE /u02/oradata/L102/redo02_B.log3 ONLINE /u01/oradata/L102/redo03_A.log3 ONLINE /u02/oradata/L102/redo03_B.logAt least two redo log groups are required, although it is advisable to have at least three redo log groups when archiving is enabled (see the following chapter). It is common, in environments where there are intensive log switches, to see the ARCHiver background process fall behind of the LGWR background process. In this case the LGWRprocess needs to wait for the ARCH process to complete archiving the redo log file.References :Note 102995.1 Maintenance of Online Redo Log Groups and Members5. Archiving------------Archiving provides the mechanism needed to backup the changes of the database.The archive files are essential in providing the necessary information to recover the database. It is advisable to run the database in archive log mode, although you may have reasons for not doing this, for example in case of a TEST environment where you accept to loose the changes made between the current time and the last backup.You may ignore this chapter when the database doesn't run in archive log mode.There are several ways of checking the archive configuration, below is one of them:connect as sysdbaSQL> archive log listDatabase log mode No Archive Mode --OR-- Archive ModeAutomatic archival Disabled --OR-- EnabledArchive destination <arch. dest.> --OR-- USE_DB_RECOVERY_FILE_DESTOldest online log sequence seq. noCurrent log sequence seq. noPre-10g, if the database is running in archive log mode but the automatic archiver process is disabled, then you were required to manually archive the redolog files. If this is not done in time then the database is frozen and any activity is prevented. Therefore you should enable automatic archiving when the database is running in archive log mode. This can be done by setting the 'log_archive_start' parameter to true in the parameter file.Starting from 10g, this parameter became obsolete and is no longer required to be set explicitly. It is important that there is enough free space on the dedicated disk(s) for the archive files, otherwise the ARCHiver process can't write and a crash is inevitable.References:Note 69739.1 How to Turn Archiving ON and OFFNote 122555.1 Determine how many disk space is needed for the archive files6. Datafiles------------6.1 Autoextend~~~~~~~~~~~~~~~The autoextend command option enables or disables the automatic extension ofdata files. If the given datafile is unable to allocate the space needed, itcan increase the size of the datafile to make space for objects to grow.A standard Oracle datafile can have, at most, 4194303 Oracle datablocks.So this also implies that the maximum size is dependant on the Oracle Block size used.DB_BLOCK_SIZE Max Mb value to use in any command~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~2048 8191 M4096 16383 M8192 32767 M16384 65535 Mstarting from Oracle 10g, we have a new functionality called BIGFILE, whichallows for bigger files to be created. Please also consider that every Operating System has its limits, therefore you should make sure that the maximum size ofa datafile cannot be extended past the Operating System allowed limit.To determine if a datafile and thus, a tablespace, has AUTOEXTEND capabilities:SQL> select file_id, tablespace_name, bytes, maxbytes, maxblocks, increment_by, file_namefrom dba_data_fileswhere autoextensible = 'YES';Reference:Note 112011.1: ALERT: RESIZE or AUTOEXTEND can "Over-size" Datafiles and Corrupt the DictionaryNote 262472.1: 10g BIGFILE Type Tablespaces Versus SMALLFILE Type6.2 Location~~~~~~~~~~~~~Verify the location of your datafiles. Overtime a database will grow and datafiles may be added to the database. Avoid placing datafiles on a 'wherever there is space' basis as this will complicate backup strategies and maintenance.Below is an example of bad usage:SQL> select * from v$dbfile;FILE# NAME--------- --------------------------------------------------1 D:\DATABASE\SYS1D806.DBF2 D:\DATABASE\D806\RBS1D806.DBF3 D:\DATABASE\D806\TMP1D806.DBF5 D:\DATABASE\D806\USR1D806.DBF6 D:\USR2D806.DBF7 F:\ORACLE\USR3D806.DBF7. Tablespaces--------------7.1 SYSTEM Tablespace~~~~~~~~~~~~~~~~~~~~~~User objects should not be created in the system tablespace. Doing so can lead to unnecessary fragmentation and preventing system tables of growing. The following queryreturns a list of objects that are created in the system tablespace but not owned by SYS or SYSTEM.SQL> select owner, segment_name, segment_typefrom dba_segmentswhere tablespace_name = 'SYSTEM'and owner not in ('SYS','SYSTEM');7.2 SYSAUX Tablespace (10g Release and above)~~~~~~~~~~~~~~~~~~~~~~The SYSAUX tablespace was automatically installed as an auxiliary tablespace to the SYSTEM tablespace when you created or upgraded the database. Some database components that formerly created and used separate tablespaces now occupy theSYSAUX tablespace.If the SYSAUX tablespace becomes unavailable, core database functionality will remain operational. The database features that use the SYSAUX tablespace could fail, or function with limited capability.The amount of data stored in this tablespace can be significant and may growover time to unmanageble sizes if not configured properly. There are a fewcomponents that need special attention.To check which components are occupying space:select space_usage_kbytes, occupant_name, occupant_descfrom v$sysaux_occupantsorder by 1 desc;Reference:Note 329984.1: Usage and Storage Management of SYSAUX tablespace occupants SM/AWR, SM/ADVISOR, SM/OPTSTAT and SM/OTHER7.3 Locally vs Dictionary Managed Tablespaces~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Locally Managed Tablespaces are available since Oracle 8i, however they becamethe default starting from Oracle 9i. Locally Managed Tablespaces, also referred to as LMT, have some advantage over Data Dictionary managed tablespaces.To verify which tablespace is Locally Managed or Dictionary Managed, you can run the following query:SQL> select tablespace_name, extent_managementfrom dba_tablespaces;Reference:Note 93771.1: Introduction to Locally-Managed TablespacesNote 105120.1: Advantages of Using Locally Managed vs Dictionary Managed Tablespaces7.4 Temporary Tablespace~~~~~~~~~~~~~~~~~~~~~~~~~o Locally Managed Tablespaces use tempfiles to serve the temporary tablespace, whereas Dictionary Managed Tablespaces use a tablespace of the type temporary. When you are running an older version (pre Oracle 9i), then it is important to check the type of tablespace used to store the temporary segments. By default, all tablespaces are created as PERMANENT, therefore you should make sure that the tablespace dedicated for temporary segments is of the type TEMPORARY.SQL> select tablespace_name, contentsfrom dba_tablespaces;TABLESPACE_NAME CONTENTS------------------------------ ---------SYSTEM PERMANENTUSER_DATA PERMANENTROLLBACK_DATA PERMANENTTEMPORARY_DATA TEMPORARYo Make sure that the users on the database are assigned a tablespace of thetype temporary. The following query lists all the users that have a permanent tablespace specified as their default temporary tablespace.SQL> select ername, t.tablespace_namefrom dba_users u, dba_tablespaces twhere u.temporary_tablespace = t.tablespace_nameand t.contents <> 'TEMPORARY';Note: User SYS and SYSTEM will show the SYSTEM tablespace as there defaulttemporary tablespace. This value can be altered as well to prevent fragmentation in the SYSTEM tablespace.SQL> alter user SYSTEM temporary tablespace TEMP;o The space allocated in the temporary tablespace is reused. This is done forperformance reasons to avoid the bottleneck of constant allocating and de-allocating of extents and segments. Therefore when looking at the free space in the temporary tablespace, this may appear as full all the time. The following are a few queries that can be used to list more meaningful information about the temporary segment usage:This will give the size of the temporary tablespace:SQL> select tablespace_name, sum(bytes)/1024/1024 mbfrom dba_temp_filesgroup by tablespace_name;This will give the "high water mark" of that temporary tablespace (= max used at one time):SQL> select tablespace_name, sum(bytes_cached)/1024/1024 mbfrom v$temp_extent_poolgroup by tablespace_name;This will give current usage:SQL> select ss.tablespace_name,sum((ed_blocks*ts.blocksize))/1024/1024 mb from gv$sort_segment ss, sys.ts$ tswhere ss.tablespace_name = group by ss.tablespace_name;7.5 Tablespace Fragmentation~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Heavly fragmented tablespaces can have an impact on the performance, especially when a lot of Full Table Scans are occurring on the system. Another disadvantage of fragmentation is that you can get out-of-space errors while the total sum of all free space is much more then you had requested.The only way to resolve fragmentation is drop and recreate the object. In most cases doing an export and import will solve the problem. If you need todefragment your system tablespace, you must rebuild the whole database sinceit is NOT possible to drop the system tablespace.References:Note 1020182.6 SCRIPT to detect tablespace fragmentationNote 1012431.6 Common causes of Fragmentation8. Objects----------8.1 Number of Extents~~~~~~~~~~~~~~~~~~~~~~While the performance hit on over extended objects is not significant, theaggregate effect on many over extended objects does impact performance. Thefollowing query will list all the objects that have allocated more extentsthan a specified minimum. Change the <--minext--> value by an actual number,in general objects allocating more then 100 a 200 extents can be recreatedwith larger extent sizes:SQL> select owner, segment_type, segment_name, tablespace_name,count(blocks), SUM(bytes/1024) "BYTES K", SUM(blocks)from dba_extentswhere owner NOT IN ('SYS','SYSTEM')group by owner, segment_type, segment_name, tablespace_namehaving count(*) > <--minext-->>order by segment_type, segment_name;8.2 Next extent~~~~~~~~~~~~~~~~It is important that segments can grow and therefore allocate their next extentwhen needed. If there is not enough free space in the tablespace then the nextextent can not be allocated and the object will fail to grow.The following query returns all the segments that are unable to allocate theirnext extent :SQL> select s.owner, s.segment_name, s.segment_type,s.tablespace_name, s.next_extentfrom dba_segments swhere s.next_extent > (select MAX(f.bytes)from dba_free_space fwhere f.tablespace_name = s.tablespace_name);Note that if there is a lot of fragmentation in the tablespace, then this querymay give you objects that still are able to grow. The above query is based onthe largest free chunk in the tablespace available. If there are a lot of'small' free chunks after each other, then Oracle will coalesce these to servethe extent allocation.Therefore it can be interesting to adapt the script in Note 1020182.6 'SCRIPTto detect tablespace fragmentation' to compare the next extent for each objectwith the 'contiguous' bytes (table space_temp) in the tablespace.8.3 Indexes~~~~~~~~~~~~An index needs to be maintained, every delete or insert on a table resultindirectly on a delete or insert on the underlying index. Over time an indexstructure can get fragmented and therefore the index should be rebuilt.9. AUTO vs MANUAL undo-----------------------Starting from Oracle 9i we introduced a new way of managing the before-images. Previously this was achieved through the RollBack Segments or also referred to as manual undo. Automatic undo is used when the UNDO_MANAGEMENT parameter is set to AUTO. When not set or set to MANUAL then we use the 'old' rollback segment mechanism. Although both versions are still available in current release, automatic undo is preferred.9.1 AUTO UNDO~~~~~~~~~~~~~~~There is little to no configuration involved to AUM (Automatic Undo Management). You basically define the amount of time the before image needs to be kept available.This is controlled through the parameter UNDO_RETENTION, defined in seconds. So a value of 900 indicates 15 minutes.It is important to realize that this value is not honored when we are under space pressure in the undo tablespace.Therefore the following formula can be used to calculate the optimal undo tablespace size:Note 262066.1: How To Size UNDO Tablespace For Automatic Undo ManagementStarting from Oracle 10g, you may choose to use the GUARANTEE option, to make sure the undo information does not get overwritten before the defined undo_retention time.Note 311615.1: Oracle 10G new feature - Automatic Undo Retention Tuning9.2 MANUAL UNDO~~~~~~~~~~~~~~~~~~o Damaged rollback segments will prevent the instance to open the database. Only if names of rollback segments are known, corrective action can be taken. Therefore specify all the rollback segments in the 'rollback_segments' parameter in theinit.orao Too small or not enough rollback segments can have serious impact on the behavior of your database. Therefore several issues must be taken into account. Thefollowing query will show you if there are not enough rollback segments onlineor if the rollback segments are too small.SQL> select d.segment_name, d.tablespace_name, s.waits, s.shrinks,s.wraps, s.statusfrom v$rollstat s, dba_rollback_segs dwhere n = d.segment_idorder by 1;SEGMENT_NAME TABLESPACE_NAME WAITS SHRINKS WRAPS STATUS---------------- ----------------------- --------- --------- --------- --------RB1 ROLLBACK_DATA 1 0 160 ONLINERB2 ROLLBACK_DATA 31 1 149 ONLINESYSTEM SYSTEM 0 0 0 ONLINEThe WAITS indicates which rollback segment headers had waits for them. Typically you would want to reduce such contention by adding rollback segments.If SHRINKS is non zero then the OPTIMAL parameter is set for that particularrollback segment, or a DBA explicitly issued a shrink on the rollback segment.The number of shrinks indicates the number of times a rollback segment shrinkedbecause a transaction has extended it beyond the OPTIMAL size. If this value is too high then the value of the OPTIMAL size should be increased as well as theoverall size of the rollback segment (the value of minextents can be increasedor the extent size itself, this depends mostly on the indications of the WRAPScolumn).The WRAPS column indicate the number of times the rollback segment wrapped toanother extent to serve the transaction. If this number is significant then you need to increase the extent size of the rollback segment.Reference:Note 62005.1 Creating, Optimizing, and Understanding Rollback Segments10. Memory Management---------------------This chapter is very version driven. Depending on which version you are running the option available will be different. Overtime Oracle has invested a great deal of time and effort in managing the memory more efficiently and transparently for the end-user.Therefore it is advisable to use the automation features as much as possible.10.1 Pre Oracle 9i~~~~~~~~~~~~~~~~~~~The different memory components (SGA & PGA) needed to be defined at the startup of thedatabase. These values were static. So if one of the memory components was too low thedatabase needed to be restarted to make the changes effective.How to determine the optimal or best value for the different memory components is not covered in this note, since this would lead us too far. However a parameter that was often misused in these versions is the sort_area_size.The 'sort_area_size' parameter in the init.ora defines the amount of memory that can beused for sorting. This value should be chosen carefully since this is part of the User Global Area (UGA) and therefore is allocated for each user individually.If there are a lot of concurrent users performing large sort operation on the databasethen the system can run out of memory.E.g.: You have a sort_area_size of 1Mb, with 200 concurrent users on the database. Although this memory is allocated dynamically, it can allocate up to 200Mband therefore can cause extensive swapping on the system.10.2 Oracle 9i~~~~~~~~~~~~~~~Starting from Oracle 9i we introduced the parametersworkarea_size_policy = [AUTO | MANUAL]pga_aggregate_target = <value>This allows you define 1 pool for the PGA memory, which will be shared across sessions. When you often receive ORA-4030 errors, then this can be an indication that this valueisspecified too low.10.3 Oracle 10g~~~~~~~~~~~~~~~~Automatic Shared Memory Management (ASMM) was introduced in 10g. The automatic shared memorymanagement feature is enabled by setting the SGA_TARGET parameter to a non-zero value.This feature has the advantage that you can share memory resources among the different components.Resources will be allocated and deallocated as needed by Oracle automatically.Automatic PGA Memory management is still available through the 'workarea_size_policy' and'pga_aggregate_target' parameters.10.4 Oracle 11g~~~~~~~~~~~~~~~~Automatic Memory Management (AMM) is being introduced in 11g. This enables automatic tuningof PGA and SGA with use of two new parameters named MEMORY_MAX_TARGET and MEMORY_TARGET.Reference:Note 443746.1: Automatic Memory Management(AMM) on 11g11. Logging & Tracing---------------------11.1 Alert File~~~~~~~~~~~~~~~~The alert log file of the database is written chronologically. Data is always appended and therefore this file can grow to an enormous size. It should becleared or truncated on a regular basis, as a large alert file occupiesunnecessary disk space and can slow down OS write performance to the file.SVRMGR> connect internal/<password>SVRMGR> show parameter background_dump_destNAME TYPE VALUE------------------------------ ------- ----------------------------------background_dump_dest string D:\Oradata\Admin\PROD\Trace\BDumpNote: starting from Oracle 11g, this location is controlled by the 'diagnostic_dest' parameter11.2 Max_dump_file_size~~~~~~~~~~~~~~~~~~~~~~~~Oracle Server processes generate trace files for certain errors or conflicts.These trace files are of use for further analyzing the probleThe init.oraparameter 'max_dump_file_size' limits the size of these trace files. The value of this parameter should be specified in Operating System blocks.Make sure the disk space can handle the maximum size specified, if not thenthis value should be changed.SVRMGR> connect internal/<password>SVRMGR> show parameter max_dump_file_sizeNAME TYPE VALUE----------------------------------- ------- ---------------------max_dump_file_size integer 1024011.3 User and core dump size parameters~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~The parameters 'user_dump_size' and 'core_dump_size' can contain a lot of trace information.It is important to clear this directory at regular times as this can take up a significantamount of space.Note: starting from Oracle 11g, this location is controlled by the 'diagnostic_dest' parameter11.4 Audit files~~~~~~~~~~~~~~~~~By default, every connection as SYS or SYSDBA is logged in an operating system file. The location is controlled through the parameter 'audit_file_dest'. If this parameter isnot set then the location defaults to $ORACLE_HOME/rdbms/audit.Overtime this directory may contain a lot of auditing information and can take up a significant amount of space.11.5 Sqlnet~~~~~~~~~~~~By default sqlnet tracing is disabled while logging for sqlnet connections andthe listener is enabled. These log files are written chronologically and data is always appended. This causes some log files to grow to enormous sizes. Theselarge log files should be cleared or truncated on a regular basis.Activate tracing in case there is a problem that needs to be analyzed. Unnecessary tracing will slow down the system and occupy free disk space. Therefore youshould disable sqlnet and listener tracing when it is not required.To find the location of the logfiles or to activate tracing see:Note 219968.1: SQL*Net, Net8, Oracle Net Services - Tracing and Logging at a Glance <<E--End--。

Oracle数据库日常巡检及常见故障解决-20180620

Oracle数据库日常巡检及常见故障解决-20180620

, SUM(DECODE(SUBSTR(TO_CHAR(first_time, 'MM/DD/RR HH24:MI:SS'),10,2),'07',1,0)) H07
, SUM(DECODE(SUBSTR(TO_CHAR(first_time, 'MM/DD/RR HH24:MI:SS'),10,2),'08',1,0)) H08
志切换,将该日志文件组的状态改动为inactive
1.1、检查数据库基本状况
检查监听状态:lsnrctl status(start/stop)
1.1、检查数据库基本状况
检查无效对象
select owner,object_name,object_type from dba_objects where status!='VALID' and owner!='SYS' and owner!='SYSTEM';
第三步:调用dbms_job的broken函数将要停止的job干掉 SQL> EXEC DBMS_JOB.BROKEN(18,TRUE); PL/SQL procedure successfully completed SQL>commit; 此时这个job还是运行的,可以通过dba_jobs_running查看
1.1、检查数据库基本状况
在线日志切换频率过高处理办法: 1、创建新的日志组 alter database add logfile group 4 ('目录/redo04.log') size
500M; 2、切换日志到新建的日志组 alter system switch logfile; 3、删除旧日志组 alter database drop logfile group 3; 注意:删除的日志文件组不能处于current状态,须要运行一次手动日

ORACLE数据库常规巡检报告单(例子)

ORACLE数据库常规巡检报告单(例子)

ORACLE数据库常规巡检报告单(例⼦)ORACLE数据库常规巡检报告单⽬录ORACLE数据库常规巡检报告单 (1)⼀、概述 (3)⼆、使⽤的相关软件简要说明 (3)三、主机及操作系统常规配置检查 (3)1、系统设置检查 (3)2、I/O 设备信息 (3)3、⽹络配置信息 (4)四、ORACLE 数据库常规检查 (5)1、ORACLE 常规检查 (5)2、基本参数配置 (5)3、ORACLE ⽤户配置⽂件 (6)五、数据库关键性能检查及分析 (6)1、数据库性能检查 (6)2、数据库响应时间分析 (6)六、备份恢复策略检查和维护 (7)1、RMAN 配置情况 (7)2、备份策略描述 (7)3、备份策略实施 (7)4、备份检查和每⽇备份脚本⽇志检查 (8)5、对当前策略的总结 (8)七、关键性SQL 语句定位及分析 (8)⼋、近期警告⽇志及相关分析 (8)1、orcl_ora_8727.trc (8)2、orcl_ora_8727.trc (9)九、⼩结 (9)⼀、概述按照维护计划和为了系统的稳定运⾏,需要定期对系统进⾏⼀次巡检,时间周期为每星期⼀次。

⽬的在于诊断当前环境是否存在安全隐患,系统运⾏是否存在明显的系统瓶颈,定位重要的SQL 语句并进⾏性能分析,分析当前备份策略,分析警告⽇志信息并提供解决⽅案。

⼆、使⽤的相关软件简要说明1.使⽤RDA 对整个系统进⾏检查,并且⽣成报告2.使⽤AWR 对数据库进⾏检查,并且⽣成报告。

3.使⽤RMAN 对数据库进⾏备份,并且使⽤RMAN 相关的功能进⾏备份检查。

相关详细后页提供三、主机及操作系统常规配置检查1、系统设置检查主机和版本号Linux localhost 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006 x86_64主机名localhost.localdomain操作系统平台64-bit Red Hat Linux操作系统版本 2.6.92、I/O 设备信息3、⽹络配置信息四、ORACLE 数据库常规检查1、ORACLE 常规检查Database OverviewDB Name ORCLGlobal Name /doc/e298af7e4693daef5ef73dba.html Host Name localhost Instance Name orclInstance Start Time 18-Nov-2008 14:14:01Restricted Mode NOArchive Log ModeARCHIVELOG3、ORACLE ⽤户配置⽂件# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATHunset USERNAME#for oracleexport ORACLE_SID=orclexport ORACLE_BASE=/oracleexport ORACLE_HOME=/oracle/10gexport PATH=$ORACLE_HOME/bin:$PATHexport NLS_LANG=AMERICAN_AMERICA.ZHS16GBK五、数据库关键性能检查及分析1、数据库性能检查2、数据库响应时间分析响应时间是⾮常重要的数据库性能指标从以上信息可以看出,RMAN 备份占⽤的⼤量的时间,六、备份恢复策略检查和维护1、RMAN 配置情况RMAN configuration parameters are:CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;CONFIGURE BACKUP OPTIMIZATION ON;CONFIGURE DEFAULT DEVICE TYPE TO DISK;CONFIGURE CONTROLFILE AUTOBACKUP ON;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'orclcongrol_%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET; CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL 1 DEVICE TYPE DISK MAXPIECESIZE 100 M MAXOPENFILES 8 RATE 40 M; CONFIGURE CHANNEL 2 DEVICE TYPE DISK MAXPIECESIZE 100 M MAXOPENFILES 8 RATE 40 M; CONFIGURE MAXSETSIZE TO UNLIMITED; # defaultCONFIGURE ENCRYPTION FOR DATABASE OFF; # defaultCONFIGURE ENCRYPTION ALGORITHM 'AES128'; # defaultCONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # defaultCONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/10g/dbs/snapcf_orcl.f'; # default2、备份策略描述选⽤RMAN 多级备份策略,以每个星期作为⼀个周期星期1 数据库全备0 级星期2 增量备份 1 级星期3 增量备份 1 级星期4 累积增量备份1c 级星期5 数据库全备0 级星期6 增量备份 1 级星期天增量备份 1 级基于以上策略,任何时间点的数据恢复只需要做最多1 次0 级恢复和2 次1 级恢复.加上当⽇的归档⽇志可以实现快速的完全恢复3、备份策略实施Cat /etc/crontabSHELL=/bin/bashPATH=/sbin:/bin:/usr/sbin:/usr/binMAILTO=rootHOME=/# run-parts01 * * * * root run-parts /etc/cron.hourly02 4 * * * root run-parts /etc/cron.daily22 4 * * 0 root run-parts /etc/cron.weekly42 4 1 * * root run-parts /etc/cron.monthly00 4 * * 1 oracle /oracle/scripts/rman/backupweek1.cmd &00 4 * * 2 oracle /oracle/scripts/rman/backupweek2.cmd &00 4 * * 3 oracle /oracle/scripts/rman/backupweek3.cmd & 00 4 * * 4 oracle/oracle/scripts/rman/backupweek4.cmd &00 4 * * 5 oracle /oracle/scripts/rman/backupweek5.cmd &00 4 * * 6 oracle /oracle/scripts/rman/backupweek6.cmd &00 4 * * 7 oracle /oracle/scripts/rman/backupweek7.cmd &4、备份检查和每⽇备份脚本⽇志检查使⽤crosscheck backupset 检查。

Oracle数据库日常巡检指令

Oracle数据库日常巡检指令

Oracle 数据库日常巡检指令Oracle数据库的日常巡检内容包括:Oracle数据库基本状况检查;Oracle相关资源的使用情况检查;Oracle数据库性能检查;数据库服务器cpu、mem和I/O 性能检查;数据库服务器安全性及其他事项检查等五大检查项目。

1、数据库基本状况检查(1)、数据库实例状况检查说明:其中“STATUS”表示Oracle当前的实例状态,必须为“OPEN”;“DATABASE_STATUS”表示Oracle当前数据库的状态,必须为“ACTIVE”。

(2)、数据库表空间状态检查说明:输出结果中STATUS应该都为“ONLINE”。

(3)、数据库数据文件检查1 select tablespace_name,status from dba_tablespaces;说明:输出结果中“STATUS”应该都为“AVAILABLE”。

(4)、数据库在线日志检查1 select group#,status,type,member from v$logfile;说明:输出结果应该有3条或3条以上记录,“STATUS”应该为非“INVALID”,非“DELETED”。

“STATUS”的值为空表示正常。

(5)、数据库回滚段检查1 select segment_name,status from dba_rollback_segs;说明:输出结果中所有回滚段的“STATUS”应该为“ONLINE”。

2、数据库相关资源使用情况检查(1)、检查Oracle初始化文件中相关参数值1 select resource_name,max_utilization,initial_allocation, limit_value from v$resource_limit;说明:若字段值【LIMIT_VALU】-【MAX_UTILIZATION】<=5,则表明与RESOURCE_NAME相关的Oracle初始化参数需要调整。

Oracle数据库日常检查

Oracle数据库日常检查

Oracle数据库日常检查A.查看所有的实例及其后台进程是否正常确认所有的instance工作正常,登陆到所有的数据库或instance上,检测oracle后台进程$env|grep SIDORACLE_SID=UWNMS3B.检查文件系统的使用情况如果文件系统的剩余空间小于10%,则需要删除不必要的文件以释放空间。

$df-hFilesystem size used avail capacity Mounted on/dev/md/dsk/d020G17G 3.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%/archivelogAIX:$df–g or df–kHP-UX$bdf or df–k or df-h注意:需要特别关注根目录,数据库软件和数据库备份所在目录的剩余空间情况!备注:数据库运行日志的及时清除1).可清除bdump,cdump,udump下的相关日志$cd$ORACLE_BASE/admin/db_name/bdump$ls-ltotal174-rwxrwxrwx1oracle dba59047Jul3022:02alert_UWNMS1.log-rwxrwxrwx1oracle dba1000Jul1422:00uwnms1_j000_18128.trc -rw-r-----1oracle dba1000Jul2222:00uwnms1_j001_5369.trc -rwxrwxrwx1oracle dba695Jul1419:12uwnms1_lgwr_18100.trc -rwxrwxrwx1oracle dba2668Jul3022:02uwnms1_lgwr_19661.trc -rwxrwxrwx1oracle dba983Jul1417:36uwnms1_lgwr_7816.trc -rwxrwxrwx1oracle dba955Jul1419:11uwnms1_lgwr_7883.trc -rwxrwxrwx1oracle dba803Jul1417:31uwnms1_p000_7714.trc -rwxrwxrwx1oracle dba801Jul1417:31uwnms1_p001_7716.trc $cd../cdump$ls-ltotal4drwxr-x---2oracle dba512Jul2514:12core_18095drwxr-x---2oracle dba512Jul2519:17core_25934$cd../udump$ls-ltotal20042-rw-r-----1oracle dba505Jul1616:33uwnms1_ora_14771.trc-rw-r-----1oracle dba4516169Jul2514:12uwnms1_ora_18095.trc -rwxrwxrwx1oracle dba644Jul1419:12uwnms1_ora_18119.trc -rw-r-----1oracle dba505Jul3015:11uwnms1_ora_18820.trc-rwxrwxrwx1oracle dba774Jul1510:23uwnms1_ora_19573.trc -rwxrwxrwx1oracle dba587Jul1510:23uwnms1_ora_19645.trc -rwxrwxrwx1oracle dba644Jul1510:23uwnms1_ora_19680.trc -rw-r-----1oracle dba720942Jul1516:28uwnms1_ora_24759.trc-rw-r-----1oracle dba4951562Jul2519:17uwnms1_ora_25934.trc -rw-r-----1oracle dba505Jul1517:21uwnms1_ora_27326.trc-rw-r-----1oracle dba503Jul3016:54uwnms1_ora_6612.trc-rwxrwxrwx1oracle dba585Jul1417:12uwnms1_ora_7523.trc-rwxrwxrwx1oracle dba767Jul1417:30uwnms1_ora_7566.trc 2).可清除oracle的监听日志$cd$ORACLE_HOME/network/log$ls-ltotal533072-rwxrwxrwx1oracle dba272507851Jul3111:28listener.log-rw-r--r--1oracle dba257876Jul3108:48sqlnet.log$cp/dev/null listener.logC.查找警告日志文件1.联接每一个操作管理系统2.使用‘TELNET’或是可比较程序3.对每一个管理实例,经常的执行$ORACLE_BASE/<SID>/bdump操作,并使其能回退到控制数据库的SID。

oracle日常运维总结

oracle日常运维总结

千里之行,始于足下。

oracle日常运维总结以下是Oracle日常运维总结的一些要点:1. 定期备份数据:重要性不言而喻,确保数据安全。

可以使用Oracle的备份工具或者第三方工具进行备份,定期检查备份的完整性和可用性。

2. 监控数据库性能:使用Oracle的性能监控工具,如AWR报告、ASH报告等,分析数据库性能瓶颈,并及时采取措施进行优化。

3. 维护数据库统计信息:定期收集和更新数据库的统计信息,以便优化查询性能。

可以使用Oracle的DBMS_STATS包来进行统计信息的收集和更新。

4. 定期检查表空间使用情况:监控数据库的表空间使用情况,及时扩展表空间或调整表空间大小,以确保数据库的正常运行。

5. 定期检查数据库日志和告警日志:定期检查数据库的日志文件和告警日志,及时处理数据库异常或错误。

6. 定期进行数据库滚动备份:数据库滚动备份可以保证数据库的连续备份,避免因备份过程中的数据变更造成备份不完整。

7. 定期进行数据库性能调优:定期进行数据库性能调优,如优化SQL语句、调整数据库参数等,以提高数据库的运行效率和性能。

8. 定期进行数据库安全审计:定期审计数据库的安全性,检查数据库的用户权限、网络安全等,并及时修复和加固数据库的安全漏洞。

第1页/共2页锲而不舍,金石可镂。

9. 定期进行数据库版本升级和补丁安装:定期检查Oracle官方网站,了解最新的数据库版本和补丁,并根据需要进行升级和安装,以保证数据库的安全和稳定。

10. 定期进行数据库容量规划:根据业务需求和数据增长情况,定期进行数据库容量规划,以确保数据库能够满足业务的需求并保持良好的性能。

以上是Oracle日常运维总结的一些要点,根据实际情况进行调整和补充。

每日oracle数据库检查表

每日oracle数据库检查表

说明
是否存在 是否存在 是否存在 是否存在 是否存在 是否存在 归档方式
结果
备注
RAC RAC RAC RAC 查看状态 是否需要清理 是否可以连接 是否有错误信息 是否接近上限 查看异常
Listener 状态、服务 Oracle 连接测试 Alert.log 连接数 等待事件 联机日志状态
lsnrctl stat listener.log @tns_string
查看使用情况 wait/idle 是否正常
可选 是否成功执行
每日oracle数据库检查表数据库检查检查内容oracle后台进程检查项orapmonsidorasmonsidoralgwrsidoradbwnsidorackptsidorarecosidoraarcnsidoralmonsidoralmdnsidoralmsnsidoradiagsid说明是否存在是否存在是否存在是否存在是否存在是否存在归档方式结果备注racracracrac查看状态是否需要清理是否可以连接是否有错误信息是否接近上限查看异常listener状态服务oracle连接测试alertlog连接数等待事件联机日志状态lsnrctlstatlistenerlogtnsstringprocesseslatchfreeenqueuevlogvlogfilelogarchive表空间数据文件状态status表空间使用情况无效数据库对象备份有效性invalid日志文件是否可用是否存在是否成功关注空闲比例比较低的表空间主机检查文件系统使用情况cpu内存虚存磁盘iooracle性能定时任务运行情况statspack报告查看使用情况waitidle是否正常可选是否成功执行
processes latch free、enqueue v$log v$logfile log_archive

数据库例行巡检流程

数据库例行巡检流程

数据库例行巡检流程
1.Oracle数据库的例行巡检流程通常包括以下几个步骤:
2.操作系统的CPU空闲率:检查操作系统的CPU空闲率以确保系统资源充足。

3.检查磁盘空间是否不足:确认数据存储设备的可用空间是否足够。

4.检查操作系统错误日志:查看是否有操作系统相关的错误记录。

5.检测数据库是否启动且侦听正常:验证数据库实例和服务器的监听器已经正确启动并正在运行。

6.检查和启动实例(服务器端):确保数据库实例已经被正确配置并且可以开始服务。

7.检测和启动侦听(服务器端):同样地,需要确认数据库的侦听器已经启动并能正常工作。

8.检查状态为非“online”的数据文件:确保所有数据文件都处于在线状态。

9.数据缓冲区命中率:评估数据缓冲区的性能,确保查询响应时间良好。

10.数据字典缓冲区命中率:类似地,检查数据字典缓冲区的性能。

11.LIBRARYCACHE命中率:检查库缓存的性能。

12.检测使用率超过80%的表空间:识别那些可能因为频繁读写
而变得过热的表空间。

13.检查作业是否正常:确认所有的后台处理任务都在正常运行。

14.了解数据库备份情况:最后,确保有适当的数据库备份策略,以便在出现问题时能够快速恢复。

Oracle数据库日常检查文档

Oracle数据库日常检查文档

数据库日常检查文档1.检查表空间使用情况:1.1检查是否开启自扩展功能:select tablespace_name,file_name,file_id,autoextensible,round((increment_by*8191)/(1024*1024),2)||'M'as自扩展大小Mfrom dba_data_files;目的:检查表空间是否开启自扩展功能。

若检查自扩展特别小,请用下面的方法把自扩展根据数据量增长情况调大。

alter database datafile'新增加数据文件路径'autoextendon next*M maxsize unlimited;--把*替换为你需要的自扩展大小1.2检查表空间的使用情况:select a.tablespace_name,a.totals总大小M,b.frees空闲大小M,round((a.totals-b.frees)/a.totals,4)*100||'%'使用率from(select sum(bytes)/(1024*1024)as totals,tablespace_namefrom dba_data_filesgroup by tablespace_name)a,(select sum(bytes)/(1024*1024)as frees,tablespace_namefrom dba_free_spacegroup by tablespace_name)bwhere a.tablespace_name=b.tablespace_name;目的:当表空间没有开启自扩展功能时,表空间的使用率大于等于85%时,需要向表空间增加数据文件。

开启自扩展功能的表空间,检查常用的表空间自扩展的大小不小于100M。

注:检查ulog用户对应的表空间:select default_tablespacefrom dba_userswhere username='ULOG';Ulog用户下的tlog表主要是记录日志的,因为大部分的报表涉及记录日志。

ORACLE数据库日常运维操作手册(带有具体代码2017)

ORACLE数据库日常运维操作手册(带有具体代码2017)

数据库日常运维操作手册目录1.日维护过程1.1 确认所有的INSTANCE状态正常1.2 检查文件系统的使用(剩余空间)1.3 检查日志文件和trace文件记录1.4 检查数据库当日备份的有效性。

1.5 检查数据文件的状态1.6 检查表空间的使用情况1.7 检查剩余表空间1.8 监控数据库性能1.9 检查数据库系统性能1.10 日常出现问题的处理。

2.每周维护过程2.1 监控数据库对象的空间扩展情况2.2 监控数据量的增长情况2.3 系统健康检查2.4 检查无效的数据库对象2.5 检查不起作用的约束2.6 检查无效的trigger3.月维护过程3.1 Analyze Tables/Indexes/Cluster3.2 检查表空间碎片3.3 寻找数据库性能调整的机会3.4 数据库性能调整3.5 提出下一步空间管理计划数据库日常运维操作手册主要针对ORACLE数据库管理员对数据库系统做定期监控:(1). 每天对ORACLE数据库的运行状态日志文件、备份情况、数据库的空间使用情况、系统资源的使用情况进行检查,发现并解决问题。

(2). 每周对数据库对象的空间扩展情况、数据的增长情况进行监控、对数据库做健康检查、对数据库对象的状态做检查。

(3). 每月对表和索引等进行Analyze、检查表空间碎片、寻找数据库性能调整的机会、进行数据库性能调整、提出下一步空间管理计划。

对ORACLE数据库状态进行一次全面检查1.日维护过程1.1 确认所有的INSTANCE状态正常登陆到所有数据库或例程,检测ORACLE后台进程:$ps –ef|grep ora1.2 检查文件系统的使用(剩余空间)如果文件系统的剩余空间小于20%,需删除不用的文件以释放空间。

#df –k1.3 检查日志文件和trace文件记录检查相关的日志文件和trace文件中是否存在错误。

A 连接到每个需管理的系统使用secureCRT远程登陆工具B 对每个数据库,进入到数据库的bdump目录,unix系统中BDUMP目录通常是$ORACLE_BASE/<SID>/bdump#$ORACLE_BASE/<SID>/bdumpC 使用Unix 和linux ‘tail’命令来查看alert_<SID>.log文件#tail $ORACLE_BASE/<SID>/bdump/alert_<SID>.logD 如果发现任何新的ORA-错误,记录并解决1.4 检查数据库当日备份的有效性。

Oracle数据库每日检查工作清单

Oracle数据库每日检查工作清单
监听器状态
磁盘使用状态
表空间使用状态
备份状态
警告日志状态
监控异常状态
Select instance_name,status from v$instance;
Ps –ef | grep ora
lsnrctl status
df –h
Alert Log File Tespace_name as "tablespace name",A.total_size as "total size",round(B.total_free_size,1) as "total free size",round((A.total_size - B.total_free_size),2) as "used size",to_char(100*B.total_free_size/A.total_size,'99.99')||'%' as "percent free" from (select tablespace_name,sum(bytes)/1024/1024 as total_size from dba_data_files group by tablespace_name) A,(select tablespace_name,sum(bytes/1024/1024) as total_free_size from dba_free_space group by tablespace_name) B where A.tablespace_name = B.tablespace_name;
数据库每日检查工作清单数据库名称数据库管理员项目正常不正常异常状态描述数据库状态监听器状态磁盘使用状态表空间使用状态备份状态警告日志状态监控异常状态selectinstancenamestatusfromvinstance

Oracle数据库巡检方案

Oracle数据库巡检方案

Oracle数据库巡检方案
Oracle数据库巡检维护方案
一、巡检维护的目的
为了保障数据库正常运行,保证数据的安全性、完整性和可用性,需进行数据库巡检维护。

二、巡检维护的分类
数据库巡检维护包含的内容很多,如果每天都将这些项目进行一遍,在时间上是不允许的,可能还会影响到数据库使用效率,因此,通常会将这些巡检维护内容分门别类地按不同的时间频率进行。

数据库巡检维护按时间频率可分为日巡检、周巡检、月巡检、半年度巡检四类。

日巡检维护指每日按计划进行的巡检维护活动,以检查数据库运行状态、数据库备份状态和告警错误为主要内容,同时还必须检查使用数据库的应用软件是否因数据库运行原因产生使用错误或不畅。

周巡检维护指按一周为周期,在每周指定日按计划进行的巡检维护活动,它的工作内容是在日巡检维护工作内容的基础上添加数据库对象检查、安全性检查等内容组成。

月巡检维护指按一月为周期,在每月指定日按计划进行的巡检维护活动,它的工作内容是在周巡检维护工作内容的基础上添加系统参数配置检查、硬件与系统平台运行状态检查等内容组成。

半年度巡检维护指按半年为周期,在指定日按计划进行的巡检维护活动,它的工作内容是在月巡检维护工作内容的基础上添加数据库性能诊断检查组成。

如果能够提供模拟环境或生产环境在特定条件下允许停机,还应该进行备份有效性测试。

由于巡检维护工作任务的涵盖性,进行半年度巡检维护日可不执行所在月的月巡检维护、所在周的周巡检维护和日巡检维护,以此类推。

三、巡检维护工作内容和周期。

oracle日常巡检内容

oracle日常巡检内容

Oracle日常巡检内容1. 概述Oracle数据库是一款功能强大的关系型数据库管理系统,用于存储和管理大量的数据。

为了保证Oracle数据库的正常运行,必须进行日常巡检工作,及时发现并解决潜在的问题,确保数据库的稳定性和性能。

本文将介绍Oracle日常巡检的内容,包括数据库基本信息、存储空间、性能优化、安全性、备份与恢复等方面。

2. 数据库基本信息在进行日常巡检时,首先需要了解数据库的基本信息,以便更好地管理和维护数据库。

以下是需要关注的内容:•数据库名称、版本和补丁级别•数据库的物理和逻辑结构•数据库的字符集和语言设置•数据库的运行状态和连接数•数据库的启动参数和配置文件3. 存储空间数据库的存储空间是关键的资源,需要定期检查和管理。

以下是存储空间的巡检内容:•数据文件和表空间的大小和增长趋势•磁盘空间的使用情况和剩余容量•数据文件的布局和分布情况•表空间的使用率和碎片情况•确保数据文件和表空间的备份和恢复策略4. 性能优化数据库的性能是用户体验的重要因素,需要进行定期的性能优化工作。

以下是性能优化的巡检内容:•数据库的响应时间和吞吐量•SQL语句的执行计划和性能指标•索引的使用情况和效率•内存和缓冲区的配置和利用率•确保数据库的统计信息是最新的5. 安全性数据库的安全性是非常重要的,需要进行巡检和加固。

以下是安全性的巡检内容:•用户和角色的权限和访问控制•数据库的审计和日志记录设置•数据库的加密和身份验证策略•数据库的防火墙和网络安全设置•确保数据库的补丁和安全更新是最新的6. 备份与恢复数据库的备份和恢复是数据库管理的核心任务之一,需要定期进行巡检和测试。

以下是备份与恢复的巡检内容:•数据库备份的策略和计划•数据库备份的完整性和可用性•数据库恢复的速度和可靠性•确保备份文件的存储和保护措施•确保备份和恢复的文档和操作步骤是最新的7. 总结Oracle数据库的日常巡检是保证数据库稳定性和性能的重要工作。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Oracle数据库日常检查A. 查看所有的实例及其后台进程是否正常确认所有的instance工作正常,登陆到所有的数据库或instance上,检测oracle后台进程$env | grep SIDORACLE_SID=UWNMS3B.检查文件系统的使用情况如果文件系统的剩余空间小于10%,则需要删除不必要的文件以释放空间。

$df -hsize used avail capacity Mounted on/dev/md/dsk/d0 20G 17G 3.1G 85% //proc 0K 0K 0K 0% /procmnttab 0K 0K 0K 0% /etc/mnttabfd 0K 0K 0K 0% /dev/fdswap 85G 192K 85G 1% /var/rundmpfs 85G 0K 85G 0% /dev/vx/dmpdmpfs 85G 0K 85G 0% /dev/vx/rdmpswap 85G 213M 85G 1% /tmp/dev/vx/dsk/data10dg/Ora_394G 292G 98G 75% /data05/dev/vx/dsk/data1dg/vola0131443G 156G 283G 36% /archivelogAIX:$df –g or df –kHP-UX$bdf or df –k or df -h注意:需要特别关注根目录,数据库软件和数据库备份所在目录的剩余空间情况!备注:数据库运行日志的及时清除1). 可清除bdump,cdump,udump下的相关日志$ cd $ORACLE_BASE/admin/db_name/bdump$ ls -ltotal 174-rwxrwxrwx 1 oracle dba 59047 Jul 30 22:02 alert_UWNMS1.log-rwxrwxrwx 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.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 -ltotal 4drwxr-x--- 2 oracle dba 512 Jul 25 14:12 core_18095drwxr-x--- 2 oracle dba 512 Jul 25 19:17 core_25934$ cd ../udump$ ls -ltotal 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 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-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 -ltotal 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.logC.查找警告日志文件1. 联接每一个操作管理系统2. 使用‘TELNET’或是可比较程序3. 对每一个管理实例,经常的执行$ORACLE_BASE/<SID>/bdump 操作,并使其能回退到控制数据库的SID。

4. 在提示下,使用UNIX 中的‘TAIL’命令查看alert_<SID>.log,或是用其他方式检查文件中最近时期的警告日志5. 如果发现任何ORA_ERRORS (ORA-XXX) 的错误,将它记录并且仔细的研究它们,或反馈给DB组如何确定警告日志文件的路径?通过参看起始参数文件init<SID>.ora,而起始参数文件一般存储在$ORACLE_HOME/dbs下D.检查数据库备份是否成功※对RMAN备份方式:检查第三方备份工具的备份日志以确定备份是否成功如果具备恢复目录的,可直接登陆到rman环境下,发命令list backup查看具体备份集合的情况;$rman target / nocatalogRecovery 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 databaseRMAN> list backup;List of Backup Sets===================BS Key Type LV Size Device Type 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 T ag: BK0Piece Name: /export/home/oracle/rman3/bk0_UWNMS3_20080728_2393 List of Datafiles in backup set 422624File LV Type Ckp SCN Ckp Time Name---- -- ---- ---------- ------------------- ----2 0 Incr 35321096 2008-07-28 03:15:14 /archivelog/oradata/UWNMS3/undo01.dbf5 0 Incr 35321096 2008-07-28 03:15:14 /archivelog/oradata/UWNMS3/system2.dbf※对EXPORT,EXPDP逻辑备份方式:检查exp,expdp日志文件以确定备份是否成功※对其他备份方式:检查相应的日志文件E.检查表空间的使用情况1. 检查在表空间中有没有剩余空间。

对每一个实例来说,检查在表空间中是否存在有剩余空间来满足当天的预期的需要。

当数据库中已有的数据是稳定的,数据日增长的平均数也是可以计算出来,最小的剩余空间至少要能满足每天数据的增长。

脚本: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_name, sum(bytes)/1024/1024 free from dba_free_space group by tablespace_name) fwhere 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 where status not in ('VALID','N/A')SELECT index_name,PARTITION_NAME,TABLESPACE_NAME FROM USER_IND_PARTITIONSWHERE status = 'UNUSABLE' ORDER BY PARTITION_NAME;*/-- 发现失效索引提出建议,如:alter index NPMDB.UQ_TPA_SAE_SUM rebuild tablespace idxdbs online nologging parallel 4 ; alter index NPMDB.UQ_TPA_SAE_SUM noparallel;3. 表空间管理-- 检查表空间数据文件状态SQL>select from dba_data_files where status=’AVAILABLE’;注:如果查询出记录,说明有数据文件不正常,必须及时提出建议.-- 查看数据文件自动扩展属性SQL>select from dba_data_files where AUTOEXTENSIBLE=’YES’;注:查出记录后,并且数据文件在”/dev/”目录下,说明是裸设备,则建议ALTER DATABASE DATAFILE '/dev/vx/rdsk/data2dg/volb0082' AUTOEXTEND OFF; F.查看数据库版本及组件数据库RDBMS版本:SQL>select * from v$version;查看数据库组件版本:SQL>col comp_name format a35;SQL>col status format a15;SQL>col version format a15;SQL>select comp_name,status,version from dba_registry;G.查看crs状态如果是10g RAC数据库运行以下命令查看CRS相关信息:1 查询并检查OCR设备ocrcheck2 查询并检查Voting Disk设备crsctl query css votedisk3 查询并检查网络接口oifcfg –getif –global4 检查ocr备份情况查找备份存放目录ocrconfig –showbackupcd 到上面的目录,检查文件应列出下面文件3份每四小时备份2份每天备份2份每周备份5 检查各个数据库节点系统时间,如果存在差距大于15分钟,建议修改。

相关文档
最新文档