Thursday 9 June 2016

Startup and Shutdown of Oracle Database


STARTING ORACLE DATABASE
      Only DBA users can start Oracle Database Server. The default DBA users are SYS and SYSTEM.
SYS user: This user is owner of Oracle DB
SYSTEM user: This user is general Administrator.
Note:- generally SYS user only starts or stops Oracle DB.
Privileges used by SYS user for DB connection:
Two Privileges or permissions are used by SYS user
  1. sysoper (System operator)
  2. It allows to perform start/stop of DB with some maintenance operations such as backup.
  3. When connected with this privilege user is treated as public user.
  4. sysdba (System DB administrator)
      It allows to perform all admin operation including DB startup/shutdown.
Selecting a specific Database:-
      On one Oracle DB server there will be several DB’s. All the Databases that are created on server are listed in a file “/etc/oratab”file.
1.
Setting a specific DB Name for working:-
export ORACLE_SID=db_name
2
      Initial DB server machine after server boots the server machine no database is ready for working. So it is required to start the database whichever is needed.
3.
 
Idle instance indicates Oracle DB is not available. Because it is not started.
When Oracle DB is started. It performs 3 operations
  1. Oracle Instance Started
  2. Database Mounted
  3. Database opened
DISPLAYING ORACLE DB SERVER WORKING ENVIRONMENT
Displaying Name of the Database:-
4
Displaying version of Oracle Database:-
5
Displaying Instance Name which operates Oracle Database:-
6
Displaying the Name of the server machine:-
7
Displaying status of the Database:-
8
Displaying of Operating System of the server machine:-
9
UNDERSTANDING STAGES OF ORACLE DB STARTUP
Database startup is having 3 stages
  1. Instance Started (nomount stage)
  2. Database Mounted (Mount Stage)
  3. Open stage
Starting oracle instance
10
Changing the DB stage from nomount to mount stage:-
11
Changing the DB state from mount to open state:-
12
 
 
 
 
 
CLOSING ORACLE DATABASE
 
Oracle Database can be closed in 3 steps.
  1. Closing Database (files)
  2. Dismounting Database (disconnects DB from Instance)
  3. Instance is shutdown (Removes Instance from DB server)
13
Types of Database Shutdown
Oracle Database can be closed in 4 types
  1. Normal Shutdown
  2. Transactional Shutdown
  3. Immediate Shutdown
  4. Abort Shutdown
Normal Shutdown:-
      In this process Oracle database is closed in the above 3 steps. But this is performed if ever no user is connected to the database. If ever any user is connected to the Database the DB server keeps the DB in shutdown mode. So the all connected users can perform as usual database operations at the same time no new DB connections are allowed.
 
      Finally the DB is closed once all the connected users are disconnected from the Database server.
13
Transactional Shutdown:-
      This type of shutdown closes the DB if ever no user Transaction is going on. If ever any transaction is going on the shutdown is possible once the transaction finalized with commit or rollback.
15
Immediate shutdown:-
      In this irrespective of user connected to the database or transactions are going on DB server closes the DB immediately by cancelling the running operations.
16
Shutdown Abort:-
      In this case instance is closed without closing the database without dismounting the database.
17
      In this case the database is said to be crashed. But it is automatically repaired and open when the DB is started for the next time.

No comments:

Post a Comment