SlideShare a Scribd company logo
Oracle
Architecture
Oracle RDBMS basics
about me

with Oracle since 2000
DBA @H3G since 2003
my private (most technical related) thoughts:
                     http://berxblog.blogspot.com
@martinberx
martin.a.berger@gmail.com
no official presentations / trainings so far

                   "it depends"
roadmap

● Database                 ●   Instance
  ○ spfile                 ●   Processes
  ○ controlfile            ●   Session
  ○ datafile               ●   Statement
  ○ redo-logs / archives   ●   Transaction
                           ●   Cluster
● Cluster                  ●   Listener

                           + Cluster failover
                           + Data Dictionary
Oracle Database 11g: Interactive Quick Reference - Your Essential Guide to Oracle Database 11g Release 2




http://www.oracle.com/webapps/dialogue/ns/dlgwelcome.jsp?p_ext=Y&p_dlg_id=9575302&src=7027600&Act=54
Database
 ○ spfile   *.compatible='11.1.0.0.0'
            *.control_files='/appl/oracle/oradata/BERX2/control01.
            ctl','/appl/oracle/oradata/BERX2/control02.
            ctl','/appl/oracle/oradata/BERX2/control03.ctl'
            *.db_block_size=8192
            *.db_name='BERX2'
            ...
Database
 ○ spfile        *.compatible='11.1.0.0.0'
                 *.control_files='/appl/oracle/oradata/BERX2/control01.
                 ctl','/appl/oracle/oradata/BERX2/control02.
                 ctl','/appl/oracle/oradata/BERX2/control03.ctl'
                 *.db_block_size=8192
                 *.db_name='BERX2'
                        ●    The database name
 ○ controlfile          ●
                        ●
                             Names and locations of associated datafiles and redo log files
                             The timestamp of the database creation
                        ●    The current log sequence number
                        ●    Checkpoint information (SCN)
Database
 ○ spfile          *.compatible='11.1.0.0.0'
                   *.control_files='/appl/oracle/oradata/BERX2/control01.
                   ctl','/appl/oracle/oradata/BERX2/control02.
                   ctl','/appl/oracle/oradata/BERX2/control03.ctl'
                   *.db_block_size=8192
                   *.db_name='BERX2'
                          ●    The database name
 ○ controlfile            ●
                          ●
                               Names and locations of associated datafiles and redo log files
                               The timestamp of the database creation
                          ●    The current log sequence number
                          ●    Checkpoint information (SCN)

                                   ●    datafiles keeps persistent data
                                   ●    Each tablespace in an Oracle database
 ○ datafile / tablespace           ●
                                        consists of one or more datafiles
                                        Tablespaces: SYSTEM, UNDO,
                                        TEMP, data
Database
 ○ spfile          *.compatible='11.1.0.0.0'
                   *.control_files='/appl/oracle/oradata/BERX2/control01.
                   ctl','/appl/oracle/oradata/BERX2/control02.
                   ctl','/appl/oracle/oradata/BERX2/control03.ctl'
                   *.db_block_size=8192
                   *.db_name='BERX2'
                          ●    The database name
 ○ controlfile            ●
                          ●
                               Names and locations of associated datafiles and redo log files
                               The timestamp of the database creation
                          ●    The current log sequence number
                          ●    Checkpoint information (SCN)

                                   ●     datafiles keeps persistent data
                                   ●     Each tablespace in an Oracle database
 ○ datafile / tablespace           ●
                                         consists of one or more datafiles
                                         Tablespaces: SYSTEM, UNDO,
                                         TEMP, data




 ○ redo-logs / archives
Cluster
Instance
A database instance is a set of memory structures that
manage database files.

● SGA
● PGA
● processes
  ○ background
  ○ server
Processes

● background process
  DBWR, LGWR, SMON, PMON, CKPK, ARCH, MMON, MMNL, RECO, etc.


