Saturday 14 March 2015

Database Startup & Shutdown

   Database Startup & Shutdown 
Startup :
The database is open and ready for use after being created. Once the Operating system is shutdown, or the database is shutdown, it must be started and opened before it can be accessed. 
There are three main modes to start the database:
1) NOMOUNT:
 The NOMOUNT mode is used to create a SGA or to create a control file.
2) MOUNT:
 The MOUNT mode reads the control files but does not access any other datafiles. The MOUNT mode is typically used for restoring the database or for moving database datafiles. 
3) OPEN:
The OPEN mode makes the database available to other users. At this point, all database datafiles are opened for access. 
Other modes are RESTRICT, RECOVER, and MIGRATE.
 The RESTRICT mode is used to fully open the database but only those users with the RESTRICTED SESSION system privilege will be able to connect to the database. This mode lets you perform database maintenance tasks while ensuring your application users cannot access the database.
 The RECOVER mode is used to automatically start recovery of the database. Alternatively, you could startup the database in MOUNT mode and issue the ALTER DATABASE RECOVER command. 
The MIGRATE mode is required starting with Oracle 9i to migrate the database from one version to another. If you do not start in MIGRATE mode, the upgrade scripts will not run. 
To startup a database using SQL*Plus use the following procedure. The command used is the STARTUP command; its format follows. 
STARTUP  [RESTRICTED] [FORCE] [PFILE=filename or SPFILE=filename]
         [EXCLUSIVE or PARALLEL]
         [MOUNT or OPEN] dbname
         [NOMOUNT] [RECOVER] [MIGRATE]
1. Log in to SQL*Plus as a user with SYSDBA (or SYSOPER) privileges. Prior to Oracle 9i, you could additionally sign on as the INTERNAL user or SYS, but INTERNAL is deprecated in 9i.
2. Issue one of the following commands:
1. STARTUP OPEN dbname PFILE=filename 

This command starts the instance, opens the database named dbname using the parameter file specified by the filename following the PFILE= clause. This starts up the database in the default, EXCLUSIVE mode.
2. STARTUP RESTRICT SPFILE=filename 

This command starts the instance, opens the database using the specified server parameter file following the SPFILE= clause. This starts up the database in the restricted only mode (only users with RESTRICTED SESSION privilege can log in).
3. STARTUP NOMOUNT 

This command starts the instance, but leaves the database dismounted and closed. Cannot be used with EXCLUSIVE, MOUNT or OPEN.
4. STARTUP MOUNT 

This command starts the instance and mounts the database, but leaves it closed.
5. STARTUP OPEN dbname PARALLEL 
This command starts the instance, opens the database and puts the database in PARALLEL mode for multi-instance use in pre-Oracle 8 versions. As of Oracle 8 simply setting the initialization parameter PARALLEL_SERVER to TRUE starts the instance in parallel server (shared) mode. PARALLEL is obsolete as of Oracle 8. Cannot be used with EXCLUSIVE or NOMOUNT or if the INIT.ORA parameter SINGLE_PROCESS is set to TRUE. The SHARED parameter is also obsolete as of Oracle 8. 
6. STARTUP OPEN dbname EXCLUSIVE 

This command is functionally identical to "a" above. Cannot be specified if PARALLEL or NOMOUNT is also specified in pre-Oracle 8 versions. EXCLUSIVE is obsolete as of Oracle 8. If PARALLEL_SERVER is FALSE the database defaults to EXCLUSIVE.
7. The FORCE parameter can be used with any of the above options to force a shutdown and restart of the database into that mode. This is not normally done and is only used for debugging and testing.
8. The RECOVER option can be used to immediately start recovery of the database on startup if desired. 
9. The MIGRATE option is used to start the database to upgrade to a new version. This option is required to migrate to Oracle 9i and above. 
Shutdown:
The databases should be shutdown before system shutdowns, before full backups and anytime system operations require it to be shutdown. 
To perform a manual shutdown, perform the following procedure. 
1. Log in to SQL*Plus as the SYS user.
2. Issue the appropriate SHUTDOWN command.
1. No option means SHUTDOWN NORMAL -
                                       the database waits for all users to disconnect, prohibits new connects, then closes and dismounts the database, then shuts down the instance.
2. SHUTDOWN IMMEDIATE -
                           cancels current calls like a system interrupt, and closes and dismounts the database, then shuts down the instance. PMON gracefully shuts down the user processes. No instance recovery is required on startup.
3. SHUTDOWN ABORT - 
                        This doesn't wait for anything. It shuts the database down now. Instance recovery will probably be required on startup. You should escalate to this by trying the other shutdowns first. 
4. SHUTDOWN TRANSACTIONAL:
                                 cancels current calls like a system interrupt, and closes and dismounts the database, then shuts down the instance. PMON gracefully shuts down the user processes. No instance recovery is required on startup.

2 comments:

  1. Videoslot777.COM | Videoslot777.COM - Free
    Videoslot777.COM. free. youtube.com - Videoslot777. video game online slots games and more with no deposit Videoslot777.com youtube to mp3 reddit · Videoslot777.com.

    ReplyDelete
  2. JCMH - MGM Grand Hotel and Casino Toledo
    Experience casino gaming with the best in gaming! 오산 출장마사지 A $350 daily welcome bonus, a VIP 안양 출장안마 club, and VIP nights for all 제주도 출장샵 of the 양산 출장샵 MGM 구미 출장안마 Resorts International

    ReplyDelete