19, oracle start and shutdown process


19.1, oracle database instance to start in three steps:

1, start oracle routine:

startup nomount;

# Read initialization parameter file, start an instance, but does not install the database. When the database started in this mode, the parameter file is read,

# Memory structure and background processes are started, but they are not attached or communicate with the disk structure of the database, the database can not be used,

# Usually starts here do create database, create or recreate control file, mount standby database

# Etc, and modify parameter is also possible.


2, reads the control file, load the database:

alter database mount;

startup mount;

# Start an instance, open the control file and load the database, but the database is not open;

All work #startup mount option to perform startup nomount options, but the other additional database structure and into these structures

# Line interactive, when it is used to obtain information from Oracle to find and attach to the main control file database structure. When in this mode,

# You can perform some administrative-type tasks, such as reading control file, recover dtabase, backup database,

#rename db files、change archivelog mode等;


3, open the database:

alter database open;

startup

# Is the most complete, instances, database load, database, log files open are completed

# If you do not specify any command-line mode on STARTUP, STARTUP OPEN option is the default startup mode. STARTUP OPEN

# Option to perform all the steps STARTUP NOMOUNT and STARTUP MOUNT option, this option becomes the database for all users

# Are available.


startup force: If you encounter difficulties when starting the database in the normal way, you can use STARTUP FORCE option, STARTUP FORCE

First option abnormal shut down the database, and then restart it.


STARTUP RESTRICT: option to start the database and put it into OPEN mode, but only to users who have RESTRICTED SESSION privilege given access.


4, view the status of the database instance:

select status from v$instance;

# For the open state

 

19.2, shut down the database instance:

1, the normal mode when the database instance:

shutdown normal;


2, immediately shut down the way the database instance:

shutdown immediate;

# Shutdown immediate implementation of the database is not shut down immediately, but perform some cleanup work at Oracle after the close (terminate the session, release the session resources),

# Shutdown can not be closed when a database, shutdown immediate closing operation of the database can be accomplished.

   

3, directly off the database instance:

shutdown abort;

# Is accessing a database session will be abruptly terminated, if the database has a large number of operations being performed, then after executing shutdown abort, restart the database

# Take a long time, because when the shutdown abort, kill the process with the same effect, shut down the database immediately, this time to file status may be inconsistent,

# Because the normal database synchronization will check each file so that when the restart point in time the same file and do not crash recovery, if the same checkpoint information,

# Do crash recovery, if the checkpoint information is inconsistent (just update the file header) you need to do media recovery. These questions are a good deal, this time the problem is the fear system

# There are a lot of IO, the results of such a sudden interruption caused by write, happened to cause the logical bad blocks file blocks that trouble relatively large number, especially block table space system damage,

# Although the probability of shutdown abort error is very small, only 1,000 people may encounter a person, but we still have to be careful. Proper handling procedures that

#shutdown immediate, if the database can not slow down down, observe IO status on the os, io almost no time to open another window shutdown abort,

# Hardly a problem.




Guess you like

Origin www.cnblogs.com/LiuChang-blog/p/12315875.html