Oracle Startup & Shutdown  

To startup Oracle 7.1

example% sqldba lmode=y

  Oracle 7.2 onwards

example% svrmgrl
SVRMGR> connect internal
SVRMGR> startup [nomount | mount ]

mount -- only mounts the database and does not open it, here only fixed tables and views (V$) can be seen.
nomount -- only starts up the instance.

To shutdown Oracle

SVRMGR> shutdown [normal | immediate | abort]
normal -- waits for all the users to log out before shutting down oracle
immediate -- shutdown down the database, uncommited data are lost
abort -- never user this as the database will need recovery when it starts up the next time.

If the system appears to hang when a shutdown is given Please check for any user who has logged on to Oracle. The database will not shutdown until all the users have logged out.To overcome this the DBA can issue

SVRMGR> shutdown immediate

This however does not save the uncommited transaction.For the query to see if there are any users still logged on to Oracle look Helpful Queries

On starting up Oracle does the following in order

Starts the instance (ORACLE_SID)
Mount the database
Opens the database to the users

On Shutting down it does the above three steps in the reverse order.

Closes the database
Unmount the database
Stops the instance.

To startup Oracle when you cannot open paramater file error occurs

SVRMGR> connect internal
SVRMGR> startup pfile='/usr/oracle7/initSID.ora'

To view the script in the control file after connecting as internal and starting up the database

SVRMGR> alter database backup controlfile to trace;

This creates a .trc file in $ORACLE_HOME/rdbms/log directory. This file contains the SQL script to create the control file. Rename it to .sql and run it from the server manager.

  If you get the following errors when starting up the database

ORA 00402 database changes by release cannot be used  by release

ORA 00405 compatibility type "truncation count"

Check the compatibility in init<SID>.ora unhash




Listener Problems

To startup, start or see the statue of the Oracle Listener

oracle% lsnrctl start

oracle% lsnrctl stop

oracle% lsnrctl stat

If the you cannot see the listener status or stop it kill the listener process after using

ps -ef | grep ora

and then start up the listener


To check if a client can access the server via the listener, from the client machine ( SQL Net Easy Config should have been done ie there should exists an alias for the Oracle SID to connect to)

if the alias is orcl ( default alias) we give

oracle% tnsping orcl