Oracle 10g Database Administrator: Implementation and Administration

Slides:



Advertisements
Similar presentations
CHAPTER 4 Tablespaces and Datafiles. Introduction After installing the binaries, creating a database, and configuring your environment, the next logical.
Advertisements

The Architecture of Oracle
Module 2: Database Architecture
Introduction to Oracle
5 Copyright © 2005, Oracle. All rights reserved. Managing Database Storage Structures.
Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 2 Overview of Database Administrator (DBA) Tools.
Oracle Architecture. Instances and Databases (1/2)
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
Basic Storage Concepts and Settings
1 - Oracle Server Architecture Overview
Harvard University Oracle Database Administration Session 2 System Level.
Oracle Architectural Components
Harvard University Oracle Database Administration Session 5 Data Storage.
Managing an Oracle Instance
10 Copyright © 2009, Oracle. All rights reserved. Managing Undo Data.
Advanced Databases Basic Database Administration Guide to Oracle 10g 1.
A Guide to Oracle9i1 Introduction to Oracle9i Database Administration Chapter 11.
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
Backup and Recovery Part 1.
Oracle9i Database Administrator: Implementation and Administration
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
Oracle Database Administration Database files Logical database structures.
IT Database Administration Section 03. Tablespaces and the DBA  Important for DBAs – logical units of database storage Made up of physical operating-system.
Database Administration TableSpace & Data File Management
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 9 Index Management.
Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
7202ICT Database Administration Lecture 7 Managing Database Storage Part 2 Orale Concept Manuel Chapter 3 & 4.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
9 Storage Structure and Relationships. 9-2 Objectives Listing the different segment types and their uses Controlling the use of extents by segments Stating.
16 Copyright © 2004, Oracle. All rights reserved. Undo Management.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Week 3 Lecture 1 The Redo Log Files and Diagnostic Files.
Introduction to Oracle. Oracle History 1979 Oracle Release client/server relational database 1989 Oracle Oracle 8 (object relational) 1999.
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
Week 3 Lecture 2 Basic Storage Concepts and Settings.
Week 4 Lecture 2 Advanced Table Management. Learning Objectives  Create tables with large object (LOB) columns and tables that are index-organized 
Database Storage Structures
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
6 Copyright © 2007, Oracle. All rights reserved. Managing Database Storage Structures.
Oracle 10g Database Administrator: Implementation and Administration Chapter 5 Basic Storage Concepts and Settings.
Managing Tablespaces and Data Files
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
Physical Database Structure .
8 Copyright © Oracle Corporation, All rights reserved. Managing Tablespaces and Data files.
Oracle Database Architectural Components
9 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
10 Copyright © 2007, Oracle. All rights reserved. Managing Undo Data.
3 Copyright © Oracle Corporation, All rights reserved. 管理数据库事例.
Table spaces.
Database structure and space Management
Maintaining Online Redo Log Files
Oracle9i Database Administrator: Implementation and Administration
Recovering from Noncritical Losses
Physical Database Structure .
Introduction To Oracle 10g
Managing Tablespaces and Data Files
Performing Database Recovery
ISYS366, Oracle Disk Internals
Chapter 5 The Redo Log Files.
Presentation transcript:

Oracle 10g Database Administrator: Implementation and Administration Chapter 5 Basic Storage Concepts and Settings

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 The Oracle 10g DB has an internal set of structures used to store data, users, constraints, data dictionary views, and other objects Also contain metadata maintained internally by DB Metadata: data that tells Oracle 10g about all the structures that store data in the database Oracle 10g Database Administrator: Implementation and Administration

Introduction to Storage Structures (continued) 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

Logical Structure Versus Physical Structure (continued) Oracle 10g Database Administrator: Implementation and Administration

Logical Structure Versus Physical Structure (continued) Oracle 10g Database Administrator: Implementation and Administration

Logical Structure Versus Physical Structure (continued) Oracle 10g Database Administrator: Implementation and Administration

Tablespaces and Datafiles Tablespaces are made up of at least one datafile You cannot create a tablespace without creating its initial datafile; you cannot create a datafile without an associated tablespace Bigfile tablespaces must be locally managed Undo tablespaces are specialized to store undo (rollback) data Oracle 10g Database Administrator: Implementation and Administration

The DATAFILE Clause When creating a tablespace with a user-managed file, specify a datafile name in the command Each datafile must have a specified SIZE Exceptions: OMFs and named files that already exist Omitting AUTOEXTEND and SIZE parameters results in AUTOEXTEND set to ON Example: Oracle 10g Database Administrator: Implementation and Administration

Implementing Oracle Managed Files (OMF) with Tablespaces Oracle 10g Database Administrator: Implementation and Administration

Implementing Oracle Managed Files (OMF) with Tablespaces (continued) Oracle 10g Database Administrator: Implementation and Administration

Implementing Oracle Managed Files (OMF) with Tablespaces (continued) Oracle 10g Database Administrator: Implementation and Administration

The EXTENT MANAGEMENT and SEGMENT SPACE MANAGEMENT Clauses These clauses tell Oracle how to track the usage of blocks within each extent 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 Default Oracle 10g Database Administrator: Implementation and Administration

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 aren’t 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

The EXTENT MANAGEMENT and SEGMENT SPACE MANAGEMENT Clauses (continued) Oracle 10g Database Administrator: Implementation and Administration

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

Creating a Dictionary-Managed Tablespace (continued) Oracle 10g Database Administrator: Implementation and Administration

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

Creating a Locally Managed Tablespace Execute: The second largest logical structure is a segment (see next slide) Oracle 10g Database Administrator: Implementation and Administration

