Oracle Database Startup and Shutdown Procedure

by Ramesh Natarajan on January 26, 2009

Oracle Flight Logo
Photo courtesy of Rob Shenk


For a DBA, starting up and shutting down of oracle database is a routine and basic operation. Sometimes Linux administrator or programmer may end-up doing some basic DBA operations on development database. So, it is important for non-DBAs to understand some basic database administration activities.

In this article, let us review how to start and stop an oracle database.

How To Startup Oracle Database

1. Login to the system with oracle username

Typical oracle installation will have oracle as username and dba as group. On Linux, do su to oracle as shown below.

$ su - oracle

2. Connect to oracle sysdba

Make sure ORACLE_SID and ORACLE_HOME are set properly as shown below.

$ env | grep ORA
ORACLE_SID=DEVDB
ORACLE_HOME=/u01/app/oracle/product/10.2.0


You can connect using either “/ as sysdba” or an oracle account that has DBA privilege.

$ sqlplus '/ as sysdba'
SQL*Plus: Release 10.2.0.3.0 - Production on Sun Jan 18 11:11:28 2009
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning and Data Mining options
SQL>

3. Start Oracle Database

The default SPFILE (server parameter file) is located under $ORACLE_HOME/dbs. Oracle will use this SPFILE during startup, if you don’t specify PFILE.

Oracle will look for the parameter file in the following order under $ORACLE_HOME/dbs. If any one of them exist, it will use that particular parameter file.

  1. spfile$ORACLE_SID.ora
  2. spfile.ora
  3. init$ORACLE_SID.ora


Type “startup” at the SQL command prompt to startup the database as shown below.

SQL> startup
ORACLE instance started.

Total System Global Area  812529152 bytes
Fixed Size                  2264280 bytes
Variable Size             960781800 bytes
Database Buffers           54654432 bytes
Redo Buffers                3498640 bytes
Database mounted.
Database opened.
SQL>


If you want to startup Oracle with PFILE, pass it as a parameter as shown below.

SQL> STARTUP PFILE=/u01/app/oracle/product/10.2.0/dbs/init.ora

How To Shutdown Oracle Database

Following three methods are available to shutdown the oracle database:

  1. Normal Shutdown
  2. Shutdown Immediate
  3. Shutdown Abort

1. Normal Shutdown

During normal shutdown, before the oracle database is shut down, oracle will wait for all active users to disconnect their sessions. As the parameter name (normal) suggest, use this option to shutdown the database under normal conditions.

SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

2. Shutdown Immediate

During immediate shutdown, before the oracle database is shut down, oracle will rollback active transaction and disconnect all active users. Use this option when there is a problem with your database and you don’t have enough time to request users to log-off.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

3. Shutdown Abort

During shutdown abort, before the oracle database is shutdown, all user sessions will be terminated immediately. Uncomitted transactions will not be rolled back. Use this option only during emergency situations when the “shutdown” and “shutdown immediate” doesn’t work.

$ sqlplus '/ as sysdba'
SQL*Plus: Release 10.2.0.3.0 - Production on Sun Jan 18 11:11:33 2009
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Connected to an idle instance.

SQL> shutdown abort
ORACLE instance shut down.
SQL>

Linux Sysadmin Course Linux provides several powerful administrative tools and utilities which will help you to manage your systems effectively. If you don’t know what these tools are and how to use them, you could be spending lot of time trying to perform even the basic administrative tasks. The focus of this course is to help you understand system administration tools, which will help you to become an effective Linux system administrator.
Get the Linux Sysadmin Course Now!

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

{ 21 comments… read them below or add one }

1 Mohan September 24, 2010 at 1:15 pm

Good article – simple and nice.

2 Anonymous January 4, 2011 at 4:39 pm

excellent note indeed

3 Anonymous March 4, 2012 at 9:28 pm

Good article. Very precise. Thanks!

4 balram May 31, 2012 at 10:56 pm

very nice topcs;

5 Kashan Syed June 12, 2012 at 10:02 am

Excellent topic

6 trisha July 25, 2012 at 12:30 am

it’s work… thanks a lot

7 Dias September 6, 2012 at 10:46 pm

Good one.

8 manikandan S September 25, 2012 at 10:21 pm

hi, very easy to understand, thank you

9 kiran October 16, 2012 at 12:01 am

good …

10 ayse February 1, 2013 at 3:20 am

thanks very much

11 praneeth March 13, 2013 at 5:08 am

hi,
what mean this error ?

startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ‘/u01/app/oracle/product/11.2.0/xe/dbs/initXE.ora’

12 Nick April 17, 2013 at 1:58 am

Very useful. Quick and easy to understand. Thanks :)

13 Maria May 28, 2013 at 2:26 am

nice and working excellent on me..
2009?? i hope i’m not too late learning oracle on linux :D
thanks ja

14 James June 20, 2013 at 3:08 pm

Awesome and detail explanation

15 syed October 4, 2013 at 4:38 am

very useful topics in interviews

16 Anonymous July 6, 2014 at 12:12 pm

Can you please share PFILE & SPFILE paths.

17 RP July 18, 2014 at 3:50 am

Can the oracle instance be restarted using Crontab?

18 ahmed August 22, 2014 at 5:46 am

1. I want to restart one table in database. any table

2. How I log table.

Thanks

19 Sri September 2, 2014 at 8:15 am

Thanks, excellent article

20 J-salem October 20, 2014 at 1:42 am

Everytime I write shutdown it shows
Ora-24324: service handle not initialized
Ora-24323: value not allowed
Ora-01090: shutdown in progress – connection is not permitted.

21 Hassan Faghihi November 23, 2014 at 11:47 pm

J-Salem, Same goes for me

Leave a Comment

Previous post:

Next post: