SlideShare una empresa de Scribd logo
1 de 27
Introduction to OracleIntroduction to Oracle
 Physical StructurePhysical Structure
 Logical StructureLogical Structure
 SGA / PGASGA / PGA
 Background ProcessesBackground Processes
Backup MethodsBackup Methods
 Computer Science Database – CS01Computer Science Database – CS01
 Administrative TasksAdministrative Tasks
Physical StructuresPhysical Structures
 Datafiles (*.dbf)Datafiles (*.dbf)
 The datafiles contain all the database data. The data of logical databaseThe datafiles contain all the database data. The data of logical database
structures, such as tables and indexes, is physically stored in the datafilesstructures, such as tables and indexes, is physically stored in the datafiles
allocated for a database.allocated for a database.
 Control Files (*.ctl)Control Files (*.ctl)
 Every Oracle database has a control file. A control file contains entries thatEvery Oracle database has a control file. A control file contains entries that
specify the physical structure of the database such as Database name and thespecify the physical structure of the database such as Database name and the
Names and locations of datafiles and redo log files.Names and locations of datafiles and redo log files.
 Redo Log Files (*.log)Redo Log Files (*.log)
 The primary function of the redo log is to record all changes made to data. If aThe primary function of the redo log is to record all changes made to data. If a
failure prevents modified data from being permanently written to the datafiles,failure prevents modified data from being permanently written to the datafiles,
then the changes can be obtained from the redo log, so work is never lost.then the changes can be obtained from the redo log, so work is never lost.
Physical Structures (cont’d)Physical Structures (cont’d)
 Archive Log Files (*.log)Archive Log Files (*.log)
 Oracle automatically archives log files when the database is in ARCHIVELOGOracle automatically archives log files when the database is in ARCHIVELOG
mode. This prevents oracle from overwriting the redo log files before they havemode. This prevents oracle from overwriting the redo log files before they have
been safely archived to another location.been safely archived to another location.
 Parameter Files (initSID.ora)Parameter Files (initSID.ora)
 Parameter files contain a list of configuration parameters for that instance andParameter files contain a list of configuration parameters for that instance and
database.database.
 Alert and Trace Log Files (*.trc)Alert and Trace Log Files (*.trc)
 Each server and background process can write to an associated trace file. When an internalEach server and background process can write to an associated trace file. When an internal
error is detected by a process, it dumps information about the error to its trace file. The alerterror is detected by a process, it dumps information about the error to its trace file. The alert
log of a database is a chronological log of messages and errors.log of a database is a chronological log of messages and errors.
Logical StructuresLogical Structures
 TablespacesTablespaces
 A database is divided into logical storage units called tablespaces, which groupA database is divided into logical storage units called tablespaces, which group
related logical structures together. One or more datafiles are explicitly created forrelated logical structures together. One or more datafiles are explicitly created for
each tablespace to physically store the data of all logical structures in aeach tablespace to physically store the data of all logical structures in a
tablespace.tablespace.
 Oracle Data BlocksOracle Data Blocks
 At the finest level of granularity, Oracle database data is stored in 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 of physical databaseOne data block corresponds to a specific number of bytes of physical database
space on disk. The standard block size is specified by the DB_BLOCK_SIZEspace on disk. The standard block size is specified by the DB_BLOCK_SIZE
initialization parameter.initialization parameter.
Logical Structures (cont’d)Logical Structures (cont’d)
 ExtentsExtents
 The next level of logical database space is an extent. An extent is a specificThe next level of logical database space is an extent. An extent is a specific
number of contiguous data blocks, obtained in a single allocation, used to store anumber of contiguous data blocks, obtained in a single allocation, used to store a
specific type of information.specific type of information.
 SegmentsSegments
 Above extents, the level of logical database storage is a segment. A segment isAbove extents, the level of logical database storage is a segment. A segment is
a set of extents allocated for a certain logical structure. The different types ofa set of extents allocated for a certain logical structure. The different types of
segments are :segments are :
 Data segment – stores table dataData segment – stores table data
 Index segment – stores index dataIndex segment – stores index data
 Temporary segment – temporary space used during SQL executionTemporary segment – temporary space used during SQL execution
 Rollback Segment – stores undo informationRollback Segment – stores undo information
Logical Structures (cont’d)Logical Structures (cont’d)
 Schema OverviewSchema Overview
 A schema is a collection of database objects. A schema is owned by a databaseA schema is a collection of database objects. A schema is owned by a database
user and has the same name as that user. Schema objects are the logicaluser and has the same name as that user. Schema objects are the logical
structures that directly refer to the database's data. Schema objects includestructures that directly refer to the database's data. Schema objects include
structures like tables, views, and indexes.structures like tables, views, and indexes.
Oracle InstanceOracle Instance
An Oracle database server consists of anAn Oracle database server consists of an
Oracle database and an Oracle instance.Oracle database and an Oracle instance.
Every time a database is started, a systemEvery time a database is started, a system
global area (SGA) is allocated and Oracleglobal area (SGA) is allocated and Oracle
background processes are started. Thebackground processes are started. The
combination of the background processescombination of the background processes
and memory buffers is called an Oracleand memory buffers is called an Oracle
instance.instance.
System Global Area (SGA)System Global Area (SGA)
The System Global Area (SGA) is a shared memory region that contains data andThe System Global Area (SGA) is a shared memory region that contains data and
control information for one Oracle instance. Users currently connected to an Oraclecontrol information for one Oracle instance. Users currently connected to an Oracle
database share the data in the SGA. The SGA contains the following memorydatabase share the data in the SGA. The SGA contains the following memory
structures :structures :
 Database Buffer CacheDatabase Buffer Cache
 Database buffers store the most recently used blocks of data. The set ofDatabase buffers store the most recently used blocks of data. The set of
database buffers in an instance is the database buffer cache. The buffer cachedatabase buffers in an instance is the database buffer cache. The buffer cache
contains modified as well as unmodified blocks. Because the most recently (andcontains modified as well as unmodified blocks. Because the most recently (and
often, the most frequently) used data is kept in memory, less disk I/O isoften, the most frequently) used data is kept in memory, less disk I/O is
necessary, and performance is improved.necessary, and performance is improved.
System Global Area (cont’d)System Global Area (cont’d)
 Redo Log Buffer of the SGARedo Log Buffer of the SGA
 The redo log buffer stores redo entries—a log of changes made to the database.The redo log buffer stores redo entries—a log of changes made to the database.
The redo entries stored in the redo log buffers are written to an online redo log,The redo entries stored in the redo log buffers are written to an online redo log,
which is used if database recovery is necessary. The size of the redo log iswhich is used if database recovery is necessary. The size of the redo log is
static.static.
 Shared Pool of the SGAShared Pool of the SGA
 The shared pool contains shared memory constructs, such as shared SQL areas.The shared pool contains shared memory constructs, such as shared SQL areas.
