Docsity

Oracle DB Storage & Management: Segments, Table Spaces, & Hybrid Compression, Thesis of Computer Science

Toggle sidebar
bg1
1 Introduction to Oracle Database
This chapter provides an overview of Oracle Database.
This chapter contains the following sections:
About Relational Databases
Schema Objects
Data Access
Transaction Management
Oracle Database Architecture
Oracle Database Documentation Roadmap
About Relational Databases
Every organization has information that it must store and manage to meet its requirements. For
example, a corporation must collect and maintain human resources records for its employees.
This information must be available to those who need it.
An information system is a formal system for storing and processing information. An
information system could be a set of cardboard boxes containing manila folders along with rules
for how to store and retrieve the folders. However, most companies today use a database to
automate their information systems. A database is an organized collection of information treated
as a unit. The purpose of a database is to collect, store, and retrieve related information for use
by database applications.
Database Management System (DBMS)
A database management system (DBMS) is software that controls the storage, organization, and
retrieval of data.
Typically, a DBMS has the following elements:
Kernel code
This code manages memory and storage for the DBMS.
Repository of metadata
This repository is usually called a data dictionary.
Query language
This language enables applications to access the data.
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Oracle DB Storage & Management: Segments, Table Spaces, & Hybrid Compression and more Thesis Computer Science in PDF only on Docsity!

1 Introduction to Oracle Database

This chapter provides an overview of Oracle Database. This chapter contains the following sections:  About Relational Databases  Schema Objects  Data Access  Transaction Management  Oracle Database Architecture  Oracle Database Documentation Roadmap

About Relational Databases

Every organization has information that it must store and manage to meet its requirements. For example, a corporation must collect and maintain human resources records for its employees. This information must be available to those who need it. An information system is a formal system for storing and processing information. An information system could be a set of cardboard boxes containing manila folders along with rules for how to store and retrieve the folders. However, most companies today use a database to automate their information systems. A database is an organized collection of information treated as a unit. The purpose of a database is to collect, store, and retrieve related information for use by database applications.

Database Management System (DBMS)

A database management system (DBMS) is software that controls the storage, organization, and retrieval of data. Typically, a DBMS has the following elements:  Kernel code This code manages memory and storage for the DBMS.  Repository of metadata This repository is usually called a data dictionary.  Query language This language enables applications to access the data.

A database application is a software program that interacts with a database to access and manipulate data. The first generation of database management systems included the following types:  Hierarchical A hierarchical database organizes data in a tree structure. Each parent record has one or more child records, similar to the structure of a file system.  Network A network database is similar to a hierarchical database, except records have a many-to- many rather than a one-to-many relationship. The preceding database management systems stored data in rigid, predetermined relationships. Because no data definition language existed, changing the structure of the data was difficult. Also, these systems lacked a simple query language, which hindered application development.

Relational Model

In his seminal 1970 paper "A Relational Model of Data for Large Shared Data Banks," E. F. Codd defined a relational model based on mathematical set theory. Today, the most widely accepted database model is the relational model. A relational database is a database that conforms to the relational model. The relational model has the following major aspects:  Structures Well-defined objects store or access the data of a database.  Operations Clearly defined actions enable applications to manipulate the data and structures of a database.  Integrity rules Integrity rules govern operations on the data and structures of a database. A relational database stores data in a set of simple relations. A relation is a set of tuples. A tuple is an unordered set of attribute values. A table is a two-dimensional representation of a relation in the form of rows (tuples) and columns (attributes). Each row in a table has the same set of columns. A relational database is a

In 1977, Larry Ellison, Bob Miner, and Ed Oates started the consultancy Software Development Laboratories, which became Relational Software, Inc. (RSI). In 1983, RSI became Oracle Systems Corporation and then later Oracle Corporation.  First commercially available RDBMS In 1979, RSI introduced Oracle V2 (Version 2) as the first commercially available SQL- based RDBMS, a landmark event in the history of relational databases.  Portable version of Oracle Database Oracle Version 3, released in 1983, was the first relational database to run on mainframes, minicomputers, and PCs. The database was written in C, enabling the database to be ported to multiple platforms.  Enhancements to concurrency control, data distribution, and scalability Version 4 introduced multiversion read consistency. Version 5, released in 1985, supported client/server computing and distributed database systems. Version 6 brought enhancements to disk I/O, row locking, scalability, and backup and recovery. Also, Version 6 introduced the first version of the PL/SQL language, a proprietary procedural extension to SQL.  PL/SQL stored program units Oracle7, released in 1992, introduced PL/SQL stored procedures and triggers.  Objects and partitioning Oracle8 was released in 1997 as the object-relational database, supporting many new data types. Additionally, Oracle8 supported partitioning of large tables.  Internet computing Oracle8i Database, released in 1999, provided native support for internet protocols and server-side support for Java. Oracle8i was designed for internet computing, enabling the database to be deployed in a multitier environment.  Oracle Real Application Clusters (Oracle RAC) Oracle9i Database introduced Oracle RAC in 2001, enabling multiple instances to access a single database simultaneously. Additionally, Oracle XML Database (Oracle XML DB) introduced the ability to store and query XML.  Grid computing