● server process
  Oracle Database creates server processes to handle the requests of client processes connected to the
  instance. A client process always communicates with a database through a separate server process.
  Server processes created on behalf of a database application can perform one or more of the following tasks:

  ●     Parse and run SQL statements issued through the application, including creating and executing the query

        plan (see "Stages of SQL Processing")

  ●     Execute PL/SQL code


  ●     Read data blocks from data files into the database buffer cache (the DBWn background process has the

        task of writing modified blocks back to disk)

  ●     Return results in such a way that the application can process the information
Session
A session is a logical entity in the database
instance memory that represents the state of a
current user login to a database.
For example, when a user is authenticated by
the database with a password, a session is
established for this user.
A session lasts from the time the user is
authenticated by the database until the time
the user disconnects or exits the database
application.
Statement
● DDL
  CREATE, ALTER, DROP, TRUNCATE, GRANT, AUDIT, COMMENT
  implicit commit


● DML
  SELECT, INSERT, UPDATE, MERGE, DELETE, EXPLAIN PLAN, LOCK TABLE


● Transaction Control
  SET TRANSACTION, SAVEPOINT, COMMIT, ROLLBACK


● ALTER (session, system)

● embedded (into procedural program)
Statement - lifecycle
Transaction
Logical unit of work that contains one or more SQL statements. All statements in a transaction commit or roll back
together. The use of transactions is one of the most important ways that a database management system differs from
a file system.



ACID
● Atomicy
             all or nothing

● Consistency
             from one valid state to another

● Isolation
             transactions does not interfer

● Durability
             just stored
Transaction - Isolation Levels
1. Read committed (default)

A query will only be able access committed data. However, the transaction may be affected by changes made by other
transactions.

This can be set by:
SET TRANSACTION ISOLATION LEVEL READ COMMITTED; (transaction level)
ALTER SESSION SET ISOLATION_LEVEL READ COMMITTED; (session level)

2. Serializable transactions

A query can only access data that was committed at the start of the transaction. Modification from DML operations performed
from the same transaction will be visible.

The Serializable transaction isolation level is not supported with distributed transactions.

This can be set by:
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; (transaction level)
ALTER SESSION SET ISOLATION_LEVEL SERIALIZABLE; (session level)

3. Read only

A query can only access data that was committed at the start of the transaction. Modification to the data is not allowed.

This can be set by:
SET TRANSACTION ISOLATION LEVEL READONLY; (transaction level)
ALTER SESSION SET ISOLATION_LEVEL READONLY; (session level)
Transaction - flow
select sal from emp where ename in ('SMITH', 'ALLEN'); -- 800, 1600
set transaction name 'my trans 1';

UPDATE emp
  SET sal = 7000
  WHERE ename = 'SMITH';

SAVEPOINT after_banda_sal;

UPDATE emp
  SET sal = sal+10400
  WHERE ename = 'ALLEN';


select sal from emp where ename in ('SMITH', 'ALLEN'); --7000, 12000

SAVEPOINT after_greene_sal;

ROLLBACK TO SAVEPOINT         after_banda_sal;

UPDATE emp
  SET sal = sal+10300
  WHERE ename = 'ALLEN';
select sal from emp where ename in ('SMITH', 'ALLEN'); -- 7000, 11900
rollback;
Transaction - redo/undo
Cluster
Cluster - Listener
Cluster - Listener II
Cluster - Listener III
Failover

Transparent Application Failover
if one instance dies, the client restarts the whole listener-connection-sequence,
cursors are re-opened, statement re-run

limitations:

 ●   The effect of any ALTER SESSION statements will be lost.
 ●   Global temporary tables will be lost.
 ●   Any PL/SQL package states will be lost.
 ●   Transactions involving INSERT, UPDATE, or DELETE statements cannot be handled
     automatically by TAF.


If there is a failure you will most likely see an ORA-25402 error. Applications should be prepared to
handle errors in the 25400-25425 range and rollback appropriately.
TAF - errors
ORA-25400: must replay fetch                                                            ORA-25406: could not generate a connect address
Cause: A failure occured since the last fetch on this statement. Failover was able to   Cause: Failover was unable to generate an address for a backup instance.
bring the statement to its original state to allow continued fetches.
                                                                                        Action: Contact Oracle customer support.
