- 浏览: 981483 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
孤星119:
好熟悉的数据库字段啊, 上家公司做的项目每天都跟这些字段打招呼 ...
Oracle exp compress参数引起的空间浪费 -
itspace:
quxiaoyong 写道遇到个问题,网上一搜,全他妈这篇文章 ...
数据库连接错误ORA-28547 -
quxiaoyong:
遇到个问题,网上一搜,全他妈这篇文章。你转来转去的有意思吗?
数据库连接错误ORA-28547 -
hctech:
关于version count过高的问题,不知博主是否看过ey ...
某客户数据库性能诊断报告 -
itspace:
invalid 写道写的不错,我根据这个来安装,有点理解错误了 ...
AIX 配置vncserver
数据库坏块校验我们通常使用dbv进行校验,Oracle对其解释为
其限制为(据matalink doc 35512.1描述)
其使用方法如下
[ora11g@mchz ~]$ dbv file=/opt/ora11g/oradata/db11g/sysaux01.dbf
DBVERIFY: Release 11.1.0.6.0 - Production on Sat Nov 20 14:19:21 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
DBVERIFY - Verification starting : FILE = /opt/ora11g/oradata/db11g/sysaux01.dbf
DBVERIFY - Verification complete
Total Pages Examined : 124920
Total Pages Processed (Data) : 30843
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 32868
Total Pages Failing (Index): 0
Total Pages Processed (Lob) : 2864
Total Pages Failing (Lob) : 0
Total Pages Processed (Other): 27857
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 30488
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Total Pages Encrypted : 0
Highest block SCN : 32211870 (0.32211870)
但我们也可以使用rman进性坏块校验,提供的信息相对于dbv更加直观,若有坏块,校验结果将存在v$database_block_corruption中。如果数据库处于归档模式,且有有效全备份,即可以通过block recover corruption list进行恢复。需要提醒的是rman校验数据库非归档模式也支持。
引用
DBVERIFY is an external command-line utility that performs a physical data structure integrity check. It can be used on offline or online databases, as well on backup files.
DBVERIFY checks are limited to cache-managed blocks (that is, data blocks). Because DBVERIFY is only for use with datafiles, it will not work against control files or redo logs.
DBVERIFY checks are limited to cache-managed blocks (that is, data blocks). Because DBVERIFY is only for use with datafiles, it will not work against control files or redo logs.
其限制为(据matalink doc 35512.1描述)
引用
Limitations and Special Notes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- As DBV performs checks at a block level it cannot detect problems
such as INDEX versus TABLE mismatches which can be detected by the
'ANALYZE TABLE .. VALIDATE STRUCTURE CASCADE' command.
- This utility can ONLY be used against DATA files.
It CANNOT be used to verify redo log files or control files.
- You can use DBV to verify an Automatic Storage Management (ASM) file.
However, the database must be opened and the option USERID has to be used
Example : dbv file=+DG1/ORCL/datafile/system01.dbf userid=system/sys
DBV checks the userid/password for ASM managed files, which is not possible when database is not open.
- On most releases on Unix DBV expects a filename extension.
This means that DBV cannot be used against datafiles with no
filename suffix, or against RAW devices.
The workaround is to create a symbolic link to the raw device where
the link name MUST have an extension.
Eg: ln -s /dev/rdsk/mydevice /tmp/mydevice.dbf
Now use DBV against /tmp/mydevice.dbf
- For RAW devices you should use the END parameter to avoid running
off the end of the Oracle file space.
eg: "dbv FILE=/dev/rdsk/r1.dbf END=<last_block_number>"
If you get the END value too high DBV can report the last page/s of the
file as corrupt as these are beyond the end of the Oracle portion of
the raw device.
You can find value for END from the V$DATAFILE view by dividing the
BYTES value by the database block size.
Eg: To find out the END value to use for file#=5:
SVRMGRL> show parameter db_block_size
NAME TYPE VALUE
----------------------------------- ------- ------
db_block_size integer 2048
SVRMGRL> select BYTES/2048 from v$datafile where FILE#=5;
BYTES/2048
----------
5120
So the command would be:
dbv file=/dev/rdsk/r1.dbf blocksize=2048 END=5120
- DBV may not be able to scan datafiles larger than 2Gb and
may report "DBV-100". This is reported in Bug:710888 for Unix and
Bug:1372172 for 8.1.6 on NT. This problem is platform and release
specific so if you get DBV-100 errors check the filesize first.
- DBV from 8.1.6 onwards may report spurious errors for rollback segment
blocks if the database has been migrated from Oracle7. See Bug:1359160
and Note:118008.1.
- DBV only checks a block in isolation - it does not know if the block
is part of an existing object or not.
- DBV is broken on SCO Unix - see Bug:814249
- DBV of a lower version should not be used against a higher DB version.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- As DBV performs checks at a block level it cannot detect problems
such as INDEX versus TABLE mismatches which can be detected by the
'ANALYZE TABLE .. VALIDATE STRUCTURE CASCADE' command.
- This utility can ONLY be used against DATA files.
It CANNOT be used to verify redo log files or control files.
- You can use DBV to verify an Automatic Storage Management (ASM) file.
However, the database must be opened and the option USERID has to be used
Example : dbv file=+DG1/ORCL/datafile/system01.dbf userid=system/sys
DBV checks the userid/password for ASM managed files, which is not possible when database is not open.
- On most releases on Unix DBV expects a filename extension.
This means that DBV cannot be used against datafiles with no
filename suffix, or against RAW devices.
The workaround is to create a symbolic link to the raw device where
the link name MUST have an extension.
Eg: ln -s /dev/rdsk/mydevice /tmp/mydevice.dbf
Now use DBV against /tmp/mydevice.dbf
- For RAW devices you should use the END parameter to avoid running
off the end of the Oracle file space.
eg: "dbv FILE=/dev/rdsk/r1.dbf END=<last_block_number>"
If you get the END value too high DBV can report the last page/s of the
file as corrupt as these are beyond the end of the Oracle portion of
the raw device.
You can find value for END from the V$DATAFILE view by dividing the
BYTES value by the database block size.
Eg: To find out the END value to use for file#=5:
SVRMGRL> show parameter db_block_size
NAME TYPE VALUE
----------------------------------- ------- ------
db_block_size integer 2048
SVRMGRL> select BYTES/2048 from v$datafile where FILE#=5;
BYTES/2048
----------
5120
So the command would be:
dbv file=/dev/rdsk/r1.dbf blocksize=2048 END=5120
- DBV may not be able to scan datafiles larger than 2Gb and
may report "DBV-100". This is reported in Bug:710888 for Unix and
Bug:1372172 for 8.1.6 on NT. This problem is platform and release
specific so if you get DBV-100 errors check the filesize first.
- DBV from 8.1.6 onwards may report spurious errors for rollback segment
blocks if the database has been migrated from Oracle7. See Bug:1359160
and Note:118008.1.
- DBV only checks a block in isolation - it does not know if the block
is part of an existing object or not.
- DBV is broken on SCO Unix - see Bug:814249
- DBV of a lower version should not be used against a higher DB version.
其使用方法如下
引用
[ora11g@mchz ~]$ dbv
DBVERIFY: Release 11.1.0.6.0 - Production on Sat Nov 20 14:18:38 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Keyword Description (Default)
----------------------------------------------------
FILE File to Verify (NONE)
START Start Block (First Block of File)
END End Block (Last Block of File)
BLOCKSIZE Logical Block Size (8192)
LOGFILE Output Log (NONE)
FEEDBACK Display Progress (0)
PARFILE Parameter File (NONE)
USERID Username/Password (NONE)
SEGMENT_ID Segment ID (tsn.relfile.block) (NONE)
HIGH_SCN Highest Block SCN To Verify (NONE)
(scn_wrap.scn_base OR scn)
DBVERIFY: Release 11.1.0.6.0 - Production on Sat Nov 20 14:18:38 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Keyword Description (Default)
----------------------------------------------------
FILE File to Verify (NONE)
START Start Block (First Block of File)
END End Block (Last Block of File)
BLOCKSIZE Logical Block Size (8192)
LOGFILE Output Log (NONE)
FEEDBACK Display Progress (0)
PARFILE Parameter File (NONE)
USERID Username/Password (NONE)
SEGMENT_ID Segment ID (tsn.relfile.block) (NONE)
HIGH_SCN Highest Block SCN To Verify (NONE)
(scn_wrap.scn_base OR scn)
引用
[ora11g@mchz ~]$ dbv file=/opt/ora11g/oradata/db11g/sysaux01.dbf
DBVERIFY: Release 11.1.0.6.0 - Production on Sat Nov 20 14:19:21 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
DBVERIFY - Verification starting : FILE = /opt/ora11g/oradata/db11g/sysaux01.dbf
DBVERIFY - Verification complete
Total Pages Examined : 124920
Total Pages Processed (Data) : 30843
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 32868
Total Pages Failing (Index): 0
Total Pages Processed (Lob) : 2864
Total Pages Failing (Lob) : 0
Total Pages Processed (Other): 27857
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 30488
Total Pages Marked Corrupt : 0
Total Pages Influx : 0
Total Pages Encrypted : 0
Highest block SCN : 32211870 (0.32211870)
但我们也可以使用rman进性坏块校验,提供的信息相对于dbv更加直观,若有坏块,校验结果将存在v$database_block_corruption中。如果数据库处于归档模式,且有有效全备份,即可以通过block recover corruption list进行恢复。需要提醒的是rman校验数据库非归档模式也支持。
引用
RMAN> backup validate database;
Starting backup at 20-NOV-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/opt/ora11g/oradata/db11g/sysaux01.dbf
input datafile file number=00001 name=/opt/ora11g/oradata/db11g/system01.dbf
input datafile file number=00003 name=/opt/ora11g/oradata/db11g/undotbs01.dbf
input datafile file number=00004 name=/opt/ora11g/oradata/db11g/users01.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
1 OK 0 12503 90880 32211897
File Name: /opt/ora11g/oradata/db11g/system01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 64333
Index 0 11434
Other 0 2610
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
2 OK 0 30488 124920 32211870
File Name: /opt/ora11g/oradata/db11g/sysaux01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 30843
Index 0 32868
Other 0 30721
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
3 OK 0 1 32000 32211897
File Name: /opt/ora11g/oradata/db11g/undotbs01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 0
Index 0 0
Other 0 31999
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
4 OK 0 557 640 31714940
File Name: /opt/ora11g/oradata/db11g/users01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 30
Index 0 3
Other 0 50
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
List of Control File and SPFILE
===============================
File Type Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
SPFILE OK 0 2
Control File OK 0 594
Finished backup at 20-NOV-10
Starting backup at 20-NOV-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/opt/ora11g/oradata/db11g/sysaux01.dbf
input datafile file number=00001 name=/opt/ora11g/oradata/db11g/system01.dbf
input datafile file number=00003 name=/opt/ora11g/oradata/db11g/undotbs01.dbf
input datafile file number=00004 name=/opt/ora11g/oradata/db11g/users01.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
1 OK 0 12503 90880 32211897
File Name: /opt/ora11g/oradata/db11g/system01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 64333
Index 0 11434
Other 0 2610
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
2 OK 0 30488 124920 32211870
File Name: /opt/ora11g/oradata/db11g/sysaux01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 30843
Index 0 32868
Other 0 30721
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
3 OK 0 1 32000 32211897
File Name: /opt/ora11g/oradata/db11g/undotbs01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 0
Index 0 0
Other 0 31999
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
4 OK 0 557 640 31714940
File Name: /opt/ora11g/oradata/db11g/users01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 30
Index 0 3
Other 0 50
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
List of Control File and SPFILE
===============================
File Type Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
SPFILE OK 0 2
Control File OK 0 594
Finished backup at 20-NOV-10
发表评论
-
buffer cache 的内部结构
2020-03-18 14:21 584BUFFER CACHE作为数据块的 ... -
Oracle OMC介绍
2020-03-18 13:19 495Oracle管理云服务(OMC)的大数据平台,自动收集的企业 ... -
参加Oracle勒索病毒防范专题培训会议
2019-09-27 17:15 5312019年7月22日,受邀参加Oracle勒索病毒防范专题培训 ... -
记一次内存换IO的Oracle优化
2019-09-27 16:50 835某客户数据库从P595物理 ... -
如何定位Oracle SQL执行计划变化的原因
2019-07-03 14:49 1471性能优化最难的是能够 ... -
如何定位Oracle SQL执行计划变化的原因
2018-10-30 09:24 1185性能优化最难的是能够 ... -
数据库性能优化目标
2018-10-08 10:59 528从数据库性能优化的场 ... -
数据库无法打开的原因及解决办法
2018-10-05 20:45 2145数据库的启动是一个相当复杂的过程。比如,Oracle在启动之前 ... -
怎么样彻底删除数据库?
2018-09-18 11:10 608Oracle提供了drop database命令用来删除数据库 ... -
Oracle减少日志量的方法
2018-09-10 10:17 871LGWR进程将LOG BUFFER中的 ... -
如何快速关闭数据库
2018-09-09 13:14 1240“一朝被蛇咬,十年怕井绳”。在没被“蛇”咬之前,很多DBA喜欢 ... -
关于《如何落地智能化运维》PPT
2018-05-17 10:19 1137在DTCC 2018发表《如何落地智能化运维》演讲,主要内容如 ... -
记录在redhat5.8平台安装oracle11.2容易忽视的几个问题
2018-05-11 19:58 587问题一:ping不通问题 在虚拟机上安装好linux系统后, ... -
《Oracle DBA实战攻略》第一章
2018-05-11 10:42 952即日起,不定期更新《OracleDBA实战攻略》一书电子版,请 ... -
Oracle 12c新特性
2018-05-11 10:33 907查询所有pdb [oracle@gj4 ~]$ sqlplu ... -
关于修改memory_target的值后数据库无法启动的问题
2017-02-28 12:24 3990操作系统:RHEL6.5 数据库版本:11.2.0.4 ... -
10g rac安装error while loading shared libraries libpthread.so.0 问题
2017-02-28 12:22 70211g rac安装在二节点跑脚本一般会报此错误: 解决这个问 ... -
记一次Oracle会话共享模式故障处理过程
2017-02-27 19:16 805故障简述 XXX第八人民医院HIS数据库7月13日11点左右从 ... -
RESMGR:cpu quantum等待事件处理过程
2017-02-27 18:23 2654由于数据库上线过程中出现大量的RESMGR:cpu quant ... -
谈谈log file sync
2014-03-19 14:18 1776数据库中的log file sync等待事件指的是,当user ...
相关推荐
Oracle RMAN,全称为Recovery Manager,是Oracle数据库系统中用于数据备份与恢复的重要工具。...通过以上内容的学习,读者可以深入理解Oracle RMAN的功能和使用方法,从而更好地保护和恢复Oracle数据库。
2. **备份数据库**:在执行`backup database`命令时,RMAN主进程会进一步分析所获取的信息,并根据备份命令与`recover.bsq`库文件中的PL/SQL块进行匹配,从而调用`sys.dbms_backup_restore`数据包来创建系统调用以...
- 步骤2:在异机上利用RMAN对这些备份进行恢复,使10g的数据库在异机上运行。 - 步骤3:升级已经恢复的10g数据库到11g。 4. 迁移前的准备工作: - 确认升级路线图:Oracle **.*.*.*不能直接升级到11g R2,必须先...
在本文中,我们将深入探讨RMAN的一些常用命令,帮助你更好地理解和使用RMAN进行数据库管理。 首先,连接到目标数据库是RMAN操作的基础。你可以通过以下命令不使用恢复目录数据库直接连接到目标数据库: ```sql ...
3. **使用RMAN**:Oracle的 Recovery Manager (RMAN) 提供了更高级的坏块检测和修复功能,如`LIST DAMAGED BLOCKS`和`REPAIR FAILURE`命令。 4. **ALTER DATABASE RECOVER MANAGED STANDBY DATABASE**:如果运行在...
RMAN(Recovery Manager)是Oracle数据库提供的一个用于数据库备份、恢复以及迁移的工具。它能够备份和恢复Oracle数据库中的数据文件、控制文件、参数文件和归档日志文件等关键组件。RMAN可以与目标数据库进行通信,...
- rman_restore_and_recover_to_target_oracle.sh:利用RMAN进行数据库的恢复操作。 整个RMAN恢复实验的过程,可以通过阅读README_CN.TXT和README_EN.TXT文件来了解。 此外,文件中还提到了一个重要的操作,即从源...
2. **块恢复**:对于逻辑损坏或部分物理损坏的块,可以尝试使用RMAN的BLOCKRECOVER命令进行恢复。 3. **数据备份**:定期备份数据是非常重要的预防措施,以便在发生损坏时能够迅速恢复数据。 4. **故障转移机制**:...
- 使用RMAN进行备份和恢复操作。 - 检查错误日志,定位问题原因。 - 执行介质恢复,重建损坏的文件。 #### 41. 增量备份 - 只备份自上次备份以来发生变化的数据块,节省存储空间和备份时间。 #### 42. 脱机备份与...
在进行RMAN备份时,正确配置环境变量是必要的,如在脚本中使用`source ~/.bash_profile`来加载环境设置。 总而言之,文档中的内容强调了RMAN备份技术的灵活性和强大功能,包括备份控制文件、数据库、归档日志的压缩...
RMAN操作是Oracle 11g版本中官方推荐的备份恢复方式,它不仅能够处理数据文件、控制文件、归档日志的备份,还可以进行增量备份,以及执行闪回数据库等操作。 在Oracle 11g版本中,RMAN的备份恢复主要分为两个方面:...
4. 热备份:结合RMAN进行ASM的热备份,确保数据安全。 六、ASM与数据库整合 1. 创建数据库:在ASM上创建数据库,利用ASM的存储优势。 2. 数据迁移:将现有数据库迁移到ASM,利用ASM的灵活性和性能提升。 3. 备份...
Oracle数据库是全球广泛使用的大型企业级数据库管理系统,其稳定性和安全性是其核心优势之一。为了确保数据的安全,定期备份数据库是非常必要的。"Oracle自动备份bat" 提供了一种通过批处理脚本来自动化这个过程的...
3. **备份与恢复**:使用RMAN(恢复管理器)或SQL*Plus进行数据库备份,以防止数据丢失,恢复时遵循特定步骤和策略。 四、Oracle查询工具 1. **SQL*Plus**:Oracle自带的命令行工具,可执行SQL查询、脚本,查看和...
- **Oracle10g失败登录的记录**: Oracle10g增加了对失败登录尝试的记录功能,有助于安全审计。 - **Oracle11g口令大小写的区分**: Oracle11g增加了对口令大小写敏感的支持,提高了安全性。 - **Oracle11g缺省口令的...
监听器配置文件`listener.ora`位于`/database/oracle10g/network/admin/`目录下。监听器用于管理客户端与数据库服务器之间的连接。这里定义了一个名为`PLSExtProc`的服务,并指定了其`ORACLE_HOME`路径以及通信协议...
Oracle提供多种备份策略,如物理备份、逻辑备份,以及使用RMAN(恢复管理器)进行自动化备份。 最后,"command.txt"可能包含一些命令行工具的使用说明,如SQL*Plus,它是Oracle的默认命令行接口,用于执行SQL查询、...