Segment Types and Their Uses Oracle 10g Database Administrator: Implementation and Administration

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

Temporary Tablespace Temporary segments need a temporary tablespace 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

Tablespaces with Nonstandard Data Block Size Oracle 10g Database Administrator: Implementation and Administration

Configuring and Viewing Storage Changing the Size, Storage Settings, and Status Read-only Tablespaces Dropping Tablespaces Renaming Tablespaces Querying the Data Dictionary for Storage Data Oracle 10g Database Administrator: Implementation and Administration

Changing the Size, Storage Settings, and Status Tasks you can handle with ALTER TABLESPACE: Change DEFAULT STORAGE settings for any future objects created in (dictionary-managed) tablespace Change the MINIMUM EXTENT size Change LOGGING to NOLOGGING and vice versa Change PERMANENT to TEMPORARY (vice versa) Change READ ONLY to READ WRITE (vice versa) Coalesce contiguous storage space Add a new datafile or temporary file Rename a datafile or temporary file Begin and end an open backup Oracle 10g Database Administrator: Implementation and Administration

Changing the Size, Storage Settings, and Status (continued) To change an existing datafile’s storage, you must use the ALTER DATABASE command instead: To modify tempfile: ALTER DATABASE TEMPFILE Oracle 10g Database Administrator: Implementation and Administration

Changing the Size, Storage Settings, and Status (continued) The status of a tablespace defines its availability to end-users and also defines how it is handled during backup and recovery ONLINE OFFLINE NORMAL TEMPORARY IMMEDIATE It is possible to take individual datafiles offline Oracle 10g Database Administrator: Implementation and Administration

Read-only Tablespaces Oracle 10g Database Administrator: Implementation and Administration

Dropping Tablespaces Oracle 10g Database Administrator: Implementation and Administration

Renaming Tablespaces Renaming tablespaces can be useful in rare circumstances, such as when switching in and out partitioned tablespaces, or incorporating transported tablespaces into an existing database Oracle 10g Database Administrator: Implementation and Administration

Querying the Data Dictionary for Storage Data Oracle 10g Database Administrator: Implementation and Administration

Querying the Data Dictionary for Storage Data (continued) Oracle 10g Database Administrator: Implementation and Administration

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

Implementing Automatic Undo Management To set up automatic undo management mode: Set UNDO_MANAGEMENT parameter to AUTO Default with DCBA tool 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

Implementing Automatic Undo Management (continued) Oracle 10g Database Administrator: Implementation and Administration

Monitoring Undo Oracle 10g Database Administrator: Implementation and Administration

Monitoring Undo (continued) Oracle 10g Database Administrator: Implementation and Administration

Monitoring Undo (continued) Oracle 10g Database Administrator: Implementation and Administration

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

Overview of Diagnostic (Trace) Files (continued) Oracle 10g Database Administrator: Implementation and Administration

Overview of Diagnostic (Trace) Files (continued) Oracle 10g Database Administrator: Implementation and Administration

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 Oracle 10g Database Administrator: Implementation and Administration

Overview of Diagnostic (Trace) Files (continued) Oracle 10g Database Administrator: Implementation and Administration

Overview of Diagnostic (Trace) Files (continued) Oracle 10g Database Administrator: Implementation and Administration

Summary Logical structures include data blocks, extents, segments, schema objects, and tablespaces Permanent tablespaces store objects, such as tables and indexes Temporary tablespaces store temporary tables and data while the data is being sorted Locally managed tablespaces use a bitmap to track used and unused space Dictionary-managed tablespaces use the data dictionary to track used and unused space The NOLOGGING setting does not log mass INSERT or DDL commands Oracle 10g Database Administrator: Implementation and Administration

Summary (continued) The REUSE setting allows Oracle 10g to reuse an existing file, erasing all its data The AUTOEXTEND ON setting gives a datafile the ability to add to its size automatically Adjacent, free extents can be manually coalesced in a dictionary-managed tablespace Free extents are automatically coalesced in a locally managed tablespace The MINIMUM EXTENT setting overrides a smaller extent size specified by an object in the tablespace Set PCTINCREASE to zero to keep extent sizes more uniform Oracle 10g Database Administrator: Implementation and Administration

Summary (continued) Dictionary-managed tablespaces use a freelist in the dictionary to track blocks Locally managed tablespaces keep extents the same size or a variable size controlled by system Types of segments: data, index, temporary, rollback Before creating a tablespace with a nonstandard data block size, you must create a cache with the corresponding data block size Many of the initial settings of a tablespace can be changed using the ALTER TABLESPACE command Oracle 10g Database Administrator: Implementation and Administration

Summary (continued) You cannot change a tablespace from LOCAL or DICTIONARY mode To block access, a tablespace can be changed from ONLINE to OFFLINE Taking a tablespace offline can be done in NORMAL, TEMPORARY, or IMMEDIATE mode Dropping a tablespace with the INCLUDING CONTENTS clause destroys all its data Undo data allows users to have read consistency, while other users make changes that are not yet committed Oracle 10g Database Administrator: Implementation and Administration

Summary (continued) Manual undo management using manually specified rollback segments is no longer supported by Oracle Automatic mode is easier to manage than manual rollbacks, and requires a special undo tablespace Undo blocks reside in undo extents within either an undo tablespace or a rollback segment The alert log file should be monitored regularly to detect errors The background trace files record errors that occur within the background processes The user trace files log errors from user session connections and transactions executed by users Oracle 10g Database Administrator: Implementation and Administration