Action: This is an internally used error message and should not be seen by the
                                                                                        ORA-25407: connection terminated
user.
                                                                                        Cause: The connection was lost while doing a fetch.
ORA-25401: can not continue fetches
                                                                                        Action: This is an internally used error message and should not be seen by the
Cause: A failure occured since the last fetch on this statement. Failover was unable
                                                                                        user.
to bring the statement to its original state to allow continued fetches.
                                                                                        ORA-25408: can not safely replay call
Action: Reexecute the statement and start fetching from the beginning
                                                                                        Cause: The connection was lost while doing this call. It may not be safe to replay it
ORA-25402: transaction must roll back
                                                                                        after failover.
Cause: A failure occured while a transaction was active on this connection.
                                                                                        Action: Check to see if the results of the call have taken place, and then replay it if
Action: The client must roll back.                                                      desired.
ORA-25403: could not reconnect                                                          ORA-25409: failover happened during the network operation,cannot continue
Cause: The connection to the database has been lost, and attempts to reconnect          Cause: The connection was lost when fetching a LOB column.
have failed.
                                                                                        Action: Failover happened when fetching LOB data directly or indirectly. Please
Action: Manually reconnect.                                                             replay the top level statement.
ORA-25404: lost instance                                                                ORA-25425: connection lost during rollback
Cause: The primary instance has died.                                                   Cause: The connection was lost while issuing a rollback and the application failed
                                                                                        over.
Action: This is an internally used error message and should not be seen by the
user.                                                                                   Action: The connection was lost and failover happened during rollback. If the
                                                                                        transaction is not externally coordinated, then Oracle implicitly rolled back, so no
ORA-25405: transaction status unknown
                                                                                        action is required. Otherwise examine pending_trans$ to determine if "rollback
Cause: A failure occured while a transaction was attempting to commit. Failover         force" is required.
could not automatically determine instance status.
                                                                                        ORA-25426: remote instance does not support shared dblinks
Action: The user must determine the transaction's status manually.
                                                                                        Cause: A shared dblink is being used to connect to a remote instance that does not
                                                                                        support this feature because it is an older version.
                                                                                        Action: Use a normal dblink if you need to connect to this instance.
Data Dictionary

● Informations about the database
  ○ Meta-info about all objects, schemata, user,
    privileges, audit
  ○ DBA_*


● Informations about the instances
  ○ many informations about structures in memory
  ○ v$* / gv$*


● Nearly everything Oracle knows you can
  select
further informations

Oracle Documentation - Concepts Guide
               http://docs.oracle.com/cd/E11882_01/server.112/e25789/toc.htm

ask
●   Ops.Oracle team
●   forums.oracle.com
●   http://www.freelists.org/list/oracle-l


read
credits

Arup Nanda - discussions about listener
Aman Sharma - review of connect-flow
Surachart Opun - general review
Martin Schretzmeier - infrastructure infos
Ops.Oracle team - review
Next Presentations


● Physical structures & (SQL) tuning

● Capacity planning basics

● anything else?

More Related Content

What's hot (20)

PDF
Redo internals ppt
Riyaj Shamsudeen
 
PPT
Présentation Oracle DataBase 11g
Cynapsys It Hotspot
 
PPTX
Oracle database introduction
Mohammad Javad Beheshtian
 
PPS
Overview of oracle database
Samar Prasad
 
PPTX
Oracle Database Introduction
Chhom Karath
 
PPTX
What’s New in Oracle Database 19c - Part 1
Satishbabu Gunukula
 
PDF
Oracle Active Data Guard: Best Practices and New Features Deep Dive
Glen Hawkins
 
PDF
HA, Scalability, DR & MAA in Oracle Database 21c - Overview
Markus Michalewicz
 
PPTX
Oracle Database | Computer Science
Transweb Global Inc
 
PDF
Backup and recovery in oracle
sadegh salehi
 
PPTX
The oracle database architecture
Akash Pramanik
 
