How start and Stop Oracle Database on a Linux host

Today we are going to see and learn about starting and shutting down an Oracle Database.

Pre-requisites:-

There are few pre-requisites before we attempt to start or stop a database.

  • The database should exist on the Linux host.
  • ORACLE_SID, ORACLE_HOME, CLASS_PATH and PATH environment variables must be set.

How to validate pre-requisites?

run command “cat /etc/oratab” and validate that output of this command should list the database.
run “. oraenv” and enter database ORACLE_SID and ORACLE_HOME when prompted. This will set-up all required paths and other environment variables.

Start a Database

run command “sqlplus / as sysdba
once sqlplus prompt is connected to idle instance then run command STARTUP. STARTUP command will start, mount the database and bring it to OPEN state.

Alternate method,

run below sequence to startup a database.

  1. run command “sqlplus / as sysdba”
  2. STARTUP NOMOUNT;
  3. ALTER DATABASE MOUNT;
  4. ALTER DATABASE OPEN;

Shutdown a Database

run command “sqlplus / as sysdba
once sqlplus prompt is connected then run command SHUTDOWN or SHUTDOWN IMMEDIATE. SHUTDOWN command will UNMOUNT and SHUTDOWN the database.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s