0 ratings0% found this document useful (0 votes) 415 views322 pagesOracledba12c Uclid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Syed Maza por Haar
Oracle 12c: Database Administration
Student Guide
® Uciid IT School
Learn trom IT Professionals
101,304 Sree Swathi Anukar, Adj.Aditya Trade Center, Ameerpet
Pty:040-6636 2777, 040-8637 2778
Copy right © 2043 Uciid IT School. All rights reserved,
This document is proprietary of Uclid IT School and protected by intellectual property laws This document
1s provides to Uctid's students for the sole purpose of fearing the concepts related Oracle database
administration, You should not copy. reproduce, translate, broadcast, mediy, transmit, distribute, exhibit,
perform publish, of display any part of this document, in any form, of by any means
'5 2 registered traslemark of Oracle Corporation andlor ts affilates. Other names may de
rks of their respective ovners
he information contained herein is subject ro charge without notice and is not warranted to be error-free,
Si you find any errors, please report them 0 us in wrtingiclid IT Schoo!
Contents
INTRODUCTION TO ORACLE DATABASE..
ORACLE DATABASE ARCHITECTURE.
ORACLE DATABASE 12¢ INSTALLATION.
DATABASE STARTUP & SHUTDOWN.
INITIALIZATION PARAMETERS.
DATA DICTIONARY.
MANAGING DIAGNOSTIC DATA
‘TABLESPACES AND DATA FILES.
UNDO TABLESPACE
‘TEMPORARY TABLESPACES
CONTROL FILES
REDO L0G FILES.
ARCHIVING
ORACLE NET SERVICES
DISTRIBUTED DATABASI
BACKUP & RECOVER)
FLASHBACK TECHNOLOGIES..
ORACLE DATA PUMP.
TRANSPORTING DATA.
CLONING .senntnn
DATABASE PATCHING ..
DATABASE UPGRADE.
DATA GUARD
PERPORMAN:
MULTITENANT ARCHITECTURE ..
Page 20f 321Uctid IT Schoo! DBA Student Guide
Introduction to Oracle Database
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 lor storing and
processing information.
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
A database management system (DBMS) is software that controls the storage, organization, and retrieval
of data. Typically, a DBMS has the following elements:
+ Kemet code
This code manages memory and storage for the DBMS.
+ Repository of metadata
-This repository is usually called a data dictionary,
+ Query language
This “oat ‘enphjas.ysers tp.access the datas
i ¢ 4 ah
A database appicatidy,d Asotthar Modan nat interSbh wil a dante of abcoss and manipulate
data. The hist generation of database managemert systems included the folowing 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 similas to a hierarchical database, except records have many-to-many
rather than 2 one-lo-many relationship,
‘The preceding database management systems stored data in igid, predetermined relationships, Because
no data definition language existed, changing the structure of the data was dificult Also. these systems
Jacked 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 s,
the relational model
A relational database is @ database that contorms to the relationa! model, The retationzal modal has the
following major aspects
+ Structures
Welldefined objects store or access the data of a database.Uslid 1T Schoo! DBA Student Guide
= Operations
Clearly defined actions enable users 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 cow ia @ table has the same set of columns. A relational
database is a database that stores data in relations (tables). For example, a relational database could
store information about company employees in an employee table, depanment table, and a salary table.
Reiationai Database Management System (RDBMS)
The relational model s the basis for a relational database management system (RDBMS), Essentially, an
RDBMS moves data into a database, stores the data, and retrieves it so that it can be manipufated by
applications. An RDBMS distinguishes between the folowing types of operations
+ Logical operations
In this case, a user specifies what content is required, For example, a user requests the names af
all employees or adds an employee record to a table.
+ Physics operations
Inthis case q roagpue 3 out he operation
For example, Atel dusel aubrbs FAindb io tins tne requesiod
rows, read th rol ahd veritanth fe velurring avesut
{0 tho user. The ROBMS stores and retieves data so hat physical operations are transparent (0
database apptcations
Oracle Database is an RDBMS. An RDBMS that implements object-oriented features such as user-
defined types, nhertance, and polmorphsn scaled an object relational database rranagemner system
(ORDBMS). Oracle Database has extended the relational madel to an object-relational model. making it
possible to store complex business models in 2 relational database.
Brief History of Oracie Database
Highlights in the evolution of Oracle Database include the following
Founding of Gracie
In 1977, Larry Ellison, Bob Miner, and Ed Oates started the consultancy Software Development
Laboratories, which became Relational Software, inc. (RSI), fr 1983, RSI became Oracle
‘Systems Corporation and then later Oracle Corporation.
* First commercially available ROBMS
In 1979, RSI introduced Oracle V2 (Version 2) as the first commercially available SQL-bases
RDBMS, a landmark event in the history of relational databases.
+ Portable version of Oracle Database
5.0 Page 4 of 321Ui IF Schoo! DBA Student Guide
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 contral, data distribution, and scalability
Version 4 introduced niti-version Tead consistency. Version 5, released in 1985, supported
client/server computing and distributed database systems, Version 6 brought enhancements to
disk V/O, row locking, scalability, and backup and recovery. Alea, Version 6 introduced the first
version of the PL/SQL language, a proprietary procedural extension to SQL.
+ PLISOL stored program units
Oracle?, released in 1982, introduced PLISOL stored procedures and riggers.
Objects and partitioning,
Oracle® was released in 1997 as the object-relational database, supporting many new data types.
Additionally, OracleB supported partitioning of large tables,
# taternet computing
OracleSi Database, released in 1999, pravided native suppor for internet protocols and serves-
Side support for Java, Oracle8i was designed for internet computing, enabling the database to be
deployed in a multtier environment
» onnnaldhde bbe eo CHOOL
racleSi Database introduced Oracle RAC in 2001, enabling mutiple instances to access a single
database simultaneously. Additionally, Oracle XML Database
(Oracle XL DB) introduced the abilty 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 selt-tuning, Oracle Automatic,
Storage Management (OracleASM) helped achieve this goal by virtualizing and simplifying
database storage management,
+ Manageabilly, diagnosabiliy, and availabilty
Oracle Database 119, released in 2007, introduced a host of new features that enable
administrators and developers to adapt quickly fo changing business requirements. The key to
adaptability is simplifying the information infrastructure by consolidating information and using
automation wherever possibie.
+ Database Consolidation
Oracle Database 12c, released in 2013, introduced Multitenant Architeclure to consolidate
multiple independent databases running on diferent servers into a Single container database thus
‘making Oracle12c as frst database for Cloud computing,
vse Page 5 of 321Uclid IT School DBA Student Guide
Oracle Database Architecture
A Database Server is the key lo information management. (n general, a server reliably manages a large
amount of data in a multiuser environment so that users can concurrently access the same data
Database server also prevents unauthorized access and provides efficient solutions for failure recovery.
Database and Instance
{An Oracle database server consists of a database and at least one database instance(commonly referred
to as simply an instance). Because an instance and a database are ¢o closely connected, the term Oracle
database is sometimes used to refer to both instance and database. Inthe stictest 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
Every running Oracle database is associated with at ieast one Oracle database instance
8 A ai ¢
instance contd lratidde) | te C H 6) O l
You can run Oracle Database in either ofthe following mutually exclusive Configurations:
‘+ Single-instance configuration
- A one-to-one relationship exists between the database and an instance
+ Oracle Real Application Clusters (Oracle RAC) configuration
A one-to-many relationship exists between the database and instances.
Single vance Dae Dracla RAS Baba
=
Vso Page 6 of 321Uclid IT Schoo! DBA Student Guide
‘Whether in a single-instance or Oracle RAC configuration, a database instance is associated ‘vith only
one database at a time. You can start a database instance and mourtt (associate the instance with) one
database, but riot mount two databases simultaneously with the same instance, Multiple instances can
run concurrently on the same computer, each accessing its own database
Because an instance exists in memory and a database exists on disk, an instance can exist without 3
database and a database can exist without an instance,
The following diagrarn shows the Instance and Database locations in a system
i ance
Memory
Disk
oa gato
es) es
1 asst aes
ey
Database... rsh pa gm ah
‘An Oracle Database a af odes ft Spree daa fsbo. Every Orae
Bronte sims fab ish Spe pied et Spf webe oro Ose
files) “ “
+ Data files
A data file is a physical file on disk that was created by Oracle Database and contains data
structures such a¢ tables and indexes. At the operating system level, Oracle Database stores
database data in deta files. Every database must Nave at least one data file.
+ Control files
A contro! file is a root file Yhat tracks the physical components of the database
Online cedo log files
The online redo log is a set of files containing records of changes made to data
Data Dictionary
‘An important part of an Oracle database is its data dictionary, which isa read-only set of tables that
provides administrative metadata about the database. A data dictionary contains information such as the
folowing
+The definitions of eve y schema object in the database, including default values for columns and
integrity constraint information
©The amourt of space allocated for and currently used by the schema abjectsUciid IT Schoo} DBA Student Guide
+The names of Oracle Database users, privileges and roles granted to users, and auditing
information related to users
The data dictionary is a central part of data managernent for every Oracle database. For example, the
database performs the following actions:
+ Accesses the data dictionary to find information about users, schema objects, and storage
structures
‘+ Modifies data dictionary to reflect changes in database structures, auditing, grants, and data.
Because Oracle Database stores data dictionary data in tables, just lke other data, users can query the
data with SQL. For example, users can run SELECT statements to determine their privileges, which
tables exist in their schema, which columns are in these tables, whether indexes are built on these
columns, and go on.
‘The data dictionary base tables are the first objects created in any Oracle database. All data dictionary
tables and views for 2 database are stored in the SYSTEM tablespace and owned by SYS user. Because
the SYSTEM tablespace is always online when the database is open, the data dictionary is always
available when the database is open.
‘Much of the data dictionary information is in the data dictionary cache because the database constantly
requires the information to validate user access and verify the state of schema objects,
Only Oracie Databasefsngufl wife Pell 8208 dict fy in He Database user
should ever alter rows'br Sehemd ob} in nesys uch activity can
compromise data integri
Instance
{A database instance is 2 Set of memory structures that manage database files, When an instance is
started, Oracle Database allocates a shared memory area called the System Global Area (SGA) and
starts one or more Background Processes,
All memory structures exist in the main memory of the computers thal constitute the ROBMS.
When applications connect to an Oracle Database, they are connected to 2 database instance. The
instance services applications by allocating ather memory areas in addition to the SGA, and starting other
processes in addition to background pracesses,
All memory structures exist in the main memory of the computers that constitute the database server.
Processes are jobs that work in the memory of these computers. A process is defined as 2 ‘thread of
control” or a meshanism in an operating systent that can run a series of steps.
Oracle Database Memory Structures
Oracle Database creates and uses memory structures for various purpases. For example, memory sores
program code being run, data thet is shared among users, and private Gata areas for each connected
ser
‘Two basic memory stuctures are associated with an instance
vsUclid IT Schoo! 7 DBA Student Guide
+ System Giobal Area (SGA): Group of shared memory structures, known as SGA components.
that contain data and control information for one Oracle Database instance. The SGA is shared
‘by alk server and background processes. Examples of data stored in the SGA include cached
data blocks and shared SQL areas.
‘+ Program Global Areas (PGA): Memory regions that contain data and control information for &
server oF background process, A PGA is non-shared memory created by Oracle Database when
a server or background process is started, Access to the PGA is exclusive to the server process,
Each server process and background process has its own PGA.
Overview of System Gioba! Area (SGA)
‘SGA is the shared memory structure that contain data and control information for one Oracle Database
instance. SGA is a read/write memory area that, along with the Oracle background processes, make up 2
database instance. All server procasses that execute on behalf of users can read information in the
instance SGA, Several processes write to the SGA during database operation.
The server and background processes do not reside within the SGA, but exist in a Separate memory
space. Each database instance has its own SGA. Oracle Database automatically allocates memory for an
SGA at instance startup and reclaims the memory af instance shutdown,
SGA consists of several memory components, which are pools of memory usid ta Satisfy @ particular
lass of memory allocation requests.
All SGA components except the reda log buffer allocate and deallocate space in units of contiguous
memory called granules.
mae Tr “| etre CHOOT Schoue
Database Buffer Cache
Redo Log Butter
‘Shared Poo!
Large Poot
Java Pool
Streams Pool
Fixed SGA\
‘The following diagram shows the Instance, SGA and components of SGA,
Page 9 of 321Uclid IT Schoot DBA Student Guide
Instance
‘System Global Area (SGA)
rae Memory
iO Butler area
/ UGA
{OER
» fee [eae]
ee ee
| tie | (amas | ax |e Se
Boot
efor
iB
ESE |
SUL Work areas
‘Session Memory [pre
Database Buffer Cache
The database buffer cache is the portion of the SGA that halds copies of data blocks that are read frorn
ata files, All users who are concurrently connested to the instance share access to the database buffer
ache
Page 10 of 321