ITPub博客

首页 > 数据库 > Oracle > Backup And Recovery User's Guide-从RMAN开始-验证数据库文件和备份

Backup And Recovery User's Guide-从RMAN开始-验证数据库文件和备份

原创 Oracle 作者: luisedalian 时间:2014-02-13 07:42:10 0 删除 编辑

可以使用VALIDATE命令来验证所有的数据文件存在、位于它们正确的位置上、没有物理损坏。

CHECK LOGICAL选项用于验证逻辑块损坏。

练习:验证数据文件

--1. 启动RMAN连接到目标数据库

--2. 对希望验证的文件执行BACKUP VALIDATE

--2.1 对所有的数据文件和归档重做日志文件的物理和逻辑损坏进行验证

RMAN> backup validate check logical database archivelog all;

 

Starting backup at 06-JUL-13

using channel ORA_DISK_1

specification does not match any archived log in the repository

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00001 name=/u01/app/oracle/oradata/TestDB12/system01.dbf

input datafile file number=00002 name=/u01/app/oracle/oradata/TestDB12/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/TestDB12/example01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/TestDB12/undotbs01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/TestDB12/users01.dbf

channel ORA_DISK_1: backup set complete, elapsed time: 00:01:26

List of Datafiles

=================

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN

---- ------ -------------- ------------ --------------- ----------

1    OK     0              15544        92200           1143134  

  File Name: /u01/app/oracle/oradata/TestDB12/system01.dbf

  Block Type Blocks Failing Blocks Processed

  ---------- -------------- ----------------

  Data       0              60318          

  Index      0              12678          

  Other      0              3620           

 

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN

---- ------ -------------- ------------ --------------- ----------

2    OK     0              23712        72968           1143132  

  File Name: /u01/app/oracle/oradata/TestDB12/sysaux01.dbf

  Block Type Blocks Failing Blocks Processed

  ---------- -------------- ----------------

  Data       0              11647          

  Index      0              8271           

  Other      0              29330          

 

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN

---- ------ -------------- ------------ --------------- ----------

3    OK     0              129          14720           1143134   

  File Name: /u01/app/oracle/oradata/TestDB12/undotbs01.dbf

  Block Type Blocks Failing Blocks Processed

  ---------- -------------- ----------------

  Data       0              0              

  Index      0              0              

  Other      0              14591          

 

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN

---- ------ -------------- ------------ --------------- ----------

4    OK     0              18           667             1071732  

  File Name: /u01/app/oracle/oradata/TestDB12/users01.dbf

  Block Type Blocks Failing Blocks Processed

  ---------- -------------- ----------------

  Data       0              91             

  Index      0              39             

  Other      0              492            

 

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN

---- ------ -------------- ------------ --------------- ----------

5    OK     0              33651        44241           1074245  

  File Name: /u01/app/oracle/oradata/TestDB12/example01.dbf

  Block Type Blocks Failing Blocks Processed

  ---------- -------------- ----------------

  Data       0              6600           

  Index      0              1148           

  Other      0              2841           

 

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:01

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 06-JUL-13

 

--2.2 验证单独的数据块

sys@TESTDB12>col file_name for a60

sys@TESTDB12>select tablespace_name, file_name, file_id, bytes/1024/1024 from dba_data_files;

 

TABLESPACE_NAME              FILE_NAME                                                       FILE_ID  BYTES/1024/1024

-------------------------  ----------------------------------------------------   -------- -----------------

USERS                          /u01/app/oracle/oradata/TestDB12/users01.dbf                     4                    5

UNDOTBS1                       /u01/app/oracle/oradata/TestDB12/undotbs01.dbf                  3                 115

SYSAUX                         /u01/app/oracle/oradata/TestDB12/sysaux01.dbf  &nbs

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17013648/viewspace-1080534/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-02-06

  • 博文量
    1986
  • 访问量
    5643938