A shared SQL area is required to process every unique SQL statement submittedA shared SQL area is required to process every unique SQL statement submitted
to a database. A shared SQL area contains information such as the parse treeto a database. A shared SQL area contains information such as the parse tree
and execution plan for the corresponding statement.and execution plan for the corresponding statement.
Program Global Area (PGA)Program Global Area (PGA)
PGA is a memory buffer that contains data and control information for aPGA is a memory buffer that contains data and control information for a
server process. A server process is a process that services a client’sserver process. A server process is a process that services a client’s
requests. A PGA is created by oracle when a server process is started. Therequests. A PGA is created by oracle when a server process is started. The
information in a PGA depends on the oracle configuration. The PGA area isinformation in a PGA depends on the oracle configuration. The PGA area is
a non-shared area of memory created by oracle when a server process isa non-shared area of memory created by oracle when a server process is
started.started.
The basic difference between SGA and PGA is that PGA cannot be sharedThe basic difference between SGA and PGA is that PGA cannot be shared
between multiple processes in the sense that it is used only forbetween multiple processes in the sense that it is used only for
requirements of a particular process whereas the SGA is used for the wholerequirements of a particular process whereas the SGA is used for the whole
instance and it is shared.instance and it is shared.
Oracle Background ProcessesOracle Background Processes
An Oracle database uses memory structures and processes to manage and accessAn Oracle database uses memory structures and processes to manage and access
the database. All memory structures exist in the main memory of the computers thatthe database. All memory structures exist in the main memory of the computers that
constitute the database system. Processes are jobs that work in the memory of theseconstitute the database system. Processes are jobs that work in the memory of these
computers.computers.
Oracle creates a set of background processes for each instance. The backgroundOracle creates a set of background processes for each instance. The background
processes consolidate functions that would otherwise be handled by multiple Oracleprocesses consolidate functions that would otherwise be handled by multiple Oracle
programs running for each user process. They asynchronously perform I/O andprograms running for each user process. They asynchronously perform I/O and
monitor other Oracle processes to provide increased parallelism for bettermonitor other Oracle processes to provide increased parallelism for better
performance and reliability.performance and reliability.
The most common background processes are :The most common background processes are :
 System Monitor – SMONSystem Monitor – SMON
 This database background process performs instance recovery at the start of theThis database background process performs instance recovery at the start of the
database. SMON also cleans up temporary segments that are no longer in usedatabase. SMON also cleans up temporary segments that are no longer in use
and recovers dead transactions skipped during crash and instance recoveryand recovers dead transactions skipped during crash and instance recovery
because of file-read or offline errors. It coalesces i.e. combines contiguous freebecause of file-read or offline errors. It coalesces i.e. combines contiguous free
extents into larger free extents.extents into larger free extents.
Background Processes (cont’d)Background Processes (cont’d)
 Process Monitor - PMONProcess Monitor - PMON
 This database background process cleans up failed user processes. PMON isThis database background process cleans up failed user processes. PMON is
responsible for releasing the lock i.e. cleaning up the cache and freeingresponsible for releasing the lock i.e. cleaning up the cache and freeing
resources that the process was using. Its effect can be seen when a processresources that the process was using. Its effect can be seen when a process
holding a lock is killed.holding a lock is killed.
 Database Writer - DBWRDatabase Writer - DBWR
 This background process is responsible for managing the contents of the dataThis background process is responsible for managing the contents of the data
block buffer cache and dictionary cache. DBWR performs batch writes ofblock buffer cache and dictionary cache. DBWR performs batch writes of
changed block. Since Oracle uses write-ahead logging, DBWR does not need tochanged block. Since Oracle uses write-ahead logging, DBWR does not need to
write blocks when a transaction commits. In the most common case, DBWRwrite blocks when a transaction commits. In the most common case, DBWR
writes only when more data needs to be read into the system global area and toowrites only when more data needs to be read into the system global area and too
few database buffers are free. The least recently used data is written to thefew database buffers are free. The least recently used data is written to the
datafiles first.datafiles first.
 Although there is only one SMON and one PMON process running per databaseAlthough there is only one SMON and one PMON process running per database
instance, one can have multiple DBWR processes running at the same time.instance, one can have multiple DBWR processes running at the same time.
Note the number of DBWR processes running is set via theNote the number of DBWR processes running is set via the
DB_WRITER_PROCESSES.DB_WRITER_PROCESSES.
Background Processes (cont’d)Background Processes (cont’d)
 Log Writer - LGWRLog Writer - LGWR
 This background process manages the writing of the contents of the redo logThis background process manages the writing of the contents of the redo log
buffer to the online redo log files. LGWR writes the log entries in batch form. Thebuffer to the online redo log files. LGWR writes the log entries in batch form. The
Redo log buffers entries always contain the most up-to-date status of theRedo log buffers entries always contain the most up-to-date status of the
database.database.
 Archiver - ARCHArchiver - ARCH
 The Archiver process reads the redo log files once Oracle has filled them andThe Archiver process reads the redo log files once Oracle has filled them and
writes a copy of the used redo log files to the specified archive log destination(s).writes a copy of the used redo log files to the specified archive log destination(s).
Actually, for most databases, ARCH has no effect on the overall systemActually, for most databases, ARCH has no effect on the overall system
performance. On some large database sites, however, archiving can have anperformance. On some large database sites, however, archiving can have an
impact on system performance.impact on system performance.
Background Processes (cont’d)Background Processes (cont’d)
 Checkpoint - CKPTCheckpoint - CKPT
 All modified information in database buffer in the SGA is written to the datafilesAll modified information in database buffer in the SGA is written to the datafiles
by a database write process (DBWR). This event indicates a checkpoint. Theby a database write process (DBWR). This event indicates a checkpoint. The
checkpoint process is responsible for signaling DBWR at checkpoints andcheckpoint process is responsible for signaling DBWR at checkpoints and
updating all of the datafiles and control files of the database.updating all of the datafiles and control files of the database.
 Recover - RECORecover - RECO
 The recover process automatically cleans up failed or suspended distributedThe recover process automatically cleans up failed or suspended distributed
transactions.transactions.
 Job Queue ProcessesJob Queue Processes
 Job queue processes are used for batch processing. They run user jobs. TheyJob queue processes are used for batch processing. They run user jobs. They
can be viewed as a scheduler service that can be used to schedule jobs ascan be viewed as a scheduler service that can be used to schedule jobs as
PL/SQL statements or procedures on an Oracle instance. Given a start date andPL/SQL statements or procedures on an Oracle instance. Given a start date and
an interval, the job queue processes try to run the job at the next occurrence ofan interval, the job queue processes try to run the job at the next occurrence of
the interval.the interval.
Computer Science DatabaseComputer Science Database
Server InformationServer Information
 Sun e4500Sun e4500
 8GB Ram8GB Ram
 8 x 400mhz CPU8 x 400mhz CPU
 32GB Disk for32GB Disk for
