SlideShare a Scribd company logo
1 of 30
DBAMETRIX Solutions
Present
Oracle Startup & Shutdown
Process
Oracle DBA Learn by Presentation series

• Oracle DBA learning by presentation offered by
  DBAMETRIX Solutions.
• This all presentations have been prepared by Gitesh P
  Trivedi.
• Gitesh Trivedi has 14 years working experience in DBA
  field and as expert consultant faculty.
• For discussing and solving problem please log in
  http://dbametrix.wordpress.com/
• For more details please contact to www.dbametrix.com
  or gitesh@dbametrix.com or giteshtrivedi@yahoo.com
In this session we get detail information for
following topics
• Which type of shutdown options available
• Which type of startup options available
• How Oracle database shutdown
• How SGA de-allocates from memory region
• How Oracle protects committed and un-committed data
• How Oracle performs normal startup
• How Oracle checks datafiles and controlfiles using
  internal check-up
• How Oracle enables & performs recovery process
• What are the internal processes
Shutdown Process

• Following options are available in Oracle

• Shutdown normal

• Shutdown transactional

• Shutdown immediate

• Shutdown abort
Shutdown normal

• Using command “shutdown;” or “shutdown normal;”.
• Default option is normal.
• Oracle triggers checkpoint process and all dirty buffers
  flush in to disk.
• Checkpoint writes stop system change number (STOP
  SCN) in to controlfile and updates all respective datafile
  header.
• Oracle drops all temporary segments from temp
  tablespaces.
• Oracle closes all datafiles and online redologfiles.
• Oracle de-allocates SGA from memory region of
  operating system.
Shutdown Normal
                                                               New connection not
             Existing Session can                                    allow
                    do work




              Buffer            Log
                                Buff      Shared Pool     C
              Cache              er                       on
                                                          St
                                                           r
                Sort Ext Pool          SGA
  Control
    File
 Stop: SCN                                              Dbwr
                                        Log Writer
                                                                          SCN:
                                                                         Datafiles
              Log                Log
              File               File
             Group-             Group
               1                  -2
While executing Shutdown Normal

• Existing session can perform work. Once those logout after
  that don’t get connection.
• No new session allows.
• After all sessions logout then Oracle starts shutdown process.
• Checkpoint occurs, dirty buffers flush in to disk.
• LGWR flushes data from Log Buffer to Online redo log files.
• Stop system change number generates and stores in
  controlfile (Stop: SCN) as well as all datafiles (Current: SCN).
• If shutdown event trigger exists then fires.
• Temporary segments drop from temporary tablespace.
• Oracle closes all datafiles, redo logs and controlfiles.
• Oracle de-allocates shared global area from memory region of
  Operating system.
Practically we take example of “shutdown”
normal command as follows.
Shutdown Transactional
                                                                New connection not
             Existing Session can do                                  allow
             work, End of transaction
                  session ended




               Buffer            Log
                                 Buff      Shared Pool     C
               Cache              er                       on
                                                           St
                                                            r
                 Sort Ext Pool          SGA
  Control
    File
 Stop: SCN                                               Dbwr
                                         Log Writer
                                                                           SCN:
                                                                          Datafiles
               Log                Log
               File               File
              Group-             Group
                1                  -2
While executing Shutdown Transactional

• Existing session can perform work. Once transaction to be
  ended it becomes kicked off from database. If logout then also
  doesn’t get connection.
• No new session allows.
• After all sessions logout then Oracle starts shutdown process.
• Checkpoint occurs, dirty buffers flush in to disk.
• LGWR flushes data from Log Buffer to Online redo log files.
• Stop system change number generates and stores in
  controlfile (Stop: SCN) as well as all datafiles (Current: SCN).
• If shutdown event trigger exists then fires.
• Temporary segments drop from temporary tablespace.
• Oracle closes all datafiles, redo logs and controlfiles.
• Oracle de-allocates shared global area from memory region of
  Operating system.
Practically we can take example of
“shutdown transactional” as follows
Shutdown Immediate
                                                                 New connection not
                                                                       allow
              ALL Existing Session
             disconnect immediately




              Buffer            Log
                                Buff      Shared Pool       C
              Cache              er                         on
                                                            St
                                                             r
                Sort Ext Pool          SGA
  Control
    File
 Stop: SCN
                                        Log Writer
                                                     Dbwr
                                                                            SCN:
                                                                           Datafiles
              Log                Log
              File               File
             Group-             Group
               1                  -2