DOCX
Oracle architecture
Soumya Das
 
PDF
Oracle db performance tuning
Simon Huang
 
PPTX
What to Expect From Oracle database 19c
Maria Colgan
 
PDF
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Sandesh Rao
 
PDF
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 
PDF
Performance Stability, Tips and Tricks and Underscores
Jitendra Singh
 
PDF
Rman Presentation
Rick van Ek
 
PDF
Oracle RAC 19c: Best Practices and Secret Internals
Anil Nair
 
PDF
Maximum Availability Architecture - Best Practices for Oracle Database 19c
Glen Hawkins
 
Redo internals ppt
Riyaj Shamsudeen
 
Présentation Oracle DataBase 11g
Cynapsys It Hotspot
 
Oracle database introduction
Mohammad Javad Beheshtian
 
Overview of oracle database
Samar Prasad
 
Oracle Database Introduction
Chhom Karath
 
What’s New in Oracle Database 19c - Part 1
Satishbabu Gunukula
 
Oracle Active Data Guard: Best Practices and New Features Deep Dive
Glen Hawkins
 
HA, Scalability, DR & MAA in Oracle Database 21c - Overview
Markus Michalewicz
 
Oracle Database | Computer Science
Transweb Global Inc
 
Backup and recovery in oracle
sadegh salehi
 
The oracle database architecture
Akash Pramanik
 
Oracle architecture
Soumya Das
 
Oracle db performance tuning
Simon Huang
 
What to Expect From Oracle database 19c
Maria Colgan
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Sandesh Rao
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 
Performance Stability, Tips and Tricks and Underscores
Jitendra Singh
 
Rman Presentation
Rick van Ek
 
Oracle RAC 19c: Best Practices and Secret Internals
Anil Nair
 
Maximum Availability Architecture - Best Practices for Oracle Database 19c
Glen Hawkins
 

Viewers also liked (13)

PDF
DBAAS – Database As a Service avec Oracle
EASYTEAM
 
PPTX
OPN 2.0 Programme en français
Oracle
 
PDF
Oracle RAC 11g Release 2 Client Connections
Markus Michalewicz
 
PPTX
Webséminaire DBaaS (Novembre 2014)
Jean-Philippe PINTE
 
PDF
Cours s5 réseau FSO
Khalil Lechheb
 
PPT
Oracle Database Vault
Khalid ALLILI
 
PPTX
Oracle e-Business Suite & RAC 11GR2
Yury Velikanov
 
PDF
Oracle 11g exploitation
Dieudonné M'sago
 
PDF
Understanding Oracle RAC 11g Release 2 Internals
Markus Michalewicz
 
PPSX
Oracle 11g R2 RAC implementation and concept
Santosh Kangane
 
PDF
Administration des base de donnees sous oracle 10g
noble Bajoli
 
PDF
Presentation corporate hitachi data systems 2012
Hitachi Data Systems France
 
PPT
Toad lsi ziane bilal
Bilal ZIANE
 
DBAAS – Database As a Service avec Oracle
EASYTEAM
 
OPN 2.0 Programme en français
Oracle
 
Oracle RAC 11g Release 2 Client Connections
Markus Michalewicz
 
Webséminaire DBaaS (Novembre 2014)
Jean-Philippe PINTE
 
Cours s5 réseau FSO
Khalil Lechheb
 
Oracle Database Vault
Khalid ALLILI
 
Oracle e-Business Suite & RAC 11GR2
Yury Velikanov
 
Oracle 11g exploitation
Dieudonné M'sago
 
Understanding Oracle RAC 11g Release 2 Internals
Markus Michalewicz
 
Oracle 11g R2 RAC implementation and concept
Santosh Kangane
 
Administration des base de donnees sous oracle 10g
noble Bajoli
 
Presentation corporate hitachi data systems 2012
Hitachi Data Systems France
 
Toad lsi ziane bilal
Bilal ZIANE
 
Ad

Similar to Oracle RDBMS architecture (20)

PPT
Introduction to oracle
durgaprasad1407
 