OracleOracle
 4mm DAT DDS34mm DAT DDS3
Tape BackupTape Backup
Computer Science DatabaseComputer Science Database
 Instance Name : CS01 (v$database)Instance Name : CS01 (v$database)
 Instance Version : 8.1.6.0.0Instance Version : 8.1.6.0.0
 Tablespaces : (dba_tablespaces)Tablespaces : (dba_tablespaces)
 SYSTEM – holds all system tablesSYSTEM – holds all system tables
 INDEX01 – user indexesINDEX01 – user indexes
 USERS01 – user tablesUSERS01 – user tables
 USERS02 – user tables (faculty)USERS02 – user tables (faculty)
 RBS – rollback segmentsRBS – rollback segments
Backup MethodsBackup Methods
 Cold Backup (aka Consistent Backups)Cold Backup (aka Consistent Backups)
 The only way to make a consistent whole databaseThe only way to make a consistent whole database
backup is to shut down the database with thebackup is to shut down the database with the
NORMAL, IMMEDIATE, or TRANSACTIONALNORMAL, IMMEDIATE, or TRANSACTIONAL
options and make the backup while the database isoptions and make the backup while the database is
closed.closed.
 Advantage : No recovery is required after datafiles areAdvantage : No recovery is required after datafiles are
restored – quicker restorerestored – quicker restore
 Disadvantage : No access to database during backupDisadvantage : No access to database during backup
time (depends on size/system speed)time (depends on size/system speed)
Backup Methods (cont’d)Backup Methods (cont’d)
 Hot Backup (aka Inconsistent Backups)Hot Backup (aka Inconsistent Backups)
 If the database must be up and running 24 hours aIf the database must be up and running 24 hours a
day, seven days a week, then you have no choice butday, seven days a week, then you have no choice but
to perform inconsistent backups of the wholeto perform inconsistent backups of the whole
database. A backup of online datafiles is called andatabase. A backup of online datafiles is called an
online backup. This requires that you run youronline backup. This requires that you run your
database in ARCHIVELOG mode.database in ARCHIVELOG mode.
 Advantage : Database remains open during backupAdvantage : Database remains open during backup
 Disadvantage : Large databases may haveDisadvantage : Large databases may have
performance impact during backup, recovery takesperformance impact during backup, recovery takes
longer and islonger and is slightlyslightly more complexmore complex
Backup Methods (cont’d)Backup Methods (cont’d)
 Logical backup (Export)Logical backup (Export)
 Logical backups are exports of schema objects, likeLogical backups are exports of schema objects, like
tables and stored procedures, into a binary file.tables and stored procedures, into a binary file.
Oracle utilities are used to move Oracle schemaOracle utilities are used to move Oracle schema
objects in and out of Oracle.objects in and out of Oracle.
 Not recommended for backup of a whole database,Not recommended for backup of a whole database,
but useful for backing up individual objects orbut useful for backing up individual objects or
schemas or moving data into another databaseschemas or moving data into another database
Administrative TasksAdministrative Tasks
 Daily ChecksDaily Checks
 Check database availabilityCheck database availability
 Check logs / trace filesCheck logs / trace files
 Check free space / resourcesCheck free space / resources
 Check for invalid objectsCheck for invalid objects
 Check for broken jobsCheck for broken jobs
 Verify backupVerify backup
Administrative Tasks (cont’d)Administrative Tasks (cont’d)
 Weekly TasksWeekly Tasks
 Collect statistics (database job)Collect statistics (database job)
 Archive / delete log filesArchive / delete log files
 Run performance reports (statspack)Run performance reports (statspack)
Administrative Tasks (cont’d)Administrative Tasks (cont’d)
 OthersOthers
 Applying patchesApplying patches
 Database upgradesDatabase upgrades
 New Database installationsNew Database installations
 Creating user accountsCreating user accounts
More InformationMore Information
 Oracle 10g Release 2 Database DocumentationOracle 10g Release 2 Database Documentation
 http://www.oracle.com/pls/db102/http://www.oracle.com/pls/db102/
 Oracle Database / SQL HelpOracle Database / SQL Help
 http://asktom.oracle.com/http://asktom.oracle.com/
 http://www.oracle.com/technology//index.htmlhttp://www.oracle.com/technology//index.html
 *FREE* Oracle Software Downloads*FREE* Oracle Software Downloads
 http://www.oracle.com/technology/software/index.htmlhttp://www.oracle.com/technology/software/index.html
 Oracle Database 10g Express EditionOracle Database 10g Express Edition
 Oracle SQL DeveloperOracle SQL Developer
 This DocumentThis Document
 Computer Science Homepage -> On-Line helpComputer Science Homepage -> On-Line help

Más contenido relacionado

La actualidad más candente

Oracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsYogiji Creations
 
576 oracle-dba-interview-questions
576 oracle-dba-interview-questions576 oracle-dba-interview-questions
576 oracle-dba-interview-questionsNaveen P
 
Oracle Database Introduction
Oracle Database IntroductionOracle Database Introduction
Oracle Database IntroductionChhom Karath
 
Oracle dba interview question
Oracle dba interview questionOracle dba interview question
Oracle dba interview questionAmarendra Sharma
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architectureAmrit Kaur
 
Oracle10g New Features I
Oracle10g New Features IOracle10g New Features I
Oracle10g New Features IDenish Patel
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questionsNaveen P
 
Oracle dba interview
Oracle dba interviewOracle dba interview
Oracle dba interviewNaveen P
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview QuestionsNaveen P
 
Introduction to Oracle Database
Introduction to Oracle DatabaseIntroduction to Oracle Database
Introduction to Oracle Databasepuja_dhar
 
Oracle training-in-hyderabad
Oracle training-in-hyderabadOracle training-in-hyderabad
Oracle training-in-hyderabadsreehari orienit
 
Bt0066 database management system1
Bt0066 database management system1Bt0066 database management system1
Bt0066 database management system1Techglyphs
 

La actualidad más candente (13)

Oracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creations
 
576 oracle-dba-interview-questions
576 oracle-dba-interview-questions576 oracle-dba-interview-questions
576 oracle-dba-interview-questions
 
Oracle Database Introduction
Oracle Database IntroductionOracle Database Introduction
Oracle Database Introduction
 
Oracle dba interview question
Oracle dba interview questionOracle dba interview question
Oracle dba interview question
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba training
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architecture
 
Oracle10g New Features I
Oracle10g New Features IOracle10g New Features I
Oracle10g New Features I
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questions
 
Oracle dba interview
Oracle dba interviewOracle dba interview
Oracle dba interview
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview Questions
 
Introduction to Oracle Database
Introduction to Oracle DatabaseIntroduction to Oracle Database
Introduction to Oracle Database
 
