Less14 Br Concepts Mb

  • Upload
    yairr

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

  • 8/14/2019 Less14 Br Concepts Mb

    1/26

    14Copyright 2005, Oracle. All rights reserved.

    Backup and Recovery Concepts

  • 8/14/2019 Less14 Br Concepts Mb

    2/26

    14-2 Copyright 2005, Oracle. All rights reserved.

    Objectives

    After completing this lesson, you should be able to do

    the following:

    Identify the types of failure that may occur in an

    Oracle database Describe ways to tune instance recovery

    Identify the importance of checkpoints, redo log

    files, and archive log files

    ConfigureARCHIVELOG mode

  • 8/14/2019 Less14 Br Concepts Mb

    3/26

    14-3 Copyright 2005, Oracle. All rights reserved.

    Part of Your Job

    The administrators duties are to:

    Protect the database from failure wherever

    possible

    Increase the mean time between failures (MTBF) Decrease the mean time to recover (MTTR)

    Minimize the loss of data

  • 8/14/2019 Less14 Br Concepts Mb

    4/26

    14-4 Copyright 2005, Oracle. All rights reserved.

    Categories of Failures

    Failures can generally be divided into the following

    categories:

    Statement failure

    User process failure Network failure

    User error

    Instance failure

    Media failure

  • 8/14/2019 Less14 Br Concepts Mb

    5/26

    14-5 Copyright 2005, Oracle. All rights reserved.

    Statement Failure

    Possible SolutionsTypical Problems

    Work with developers to correct

    program errors.

    Logic errors in applications

    Enable resumable space

    allocation.

    Increase owner quota.

    Add space to tablespace.

    Attempts to allocate space that

    fail

    Provide appropriate object or

    system privileges.

    Attempts to perform operations

    with insufficient privileges

    Work with users to validate and

    correct data.

    Attempts to enter invalid data

    into a table

  • 8/14/2019 Less14 Br Concepts Mb

    6/26

    14-6 Copyright 2005, Oracle. All rights reserved.

    User Process Failure

    Possible SolutionsTypical Problems

    A DBAs action is not usually

    needed to resolve user process

    failures. Instance background

    processes roll back uncommitted

    changes and release locks.

    Watch for trends.

    A user performs an abnormal

    disconnect

    A users session is abnormally

    terminated

    A user experiences a program

    error that terminates the

    session

  • 8/14/2019 Less14 Br Concepts Mb

    7/2614-7 Copyright 2005, Oracle. All rights reserved.

    Network Failure

    Possible SolutionsTypical Problems

    Configure a backup network

    connection.

    Network connection fails

    Configure multiple network cards.Network Interface Card (NIC)

    fails

    Configure a backup listener and

    connect-time failover.

    Listener fails

  • 8/14/2019 Less14 Br Concepts Mb

    8/2614-8 Copyright 2005, Oracle. All rights reserved.

    User Error

    Possible SolutionsTypical Causes

    Recover table from the recycle bin.A user drops a table

    Roll back or use flashback query to

    recover.

    A user inadvertently deletes

    or modifies data

    Oracle LogMiner

  • 8/14/2019 Less14 Br Concepts Mb

    9/2614-9 Copyright 2005, Oracle. All rights reserved.

    User Error

    Full Notes Page

  • 8/14/2019 Less14 Br Concepts Mb

    10/2614-10 Copyright 2005, Oracle. All rights reserved.

    Instance Failure

    Failure of one of the

    background processes

    Possible SolutionsTypical Causes

    Emergency shutdown

    procedures

    Hardware failure

    Restart the instance by using the

    startup command. Recovering from

    instance failure is automatic,

    including rolling forward changes in

    the redo logs and then rolling backany uncommitted transactions.

    Investigate the causes of failure by

    using the alert log, trace files, and

    Enterprise Manager.

    Power outage

  • 8/14/2019 Less14 Br Concepts Mb

    11/2614-11 Copyright 2005, Oracle. All rights reserved.

    Instance Recovery

    Instance or crash recovery:

    Is caused by attempts to open a database whose

    files are not synchronized on shutdown

    Is automatic Uses information stored in redo log groups to

    synchronize files

    Involves two distinct operations:

    Rolling forward: Data files are restored to their state

    before the instance failed.

    Rolling back: Changes made but not committed are

    returned to their original state.

  • 8/14/2019 Less14 Br Concepts Mb

    12/2614-12 Copyright 2005, Oracle. All rights reserved.

    Phases of Instance Recovery

    1. Data files out of sync

    2. Roll forward (redo)

    3. Committed and

    noncommitted data in files4. Roll back (undo)

    5. Committed data in files

    Database

    Undo

    Instance

    Backgroundprocesses

    Data file

    SCN: 99

    Data file

    SCN: 129

    Data file

    SCN: 140

    Control file

    SCN: 143

    Control file

    SCN: 143

    Redo log

    groupSCN 74-101

    Redo log

    groupSCN 102-143

    SGA

  • 8/14/2019 Less14 Br Concepts Mb

    13/2614-13 Copyright 2005, Oracle. All rights reserved.

    Tuning Instance Recovery

    During instance recovery, the transactions

    between the checkpoint position and the end of

    redo log must be applied to data files.

    Tune instance recovery by controlling thedifference between the checkpoint position and

    the end of redo log.

    End of redo logCheckpoint position

    Transactions

    Instance recovery

  • 8/14/2019 Less14 Br Concepts Mb

    14/2614-14 Copyright 2005, Oracle. All rights reserved.

    Using the MTTR Advisor

    Specify the desired time in seconds or minutes.

    The default value is 0 (disabled).

    The maximum value is 3,600 seconds (one hour).

  • 8/14/2019 Less14 Br Concepts Mb

    15/2614-15 Copyright 2005, Oracle. All rights reserved.

    Media Failure

    Failure of disk controller

    Deletion or corruption of

    database file

    Possible SolutionsTypical Causes

    1. Restore the affected file from

    backup.

    2. If necessary, inform the database

    of a new file location.

    3. If necessary, recover the file by

    applying redo information.

    Failure of disk drive

  • 8/14/2019 Less14 Br Concepts Mb

    16/2614-16 Copyright 2005, Oracle. All rights reserved.

    Configuring for Recoverability

    To configure your database for maximum

    recoverability, you must:

    Schedule regular backups

    Multiplex control files Multiplex redo log groups

    Retain archived copies of redo logs

  • 8/14/2019 Less14 Br Concepts Mb

    17/2614-17 Copyright 2005, Oracle. All rights reserved.

    Control Files

    Protect against database failure by multiplexing

    control files. Best practice suggestions:

    At least two copies (Oracle recommends three)

    Each copy on a separate disk At least one copy on a separate disk controller

    Control files

  • 8/14/2019 Less14 Br Concepts Mb

    18/2614-18 Copyright 2005, Oracle. All rights reserved.

    Redo Log Files

    Multiplex redo log groups to protect against media

    failure and loss of data. Best practice suggestions:

    At least two members (files) per group

    Each member on a separate disk drive Each member on a separate disk controller

    Note: Performance is heavily influenced by writing to

    redo logs.

    Group 1 Group 2 Group 3

    Disk 1

    Disk 2

    Member 1 Member 2 Member 1

    Member 2 Member 1 Member 2

  • 8/14/2019 Less14 Br Concepts Mb

    19/2614-19 Copyright 2005, Oracle. All rights reserved.

    Multiplexing the Redo Log

  • 8/14/2019 Less14 Br Concepts Mb

    20/2614-20 Copyright 2005, Oracle. All rights reserved.

    Archive Log Files

    To preserve redo information, create archived copies

    of redo log files by performing the following steps.

    1. Specify archive log file naming convention.

    2. Specify one or more archive log file locations.3. Switch the database toARCHIVELOG mode.

    Online redo log files Archive log files

  • 8/14/2019 Less14 Br Concepts Mb

    21/2614-21 Copyright 2005, Oracle. All rights reserved.

    Archive Log File: Naming and Destinations

  • 8/14/2019 Less14 Br Concepts Mb

    22/2614-22 Copyright 2005, Oracle. All rights reserved.

    Archiving Log File Naming and

    Destinations

    Full Notes Page

  • 8/14/2019 Less14 Br Concepts Mb

    23/2614-23 Copyright 2005, Oracle. All rights reserved.

    ARCHIVELOG Mode

    To place the database inARCHIVELOG mode,perform the following steps:

    1. Select theARCHIVELOG Mode check box.

    2. Click Apply. The database can be set to

    ARCHIVELOG mode only from theMOUNT state.

    3. Click Yes when asked whether you want to restartthe database.

    4. Backup your database.

    Databases inARCHIVELOG mode have access tothe full range of backup and recovery options.

  • 8/14/2019 Less14 Br Concepts Mb

    24/2614-24 Copyright 2005, Oracle. All rights reserved.

    Summary

    In this lesson, you should have learned how to:

    Identify the types of failure that may occur in an

    Oracle database

    Describe ways to tune instance recovery Identify the importance of checkpoints, redo log

    files, and archive log files

    ConfigureARCHIVELOG mode

  • 8/14/2019 Less14 Br Concepts Mb

    25/2614-25 Copyright 2005, Oracle. All rights reserved.

    Practice Overview:

    Configuring for Recoverability

    This practice covers the following topics:

    Multiplexing control files

    Multiplexing redo log groups

    Placing your database inARCHIVELOG mode Ensuring that redundant archive logs are created

  • 8/14/2019 Less14 Br Concepts Mb

    26/26