Startup / Shutdown Database 11g.

This tutorial is for new students who wants to learn how to startup / shutdown their database cleanly.
As a DBA, you often perform special operations such as shutting down or starting up a database. Because only a DBA should perform these operations, the database administrator usernames require a secure authentication scheme.

To shutdown and startup your database instance in oracle database 11g, you need special priviledges which are:
1. Special Operating system priviledge i.e. oracle user (In OEL).
2. SYSDBA priviledges
3. SYSOPER priviledges

Startup Process

Before you start up your database instance and connect as sysdba, startup your listener and enterprise manager.

To connect your listener run this query:

          lsnrctl start
          lsnrctl status /*Checks status of listener*/
          lsnrctl stop /*Stops listener network service*/ 
          

After starting up your listener network service, you then start your Enterprise Manager control

To start your enterprise manager, run the following single query.

          emctl start dbconsole
          

After starting emctl, if we wish to use Enterprise manager all we have to do is use a web browser with url: https://localhost:1153/em

Now to start your instance (An instance is a collection of background processes and memory structures that allows us access our database.) we connect to have sysdba/sysoper priviledges.

sqlplus / as sysdba /*connects us as user sys with sysdba priviledges*/
             

Instance startup involves three stages:
1. Unmounted: When instance is started (Background process + Memory structure = instance).
2. Mounted: Instance is associated with database at the startup stage process.(control file is mounted.)
3. Open: Datafiles, redo logs are opened. i.e. database is opened.

After running the sql*plus query, you would observe the instance is connected to an idle instance meaning its in the unmount stage.
To Open instance, simply run startup command.

startup 

starting up oracle database11g

Shutdown Process

To shutdown your database, you must have SYSDBA or SYSOPER priviledges.
The shutdown processes are:
1. Close: closes the database
2. Unmount: unmounts the database
3. Shutdown: shutdown the instance.

There are four different modes of shutting down your database:
1. Normal: if you just type shutdown on sql*plus prompt, thats a normal shutdown. A normal shutdown waits for every session to close  before it actually shuts down.
2. Transactional: Using shutdown transactional on sql*plus prompt waits for all transaction to close before it actually shuts down.
3. Immediate: Most used shutdowns type, it terminates all session and closes the database once it is run.
4. Abort: if all fails, then the shutdown abort is used to forcefully shutdown the database. also, Note that during database startup again, instance recovery is performed(i.e. Applying your redo logs to your database).

shutdown /*shutdown normal*/
shutdown transactional 
shutdown immediate
shutdown abort