knowledge transfer on oracle rman restore

Upload: nikos-plevris

Post on 30-May-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    1/17

    A hands-on knowledge transfer session on restore scenariosOctober 2009

    Nikos PlevrisPrincipal Service Delivery Manager

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    2/17

    Agenda

    The story The actors Hints & Tips

    Scenario 1 Scenario 2 Scenario 3 Scenario 4

    The end

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    3/17

    The story

    Manager , DBAs.

    o Manager " . !! , ,

    . !

    ..". , , PC . . , , " , ". ' .

    . " , ". manual, Installer (OUI)

    , , ',

    . ...

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    4/17

    Little 4 Pigs DBAs YPA :=... - ! PE := -

    ! B32 32, Oracl Pili8 := 8 -

    !

    The Wolf Mr Leonidas

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    5/17

    Its all about this!

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    6/17

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    7/17

    Scenario 1 How to fix

    For permanent media failures, here are theinstructions for dropping and re-creating onemember of an online redo log group:1. Identify the online redo log fileexperiencing media failure.2. If the online redo log file is part of thecurrent online log group, thenSQL>alter system switch logfile3. Drop the damaged member.SQL> alter database drop logfile

    member '';4. Add a new member to the group.SQL> alter database add logfile

    member '\directory\member>' reuse togroup ;

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    8/17

    Scenario 2 s adventure

    .

    DBA, . PIG2. :$ rm *.log : ALL members of the logfile

    group 2 were removed. , errors . ...

    Hints & Tips1. Inspect the alert.log file todetermine which online redo log

    files have experienced a mediafailure.2. Query V$LOG and V$LOGFILE todetermine the status of the loggroup CURRENT or ACTIVE orINACTIVE.3. Then see next slide for

    details on how to fix the remainingfailed member(s).

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    9/17

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    10/17

    The 4 Little pigs should know

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    11/17

    Hints & TipsSee alrt.log for ORA-1578 errors RMAN>backup validate datafile;

    Use the dbverify utility to validatewhich datafile has a corrupt block:$ dbv file= blocksize=8192

    Use viewV$DATABASE_BLOCK_CORRUPTION toidentify corruption details

    Scenario 3 s adventure

    , ., 32. ? To corrupt some blocks of thesalary table in the database PIG3 ."

    , 32 . 5 . - , . " !

    ,

    errors. The query was:select * from scott.salgrade;

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    12/17

    Scenario 3 How to fix

    Identify object with corruption fromDBA_EXTENTS, DBA_SEGMENTSSQL>SELECT tablespace_name,segment_type, owner, segment_nameFROM dba_extents WHERE file_id =

    and 125021 between block_id AND block_id + blocks - 1;

    Use the RMAN recover command to restoreblock in datafile (if

    youre using Oracle Database 10 g orOracle9 i , then use the RMAN blockrecover command):RMAN> recover datafile block

    ; Important RMAN will attempt to restore the block from either

    a full backup, or a level 0 backup, or an image copybackup generated by backup as copy command.

    After the block has been restored, any requiredarchived redo logs must be available to recover theblock.

    RMAN cant perform block media recovery usingincremental level 1 (or higher)

    backups.

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    13/17

    Scenario 4 s adve nture , . ! . oracle UNIXaccount password citrix Metaframe login Pili8 server,

    PIG4. DROP TABLE

    . . . ,

    archived logs. , Pili8 alertemail : " error ORA-00942: table or view does not exist"

    26/10 09:38 . Pili8 !

    Hints & Tips-Time Sequence of events toconsider:

    1.DROP TABLE (t0) > Point-In-Time-Recovery2.Missing archived log (t1) ->Not needed3.Generated archived logs) ->Apply them

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    14/17

    Scenario 4 How to fixQuery v$log_history, v$archived_log to identifytime/SCNUse RMAN to restore db until time/SCNRMAN> run {2> set until time "to_date('25/10/200905:32:58','dd/mm/yyyy HH24:mi:ss')";3> restore database;4> recover database;5> }Open db with resetlogs.Before opening db withresetlogs, the checkpoint SCN for all online datafiles

    must be identicalSQL> select file#, status,checkpoint_change#,to_char(checkpoint_time,'dd-mon-rrrrhh24:mi:ss') from v$datafile_header;To tackle error RMAN-06059:expected archived lognot found RMAN>crosscheck {backup|archivelog all}; RMAN>delete noprompt obsolete;

    RMAN>delete expired archivelog all;Important Immediately backup database/archive logs after

    incomplete recovery The V$DATAFILE_HEADER view uses the physical

    datafile on disk as its source. The V$DATAFILEview uses the control file as its source.

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    15/17

    My dearest little ones keep in mind 1

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    16/17

    My dearest little ones keep in mind 2

  • 8/9/2019 Knowledge Transfer on ORACLE RMAN restore

    17/17

    The end..

    Be tha nkful for problems. If they were less difficult ,someo ne else with less ability might have your job.