Oracle training-in-hyderabad
Oracle training-in-hyderabadOracle training-in-hyderabad
Oracle training-in-hyderabad
 
Bt0066 database management system1
Bt0066 database management system1Bt0066 database management system1
Bt0066 database management system1
 

Similar a Introduction to oracle

ORACLE Architechture.ppt
ORACLE Architechture.pptORACLE Architechture.ppt
ORACLE Architechture.pptaggarwalb
 
Sql introduction
Sql introductionSql introduction
Sql introductionvimal_guru
 
DBA 101 : Calling all New Database Administrators (WP)
DBA 101 : Calling all New Database Administrators (WP)DBA 101 : Calling all New Database Administrators (WP)
DBA 101 : Calling all New Database Administrators (WP)Gustavo Rene Antunez
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabadunited global soft
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadUgs8008
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba trainingUgs8008
 
Ora01_OraArc.pdf
Ora01_OraArc.pdfOra01_OraArc.pdf
Ora01_OraArc.pdfNamNguynMu
 
Oracle DBA Online Trainingin India
Oracle DBA Online Trainingin IndiaOracle DBA Online Trainingin India
Oracle DBA Online Trainingin Indiaunited global soft
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabadunited global soft
 
Oracle Database Architecture
Oracle Database ArchitectureOracle Database Architecture
Oracle Database ArchitectureHamzaakmak1
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle DatabaseMeysam Javadi
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overviewhonglee71
 
Database Administrator interview questions and answers
Database Administrator interview questions and answersDatabase Administrator interview questions and answers
Database Administrator interview questions and answersMLR Institute of Technology
 
Oracle db architecture
Oracle db architectureOracle db architecture
Oracle db architectureSimon Huang
 

Similar a Introduction to oracle (20)

Introduction to oracle
Introduction to oracleIntroduction to oracle
Introduction to oracle
 
Oracle 10g Introduction 1
Oracle 10g Introduction 1Oracle 10g Introduction 1
Oracle 10g Introduction 1
 
ORACLE Architechture.ppt
ORACLE Architechture.pptORACLE Architechture.ppt
ORACLE Architechture.ppt
 
Sql introduction
Sql introductionSql introduction
Sql introduction
 
1650607.ppt
1650607.ppt1650607.ppt
1650607.ppt
 
DBA 101 : Calling all New Database Administrators (WP)
DBA 101 : Calling all New Database Administrators (WP)DBA 101 : Calling all New Database Administrators (WP)
DBA 101 : Calling all New Database Administrators (WP)
 
Oracle DB
Oracle DBOracle DB
Oracle DB
 
MS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTUREMS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTURE
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba training
 
Ora01_OraArc.pdf
Ora01_OraArc.pdfOra01_OraArc.pdf
Ora01_OraArc.pdf
 
Oracle DBA Online Trainingin India
Oracle DBA Online Trainingin IndiaOracle DBA Online Trainingin India
Oracle DBA Online Trainingin India
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
 
Oracle Database Architecture
Oracle Database ArchitectureOracle Database Architecture
Oracle Database Architecture
 
An Introduction To Oracle Database
An Introduction To Oracle DatabaseAn Introduction To Oracle Database
An Introduction To Oracle Database
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
Database Administrator interview questions and answers
Database Administrator interview questions and answersDatabase Administrator interview questions and answers
Database Administrator interview questions and answers
 
Oracle db architecture
Oracle db architectureOracle db architecture
Oracle db architecture
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
 

Último

How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Último (20)

How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 