Oracle Database 10g introduced grid computing in 2003. This release enabled organizations to virtualize computing resources by building a grid infrastructure based on low-cost commodity servers. A key goal was to make the database self-managing and self-tuning. Oracle Automatic Storage Management (Oracle ASM) helped achieve this goal by virtualizing and simplifying database storage management.  Manageability, diagnosability, and availability Oracle Database 11g, released in 2007, introduced a host of new features that enabled administrators and developers to adapt quickly to changing business requirements. The key to adaptability is simplifying the information infrastructure by consolidating information and using automation wherever possible.  Plugging In to the Cloud Oracle Database 12c, released in 2013, was designed for the Cloud, featuring a new Multitenant architecture, In-Memory column store, and support for JSON documents. Oracle Database 12c helps customers make more efficient use of their IT resources, while continuing to reduce costs and improve service levels for users. Schema Objects One characteristic of an RDBMS is the independence of physical data storage from logical data structures. In Oracle Database, a database schema is a collection of logical data structures, or schema objects. A database user owns a database schema, which has the same name as the user name. Schema objects are user-created structures that directly refer to the data in the database. The database supports many types of schema objects, the most important of which are tables and indexes. A schema object is one type of database object. Some database objects, such as profiles and roles, do not reside in schemas. See Also: "Introduction to Schema Objects" to learn more about schema object types, storage, and dependencies

Tables

A table describes an entity such as employees. You define a table with a table name, such as employees, and set of columns. In general, you give each column a name, a data type, and a width when you create the table.

A SQL statement can be thought of as a very simple, but powerful, computer program or instruction. Users specify the result that they want (for example, the names of employees), not how to derive it. A SQL statement is a string of SQL text such as the following: SELECT first_name, last_name FROM employees; SQL statements enable you to perform the following tasks:  Query data  Insert, update, and delete rows in a table  Create, replace, alter, and drop objects  Control access to the database and its objects  Guarantee database consistency and integrity SQL unifies the preceding tasks in one consistent language. Oracle SQL is an implementation of the ANSI standard. Oracle SQL supports numerous features that extend beyond standard SQL. See Also: "SQL" to learn more about SQL standards and the main types of SQL statements

PL/SQL and Java

PL/SQL is a procedural extension to Oracle SQL. PL/SQL is integrated with Oracle Database, enabling you to use all of the Oracle Database SQL statements, functions, and data types. You can use PL/SQL to control the flow of a SQL program, use variables, and write error-handling procedures. A primary benefit of PL/SQL is the ability to store application logic in the database itself. A PL/ SQL procedure or function is a schema object that consists of a set of SQL statements and other PL/SQL constructs, grouped together, stored in the database, and run as a unit to solve a specific problem or to perform a set of related tasks. The principal benefit of server-side programming is that built-in functionality can be deployed anywhere. Oracle Database can also store program units written in Java. A Java stored procedure is a Java method published to SQL and stored in the database for general use. You can call existing PL/SQL programs from Java and Java programs from PL/SQL. See Also:  "Server-Side Programming: PL/SQL and Java"  "Client-Side Database Programming" Transaction Management

Oracle Database is designed as a multiuser database. The database must ensure that multiple users can work concurrently without corrupting one another's data.

Transactions

A transaction is a logical, atomic unit of work that contains one or more SQL statements. An RDBMS must be able to group SQL statements so that they are either all committed, which means they are applied to the database, or all rolled back, which means they are undone. An illustration of the need for transactions is a funds transfer from a savings account to a checking account. The transfer consists of the following separate operations:

  1. Decrease the savings account.
  2. Increase the checking account.
  3. Record the transaction in the transaction journal. Oracle Database guarantees that all three operations succeed or fail as a unit. For example, if a hardware failure prevents a statement in the transaction from executing, then the other statements must be rolled back. Transactions are one feature that set Oracle Database apart from a file system. If you perform an atomic operation that updates several files, and if the system fails halfway through, then the files will not be consistent. In contrast, a transaction moves an Oracle database from one consistent state to another. The basic principle of a transaction is "all or nothing": an atomic operation succeeds or fails as a whole. See Also: "Transactions" to learn about the definition of a transaction, statement-level atomicity, and transaction control

Data Concurrency