While executing Shutdown Immediate

• Existing ALL sessions are kicked off from database. They
  loose connection from database.
• No new session allows.
• User will lose all uncommitted transaction data. Immediately
  Oracle starts shutdown process.
• Checkpoint occurs, dirty buffers flush in to disk.
• LGWR flushes data from Log Buffer to Online redo log files.
• Stop system change number generates and stores in
  controlfile (Stop: SCN) as well as all datafiles (Current: SCN).
• If shutdown event trigger exists then fires.
• Temporary segments drop from temporary tablespace.
• Oracle closes all datafiles, redo logs and controlfiles.
• Oracle de-allocates shared global area from memory region of
  Operating system.
Practically we can take example of
“shutdown immediate” as follows
Shutdown abort
                                                               New connection not
                                                                     allow
              ALL Existing Session
             disconnect immediately




              Buffer            Log
                                Buff      Shared Pool    C
              Cache              er                      on
                                                         St
                                                          r
                Sort Ext Pool          SGA
  Control
    File
 Stop: SCN
                                        Log Writer      Dbwr
                                                                          SCN:
                                                                         Datafiles
              Log                Log
              File               File
             Group-             Group
               1                  -2



                                 Shutdown
                                SGA/Instance
While executing Shutdown ABORT

•   Existing ALL sessions are kicked off from database. They loose
    connection from database.
•   No new session allows.
•   User will lose all uncommitted transaction data. Immediately Oracle
    starts shutdown process.
•   NO Checkpoint occurs & NO dirty buffers flush in to disk.
•   NO LGWR flushes data from Log Buffer to Online redo log files.
•   There is no STOP SCN generated and not Controlfile, datafile
    header updated.
•   No shutdown event trigger even if exists.
•   No Temporary segments drop from temporary tablespace.
•   Oracle closes only Instance (SGA and background processes).
•   Database will be in inconsistence mode.
Problem occurs during shutdown process

• Oracle updates alert.log in every shutdown options.
• If any error occurs Oracle logs in to alert.log.
• During “shutdown immediate” option, Oracle may takes
  time for shutting down database due to rollback pending
  transaction.
• Without “abort” option, Database is consistence mode in
  all other shutting down options. We can take cold
  backup.
• In “shutdown abort” option, database is in inconsistence
  mode, we can’t take cold backup.
Practically we can take example of
“shutdown abort” as follows
Physical structure of Oracle database

•   Parameter file (init.ora & spfile)
•   Password file
•   Control files
•   Online redo log files
•   Datafiles
•   Trace files including alert.log
•   If sys user’s audit enables then audit files
Startup Process

• Step by step startup command
• Startup nomount ( only instance started)
• Startup mount (control file open and check)
• Startup open ( datafiles and redo log files open and
  check)
• Startup force ( forcibly instance start and instance
  recovery perform)
• All commands are available after each step
• Oracle logs all details and error in alert.log file during
  startup command execution
Startup nomount

• Oracle reads parameter file and populates instance.
• Before startup instance Oracle also checks password file
  and match it.
• Oracle also reads location and name of controlfile from
  parameter file (init.ora or spfile).
• Shared Global Area and background processes are
  starting.
• After finishing command execution successfully, Oracle
  prompts message “instance started”.
• This command is useful for new database creation and
  controlfile recreation.
Startup nomount                                    Parameter
                                                      file




           Buffer           Log
                            Buff     Shared Pool     C
           Cache             er                      on
                                                     St
                                                      r
            Sort Ext Pool          SGA                         Pmon



                  Dbwr
                                                      Smon
Startup mount

• After instance starts next step is mount.
• In mount stage Oracle opens all controlfiles from each
  location and read contains. It also checks STOP SCN
  from controlfile.
• If controlfile is missing or corrupt, Oracle gives error in
  mount stage only.
• If any datafile or online redo log file is missing there is no
  error will be generated.
• If we started instance using “startup nomount” then we
  can mount database using “alter database mount;”
  command.
Startup mount                                       Parameter
                                                       file




            Buffer           Log
                             Buff     Shared Pool     C
            Cache             er                      on
                                                      St
 Control                                               r
   File      Sort Ext Pool          SGA                         Pmon
Stop: SCN


                   Dbwr
                                                       Smon
Practically we can take example of “startup”
step by step as follows
Startup open

• After mounting database, Oracle opens all datafiles and
  online redo log files.
• Oracle matches STOP SCN of controlfile to each and every
  datafile (from header of datafile).