Introduction to oracle

  • 1. Introduction to OracleIntroduction to Oracle  Physical StructurePhysical Structure  Logical StructureLogical Structure  SGA / PGASGA / PGA  Background ProcessesBackground Processes Backup MethodsBackup Methods  Computer Science Database – CS01Computer Science Database – CS01  Administrative TasksAdministrative Tasks
  • 2.
  • 3. Physical StructuresPhysical Structures  Datafiles (*.dbf)Datafiles (*.dbf)  The datafiles contain all the database data. The data of logical databaseThe datafiles contain all the database data. The data of logical database structures, such as tables and indexes, is physically stored in the datafilesstructures, such as tables and indexes, is physically stored in the datafiles allocated for a database.allocated for a database.  Control Files (*.ctl)Control Files (*.ctl)  Every Oracle database has a control file. A control file contains entries thatEvery Oracle database has a control file. A control file contains entries that specify the physical structure of the database such as Database name and thespecify the physical structure of the database such as Database name and the Names and locations of datafiles and redo log files.Names and locations of datafiles and redo log files.  Redo Log Files (*.log)Redo Log Files (*.log)  The primary function of the redo log is to record all changes made to data. If aThe primary function of the redo log is to record all changes made to data. If a failure prevents modified data from being permanently written to the datafiles,failure prevents modified data from being permanently written to the datafiles, then the changes can be obtained from the redo log, so work is never lost.then the changes can be obtained from the redo log, so work is never lost.
  • 4. Physical Structures (cont’d)Physical Structures (cont’d)  Archive Log Files (*.log)Archive Log Files (*.log)  Oracle automatically archives log files when the database is in ARCHIVELOGOracle automatically archives log files when the database is in ARCHIVELOG mode. This prevents oracle from overwriting the redo log files before they havemode. This prevents oracle from overwriting the redo log files before they have been safely archived to another location.been safely archived to another location.  Parameter Files (initSID.ora)Parameter Files (initSID.ora)  Parameter files contain a list of configuration parameters for that instance andParameter files contain a list of configuration parameters for that instance and database.database.  Alert and Trace Log Files (*.trc)Alert and Trace Log Files (*.trc)  Each server and background process can write to an associated trace file. When an internalEach server and background process can write to an associated trace file. When an internal error is detected by a process, it dumps information about the error to its trace file. The alerterror is detected by a process, it dumps information about the error to its trace file. The alert log of a database is a chronological log of messages and errors.log of a database is a chronological log of messages and errors.
  • 5. Logical StructuresLogical Structures  TablespacesTablespaces  A database is divided into logical storage units called tablespaces, which groupA database is divided into logical storage units called tablespaces, which group related logical structures together. One or more datafiles are explicitly created forrelated logical structures together. One or more datafiles are explicitly created for each tablespace to physically store the data of all logical structures in aeach tablespace to physically store the data of all logical structures in a tablespace.tablespace.  Oracle Data BlocksOracle Data Blocks  At the finest level of granularity, Oracle database data is stored in 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 of physical databaseOne data block corresponds to a specific number of bytes of physical database space on disk. The standard block size is specified by the DB_BLOCK_SIZEspace on disk. The standard block size is specified by the DB_BLOCK_SIZE initialization parameter.initialization parameter.
  • 6. Logical Structures (cont’d)Logical Structures (cont’d)  ExtentsExtents  The next level of logical database space is an extent. An extent is a specificThe next level of logical database space is an extent. An extent is a specific number of contiguous data blocks, obtained in a single allocation, used to store anumber of contiguous data blocks, obtained in a single allocation, used to store a specific type of information.specific type of information.  SegmentsSegments  Above extents, the level of logical database storage is a segment. A segment isAbove extents, the level of logical database storage is a segment. A segment is a set of extents allocated for a certain logical structure. The different types ofa set of extents allocated for a certain logical structure. The different types of segments are :segments are :  Data segment – stores table dataData segment – stores table data  Index segment – stores index dataIndex segment – stores index data  Temporary segment – temporary space used during SQL executionTemporary segment – temporary space used during SQL execution  Rollback Segment – stores undo informationRollback Segment – stores undo information
  • 7. Logical Structures (cont’d)Logical Structures (cont’d)  Schema OverviewSchema Overview  A schema is a collection of database objects. A schema is owned by a databaseA schema is a collection of database objects. A schema is owned by a database user and has the same name as that user. Schema objects are the logicaluser and has the same name as that user. Schema objects are the logical structures that directly refer to the database's data. Schema objects includestructures that directly refer to the database's data. Schema objects include structures like tables, views, and indexes.structures like tables, views, and indexes.
  • 8.
  • 9. Oracle InstanceOracle Instance An Oracle database server consists of anAn Oracle database server consists of an Oracle database and an Oracle instance.Oracle database and an Oracle instance. Every time a database is started, a systemEvery time a database is started, a system global area (SGA) is allocated and Oracleglobal area (SGA) is allocated and Oracle background processes are started. Thebackground processes are started. The combination of the background processescombination of the background processes and memory buffers is called an Oracleand memory buffers is called an Oracle instance.instance.
  • 10. System Global Area (SGA)System Global Area (SGA) The System Global Area (SGA) is a shared memory region that contains data andThe System Global Area (SGA) is a shared memory region that contains data and control information for one Oracle instance. Users currently connected to an Oraclecontrol information for one Oracle instance. Users currently connected to an Oracle database share the data in the SGA. The SGA contains the following memorydatabase share the data in the SGA. The SGA contains the following memory structures :structures :  Database Buffer CacheDatabase Buffer Cache  Database buffers store the most recently used blocks of data. The set ofDatabase buffers store the most recently used blocks of data. The set of database buffers in an instance is the database buffer cache. The buffer cachedatabase buffers in an instance is the database buffer cache. The buffer cache contains modified as well as unmodified blocks. Because the most recently (andcontains modified as well as unmodified blocks. Because the most recently (and often, the most frequently) used data is kept in memory, less disk I/O isoften, the most frequently) used data is kept in memory, less disk I/O is necessary, and performance is improved.necessary, and performance is improved.
  • 11. System Global Area (cont’d)System Global Area (cont’d)  Redo Log Buffer of the SGARedo Log Buffer of the SGA  The redo log buffer stores redo entries—a log of changes made to the database.The redo log buffer stores redo entries—a log of changes made to the database. The redo entries stored in the redo log buffers are written to an online redo log,The redo entries stored in the redo log buffers are written to an online redo log, which is used if database recovery is necessary. The size of the redo log iswhich is used if database recovery is necessary. The size of the redo log is static.static.  Shared Pool of the SGAShared Pool of the SGA  The shared pool contains shared memory constructs, such as shared SQL areas.The shared pool contains shared memory constructs, such as shared SQL areas. A shared SQL area is required to process every unique SQL statement submittedA shared SQL area is required to process every unique SQL statement submitted to a database. A shared SQL area contains information such as the parse treeto a database. A shared SQL area contains information such as the parse tree and execution plan for the corresponding statement.and execution plan for the corresponding statement.
  • 12. Program Global Area (PGA)Program Global Area (PGA) PGA is a memory buffer that contains data and control information for aPGA is a memory buffer that contains data and control information for a server process. A server process is a process that services a client’sserver process. A server process is a process that services a client’s requests. A PGA is created by oracle when a server process is started. Therequests. A PGA is created by oracle when a server process is started. The information in a PGA depends on the oracle configuration. The PGA area isinformation in a PGA depends on the oracle configuration. The PGA area is a non-shared area of memory created by oracle when a server process isa non-shared area of memory created by oracle when a server process is started.started. The basic difference between SGA and PGA is that PGA cannot be sharedThe basic difference between SGA and PGA is that PGA cannot be shared between multiple processes in the sense that it is used only forbetween multiple processes in the sense that it is used only for requirements of a particular process whereas the SGA is used for the wholerequirements of a particular process whereas the SGA is used for the whole instance and it is shared.instance and it is shared.
  • 13. Oracle Background ProcessesOracle Background Processes An Oracle database uses memory structures and processes to manage and accessAn Oracle database uses memory structures and processes to manage and access the database. All memory structures exist in the main memory of the computers thatthe database. All memory structures exist in the main memory of the computers that constitute the database system. Processes are jobs that work in the memory of theseconstitute the database system. Processes are jobs that work in the memory of these computers.computers. Oracle creates a set of background processes for each instance. The backgroundOracle creates a set of background processes for each instance. The background processes consolidate functions that would otherwise be handled by multiple Oracleprocesses consolidate functions that would otherwise be handled by multiple Oracle programs running for each user process. They asynchronously perform I/O andprograms running for each user process. They asynchronously perform I/O and monitor other Oracle processes to provide increased parallelism for bettermonitor other Oracle processes to provide increased parallelism for better performance and reliability.performance and reliability. The most common background processes are :The most common background processes are :  System Monitor – SMONSystem Monitor – SMON  This database background process performs instance recovery at the start of theThis database background process performs instance recovery at the start of the database. SMON also cleans up temporary segments that are no longer in usedatabase. SMON also cleans up temporary segments that are no longer in use and recovers dead transactions skipped during crash and instance recoveryand recovers dead transactions skipped during crash and instance recovery because of file-read or offline errors. It coalesces i.e. combines contiguous freebecause of file-read or offline errors. It coalesces i.e. combines contiguous free extents into larger free extents.extents into larger free extents.
  • 14. Background Processes (cont’d)Background Processes (cont’d)  Process Monitor - PMONProcess Monitor - PMON  This database background process cleans up failed user processes. PMON isThis database background process cleans up failed user processes. PMON is responsible for releasing the lock i.e. cleaning up the cache and freeingresponsible for releasing the lock i.e. cleaning up the cache and freeing resources that the process was using. Its effect can be seen when a processresources that the process was using. Its effect can be seen when a process holding a lock is killed.holding a lock is killed.  Database Writer - DBWRDatabase Writer - DBWR  This background process is responsible for managing the contents of the dataThis background process is responsible for managing the contents of the data block buffer cache and dictionary cache. DBWR performs batch writes ofblock buffer cache and dictionary cache. DBWR performs batch writes of changed block. Since Oracle uses write-ahead logging, DBWR does not need tochanged block. Since Oracle uses write-ahead logging, DBWR does not need to write blocks when a transaction commits. In the most common case, DBWRwrite blocks when a transaction commits. In the most common case, DBWR writes only when more data needs to be read into the system global area and toowrites only when more data needs to be read into the system global area and too few database buffers are free. The least recently used data is written to thefew database buffers are free. The least recently used data is written to the datafiles first.datafiles first.  Although there is only one SMON and one PMON process running per databaseAlthough there is only one SMON and one PMON process running per database instance, one can have multiple DBWR processes running at the same time.instance, one can have multiple DBWR processes running at the same time. Note the number of DBWR processes running is set via theNote the number of DBWR processes running is set via the DB_WRITER_PROCESSES.DB_WRITER_PROCESSES.
  • 15. Background Processes (cont’d)Background Processes (cont’d)  Log Writer - LGWRLog Writer - LGWR  This background process manages the writing of the contents of the redo logThis background process manages the writing of the contents of the redo log buffer to the online redo log files. LGWR writes the log entries in batch form. Thebuffer to the online redo log files. LGWR writes the log entries in batch form. The Redo log buffers entries always contain the most up-to-date status of theRedo log buffers entries always contain the most up-to-date status of the database.database.  Archiver - ARCHArchiver - ARCH  The Archiver process reads the redo log files once Oracle has filled them andThe Archiver process reads the redo log files once Oracle has filled them and writes a copy of the used redo log files to the specified archive log destination(s).writes a copy of the used redo log files to the specified archive log destination(s). Actually, for most databases, ARCH has no effect on the overall systemActually, for most databases, ARCH has no effect on the overall system performance. On some large database sites, however, archiving can have anperformance. On some large database sites, however, archiving can have an impact on system performance.impact on system performance.
  • 16. Background Processes (cont’d)Background Processes (cont’d)  Checkpoint - CKPTCheckpoint - CKPT  All modified information in database buffer in the SGA is written to the datafilesAll modified information in database buffer in the SGA is written to the datafiles by a database write process (DBWR). This event indicates a checkpoint. Theby a database write process (DBWR). This event indicates a checkpoint. The checkpoint process is responsible for signaling DBWR at checkpoints andcheckpoint process is responsible for signaling DBWR at checkpoints and updating all of the datafiles and control files of the database.updating all of the datafiles and control files of the database.  Recover - RECORecover - RECO  The recover process automatically cleans up failed or suspended distributedThe recover process automatically cleans up failed or suspended distributed transactions.transactions.  Job Queue ProcessesJob Queue Processes  Job queue processes are used for batch processing. They run user jobs. TheyJob queue processes are used for batch processing. They run user jobs. They can be viewed as a scheduler service that can be used to schedule jobs ascan be viewed as a scheduler service that can be used to schedule jobs as PL/SQL statements or procedures on an Oracle instance. Given a start date andPL/SQL statements or procedures on an Oracle instance. Given a start date and an interval, the job queue processes try to run the job at the next occurrence ofan interval, the job queue processes try to run the job at the next occurrence of the interval.the interval.
  • 17.
  • 18. Computer Science DatabaseComputer Science Database Server InformationServer Information  Sun e4500Sun e4500  8GB Ram8GB Ram  8 x 400mhz CPU8 x 400mhz CPU  32GB Disk for32GB Disk for OracleOracle  4mm DAT DDS34mm DAT DDS3 Tape BackupTape Backup
  • 19. Computer Science DatabaseComputer Science Database  Instance Name : CS01 (v$database)Instance Name : CS01 (v$database)  Instance Version : 8.1.6.0.0Instance Version : 8.1.6.0.0  Tablespaces : (dba_tablespaces)Tablespaces : (dba_tablespaces)  SYSTEM – holds all system tablesSYSTEM – holds all system tables  INDEX01 – user indexesINDEX01 – user indexes  USERS01 – user tablesUSERS01 – user tables  USERS02 – user tables (faculty)USERS02 – user tables (faculty)  RBS – rollback segmentsRBS – rollback segments
  • 20.
  • 21. Backup MethodsBackup Methods  Cold Backup (aka Consistent Backups)Cold Backup (aka Consistent Backups)  The only way to make a consistent whole databaseThe only way to make a consistent whole database backup is to shut down the database with thebackup is to shut down the database with the NORMAL, IMMEDIATE, or TRANSACTIONALNORMAL, IMMEDIATE, or TRANSACTIONAL options and make the backup while the database isoptions and make the backup while the database is closed.closed.  Advantage : No recovery is required after datafiles areAdvantage : No recovery is required after datafiles are restored – quicker restorerestored – quicker restore  Disadvantage : No access to database during backupDisadvantage : No access to database during backup time (depends on size/system speed)time (depends on size/system speed)
  • 22. Backup Methods (cont’d)Backup Methods (cont’d)  Hot Backup (aka Inconsistent Backups)Hot Backup (aka Inconsistent Backups)  If the database must be up and running 24 hours aIf the database must be up and running 24 hours a day, seven days a week, then you have no choice butday, seven days a week, then you have no choice but to perform inconsistent backups of the wholeto perform inconsistent backups of the whole database. A backup of online datafiles is called andatabase. A backup of online datafiles is called an online backup. This requires that you run youronline backup. This requires that you run your database in ARCHIVELOG mode.database in ARCHIVELOG mode.  Advantage : Database remains open during backupAdvantage : Database remains open during backup  Disadvantage : Large databases may haveDisadvantage : Large databases may have performance impact during backup, recovery takesperformance impact during backup, recovery takes longer and islonger and is slightlyslightly more complexmore complex
  • 23. Backup Methods (cont’d)Backup Methods (cont’d)  Logical backup (Export)Logical backup (Export)  Logical backups are exports of schema objects, likeLogical backups are exports of schema objects, like tables and stored procedures, into a binary file.tables and stored procedures, into a binary file. Oracle utilities are used to move Oracle schemaOracle utilities are used to move Oracle schema objects in and out of Oracle.objects in and out of Oracle.  Not recommended for backup of a whole database,Not recommended for backup of a whole database, but useful for backing up individual objects orbut useful for backing up individual objects or schemas or moving data into another databaseschemas or moving data into another database
  • 24. Administrative TasksAdministrative Tasks  Daily ChecksDaily Checks  Check database availabilityCheck database availability  Check logs / trace filesCheck logs / trace files  Check free space / resourcesCheck free space / resources  Check for invalid objectsCheck for invalid objects  Check for broken jobsCheck for broken jobs  Verify backupVerify backup
  • 25. Administrative Tasks (cont’d)Administrative Tasks (cont’d)  Weekly TasksWeekly Tasks  Collect statistics (database job)Collect statistics (database job)  Archive / delete log filesArchive / delete log files  Run performance reports (statspack)Run performance reports (statspack)
  • 26. Administrative Tasks (cont’d)Administrative Tasks (cont’d)  OthersOthers  Applying patchesApplying patches  Database upgradesDatabase upgrades  New Database installationsNew Database installations  Creating user accountsCreating user accounts
  • 27. More InformationMore Information  Oracle 10g Release 2 Database DocumentationOracle 10g Release 2 Database Documentation  http://www.oracle.com/pls/db102/http://www.oracle.com/pls/db102/  Oracle Database / SQL HelpOracle Database / SQL Help  http://asktom.oracle.com/http://asktom.oracle.com/  http://www.oracle.com/technology//index.htmlhttp://www.oracle.com/technology//index.html  *FREE* Oracle Software Downloads*FREE* Oracle Software Downloads  http://www.oracle.com/technology/software/index.htmlhttp://www.oracle.com/technology/software/index.html  Oracle Database 10g Express EditionOracle Database 10g Express Edition  Oracle SQL DeveloperOracle SQL Developer  This DocumentThis Document  Computer Science Homepage -> On-Line helpComputer Science Homepage -> On-Line help

