Database Administration
Database 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
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.
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.
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.
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.
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).
10
11
12
13
Local
New way (default) Faster Uses bitmaps in header file
14
These clauses tell Oracle how to track the usage of blocks within each extent
Default
15
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
17
18
Locally managed tablespaces reduce/eliminate the problem of unused free space gaps (see Fig. 5-10)
19
20
You can specify that segment free space be stored locally as a bitmap too
21
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
23
24
You can drop an undo tablespace by using the DROP TABLESPACE command
Wait until the status is OFFLINE before dropping the tablespace
25
26
Monitoring Undo
27
28
29
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
30