Oracle配置数据库诊断
环境:RHEL 6.4 + Oracle 11.2.0.4
1. 设置ADR
2. 使用Support Workbench
3. 恢复块介质
Reference
1. 设置ADR
## 1.1 查看v$diag_info ##
查看v$diag_info
诊断库相关信息:
col value for a70
col name for a35
set linesize 140
select * from v$diag_info;
SQL> select * from v$diag_info;
INST_ID NAME VALUE
---------- ----------------------------------- ----------------------------------------------------------------------
1 Diag Enabled TRUE
1 ADR Base /opt/app/oracle11
1 ADR Home /opt/app/oracle11/diag/rdbms/vas/vas
1 Diag Trace /opt/app/oracle11/diag/rdbms/vas/vas/trace
1 Diag Alert /opt/app/oracle11/diag/rdbms/vas/vas/alert
1 Diag Incident /opt/app/oracle11/diag/rdbms/vas/vas/incident
1 Diag Cdump /opt/app/oracle11/diag/rdbms/vas/vas/cdump
1 Health Monitor /opt/app/oracle11/diag/rdbms/vas/vas/hm
1 Default Trace File /opt/app/oracle11/diag/rdbms/vas/vas/trace/vas_ora_10952.trc
1 Active Problem Count 2
1 Active Incident Count 17
11 rows selected.
1.2 ADRCI工具
ADR完全基于文件系统,可以使用ADRCI查询ADR的内容,还可以将事件和问题信息打包在可以发送给Oracle Support部门的ZIP压缩文件中。
$ adrci
ADRCI: Release 11.2.0.4.0 - Production on Thu Dec 31 10:57:51 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
ADR base = "/oradata/app/oracle"
adrci> help
HELP [topic]
Available Topics:
CREATE REPORT
ECHO
EXIT
HELP
HOST
IPS
PURGE
RUN
SET BASE
SET BROWSER
SET CONTROL
SET ECHO
SET EDITOR
SET HOMES | HOME | HOMEPATH
SET TERMOUT
SHOW ALERT
SHOW BASE
SHOW CONTROL
SHOW HM_RUN
SHOW HOMES | HOME | HOMEPATH
SHOW INCDIR
SHOW INCIDENT
SHOW PROBLEM
SHOW REPORT
SHOW TRACEFILE
SPOOL
There are other commands intended to be used directly by Oracle, type
"HELP EXTENDED" to see the list
adrci>
2. 使用Support Workbench
## 2.1 手工构造一则ORA-00600错误 ##
```
SQL> alter user jingyu identified by values '';
alter user jingyu identified by values ''
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [kzsviver:1], [], [], [], [], [],
[], [], [], [], [], []
```
可以在EM中,打包问题 -> 快速打包 -> 创建新程序包 -> 查看内容 -> 查看清单 -> 调度
已成功生成程序包 ORA600kzs_20151231145006 的上载文件。
该上载文件位于 [/oradata/app/oracle/product/11.2.0/dbhome_1/ChinaUnicomDB_shitan/sysman/emd/state/ORA600kzs_20151231145006_COM_1.zip]。
请将其手动发送到 Oracle。
我们来看下这个压缩文件打包了哪些文件:
```
$ unzip ORA600kzs_20151231145006_COM_1.zip
Archive: ORA600kzs_20151231145006_COM_1.zip
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/IPS_CONFIGURATION.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/IPS_PACKAGE.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/IPS_PACKAGE_INCIDENT.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/IPS_PACKAGE_FILE.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/IPS_PACKAGE_HISTORY.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/IPS_FILE_METADATA.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/IPS_FILE_COPY_LOG.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/DDE_USER_ACTION_DEF.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/DDE_USER_ACTION_PARAMETER_DEF.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/DDE_USER_ACTION.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/DDE_USER_ACTION_PARAMETER.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/DDE_USER_INCIDENT_TYPE.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/DDE_USER_INCIDENT_ACTION_MAP.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/INCIDENT.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/INCCKEY.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/INCIDENT_FILE.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/PROBLEM.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/HM_RUN.dmp
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/export/EM_USER_ACTIVITY.dmp
inflating: diag/rdbms/shitan/shitan/incident/incdir_5097/shitan_ora_27456_i5097.trm
inflating: diag/rdbms/shitan/shitan/incident/incdir_5097/shitan_ora_27456_i5097.trc
inflating: diag/rdbms/shitan/shitan/trace/shitan_ora_27456.trc
inflating: diag/rdbms/shitan/shitan/trace/shitan_ora_27456.trm
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/manifest_1_1.xml
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/manifest_1_1.html
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/manifest_1_1.txt
inflating: diag/rdbms/shitan/shitan/alert/log.xml
inflating: diag/rdbms/shitan/shitan/trace/alert_shitan.log
inflating: diag/rdbms/shitan/shitan/trace/shitan_mmon_18549.trc
inflating: diag/rdbms/shitan/shitan/trace/shitan_mmon_18549.trm
inflating: diag/rdbms/shitan/shitan/trace/shitan_ora_18600.trc
inflating: diag/rdbms/shitan/shitan/trace/shitan_ora_18600.trm
inflating: diag/rdbms/shitan/shitan/trace/shitan_lgwr_18541.trc
inflating: diag/rdbms/shitan/shitan/trace/shitan_lgwr_18541.trm
inflating: diag/rdbms/shitan/shitan/trace/shitan_diag_18531.trc
inflating: diag/rdbms/shitan/shitan/trace/shitan_diag_18531.trm
inflating: diag/rdbms/shitan/shitan/trace/shitan_dbrm_18533.trc
inflating: diag/rdbms/shitan/shitan/trace/shitan_dbrm_18533.trm
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/config.xml
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/crs/crsdiag.log
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/opatch/opatch.log
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/opatch/opatch.xml
inflating: diag/rdbms/shitan/shitan/incpkg/pkg_1/seq_1/metadata.xml
inflating: metadata.xml
```
## 2.2 使用HM(Health Monitor) ##
```
col name for a50
select id, name, offline_capable from v$hm_check order by id;
```
3. 恢复块介质
在RMAN备份命令,ANALYZE命令,dbv操作系统命令以及尝试访问受损块的SQL查询,都会找到坏块后填充v$database_block_corruption视图。
SQL> select * from v$database_block_corruption;
如果Oracle检测到受损块,它将在EM主页和警报日志中注册ORA-01578错误.错误消息包含坏块的绝对文件编号和块编号。例如:
ORA-01578: ORACLE data block corrupted (file # 5, block # 403)
ORA-01110: data file 5: '/oradata/data/SHITAN/datafile/o1_mf_dbs_d_ji_c7q2vg1x_.dbf'
通常,引起损坏的原因是操作系统或磁盘硬件故障,如存在故障的I/O硬件或固件、操作系统缓存问题、内存或分页问题或磁盘修复实用程序引发的错误。
-- 恢复5号数据文件的第403个块
RMAN> recover datafile 5 block 403;
-- 恢复v$database_block_corruption视图中记录的所有坏块
RMAN> recover corruption list;
DRA使用相关可参考:
Reference
- OCP 认证考试指南 (1Z0-053)[M]. 清华大学出版社, 2010.
Oracle配置数据库诊断的更多相关文章
- oracle配置数据库可恢复性(认证系列总结一)
原创作品,转载请注明出处:https://www.cnblogs.com/sunshine5683/p/10263246.html 接下来的n多天,将进入oracle认证系列的学习总结中,本该从asm ...
- 新建Oracle数据库时,提示使用database control配置数据库时,要求在当前oracle主目录中配置监听程序
新建一个oracle数据库时,当提示使用database control配置数据库时,要求在当前oracle主目录中配置监听程序等字样的时候,问题是那个监听的服务没有启动,解决方法如下: 打开cmd命 ...
- oracle slient静默安装并配置数据库及仅安装数据库不配置数据库shell
<1,>仅安装数据库软件不配置数据库 ./x86oracle.sh /ruiy/ocr/DBSoftware/app/oracle /ruiy/ocr/DBSoftware/app/ora ...
- ORACLE 配置连接远程数据库
ORACLE配置tnsnames.ora文件实例 客户机为了和服务器连接,必须先和服务器上的监听进程联络.ORACLE通过tnsnames.ora文件中的连接描述符来说明连接信息.一般tnsnames ...
- 在oracle配置mysql数据库的dblink
本文介绍如何在oracle配置mysql数据库的dblink:虽然dblink使用很占资源:俗称“性能杀手”.但有些场景不得不使用它.例如公司使用数据库是oracle:可能其他部门或者CP合作公司使用 ...
- sqldbx配置连接Oracle 12C数据库
本地开发环境: Windows10 64位.Oracle 12C客户端 32位.sqlDBX (32位) =============================================== ...
- Oracle ADDM性能诊断利器及报告解读
性能优化是一个永恒的话题,性能优化也是最具有价值,最值得花费精力深入研究的一个课题,因为资源是有限的,时间是有限的.在Oracle数据库中,随着Oracle功能的不断强大和完善,Oralce数据库在性 ...
- Oracle创建数据库
Oracle创建数据库有三种方式:一.使用DBCA(Database Configuration Assistant 数据库配置助手):二.使用 create database指令:三.在安装数据库软 ...
- ORACLE配置tnsnames.ora文件实例
ORACLE配置tnsnames.ora文件实例客户机为了和服务器连接,必须先和服务器上的监听进程联络.ORACLE通过tnsnames.ora文件中的连接描述符来说明连接信息.一般tnsnames. ...
随机推荐
- spark 大数据 LR测试
#!/bin/bash size="120Y*10W"date1=`date +%F_%H-%M-%S`config="spark-submit \ --jars /da ...
- *HDU 1398 母函数
Square Coins Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tota ...
- JS中常遇到的浏览器兼容问题和解决方法
今天整理了一下浏览器对JS的兼容问题,希望能给你们带来帮助,我没想到的地方请留言给我,我再加上: 常遇到的关于浏览器的宽高问题: //以下均可console.log()实验 var winW=docu ...
- PHP之几道面试题
1.二分查找算法 function two_find($arr,$low,$height,$k){ if($low<=$height){ $mid = intval(($low+$height) ...
- HOJ 1797 Red and Black
传送门 http://acm.hit.edu.cn/hoj/problem/view?id=1797 总体的思路是遍历可以到达的' . ',将其对应的vis数组化为1,然后统计所有为1的vis项; ...
- Unity3D UGUI之ScrollView弹簧效果
unity3d版本5.3.2p4 UGUI中ScrollView包含Viewport(Content) ScrollView包含脚本.其Movement Type一共3个选项.Elastic就是弹簧效 ...
- WPF整理-Mutex确保Application单例运行
有时我们不希望我们的WPF应用程序可以同时运行有多个实例,当我们试图运行第二个实例的时候,已经运行的实例也应该弹出来. 我们可以用Mutex来实现 打开App.xaml.cs,在App类中添加如下内容 ...
- 华为oj 字符串最后一个单词的长度
<img alt="http://img.bbs.csdn.net/upload/201508/06/1438867109_670158.jpg" src="htt ...
- FASTJSON
package com.hanqi.test; import java.util.ArrayList;import java.util.Date;import java.util.List; impo ...
- WebDriver API元素的定位
一.以下截图为用FireBug定位的用火狐(Firefox)浏览器打开的百度首页,下面所讲述的八种定位方法,就是以该截图中的百度输入框为例子. ①.FireBug是Firefox浏览器下的开发类插件, ...