无RMAN备份集情况下的坏块恢复

WBOY
풀어 주다: 2016-06-07 16:42:57
원래의
930명이 탐색했습니다.

虽然在没有RMAN备份集的情况下,通过热备文件可以把丢失的数据恢复出来,但这毕竟还是很不靠谱的。在生产环境中,我们几乎不可能

测试的环境是没有可用的RMAN备份集,但是有数据文件的热备,下面来看测试:


--创建测试用户和测试表
[Oracle@ora10g ~]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on 16 16:01:02 2014


Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> create user zlm identified by zlm;

User created.

SQL> alter user zlm default tablespace zlm;

User altered.


SQL> grant dba to zlm;


Grant succeeded.


SQL> conn zlm/zlm

Connected.
SQL> create table corrupt_test (id number(10),name varchar2(15));


Table created.


SQL> insert into corrupt_test values(1,'aaron8219');


1 row created.


SQL> commit;


Commit complete.


SQL> set lin 130

SQL> col segment_name for a20

SQL> col tablespace_name for a20
SQL> select segment_name,tablespace_name from dba_segments where segment_name='CORRUPT_TEST';

 

SEGMENT_NAME        TABLESPACE_NAME
-------------------- --------------------
CORRUPT_TEST        ZLM


SQL> col name for a45
SQL> select a.segment_name,a.tablespace_name,b.file#,b.name from dba_segments a,v$datafile b where a.header_file=b.file# and a.segment_name='CORRUPT_TEST';


SEGMENT_NAME        TABLESPACE_NAME          FILE# NAME
-------------------- -------------------- ---------- ---------------------------------------------
CORRUPT_TEST        ZLM                          6 /u01/app/oracle/oradata/ora10g/zlm01.dbf


由于之前做过RMAN备份,所以先把备份集删除


[oracle@ora10g ~]$ rman target /


Recovery Manager: Release 10.2.0.1.0 - Production on 16 16:06:47 2014


Copyright (c) 1982, 2005, Oracle.  All rights reserved.


connected to target database: ORA10G (DBID=4175411955)


RMAN> list backupset;

 

using target database control file instead of recovery catalog


List of Backup Sets
===================


BS Key  Type LV Size      Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
286    Full    880.50M    DISK        00:01:35    2014-11-12   
        BP Key: 286  Status: AVAILABLE  Compressed: NO  Tag: TAG20141112T141548
        Piece Name: /u01/app/oracle/flash_recovery_area/ORA10G/backupset/2014_11_12/o1_mf_nnndf_TAG20141112T141548_b65yrnkg_.bkp
  List of Datafiles in backup set 286
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- ---------- ----
  1      Full 1202813    2014-11-12 /u01/app/oracle/oradata/ora10g/system01.dbf
  2      Full 1202813    2014-11-12 /u01/app/oracle/oradata/ora10g/undotbs01.dbf
  3      Full 1202813    2014-11-12 /u01/app/oracle/oradata/ora10g/sysaux01.dbf
  4      Full 1202813    2014-11-12 /u01/app/oracle/oradata/ora10g/users01.dbf
  5      Full 1202813    2014-11-12 /u01/app/oracle/oradata/ora10g/example01.dbf
  6      Full 1202813    2014-11-12


BS Key  Size      Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
302    42.17M    DISK        00:00:27    2014-11-21   
        BP Key: 302  Status: AVAILABLE  Compressed: YES  Tag: ARC_BAK
        Piece Name: /u01/orabackup/backupsets/ora10g-4175411955_20141121_864227317_351.arc


  List of Archived Logs in backup set 302
  Thrd Seq    Low SCN    Low Time  Next SCN  Next Time
  ---- ------- ---------- ---------- ---------- ---------
  1    39      1234835    2014-11-18 1247748    2014-11-21
  1    40      1247748    2014-11-21 1249682    2014-11-21
  1    41      1249682    2014-11-21 1250181    2014-11-21
  1    42      1250181    2014-11-21 1258063    2014-11-21
  1    43      1258063    2014-11-21 1260208    2014-11-21

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