Thursday, July 16, 2015

Oracle database startup/shutdown procedure

Oracle database startup/shutdown

A. Shutdown database instances
1. Login to the system and check the database process
$ ps -ef | more

2. Once you find the database process, see what user it owns
# users process
 oracle pmon

3. Login as a process owner
# su - oracle

4. Find the SID
Most of the case, you will find on env
$ env | grep -i sid

4. Now, open SQLplus as a sysdba user
$ sqlplus / as sysdba

5. At the prompt type shutdown
sql> shutdown immediate
sql> quit

6. Now, stop the listener
$ lsnrctl stop

7. Check and verify all database related instances are down.

If you have other instance owned by other user, login as that user and shutdown the database.

B. Starting database instances
1. Login and find the SID and login as that users

2. Start listener instance
$ lsnrctl start

2. Login as sysdba to sqlplus
$ sqlplus / as sysdba
sql> startup
sql> quit

Verify database are up successfully

RAC instances shutdown

1. Stop database instances
$ srvctl stop database -d SID

2. Stop listners in the cluster
$ srvctl stop listener


1. Start the listener
$ srvctl start listener
$ srvctl start scan_listener

2. Start database
$ srvctl start database -d SID

Env set up
export PS1="[\u@\h]$ORACLE_SID>"
alias spls='sqlplus "/as sysdba"'
alias sid='echo $ORACLE_SID'
alias tns='cd $TNS_ADMIN; ls -ltr'
alias dbs='cd $ORACLE_HOME/dbs; ls -ltr'

Process check
ps -ef | grep pmon
ps -ef | grep smon
ps -ef | grep tns

No comments:

Post a Comment