• If Oracle finds any mismatch of this number due to instance
  crash or “shutdown abort” then it performs instance recovery.
• If Oracle finds any mismatch of this number due to not above
  circumstances then asks for media recovery.
• Alternate we can use “alter database open” command after
  mounting database with “startup mount;”.
• If startup event trigger exists then fires after open database.
Startup open                                            Parameter
                                                           file




            Buffer             Log
                               Buff       Shared Pool     C
            Cache               er                        on
                                                          St
 Control                                                   r
   File        Sort Ext Pool          SGA                           Pmon
Stop: SCN


                     Dbwr
                                                           Smon


                                                                            SCN:
                                                                           Datafiles
                 Log               Log
                 File              File
                Group-            Group
                  1                 -2
Practically we can take example of normal
“startup” as follows
When Oracle performs recovery?

• When Instance crashed.
• When issued “shutdown abort”.
• When mismatch found of SCN of controlfile and any of
  datafile’s header.
• During instance recovery Oracle performs roll-forward
  and roll-backward scenario.
• If Oracle finds any of new datafile or older datafile means
  new Stop: SCN or older Stop: SCN then asks for media
  recovery.
• After starting database Stop SCN becomes infinitive in
  controlfile.
DBAMETRIX Solutions
               Present
       Oracle Startup and Shutdown Process

Prepared By: Gitesh P Trivedi
gitesh@dbametrix.com
http://www.dbametrix.com

More Related Content

More from Remote DBA Services

do's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Jobdo's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of JobRemote DBA Services
 
logical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptxlogical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptxRemote DBA Services
 
oracle 23c new features for developer and dba
oracle 23c new features for developer and dbaoracle 23c new features for developer and dba
oracle 23c new features for developer and dbaRemote DBA Services
 
Oracle Database Buffer Cache Management.pptx
Oracle Database Buffer Cache Management.pptxOracle Database Buffer Cache Management.pptx
Oracle Database Buffer Cache Management.pptxRemote DBA Services
 
What is the Oracle Database Buffer Cache
What is the Oracle Database Buffer CacheWhat is the Oracle Database Buffer Cache
What is the Oracle Database Buffer CacheRemote DBA Services
 
Oracle dba advance-24-7-running databases
Oracle dba advance-24-7-running databasesOracle dba advance-24-7-running databases
Oracle dba advance-24-7-running databasesRemote DBA Services
 
Oracle database 12c new features
Oracle database 12c new featuresOracle database 12c new features
Oracle database 12c new featuresRemote DBA Services
 
1Z0-052 Oracle 11g Administration I
1Z0-052 Oracle 11g Administration I1Z0-052 Oracle 11g Administration I
1Z0-052 Oracle 11g Administration IRemote DBA Services
 
Remote Dba Team Oracle Architecture In Nutshell
Remote Dba Team   Oracle Architecture In NutshellRemote Dba Team   Oracle Architecture In Nutshell
Remote Dba Team Oracle Architecture In NutshellRemote DBA Services
 
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By PresentationRemote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By PresentationRemote DBA Services
 

More from Remote DBA Services (10)

do's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Jobdo's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Job
 
logical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptxlogical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptx
 
oracle 23c new features for developer and dba
oracle 23c new features for developer and dbaoracle 23c new features for developer and dba
oracle 23c new features for developer and dba
 
Oracle Database Buffer Cache Management.pptx
Oracle Database Buffer Cache Management.pptxOracle Database Buffer Cache Management.pptx
Oracle Database Buffer Cache Management.pptx
 
What is the Oracle Database Buffer Cache
What is the Oracle Database Buffer CacheWhat is the Oracle Database Buffer Cache
What is the Oracle Database Buffer Cache
 
Oracle dba advance-24-7-running databases
Oracle dba advance-24-7-running databasesOracle dba advance-24-7-running databases
Oracle dba advance-24-7-running databases
 
Oracle database 12c new features
Oracle database 12c new featuresOracle database 12c new features
Oracle database 12c new features
 
1Z0-052 Oracle 11g Administration I
1Z0-052 Oracle 11g Administration I1Z0-052 Oracle 11g Administration I
1Z0-052 Oracle 11g Administration I
 
Remote Dba Team Oracle Architecture In Nutshell
Remote Dba Team   Oracle Architecture In NutshellRemote Dba Team   Oracle Architecture In Nutshell
Remote Dba Team Oracle Architecture In Nutshell
 
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By PresentationRemote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
 