Notas del editor

  1. Datafiles Every Oracle database has one or more physical datafiles. The datafiles contain all the database data. The data of logical database structures, such as tables and indexes, is physically stored in the datafiles allocated for a database. One or more datafiles form a logical unit of database storage called a tablespace. Data in a datafile is read, as needed, during normal database operation and stored in the memory cache of Oracle. For example, assume that a user wants to access some data in a table of a database. If the requested information is not already in the memory cache for the database, then it is read from the appropriate datafiles and stored in memory. Modified or new data is not necessarily written to a datafile immediately. To reduce the amount of disk access and to increase performance, data is pooled in memory and written to the appropriate datafiles all at once, as determined by the database writer process (DBWn) background process. Control Files Every Oracle database has a control file. A control file contains entries that specify the physical structure of the database such as Database name and the Names and locations of datafiles and redo log files. Oracle can multiplex the control file, that is, simultaneously maintain a number of identical control file copies, to protect against a failure involving the control file. Every time an instance of an Oracle database is started, its control file identifies the database and redo log files that must be opened for database operation to proceed. If the physical makeup of the database is altered (for example, if a new datafile or redo log file is created), then the control file is automatically modified by Oracle to reflect the change. A control file is also used in database recovery. Redo Log Files Every Oracle database has a set of two or more redo log files. The set of redo log files is collectively known as the redo log for the database. A redo log is made up of redo entries (also called redo records). The primary function of the redo log is to record all changes made to data. If a failure prevents modified data from being permanently written to the datafiles, then the changes can be obtained from the redo log, so work is never lost. To protect against a failure involving the redo log itself, Oracle allows a multiplexed redo log so that two or more copies of the redo log can be maintained on different disks. The information in a redo log file is used only to recover the database from a system or media failure that prevents database data from being written to the datafiles. For example, if an unexpected power outage terminates database operation, then data in memory cannot be written to the datafiles, and the data is lost. However, lost data can be recovered when the database is opened, after power is restored. By applying the information in the most recent redo log files to the database datafiles, Oracle restores the database to the time at which the power failure occurred. The process of applying the redo log during a recovery operation is called rolling forward.
  2. Archive Log Files You can enable automatic archiving of the redo log. Oracle automatically archives log files when the database is in ARCHIVELOG mode. This prevents oracle from overwriting the redo log files before a they have been safely archived to another location. Parameter Files Parameter files contain a list of configuration parameters for that instance and database. Oracle recommends that you create a server parameter file (SPFILE) as a dynamic means of maintaining initialization parameters. A server parameter file lets you store and manage your initialization parameters persistently in a server-side disk file. Alert and Trace Log Files Each server and background process can write to an associated trace file. When an internal error is detected by a process, it dumps information about the error to its trace file. Some of the information written to a trace file is intended for the database administrator, while other information is for Oracle Support Services. Trace file information is also used to tune applications and instances. The alert file, or alert log, is a special trace file. The alert log of a database is a chronological log of messages and errors.
  3. Tablespaces A database is divided into logical storage units called tablespaces, which group related logical structures together. For example, tablespaces commonly group together all application objects to simplify some administrative operations. One or more datafiles are explicitly created for each tablespace to physically store the data of all logical structures in a tablespace. Every Oracle database contains a SYSTEM tablespace. Oracle creates them automatically when the database is created. Oracle 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 of physical database space on disk. The standard block size is specified by the DB_BLOCK_SIZE initialization parameter. A database uses and allocates free database space in Oracle data blocks. Oracle reads and writes data in blocks, so a larger block size could lead to more data transfer per I/O call. The default block size depends on the system architecture, but is generally 8k for UNIX systems. A larger block size is sometimes used for data warehouse systems which access data in larger chunks.
  4. Extents The next level of logical database space is an extent. An extent is a specific number of contiguous data blocks, obtained in a single allocation, used to store a specific type of information. Segments Above extents, the level of logical database storage is a segment. A segment is a set of extents allocated for a certain logical structure. The different types of segments are : Data segment – stores table data Index segment – stores index data Temporary segment – temporary space used during SQL execution Rollback Segment – stores undo information
  5. Schema Overview A schema is a collection of database objects. A schema is owned by a database user and has the same name as that user. Schema objects are the logical structures that directly refer to the database's data. Schema objects include structures like tables, views, and indexes. There is no relationship between a tablespace and a schema. Objects in the same schema can be in different tablespaces, and a tablespace can hold objects from different schemas.
  6. System Global Area The System Global Area (SGA) is a shared memory region that contains data and control information for one Oracle instance. Oracle allocates the SGA when an instance starts and deallocates it when the instance shuts down. Each instance has its own SGA. Users currently connected to an Oracle database share the data in the SGA. For optimal performance, the entire SGA should be as large as possible (while still fitting in real memory) to store as much data in memory as possible and to minimize disk I/O. The SGA contains the following memory structures : Database Buffer Cache Database buffers store the most recently used blocks of data. The set of database buffers in an instance is the database buffer cache. The buffer cache contains modified as well as unmodified blocks. Because the most recently (and often, the most frequently) used data is kept in memory, less disk I/O is necessary, and performance is improved.
  7. Redo Log Buffer of the SGA The redo log buffer stores redo entries—a log of changes made to the database. The redo entries stored in the redo log buffers are written to an online redo log, which is used if database recovery is necessary. The size of the redo log is static. Shared Pool of the SGA The shared pool contains shared memory constructs, such as shared SQL areas. A shared SQL area is required to process every unique SQL statement submitted to a database. This area contains information such as the parse tree and execution plan for the corresponding statement. A single shared SQL area is used by multiple applications that issue the same statement, leaving more shared memory for other uses.
  8. PGA is a memory buffer that contains data and control information for a server process. A server process is a process that services a client’s requests. A PGA is created by oracle when a server process is started. The information in a PGA depends on the oracle configuration. The PGA area is a non-shared area of memory created by oracle when a server process is started. The basic difference between SGA and PGA is that PGA cannot be shared between multiple processes in the sense that it is used only for requirements of a particular process whereas the SGA is used for the whole instance and it is shared.
  9. 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 database system. Processes are jobs that work in the memory of these computers. Oracle creates a set of background processes for each instance. The background processes consolidate functions that would otherwise be handled by multiple Oracle programs running for each user process. They asynchronously perform I/O and monitor other Oracle processes to provide increased parallelism for better performance and reliability. The most common background processes are : System Monitor – SMON This database background process performs instance recovery at the start of the database. SMON also cleans up temporary segments that are no longer in use and recovers dead transactions skipped during crash and instance recovery because of file-read or offline errors. It coalesces i.e. combines contiguous free extents into larger free extents.
  10. Process Monitor - PMON This database background process cleans up failed user processes. PMON is responsible for releasing the lock i.e. cleaning up the cache and freeing resources that the process was using. Its effect can be seen when a process holding a lock is killed. Database Writer - DBWR This background process is responsible for managing the contents of the data block buffer cache and dictionary cache. DBWR performs batch writes of changed block. Since Oracle uses write-ahead logging, DBWR does not need to write blocks when a transaction commits. In the most common case, DBWR writes only when more data needs to be read into the system global area and too few database buffers are free. The least recently used data is written to the datafiles first. Although there is only one SMON and one PMON process running per database instance, one can have multiple DBWR processes running at the same time. Note the number of DBWR processes running is set via the DB_WRITER_PROCESSES.
  11. Log Writer - LGWR This background process manages the writing of the contents of the redo log buffer to the online redo log files. LGWR writes the log entries in batch form. The Redo log buffers entries always contain the most up-to-date status of the database. Note LGWR is the only process that writes to the online redo log files and the only one that directly reads the redo log buffer during normal database operation. Archiver - ARCH The Archiver process reads the redo log files once Oracle has filled them and writes a copy of the used redo log files to the specified archive log destination(s). Actually, for most databases, ARCH has no effect on the overall system performance. On some large database sites, however, archiving can have an impact on system performance. We can specify up to ten ARCn processes for each database instance LGWR will start additional Archivers as needed, based on the load, up to the limit specified by the initialization parameter LOG_ARCHIVE_MAX_PROCESSES.
  12. Checkpoint - CKPT All modified information in database buffer in the SGA is written to the datafiles by a database write process (DBWR). This event indicates a checkpoint. The checkpoint process is responsible for signaling DBWR at checkpoints and updating all of the datafiles and control files of the database. Recover - RECO The recover process automatically cleans up failed or suspended distributed transactions. Job Queue Processes Job queue processes are used for batch processing. They run user jobs. They can be viewed as a scheduler service that can be used to schedule jobs as PL/SQL statements or procedures on an Oracle instance. Given a start date and an interval, the job queue processes try to run the job at the next occurrence of the interval.
  13. Instance Name : CS01 (v$database) Instance Version : 8.1.6.0.0 Tablespaces : (dba_tablespaces) SYSTEM – holds all system tables INDEX01 – user indexes USERS01 – user tables USERS02 – user tables (faculty) RBS – rollback segments
  14. A consistent backup of a database or part of a database is a backup in which all read/write datafiles and control files are checkpointed with the same SCN. The only way to make a consistent whole database backup is to shut down the database with the NORMAL, IMMEDIATE, or TRANSACTIONAL options and make the backup while the database is closed. If a database is not shut down cleanly, for example, an instance fails or you issue a SHUTDOWN ABORT statement, then the database's datafiles are always inconsistent—unless the database is a read-only database. The important point is that you can open the database after restoring a consistent whole database backup without needing recovery because the data is already consistent: no action is required to make the data in the restored datafiles correct. Hence, you can restore a year-old consistent backup of your database without performing media recovery and without Oracle performing instance recovery. Of course, when you restore a consistent whole database backup without applying redo, you lose all transactions that were made since the backup was taken. When this type of backup is restored and archived logs are available, you have the option of either opening the database immediately and losing transactions that were made since the backup was taken, or applying the archived logs to recover those transactions. Advantage : No recovery is required after datafiles are restored – quicker restore Disadvantage : No access to database during backup time (depends on size/system speed)
  15. An inconsistent backup is a backup in which the files being backed up do not contain all the changes made at all the SCNs. In other words, some changes are missing. This means that the files in the backup contain data taken from different points in time. This can occur because the datafiles are being modified as backups are being taken. Oracle recovery makes inconsistent backups consistent by reading all archived and online redo logs, starting with the earliest SCN in any of the datafile headers, and applying the changes from the logs back into the datafiles. If the database must be up and running 24 hours a day, seven days a week, then you have no choice but to perform inconsistent backups of the whole database. A backup of online datafiles is called an online backup. This requires that you run your database in ARCHIVELOG mode. Advantage : Database remains open during backup Disadvantage : Large databases may have performance impact during backup, recovery takes longer and is slightly more complex
  16. Logical backup (Export) Logical backups are exports of schema objects, like tables and stored procedures, into a binary file. Oracle utilities are used to move Oracle schema objects in and out of Oracle. Not recommended for backup of a whole database, but useful for backing up individual objects or schemas or moving data into another database
  17. Daily Checks Check database availability Make sure the database is available. Log into each instance and run daily reports or test scripts. Check logs / trace files Check alert_sid.log for ORA-* errors and investigate as required Check free space / resources Check server disk space and processor / memory utilization Check for invalid objects Run a query against dba_objects to make sure no objects have become invalidated. This can be caused by such things as failing jobs, new objects and changed passwords. Check for broken jobs Run a query against dbms_jobs to make sure there are no broken job. A job is a PLSQL program that is defined to run at a specified time. Verify backup Make sure whatever backup system is in place is working properly.
  18. Weekly Tasks Collect statistics (database job) Collecting statistics on database objects allows the optimizer to pick the most efficient query plan for sql statements. As the database changes the statistics become out of date and need to be refreshed. A job should be setup to gather new statistics each week or more often if the data changes frequently. Confirm that the job runs successfully. Archive / delete log files To save disk space and make it easier to find errors you should tar or zip up old log files. After a period of time they can be deleted. Run performance reports (statspack) Using these reports you will hopefully be able to see database performance issues before the user does. Save old reports and compare them to new ones to help point out system problems.
  19. Others Applying patches Security patchsets are released quarterly from Oracle and should be applied as soon as possible after adequate testing has been performed. Database upgrades Upgrades to the base database release from Oracle should be applied after extensive testing has been performed. New Database installations Creating user accounts Here it is automated through a script which checks the LDAP directory for students registered in 315/334