0% found this document useful (0 votes)
185 views31 pages

Database Administration

- The document discusses storage structures in an Oracle database including the differences between logical and physical structures. It describes tablespaces, segments, schema objects, extents, and database blocks. - It covers creating and managing tablespaces, temporary tablespaces, undo data, and diagnostic trace files. Automatic undo management and monitoring undo space is also summarized.

Uploaded by

chinbom
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views31 pages

Database Administration

- The document discusses storage structures in an Oracle database including the differences between logical and physical structures. It describes tablespaces, segments, schema objects, extents, and database blocks. - It covers creating and managing tablespaces, temporary tablespaces, undo data, and diagnostic trace files. Automatic undo management and monitoring undo space is also summarized.

Uploaded by

chinbom
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 31

CIT 4403 Database Administration

Oracle 10g Database Administrator: Implementation & Administration

Chapter 5

Objectives
Differentiate between logical and physical structures Create many types of tablespaces Configure and view storage for tablespaces and datafiles Use and manage undo data Learn to describe and configure diagnostic (trace) files

Oracle 10g Database Administrator: Implementation and Administration

Introduction to Storage Structures

Oracle 10g Database Administrator: Implementation and Administration

Logical Structure Versus Physical Structure


Physical structures: composed of OS components and have a physical name and location
Datafiles (see Figure 5-2) Redo log files Control files

Logical structures: orderly groupings of information that allow you to manipulate/access related data
Cannot be viewed or modified outside the database Generally associated with physical structure(s) E.g. (Figure 5-3): tablespaces, segments, schema objects, extents, database blocks
Oracle 10g Database Administrator: Implementation and Administration

Tablespace
The largest logical structure in the database. A logical data storage space that maps directly to one or more data files. Tables, indexes, and other objects are created within a tablespce. A datafile can only be associated with one tablespace.

Oracle 10g Database Administrator: Implementation and Administration

Segment
Segment is a set of extents that make up a schema object within a tablespace. Segments have several different uses, including being the storage holders for a schema object within a table space. Each segment belongs to one schema object. For example, a table has one segment containing all of its extents.

Oracle 10g Database Administrator: Implementation and Administration

Schema Object
A schema object contains a wide variety of objects that can be created by users. Tables and indexes are probably the most common types of schema objects. Each schema object must be contained within one tablespace, with the exception of partitioned tables and partitioned indexes.

Oracle 10g Database Administrator: Implementation and Administration

Extent
An extent is a contiguous group of data blocks that are assigned to a segment. When more space is needed for an object, such as a table, the allocated in the form of one extent.

Oracle 10g Database Administrator: Implementation and Administration

Database Blocks
Smallest logical unit. A data block is made up of a set of physical bytes in a physical file. A direct mapping to actual, physical, data blocks (the nexus of the logical and physical worlds).

Oracle 10g Database Administrator: Implementation and Administration

Logical Structure Versus Physical Structure (continued)

Oracle 10g Database Administrator: Implementation and Administration

10

Logical Structure Versus Physical Structure (continued)

Oracle 10g Database Administrator: Implementation and Administration

11

Logical Structure Versus Physical Structure (continued)

Oracle 10g Database Administrator: Implementation and Administration

12

Segment Management Manual Automatic


Old way Uses free lists Exists for backward compatibility Default for 10g! New way Uses bitmaps Strongly recommended

Oracle 10g Database Administrator: Implementation and Administration

13

Extent Management Dictionary


Old way Slower Uses a data dictionary in Systems file

Local
New way (default) Faster Uses bitmaps in header file

Oracle 10g Database Administrator: Implementation and Administration

14

These clauses tell Oracle how to track the usage of blocks within each extent
Default

The EXTENT MANAGEMENT and SEGMENT SPACE MANAGEMENT Clauses

Locally vs. dictionary-managed performance:


Locally managed tablespaces store the map of where extents are in datafiles in a rapid access bitmap, in the header of the datafile Dictionary-managed tablespaces store this information in metadata, in the SYSTEM tablespace
Oracle 10g Database Administrator: Implementation and Administration

15

The EXTENT MANAGEMENT and SEGMENT SPACE MANAGEMENT Clauses (continued)


Deallocated extents return to free space list in data dictionary as a contiguous chunk of data blocks
For these to be usable, the next object that needs an extent must be that exact size (or smaller) extent Otherwise, deallocated data blocks are passed over, and data blocks at the end of datafile are used
Datafile grows faster than necessary