A requirement of a multiuser RDBMS is the control of data concurrency, which is the simultaneous access of the same data by multiple users. Without concurrency controls, users could change data improperly, compromising data integrity. For example, one user could update a row while a different user simultaneously updates it. If multiple users access the same data, then one way of managing concurrency is to make users wait. However, the goal of a DBMS is to reduce wait time so it is either nonexistent or negligible. All SQL statements that modify data must proceed with as little interference as possible. Destructive interactions, which are interactions that incorrectly update data or alter underlying data structures, must be avoided.

In the strictest sense the terms have the following meanings:  Database A database is a set of files, located on disk, that store data. These files can exist independently of a database instance.  Database instance An instance is a set of memory structures that manage database files. The instance consists of a shared memory area, called the system global area (SGA), and a set of background processes. An instance can exist independently of database files. Figure 1-1 shows a database and its instance. For each user connection to the instance, a client process runs the application. Each client process is associated with its own server process. The server process has its own private session memory, known as the program global area (PGA). Figure 1-1 Oracle Instance and Database

Description of "Figure 1-1 Oracle Instance and Database" A database can be considered from both a physical and logical perspective. Physical data is data viewable at the operating system level. For example, operating system utilities such as the Linux ls and ps can list database files and processes. Logical data such as a table is meaningful only for the database. A SQL statement can list the tables in an Oracle database, but an operating system utility cannot. The database has physical structures and logical structures. Because the physical and logical structures are separate, you can manage the physical storage of data without affecting access to logical storage structures. For example, renaming a physical database file does not rename the tables whose data is stored in this file.

 Data blocks At the finest level of granularity, Oracle Database data is stored in data blocks. One data block corresponds to a specific number of bytes on disk.  Extents An extent is a specific number of logically contiguous data blocks, obtained in a single allocation, used to store a specific type of information.  Segments A segment is a set of extents allocated for a user object (for example, a table or index), undo data, or temporary data.  Tablespaces A database is divided into logical storage units called tablespaces. A tablespace is the logical container for a segment. Each tablespace consists of at least one data file. See Also: "Logical Storage Structures"

Database Instance Structures

An Oracle database uses memory structures and processes to manage and access the database. All memory structures exist in the main memory of the computers that constitute the RDBMS. When applications connect to an Oracle database, they connect to a database instance. The instance services applications by allocating other memory areas in addition to the SGA, and starting other processes in addition to background processes. Oracle Database Processes A process is a mechanism in an operating system that can run a series of steps. Some operating systems use the terms job, task, or thread. For the purposes of this topic, a thread is equivalent to a process. An Oracle database instance has the following types of processes:  Client processes These processes are created and maintained to run the software code of an application program or an Oracle tool. Most environments have separate computers for client processes.

 Background processes These processes consolidate functions that would otherwise be handled by multiple Oracle Database programs running for each client process. Background processes asynchronously perform I/O and monitor other Oracle Database processes to provide increased parallelism for better performance and reliability.  Server processes These processes communicate with client processes and interact with Oracle Database to fulfill requests. Oracle processes include server processes and background processes. In most environments, Oracle processes and client processes run on separate computers. See Also: "Process Architecture" Instance Memory Structures Oracle Database creates and uses memory structures for program code, data shared among users, and private data areas for each connected user. The following memory structures are associated with a database instance:  System Global Area (SGA) The SGA is a group of shared memory structures that contain data and control information for one database instance. Examples of SGA components include the database buffer cache and shared SQL areas. Starting in Oracle Database 12c Release 1 (12.1.0.2), the SGA can contain an optional In-Memory Column Store (IM column store), which enables data to be populated in memory in a columnar format.  Program Global Areas (PGA) A PGA is a memory region that contains data and control information for a server or background process. Access to the PGA is exclusive to the process. Each server process and background process has its own PGA. See Also: "Memory Architecture"

Application and Networking Architecture

Communication protocols define the way that data is transmitted and received on a network. Oracle Net Services supports communications on all major network protocols, including TCP/IP, HTTP, FTP, and WebDAV. Oracle Net, a component of Oracle Net Services, establishes and maintains a network session from a client application to a database server. After a network session is established, Oracle Net acts as the data courier for both the client application and the database server, exchanging messages between them. Oracle Net can perform these jobs because it is located on each computer in the network. An important component of Net Services is the Oracle Net Listener (called the listener), which is a process that runs on the database or elsewhere in the network. Client applications send connection requests to the listener, which manages the traffic of these requests to the database. When a connection is established, the client and database communicate directly. The most common ways to configure an Oracle database to service client requests are:  Dedicated server architecture Each client process connects to a dedicated server process. The server process is not shared by any other client for the duration of the client's session. Each new session is assigned a dedicated server process.  Shared server architecture The database uses a pool of shared server processes for multiple sessions. A client process communicates with a dispatcher, which is a process that enables many clients to connect to the same database instance without the need for a dedicated server process for each client. See Also:  "Overview of Oracle Net Services Architecture"  Oracle Database Net Services Administrator's Guide to learn more about Oracle Net architecture  Oracle XML DB Developer’s Guide for information about using WebDAV with the database

