Starting / Shutdown Oracle Database in Unix

| Posted by watashii | Filed under Database, Unix

This simple guide to shows how to start /stop your Oracle database from Unix.  You must have logon access to do this.

Step 1

Unix login as oracle (usually the user that installed the database)

Step 2

Make sure your environment variables are set, eg:

ORACLE_SID=MYDBSID
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1
LD_LIBRARY_PATH=/opt/oracle/product/11.2.0/dbhome_1/lib
PATH=/usr/bin:/usr/sbin:/usr/ucb:/usr/local:/usr/local/bin:/usr/local/sbin:/opt/oracle/product/11.2.0/dbhome_1/bin

Step 3 – Start DB Instance

On the Unix command line, run sqlplus with sysdba, and simply type startup in the prompt to start it up.

oracle@db-srv-01 % sqlplus '/ as sysdba'

SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 30 12:06:47 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 3207790592 bytes
Fixed Size                  2152368 bytes
Variable Size            2449475664 bytes
Database Buffers          738197504 bytes
Redo Buffers               17965056 bytes
Database mounted.
Database opened.

Step 4 – Start Listener

To start the oracle listener (assuming listener.ora is setup), run lsnrctl start

oracle@db-srv-01 % lsnrctl start

LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 30-NOV-2010 12:00:34

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /opt/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
System parameter file is /opt/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/db-srv-01/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db-srv-01)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db-srv-01)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
Start Date                30-NOV-2010 12:00:35
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/db-srv-01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db-srv-01)(PORT=1521)))
The listener supports no services
The command completed successfully

Step 4 – Shutdown

Similarly, to shutdown the instance, type shudown normal within sqlplus.

Stop the listener, by running lsnrctl stop

Share:

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Print
  • email

Related Posts:

  1. Oracle Database Link – Access Schema Tables From Another Database
  2. Oracle Timezone Conversions – GMT to localtime (and back)
  3. Oracle SQL Loader – Importing CSV files to a table
  4. Oracle SQLPlus Query Output to a File
  5. Oracle Index Null Values

Tags: , , , ,

Leave a Reply