less05 storage tb

Upload: yairr

Post on 30-May-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Less05 Storage Tb

    1/26

    5Copyright 2005, Oracle. All rights reserved.

    Managing Database Storage Structures

  • 8/14/2019 Less05 Storage Tb

    2/26

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

    Objectives

    After completing this lesson, you should be able to dothe following: Describe how table row data is stored in blocks

    Define the purpose of tablespaces and data files Create and manage tablespaces Obtain tablespace information Describe the main concepts and functionality

    of Automatic Storage Management (ASM)

  • 8/14/2019 Less05 Storage Tb

    3/26

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

    Storage Structures

    Database

    Tablespace

    Segment

    Extent

    Oracle datablock

    Logical Physical

    OSblock

    OS file

  • 8/14/2019 Less05 Storage Tb

    4/26

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

    How Table Data Is Stored

    Tablespace

    Table A Table B

    SegmentSegment

    Rows

    Columns

    Table

    Blocks

    Row piece Extent

  • 8/14/2019 Less05 Storage Tb

    5/26

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

    Anatomy of a Database Block

    Block header

    Free space

    Row data

    Growth

  • 8/14/2019 Less05 Storage Tb

    6/26

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

    Tablespaces and Data Files

    The Oracle database stores data logically intablespaces and physically in data files. Tablespaces:

    Can belong to only one database Consist of one or more data files Are further divided into logical units of storage

    Data files: Can belong to only one

    tablespace and one database Are a repository for schema

    object data

    Database

    Tablespace

    Data files

  • 8/14/2019 Less05 Storage Tb

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

    Space Management in Tablespaces

    Locally managed tablespace: Free extents are managed in the tablespace. A bitmap is used to record free extents. Each bit corresponds to a block or group of blocks. The bit value indicates free or used extents. The use of locally managed tablespaces is

    recommended. Dictionary-managed tablespace:

    Free extents are managed by the data dictionary. Appropriate tables are updated when extents are

    allocated or unallocated. These tablespaces are supported only for backward

    compatibility.

  • 8/14/2019 Less05 Storage Tb

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

    Creating a New Tablespace

  • 8/14/2019 Less05 Storage Tb

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

    Creating a New Tablespace(Notes Only Slide)

  • 8/14/2019 Less05 Storage Tb

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

    Storage for Locally Managed Tablespaces

  • 8/14/2019 Less05 Storage Tb

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

    Storage for Locally Managed TablespacesFull Notes Page

  • 8/14/2019 Less05 Storage Tb

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

    Tablespaces in the PreconfiguredDatabase

    SYSTEM

    SYSAUX

    TEMP

    UNDOTBS1

    USERS

    EXAMPLE

  • 8/14/2019 Less05 Storage Tb

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

    Tablespaces in thePreconfigured Database

    Full Notes Page

  • 8/14/2019 Less05 Storage Tb

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

    Altering a Tablespace

  • 8/14/2019 Less05 Storage Tb

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

    Altering a TablespaceFull Notes Page

  • 8/14/2019 Less05 Storage Tb

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

    Altering a TablespaceFull Notes Page

  • 8/14/2019 Less05 Storage Tb

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

    Actions with Tablespaces

  • 8/14/2019 Less05 Storage Tb

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

    Actions with TablespacesFull Notes Page

  • 8/14/2019 Less05 Storage Tb

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

    Dropping Tablespaces

  • 8/14/2019 Less05 Storage Tb

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

    Viewing Tablespace Information

  • 8/14/2019 Less05 Storage Tb

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

    Where We Are

    Using tablespaces to separate data Creating various types of tablespaces Managing tablespaces

    Obtaining tablespace information Describe the main concepts and functionality

    of Automatic Storage Management (ASM)

  • 8/14/2019 Less05 Storage Tb

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

    What Is Automatic Storage Management?

    Is a portable and high-performancecluster file system

    Manages Oracle database files

    Spreads data across disksto balance load Mirrors data Solves many storage

    management challengesASM

    Filesystem

    Volumemanager

    Application

    Database

    Operating system

  • 8/14/2019 Less05 Storage Tb

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

    ASM: Key Features and Benefits

    Stripes files, but not logical volumes Provides online disk reconfiguration and dynamic

    rebalancing

    Allows for adjustable rebalancing speed Provides redundancy on a per-file basis Supports only Oracle database files Is cluster aware

    Is automatically installed

  • 8/14/2019 Less05 Storage Tb

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

    ASM: Concepts

    Database

    Tablespace

    Segment

    Extent

    Oracle datablock

    Data file

    Physicalblock

    ASM disk

    ASM file

    Allocation unitFile system

    fileor

    Raw device

    ASMdisk group

  • 8/14/2019 Less05 Storage Tb

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

    Summary

    In this lesson, you should have learned how to: Describe how table row data is stored in blocks Define the purpose of tablespaces and data files

    Create and manage tablespaces Obtain tablespace information Describe the main concepts and functionality of

    ASM, such as:

    Disk mirroring Dynamic rebalancing ASM disk groups

  • 8/14/2019 Less05 Storage Tb

    26/26

    Practice Overview:Managing Database Storage Structures

    This practice covers the following topics: Creating tablespaces Gathering information about tablespaces