Multitenant Architecture

The multitenant architecture enables an Oracle database to be a multitenant container database (CDB). A CDB is a single physical database that contains zero, one, or many user-created pluggable databases. A pluggable database (PDB) is a portable collection of schemas, schema objects, and

nonschema objects that appears to an Oracle Net client as a non-CDB. A non-CDB is a traditional Oracle database that cannot contain PDBs. Starting in Oracle Database 12c, you must create a database as either a CDB or non-CDB. You can plug a non-CDB into a CDB as a PDB. To move a PDB to a non-CDB, you must use Oracle Data Pump. By consolidating multiple physical databases on separate computers into a single database on a single computer, the multitenant architecture provides the following benefits:  Cost reduction for hardware  Easier and more rapid movement of data and code  Easier management and monitoring of the physical database  Separation of data and code  Separation of duties between a PDB administrator, who manages only the PDBs to which she or he is granted privileges, and the CDB administrator, who manages the entire CDB Benefits for manageability include:  Easier upgrade of data and code by unplugging and plugging in PDBs  Easier testing by using PDBs for development before plugging them in to the production CDB  Ability to flash back an individual PDB to a previous SCN  Ability to set performance limits for memory and I/O at the PDB level  Ability to install, upgrade, and manage a master application definition within an application container, which is a set of PDBs plugged in to a common application root Example 1-1 Non-CDB Architecture Figure 1-2 shows two separate non-CDBs: hr and sales. Each non-CDB has its own memory and set of database files, and resides on its own computer. Each non-CDB has its own dedicated user application. Figure 1-2 Non-CDBs Description of "Figure 1-2 Non-CDBs" Example 1-2 Multitenant Architecture

The documentation set is designed with specific access paths to ensure that users are able to find the information they need as efficiently as possible. The documentation set is divided into three layers or groups: basic, intermediate, and advanced. Users begin with the manuals in the basic group, proceed to the manuals in the intermediate group (the 2 Day + series), and finally to the advanced manuals, which include the remainder of the documentation.

Oracle Database Documentation: Basic Group

Technical users who are new to Oracle Database begin by reading one or more manuals in the basic group from cover to cover. Each manual in this group is designed to be read in two days. In addition to this manual, the basic group includes the manuals shown in the following table. Table 1-1 Basic Group Manual Description Oracle Database 2 Day DBA A database administrator (DBA) is responsible for the overall operation of Oracle Database. This task-based quick start teaches DBAs how to perform daily database administrative tasks using Oracle Enterprise Manager Database Express (EM Express). The manual teaches DBAs how to perform all typical administrative tasks needed to keep the database operational, including how to perform basic troubleshooting and performance monitoring activities. Oracle Database 2 Day Developer's Guide This task-based quick start guide explains how to use the basic features of Oracle Database through SQL and PL/SQL. The manuals in the basic group are closely related, which is reflected in the number of cross- references. For example, Oracle Database Concepts frequently sends users to a 2 Day manual to learn how to perform a task based on a concept. The 2 Day manuals frequently reference Oracle Database Concepts for conceptual background about a task.

Oracle Database Documentation: Intermediate Group

The next step up from the basic group is the intermediate group. Manuals in the intermediate group are prefixed with the word 2 Day + because they expand on and assume information contained in the 2 Day manuals. The 2 Day + manuals cover topics in more depth than is possible in the basic manuals, or cover topics of special interest.

As shown in the following table, the 2 Day + manuals are divided into manuals for DBAs and developers. Table 1-2 Intermediate Group: 2 Day + Guides Database Administrators Database Developers Oracle Database 2 Day + Performance Tuning Guide Oracle Database 2 Day + Java Developer's Guide Oracle Database 2 Day + Real Application Clusters Guide Oracle Database 2 Day + PHP Developer's Guide Oracle Database 2 Day + Security Guide

Oracle Database Documentation: Advanced Group

The advanced group manuals are intended for expert users who require more detailed information about a particular topic than can be provided by the 2 Day + manuals. The following table lists essential reference manuals in the advanced group. Table 1-3 Essential Reference Manuals Manual Description Oracle Database SQL Language Reference This manual is the definitive source of information about Oracle SQL. Oracle Database Reference The manual is the definitive source of information about initialization parameters, data dictionary views, dynamic performance views, wait events, and background processes. The advanced guides are too numerous to list in this section. The following table lists guides that the majority of expert Oracle DBAs use. Table 1-4 Advanced Group for DBAs