PDF
Sql introduction
vimal_guru
 
PPT
Oracle architecture
Sandeep Kamath
 
PPTX
PHP Oracle
Nur Hidayat
 
PPT
Lecture2 oracle ppt
Hitesh Kumar Markam
 
PPT
Oracle 10g Introduction 1
Eryk Budi Pratama
 
PPT
ora_sothea
thysothea
 
PDF
0396 oracle-goldengate-12c-tutorial
KlausePaulino
 
PPT
ORACLE Architechture.ppt
aggarwalb
 
PPTX
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
PPTX
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
TXT
Oracle11g notes
Manish Mudhliyar
 
PDF
Oracle Database Management Basic 1
Chien Chung Shen
 
PDF
2008 Collaborate IOUG Presentation
Biju Thomas
 
PDF
Top 20 FAQs on the Autonomous Database
Sandesh Rao
 
PDF
ORACLE ARCHITECTURE
Manohar Tatwawadi
 
PPT
High Availability And Oracle Data Guard 11g R2
Mario Redón Luz
 
PDF
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
PDF
Oracle db architecture
Simon Huang
 
PPT
Less04 Instance
vivaankumar
 
Introduction to oracle
durgaprasad1407
 
Sql introduction
vimal_guru
 
Oracle architecture
Sandeep Kamath
 
PHP Oracle
Nur Hidayat
 
Lecture2 oracle ppt
Hitesh Kumar Markam
 
Oracle 10g Introduction 1
Eryk Budi Pratama
 
ora_sothea
thysothea
 
0396 oracle-goldengate-12c-tutorial
KlausePaulino
 
ORACLE Architechture.ppt
aggarwalb
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
Oracle11g notes
Manish Mudhliyar
 
Oracle Database Management Basic 1
Chien Chung Shen
 
2008 Collaborate IOUG Presentation
Biju Thomas
 
Top 20 FAQs on the Autonomous Database
Sandesh Rao
 
ORACLE ARCHITECTURE
Manohar Tatwawadi
 
High Availability And Oracle Data Guard 11g R2
Mario Redón Luz
 
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
Oracle db architecture
Simon Huang
 
Less04 Instance
vivaankumar
 
Ad

Recently uploaded (20)

PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
July Patch Tuesday
Ivanti
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 