If there are contiguous deallocated extents, they arent seen as a chunk of space until coalesced
Coalescence: combining of multiple adjacent free extents into a single contiguous free extent
Occurs periodically through the SMON background process
Oracle 10g Database Administrator: Implementation and Administration

16

The EXTENT MANAGEMENT and SEGMENT SPACE MANAGEMENT Clauses (continued)

Oracle 10g Database Administrator: Implementation and Administration

17

Segment Types and Their Uses (continued)


In Oracle 10g, segments are created automatically when they are needed
The only exceptions are manual rollback segments, which can be created manually for cross compatibility with older versions of Oracle database
Manual rollback is redundant, not supported, and not recommended for use in Oracle 10g

Oracle 10g Database Administrator: Implementation and Administration

18

Creating a Dictionary-Managed Tablespace

Dictionary-managed tablespaces cause slower performance of DML commands


Updates involve multiple tables behind the scenes

Locally managed tablespaces reduce/eliminate the problem of unused free space gaps (see Fig. 5-10)

Oracle 10g Database Administrator: Implementation and Administration

19

Creating a Dictionary-Managed Tablespace (continued)

Oracle 10g Database Administrator: Implementation and Administration

20

Creating a Dictionary-Managed Tablespace (continued)


Locally managed tablespaces are more efficient (storage info is in a bitmap stored with tablespace)
There is a bitmap for each datafile in the tablespace Bitmap: small record in datafile header with one bit for each data block number that marks the beginning of a used group of consecutive blocks in datafile Redo/undo log records created only for data changes

You can specify that segment free space be stored locally as a bitmap too

Oracle 10g Database Administrator: Implementation and Administration

21

Creating a Locally Managed Tablespace


Execute:

The second largest logical structure is a segment (see next slide)

Oracle 10g Database Administrator: Implementation and Administration

22

Temporary Tablespace
Temporary segments need a temporary tablespace
Example, sorting data Oracle recommends creating locally managed, temporary tablespaces You can also create multiple temporary tablespaces
Require a tablespace group Group can be set as the default for the entire DB

Assign the user a default temporary tablespace:

Oracle 10g Database Administrator: Implementation and Administration

23

Overview of Undo Data


Undo data is made up of undo blocks
Each undo block contains the before image of the data in the block

Also used to redo original data after a ROLLBACK


Also provides read consistency for users accessing the table between the time the update is pending, and the time the update has been committed

Undo data is also used during database recovery


If DB fails and prevents a commit from happening, data in the redo log is inaccurate

Ways to manage undo data: manual and automatic


Oracle 10g Database Administrator: Implementation and Administration

24

Implementing Automatic Undo Management


To set up automatic undo management mode:
1. Set UNDO_MANAGEMENT parameter to AUTO
Default with DCBA tool

2. Create an undo tablespace

You can drop an undo tablespace by using the DROP TABLESPACE command
Wait until the status is OFFLINE before dropping the tablespace

Oracle 10g Database Administrator: Implementation and Administration

25

Implementing Automatic Undo Management (continued)

Oracle 10g Database Administrator: Implementation and Administration

26

Monitoring Undo

Oracle 10g Database Administrator: Implementation and Administration

27

Monitoring Undo (continued)

Oracle 10g Database Administrator: Implementation and Administration

28

Monitoring Undo (continued)

Oracle 10g Database Administrator: Implementation and Administration

29

Overview of Diagnostic (Trace) Files


Trace files allow highly detailed problem resolution
Typically used to solve serious problems

Serious errors are most often written to trace files, and duplicated to the primary trace file (alert log) Not all critical errors may be sent to the trace files
DB crash may only be sent to a memory core dump

Relevant directories in ORACLE_BASE/admin


bdump cdump udump
Oracle 10g Database Administrator: Implementation and Administration

30

Overview of Diagnostic (Trace) Files (continued)


Trace files are automatically created/written to by DB Alert log file (alert.log) is created when DB starts up
The other types of files are created as events occur

Trace files are not only for logging errors


Alert log contains details of DB start up and shut down

Other important trace configuration parameters:


MAX_DUMP_FILE_SIZE SQL_TRACE TIMED_STATISTICS STATISTICS_LEVEL
31

Oracle 10g Database Administrator: Implementation and Administration

You might also like