Sei sulla pagina 1di 24

Managing Database Storage Structures

Copyright © 2007, Oracle. All rights reserved.


Objectives

After completing this lesson, you should be able to:


• Describe the storage of table row data 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)

6-2 Copyright © 2007, Oracle. All rights reserved.


6-3 Copyright © 2007, Oracle. All rights reserved.
How Table Data Is Stored

Columns Blocks

Table A Table B

Rows

Segment Segment

Table
Tablespace

Row piece Extent

6-4 Copyright © 2007, Oracle. All rights reserved.


Database Block: Contents

Block header
Growth
Free space

Row data

6-5 Copyright © 2007, Oracle. All rights reserved.


6-6 Copyright © 2007, 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.
– Use of locally managed tablespaces is recommended.
• Dictionary-managed tablespace:
– Free extents are managed by Oracle.
– Appropriate tables are updated when extents are
allocated or unallocated.
– These tablespaces are supported only for backward
compatibility.

6-7 Copyright © 2007, Oracle. All rights reserved.


6-8 Copyright © 2007, Oracle. All rights reserved.
Creating a New Tablespace

6-9 Copyright © 2007, Oracle. All rights reserved.


Storage for Locally Managed Tablespaces

6 - 10 Copyright © 2007, Oracle. All rights reserved.


Tablespaces in the Preconfigured Database

SYSTEM • UNDOTBS1
SYSAUX • USERS
TEMP • EXAMPLE

6 - 11 Copyright © 2007, Oracle. All rights reserved.


Altering a Tablespace

6 - 12 Copyright © 2007, Oracle. All rights reserved.


Actions with Tablespaces

6 - 13 Copyright © 2007, Oracle. All rights reserved.


Dropping Tablespaces

6 - 14 Copyright © 2007, Oracle. All rights reserved.


Viewing Tablespace Information

6 - 15 Copyright © 2007, Oracle. All rights reserved.


Gathering Storage Information

6 - 16 Copyright © 2007, Oracle. All rights reserved.


Viewing Tablespace Contents

12061_1_sel_ts_3

6 - 17 Copyright © 2007, Oracle. All rights reserved.


Oracle Managed Files (OMF)

Specify file operations in terms of database objects rather


than file names.
Parameter Description

DB_CREATE_FILE_DEST Defines the location of the default file


system directory for data files and
temporary files
DB_CREATE_ONLINE_LOG_DEST_n Defines the location for redo log files
and control file creation
DB_RECOVERY_FILE_DEST Default location for the flash recovery
area

Example:
SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST = '/u01/oradata';
SQL> CREATE TABLESPACE tbs_1;

6 - 18 Copyright © 2007, Oracle. All rights reserved.


6 - 19 Copyright © 2007, Oracle. All rights reserved.
Automatic Storage Management

• Is a portable and high-performance


cluster file system
• Manages Oracle database files
Application
• Spreads data across disks
to balance load
Database
• Mirrors data
File
• Solves storage-management system
challenges ASM
Volume
manager

Operating system

6 - 20 Copyright © 2007, 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

6 - 21 Copyright © 2007, Oracle. All rights reserved.


ASM: Concepts

ASM
Database
disk group

Tablespace Data file ASM file

Segment ASM disk

File-system
Extent
file Allocation unit
or
raw device
Oracle
block Physical
block

6 - 22 Copyright © 2007, Oracle. All rights reserved.


Summary

In this lesson, you should have learned how to:


• Describe the storage of table row data 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)

6 - 23 Copyright © 2007, Oracle. All rights reserved.


Practice 6 Overview:
Managing Database Storage Structures

This practice covers the following topics:


• Creating tablespaces
• Gathering information about tablespaces

6 - 24 Copyright © 2007, Oracle. All rights reserved.

Potrebbero piacerti anche