2. Startupandshutdown o

Embed Size (px)

Citation preview

  • 8/13/2019 2. Startupandshutdown o

    1/3

    Startup and shutdown Method

    When startup command is issued, Oracle looks for the parameter file in following order.

    1. Spfile.ora

    2. init.ora

    Oracle look for the parameter file in O!"#$%&'O(%)d*s

    We can startup the data*ase instance with following options.

    1. startup

    2. startup nomount

    +. Startup mount

    startup pfile-)location)filename-

    . startup upgrade

    /. startup mount restrict

    1. startup:-

    1. It will read the parameter file.

    2. It will start the *ackground processes and allocate memor0 S"3. 4 Instance started.

    +. It reads the controlfile. 4Instance mounted.

    . 5h0sicall0 checks the datafiles and redolog files.

    /. #hecks the S#6 num*er of the datafiles and controlfiles.

    It is used in normal situations.

    If the S#6s in the control files don-t match some of the S#6s in the data files headers7the

    *ackground process smon3 will automaticall0 perform an instance reco8er0 *efore opening the

    data*ase.

    2. startup mount:--

    It will do 1,2 and +.

    It will not do and /.

    #an *e used when9:: !eco8er0 is needed for the entire data*ase, ;lash*ack is to *e performed,

    an0 feature like archi8e log is to *e ena*led or disa*led.

  • 8/13/2019 2. Startupandshutdown o

    2/3

    3. startup nomount:--

    It will do 1 and 2.

    It will not do +, and /.

    #an *e used when9:: #reating data*ase and creating controlfile.

    4. startup upgrade:--

    It will do 1 to / and

    . i8e the option of upgrading data*ase.

    =. sers cannot connect to the data*ase.

    #an *e used to upgrade the data*ase dictionar0

    Data*ase must *e shutdown and restarted for users to connect.

    5. startup mount restrict:--

    It will read 1, 2 and +.

    It will not read and /.

    sed when the data*ase is dropped.

    Changing the status:--

    Alter database mount

    ?his command can *e used when data*ase is in nomount state, this will read the controlfiles

    and mount the data*ase.

    Alter database open

    ?his command can *e used when data*ase is mounted.

    ?his will read the datafiles and redolog file and will check if the datafiles are consistent. "llows

    the users to connect to the data*ase,

    Alter database close

    ?his command can *e used when data*ase open. ?his will release the datafiles and redolog

    files.

    ser connections will not *e allowed. Status will change to mount.

    Alter database dismount

  • 8/13/2019 2. Startupandshutdown o

    3/3

    ?his command can *e used when data*ase is at mount state. ?his will release the control file

    and change the status to nomount.

    !he database can be shutdown with the "ollowing options:--

    Shutdown:--

    6o new user connections can *e made to the data*ase once the command is issued. Oracle

    waits for all users to e@it their sessions *efore shutting down the data*ase. 6o instance

    reco8er0 is needed when 0ou restart data*ase, it will *e consistent when it-s shut down in this

    wa0. Oracle closes the data files and terminates the *ackground processes. Oracle-s S" is

    deallocated.

    Shutdown transactional:--

    6o new user connections are permitted once the command is issued. %@isting users can-t start

    a new transaction and will *e disconnected. If a user has a transaction in progress, oracle will

    wait until the transaction is completed *efore disconnecting the user. "fter all e@istingtransactions are completed. Oracle shuts down the instance and deallocates memor0. Oracle

    writes all redo log *uffers and data *lock *uffers to disk. 6o instance reco8er0 is needed

    *ecause the data*ase is consistent.

    A%I6 DA(S&$O#B.sleepseconds > C.C13%6D)

    Shutdown immediate:--

    6o new user connections are allowed once the command is issued. Oracle immediatel0

    disconnects all users. Oracle terminates all currentl0 e@ecuting transactions. ;or all transactions

    terminated midwa0, oracle will perform a roll*ack so that data*ase ends up consistent.

    Sometimes oracle ma0 *e *us0 rolling *ack the transactions it Eust terminated. Oracle

    terminates the *ackground processes and deallocates memor0. 6o instance reco8er0 is needed

    upon starting up the data*ase *ecause it is consistent when shut down.

    Shutdown abort:--

    6o new connections are permitted once the command is issued. %@isting sessions are

    terminated, regardless of whether the0 ha8e an acti8e transaction or not. Oracle doesn-t roll

    *ack the terminated transactions. Oracle doesn-t write the redo log *uffers and data *uffers todisk. Oracle terminates the *ackground processes, deallocates memor0 immediatel0, and

    shutdown. pon restarting, oracle will perform an automatic instance reco8er0, *ecause the

    data*ase isn-t guaranteed to *e consistent when shut down.