Oracle RDBMS architecture

  • 2. about me with Oracle since 2000 DBA @H3G since 2003 my private (most technical related) thoughts: http://berxblog.blogspot.com @martinberx [email protected] no official presentations / trainings so far "it depends"
  • 3. roadmap ● Database ● Instance ○ spfile ● Processes ○ controlfile ● Session ○ datafile ● Statement ○ redo-logs / archives ● Transaction ● Cluster ● Cluster ● Listener + Cluster failover + Data Dictionary
  • 4. Oracle Database 11g: Interactive Quick Reference - Your Essential Guide to Oracle Database 11g Release 2 http://www.oracle.com/webapps/dialogue/ns/dlgwelcome.jsp?p_ext=Y&p_dlg_id=9575302&src=7027600&Act=54
  • 5. Database ○ spfile *.compatible='11.1.0.0.0' *.control_files='/appl/oracle/oradata/BERX2/control01. ctl','/appl/oracle/oradata/BERX2/control02. ctl','/appl/oracle/oradata/BERX2/control03.ctl' *.db_block_size=8192 *.db_name='BERX2' ...
  • 6. Database ○ spfile *.compatible='11.1.0.0.0' *.control_files='/appl/oracle/oradata/BERX2/control01. ctl','/appl/oracle/oradata/BERX2/control02. ctl','/appl/oracle/oradata/BERX2/control03.ctl' *.db_block_size=8192 *.db_name='BERX2' ● The database name ○ controlfile ● ● Names and locations of associated datafiles and redo log files The timestamp of the database creation ● The current log sequence number ● Checkpoint information (SCN)
  • 7. Database ○ spfile *.compatible='11.1.0.0.0' *.control_files='/appl/oracle/oradata/BERX2/control01. ctl','/appl/oracle/oradata/BERX2/control02. ctl','/appl/oracle/oradata/BERX2/control03.ctl' *.db_block_size=8192 *.db_name='BERX2' ● The database name ○ controlfile ● ● Names and locations of associated datafiles and redo log files The timestamp of the database creation ● The current log sequence number ● Checkpoint information (SCN) ● datafiles keeps persistent data ● Each tablespace in an Oracle database ○ datafile / tablespace ● consists of one or more datafiles Tablespaces: SYSTEM, UNDO, TEMP, data
  • 8. Database ○ spfile *.compatible='11.1.0.0.0' *.control_files='/appl/oracle/oradata/BERX2/control01. ctl','/appl/oracle/oradata/BERX2/control02. ctl','/appl/oracle/oradata/BERX2/control03.ctl' *.db_block_size=8192 *.db_name='BERX2' ● The database name ○ controlfile ● ● Names and locations of associated datafiles and redo log files The timestamp of the database creation ● The current log sequence number ● Checkpoint information (SCN) ● datafiles keeps persistent data ● Each tablespace in an Oracle database ○ datafile / tablespace ● consists of one or more datafiles Tablespaces: SYSTEM, UNDO, TEMP, data ○ redo-logs / archives
  • 10. Instance A database instance is a set of memory structures that manage database files. ● SGA ● PGA ● processes ○ background ○ server
  • 11. Processes ● background process DBWR, LGWR, SMON, PMON, CKPK, ARCH, MMON, MMNL, RECO, etc. ● server process Oracle Database creates server processes to handle the requests of client processes connected to the instance. A client process always communicates with a database through a separate server process. Server processes created on behalf of a database application can perform one or more of the following tasks: ● Parse and run SQL statements issued through the application, including creating and executing the query plan (see "Stages of SQL Processing") ● Execute PL/SQL code ● Read data blocks from data files into the database buffer cache (the DBWn background process has the task of writing modified blocks back to disk) ● Return results in such a way that the application can process the information
  • 12. Session A session is a logical entity in the database instance memory that represents the state of a current user login to a database. For example, when a user is authenticated by the database with a password, a session is established for this user. A session lasts from the time the user is authenticated by the database until the time the user disconnects or exits the database application.
  • 13. Statement ● DDL CREATE, ALTER, DROP, TRUNCATE, GRANT, AUDIT, COMMENT implicit commit ● DML SELECT, INSERT, UPDATE, MERGE, DELETE, EXPLAIN PLAN, LOCK TABLE ● Transaction Control SET TRANSACTION, SAVEPOINT, COMMIT, ROLLBACK ● ALTER (session, system) ● embedded (into procedural program)
  • 15. Transaction Logical unit of work that contains one or more SQL statements. All statements in a transaction commit or roll back together. The use of transactions is one of the most important ways that a database management system differs from a file system. ACID ● Atomicy all or nothing ● Consistency from one valid state to another ● Isolation transactions does not interfer ● Durability just stored
  • 16. Transaction - Isolation Levels 1. Read committed (default) A query will only be able access committed data. However, the transaction may be affected by changes made by other transactions. This can be set by: SET TRANSACTION ISOLATION LEVEL READ COMMITTED; (transaction level) ALTER SESSION SET ISOLATION_LEVEL READ COMMITTED; (session level) 2. Serializable transactions A query can only access data that was committed at the start of the transaction. Modification from DML operations performed from the same transaction will be visible. The Serializable transaction isolation level is not supported with distributed transactions. This can be set by: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; (transaction level) ALTER SESSION SET ISOLATION_LEVEL SERIALIZABLE; (session level) 3. Read only A query can only access data that was committed at the start of the transaction. Modification to the data is not allowed. This can be set by: SET TRANSACTION ISOLATION LEVEL READONLY; (transaction level) ALTER SESSION SET ISOLATION_LEVEL READONLY; (session level)
  • 17. Transaction - flow select sal from emp where ename in ('SMITH', 'ALLEN'); -- 800, 1600 set transaction name 'my trans 1'; UPDATE emp SET sal = 7000 WHERE ename = 'SMITH'; SAVEPOINT after_banda_sal; UPDATE emp SET sal = sal+10400 WHERE ename = 'ALLEN'; select sal from emp where ename in ('SMITH', 'ALLEN'); --7000, 12000 SAVEPOINT after_greene_sal; ROLLBACK TO SAVEPOINT after_banda_sal; UPDATE emp SET sal = sal+10300 WHERE ename = 'ALLEN'; select sal from emp where ename in ('SMITH', 'ALLEN'); -- 7000, 11900 rollback;
  • 23. Failover Transparent Application Failover if one instance dies, the client restarts the whole listener-connection-sequence, cursors are re-opened, statement re-run limitations: ● The effect of any ALTER SESSION statements will be lost. ● Global temporary tables will be lost. ● Any PL/SQL package states will be lost. ● Transactions involving INSERT, UPDATE, or DELETE statements cannot be handled automatically by TAF. If there is a failure you will most likely see an ORA-25402 error. Applications should be prepared to handle errors in the 25400-25425 range and rollback appropriately.
  • 24. TAF - errors ORA-25400: must replay fetch ORA-25406: could not generate a connect address Cause: A failure occured since the last fetch on this statement. Failover was able to Cause: Failover was unable to generate an address for a backup instance. bring the statement to its original state to allow continued fetches. Action: Contact Oracle customer support. Action: This is an internally used error message and should not be seen by the ORA-25407: connection terminated user. Cause: The connection was lost while doing a fetch. ORA-25401: can not continue fetches Action: This is an internally used error message and should not be seen by the Cause: A failure occured since the last fetch on this statement. Failover was unable user. to bring the statement to its original state to allow continued fetches. ORA-25408: can not safely replay call Action: Reexecute the statement and start fetching from the beginning Cause: The connection was lost while doing this call. It may not be safe to replay it ORA-25402: transaction must roll back after failover. Cause: A failure occured while a transaction was active on this connection. Action: Check to see if the results of the call have taken place, and then replay it if Action: The client must roll back. desired. ORA-25403: could not reconnect ORA-25409: failover happened during the network operation,cannot continue Cause: The connection to the database has been lost, and attempts to reconnect Cause: The connection was lost when fetching a LOB column. have failed. Action: Failover happened when fetching LOB data directly or indirectly. Please Action: Manually reconnect. replay the top level statement. ORA-25404: lost instance ORA-25425: connection lost during rollback Cause: The primary instance has died. Cause: The connection was lost while issuing a rollback and the application failed over. Action: This is an internally used error message and should not be seen by the user. Action: The connection was lost and failover happened during rollback. If the transaction is not externally coordinated, then Oracle implicitly rolled back, so no ORA-25405: transaction status unknown action is required. Otherwise examine pending_trans$ to determine if "rollback Cause: A failure occured while a transaction was attempting to commit. Failover force" is required. could not automatically determine instance status. ORA-25426: remote instance does not support shared dblinks Action: The user must determine the transaction's status manually. Cause: A shared dblink is being used to connect to a remote instance that does not support this feature because it is an older version. Action: Use a normal dblink if you need to connect to this instance.
  • 25. Data Dictionary ● Informations about the database ○ Meta-info about all objects, schemata, user, privileges, audit ○ DBA_* ● Informations about the instances ○ many informations about structures in memory ○ v$* / gv$* ● Nearly everything Oracle knows you can select
  • 26. further informations Oracle Documentation - Concepts Guide http://docs.oracle.com/cd/E11882_01/server.112/e25789/toc.htm ask ● Ops.Oracle team ● forums.oracle.com ● http://www.freelists.org/list/oracle-l read
  • 27. credits Arup Nanda - discussions about listener Aman Sharma - review of connect-flow Surachart Opun - general review Martin Schretzmeier - infrastructure infos Ops.Oracle team - review
  • 28. Next Presentations ● Physical structures & (SQL) tuning ● Capacity planning basics ● anything else?