Recently uploaded

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 

Recently uploaded (20)

Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Remote DBA team- Oracle Database Startup & Shutdown Process

  • 2. Oracle DBA Learn by Presentation series • Oracle DBA learning by presentation offered by DBAMETRIX Solutions. • This all presentations have been prepared by Gitesh P Trivedi. • Gitesh Trivedi has 14 years working experience in DBA field and as expert consultant faculty. • For discussing and solving problem please log in http://dbametrix.wordpress.com/ • For more details please contact to www.dbametrix.com or gitesh@dbametrix.com or giteshtrivedi@yahoo.com
  • 3. In this session we get detail information for following topics • Which type of shutdown options available • Which type of startup options available • How Oracle database shutdown • How SGA de-allocates from memory region • How Oracle protects committed and un-committed data • How Oracle performs normal startup • How Oracle checks datafiles and controlfiles using internal check-up • How Oracle enables & performs recovery process • What are the internal processes
  • 4. Shutdown Process • Following options are available in Oracle • Shutdown normal • Shutdown transactional • Shutdown immediate • Shutdown abort
  • 5. Shutdown normal • Using command “shutdown;” or “shutdown normal;”. • Default option is normal. • Oracle triggers checkpoint process and all dirty buffers flush in to disk. • Checkpoint writes stop system change number (STOP SCN) in to controlfile and updates all respective datafile header. • Oracle drops all temporary segments from temp tablespaces. • Oracle closes all datafiles and online redologfiles. • Oracle de-allocates SGA from memory region of operating system.
  • 6. Shutdown Normal New connection not Existing Session can allow do work Buffer Log Buff Shared Pool C Cache er on St r Sort Ext Pool SGA Control File Stop: SCN Dbwr Log Writer SCN: Datafiles Log Log File File Group- Group 1 -2
  • 7. While executing Shutdown Normal • Existing session can perform work. Once those logout after that don’t get connection. • No new session allows. • After all sessions logout then Oracle starts shutdown process. • Checkpoint occurs, dirty buffers flush in to disk. • LGWR flushes data from Log Buffer to Online redo log files. • Stop system change number generates and stores in controlfile (Stop: SCN) as well as all datafiles (Current: SCN). • If shutdown event trigger exists then fires. • Temporary segments drop from temporary tablespace. • Oracle closes all datafiles, redo logs and controlfiles. • Oracle de-allocates shared global area from memory region of Operating system.
  • 8. Practically we take example of “shutdown” normal command as follows.
  • 9. Shutdown Transactional New connection not Existing Session can do allow work, End of transaction session ended Buffer Log Buff Shared Pool C Cache er on St r Sort Ext Pool SGA Control File Stop: SCN Dbwr Log Writer SCN: Datafiles Log Log File File Group- Group 1 -2
  • 10. While executing Shutdown Transactional • Existing session can perform work. Once transaction to be ended it becomes kicked off from database. If logout then also doesn’t get connection. • No new session allows. • After all sessions logout then Oracle starts shutdown process. • Checkpoint occurs, dirty buffers flush in to disk. • LGWR flushes data from Log Buffer to Online redo log files. • Stop system change number generates and stores in controlfile (Stop: SCN) as well as all datafiles (Current: SCN). • If shutdown event trigger exists then fires. • Temporary segments drop from temporary tablespace. • Oracle closes all datafiles, redo logs and controlfiles. • Oracle de-allocates shared global area from memory region of Operating system.
  • 11. Practically we can take example of “shutdown transactional” as follows
  • 12. Shutdown Immediate New connection not allow ALL Existing Session disconnect immediately Buffer Log Buff Shared Pool C Cache er on St r Sort Ext Pool SGA Control File Stop: SCN Log Writer Dbwr SCN: Datafiles Log Log File File Group- Group 1 -2
  • 13. While executing Shutdown Immediate • Existing ALL sessions are kicked off from database. They loose connection from database. • No new session allows. • User will lose all uncommitted transaction data. Immediately Oracle starts shutdown process. • Checkpoint occurs, dirty buffers flush in to disk. • LGWR flushes data from Log Buffer to Online redo log files. • Stop system change number generates and stores in controlfile (Stop: SCN) as well as all datafiles (Current: SCN). • If shutdown event trigger exists then fires. • Temporary segments drop from temporary tablespace. • Oracle closes all datafiles, redo logs and controlfiles. • Oracle de-allocates shared global area from memory region of Operating system.
  • 14. Practically we can take example of “shutdown immediate” as follows
  • 15. Shutdown abort New connection not allow ALL Existing Session disconnect immediately Buffer Log Buff Shared Pool C Cache er on St r Sort Ext Pool SGA Control File Stop: SCN Log Writer Dbwr SCN: Datafiles Log Log File File Group- Group 1 -2 Shutdown SGA/Instance
  • 16. While executing Shutdown ABORT • Existing ALL sessions are kicked off from database. They loose connection from database. • No new session allows. • User will lose all uncommitted transaction data. Immediately Oracle starts shutdown process. • NO Checkpoint occurs & NO dirty buffers flush in to disk. • NO LGWR flushes data from Log Buffer to Online redo log files. • There is no STOP SCN generated and not Controlfile, datafile header updated. • No shutdown event trigger even if exists. • No Temporary segments drop from temporary tablespace. • Oracle closes only Instance (SGA and background processes). • Database will be in inconsistence mode.
  • 17. Problem occurs during shutdown process • Oracle updates alert.log in every shutdown options. • If any error occurs Oracle logs in to alert.log. • During “shutdown immediate” option, Oracle may takes time for shutting down database due to rollback pending transaction. • Without “abort” option, Database is consistence mode in all other shutting down options. We can take cold backup. • In “shutdown abort” option, database is in inconsistence mode, we can’t take cold backup.
  • 18. Practically we can take example of “shutdown abort” as follows
  • 19. Physical structure of Oracle database • Parameter file (init.ora & spfile) • Password file • Control files • Online redo log files • Datafiles • Trace files including alert.log • If sys user’s audit enables then audit files
  • 20. Startup Process • Step by step startup command • Startup nomount ( only instance started) • Startup mount (control file open and check) • Startup open ( datafiles and redo log files open and check) • Startup force ( forcibly instance start and instance recovery perform) • All commands are available after each step • Oracle logs all details and error in alert.log file during startup command execution
  • 21. Startup nomount • Oracle reads parameter file and populates instance. • Before startup instance Oracle also checks password file and match it. • Oracle also reads location and name of controlfile from parameter file (init.ora or spfile). • Shared Global Area and background processes are starting. • After finishing command execution successfully, Oracle prompts message “instance started”. • This command is useful for new database creation and controlfile recreation.
  • 22. Startup nomount Parameter file Buffer Log Buff Shared Pool C Cache er on St r Sort Ext Pool SGA Pmon Dbwr Smon
  • 23. Startup mount • After instance starts next step is mount. • In mount stage Oracle opens all controlfiles from each location and read contains. It also checks STOP SCN from controlfile. • If controlfile is missing or corrupt, Oracle gives error in mount stage only. • If any datafile or online redo log file is missing there is no error will be generated. • If we started instance using “startup nomount” then we can mount database using “alter database mount;” command.
  • 24. Startup mount Parameter file Buffer Log Buff Shared Pool C Cache er on St Control r File Sort Ext Pool SGA Pmon Stop: SCN Dbwr Smon
  • 25. Practically we can take example of “startup” step by step as follows
  • 26. Startup open • After mounting database, Oracle opens all datafiles and online redo log files. • Oracle matches STOP SCN of controlfile to each and every datafile (from header of datafile). • If Oracle finds any mismatch of this number due to instance crash or “shutdown abort” then it performs instance recovery. • If Oracle finds any mismatch of this number due to not above circumstances then asks for media recovery. • Alternate we can use “alter database open” command after mounting database with “startup mount;”. • If startup event trigger exists then fires after open database.
  • 27. Startup open Parameter file Buffer Log Buff Shared Pool C Cache er on St Control r File Sort Ext Pool SGA Pmon Stop: SCN Dbwr Smon SCN: Datafiles Log Log File File Group- Group 1 -2
  • 28. Practically we can take example of normal “startup” as follows
  • 29. When Oracle performs recovery? • When Instance crashed. • When issued “shutdown abort”. • When mismatch found of SCN of controlfile and any of datafile’s header. • During instance recovery Oracle performs roll-forward and roll-backward scenario. • If Oracle finds any of new datafile or older datafile means new Stop: SCN or older Stop: SCN then asks for media recovery. • After starting database Stop SCN becomes infinitive in controlfile.
  • 30. DBAMETRIX Solutions Present Oracle Startup and Shutdown Process Prepared By: Gitesh P Trivedi gitesh@dbametrix.com http://www.dbametrix.com