les06_rev2

Upload: breno-coelho

Post on 05-Jul-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/16/2019 les06_Rev2

    1/11

    6Copyright © Oracle Corporation, 2002. All rights reserved.

    Maintaining the Control File

  • 8/16/2019 les06_Rev2

    2/11

    6-2 Copyright © Oracle Corporation, 2002. All rights reserved.

    Objectives

    After completing this lesson, you should be able to do

    the following:

    • Eplain the uses of the control file

    • !ist the contents of the control file• Multiple and manage the control file

    • Manage the control file with Oracle Managed Files

    "OMF#

    • Obtain control file information

  • 8/16/2019 les06_Rev2

    3/11

    6-3 Copyright © Oracle Corporation, 2002. All rights reserved.

    Control File

    • A small binary file

    • $efines current state of physical database

    • Maintains integrity of database

    • %e&uired: – At MOUNT state during database start up

     – 'o operate the database

    • !in(ed to a single database

    • !oss may re&uire recovery• )i*ed initially by

    CREATE DATABASE

    Controlfiles

    $atabase

  • 8/16/2019 les06_Rev2

    4/11

    6-5 Copyright © Oracle Corporation, 2002. All rights reserved.

    Control File Contents

    A control file contains the following entries:

    • $atabase name and identifier 

    • 'ime stamp of database creation

    • 'ablespace names• +ames and locations of data files and online redo

    log files

    • Current online redo log file se&uence number 

    • Chec(point information• egin and end of undo segments

    • %edo log archive information

    • ac(up information

  • 8/16/2019 les06_Rev2

    5/11

    6- Copyright © Oracle Corporation, 2002. All rights reserved.

    Multipleing the Control File

    CONTROL_FILES=

    $HOME/ORADATA/u01/ctrl01.ctl, $HOME/ORADATA/u02/ctrl02.ctl

    $is( - "u.-# $is( / "u./#

     ctrl02.ctlctrl01.ctl

  • 8/16/2019 les06_Rev2

    6/11

    6-! Copyright © Oracle Corporation, 2002. All rights reserved.

    Multipleing the Control File

    0hen 1sing )2F3!E

    -4 Alter the )2F3!E:

    /4 )hut down the database:

    54 Create additional control files:

    64 )tart the database:

     ALTER SSTEM SET c!"tr!l_#l%& ='$HOME/ORADATA/u01/ctrl01.ctl','$HOME/ORADATA/u02/ctrl02.ctl' SCO(E=S(FILE)

    c* $HOME/ORADATA/u01/ctrl01.ctl$HOME/ORADATA/u02/ctrl02.ctl

    &t+rtu*

    &ut-!" %-+t%

  • 8/16/2019 les06_Rev2

    7/116-" Copyright © Oracle Corporation, 2002. All rights reserved.

    Multipleing the Control File

    0hen 1sing 2F3!E

    -4 )hut down the database:

    /4 Create additional control files:

    54 Add control file names to 2F3!E:

    64 )tart the database:

    &ut-!" %-+t%

    CONTROL_FILES = $HOME/ORADATA/u01/ctrl01.ctl,$HOME/ORADATA/u02/ctrl02.ctl

    c* $HOME/ORADATA/u01/ctrl01.ctl$HOME/ORADATA/u02/ctrl02.ctl

    &t+rtu*

  • 8/16/2019 les06_Rev2

    8/116-#0 Copyright © Oracle Corporation, 2002. All rights reserved.

    Managing Control Files with OMF

    • OMF is created if the CONTROL_FILES parameter isnot specified4

    • !ocations are defined by

    DB_CREATE_ONLINE_LO_DEST_"4• +ames are uni&uely generated and displayed in the

    +l%rtSID.l!4

  • 8/16/2019 les06_Rev2

    9/116-## Copyright © Oracle Corporation, 2002. All rights reserved.

    Obtaining Control File 3nformation

    3nformation about control file status and locations can

    be retrieved by &uerying the following views4

    • 3$CONTROLFILE: !ists the name and status of all

    control files associated with the instance• 3$(ARAMETER : !ists status and location of all

    parameters

    • 3$CONTROLFILE_RECORD_SECTION: 2rovidesinformation about the control file record sections

    • SHO4 (ARAMETER CONTROL_FILES: !ists the name,status, and location of the control files

  • 8/16/2019 les06_Rev2

    10/116-#$ Copyright © Oracle Corporation, 2002. All rights reserved.

    )ummary

    3n this lesson, you should have learned how to:

    • Multiple the control file when using an )2F3!E

    • Multiple the control file when using an "t.!r+

    • Manage the control files using OMF

  • 8/16/2019 les06_Rev2

    11/116-#5 Copyright © Oracle Corporation 2002 All rights reserved

    2ractice 7 Overview

    'his practice covers the following topics:

    • )tarting the database without a control file

    • Multipleing an eisting control file