How to manage oracle services and processes?

In this post we are going to discuss the starting and stopping of various oracle processes including database instances,ASM(Automatic Storage Management) instances,CSS Daemon,Oracle Net Listener,iSQL*PLUS,Ultrasearch,Oracle Enterprise Manager database control,Oracle Management Agent. Database Instances and ASM instances: 1) Identify the Oracle SID and Oracle home directory for the instance . In Solaris: $ cat /var/opt/oracle/oratab On other operating systems: $cat /etc/oratab The oratab file contains lines similar to the following, which identify the SID and corresponding Oracle home directory for each database or Automatic Storage Management instance on the system: sid:oracle_home_directory:[YN] We use the plus sign (+) as the first character in the SID of Automatic Storage Management instances. 2) Depending on default shell, run the oraenv or coraenv script to set the environment variables for the instance Bourne, Bash, or Korn shell:$ . /usr/local/bin/oraenv C shell:% source /usr/local/bin/coraenv 3) When prompted, specify the SID for the instance. 4) Run the following commands to shut down the instance: $ sqlplus /nolog SQL> CONNECT SYS/sys_password as SYSDBA SQL> SHUTDOWN NORMAL 5) Quit the SQL*PLUS prompt Run the following commands to start the instance: $ sqlplus /nolog SQL> CONNECT SYS/sys_password as SYSDBA SQL> STARTUP CSS Daemon : To stop the Oracle Cluster Services Synchronization (CSS) daemon, run the following command: On AIX and Mac OS X:/etc/init.cssd stop On other platforms:/etc/init.d/init.cssd stop To stop and restart the CSS daemon : $ORACLE_HOME/bin/localconfig reset Oracle Net listener : Run the following command to determine the listener name and Oracle home directory for the Oracle Net listener that we want to stop: On Mac OS X:$ ps -auxwww grep tnslsnr On other platforms:$ ps -ef grep tnslsnr This command displays a list of the Oracle Net listeners running on the system. The output of this command is similar to the following: 94248 ?? I 0:00.18 oracle_home1/bin/tnslsnr listenername1 -inherit 94248 ?? I 0:00.18 oracle_home2/bin/tnslsnr listenername2 -inherit In this sample output, listenername1 and listenername2 are the names of the listeners. If required, set the ORACLE_HOME environment variable to specify the appropriate Oracle home directory for the listener that we want to stop: Bourne, Bash, or Korn shell:$ ORACLE_HOME=oracle_home1 $ export ORACLE_HOME C shell:% setenv ORACLE_HOME oracle_home1 Run the following command to stop the Oracle Net listener: $ $ORACLE_HOME/bin/lsnrctl stop listenername If the name of the listener is the default name, LISTENER, then you do not have to specify the name in this command. To start an Oracle Net listener: If required, set the ORACLE_HOME environment variable to specify the appropriate Oracle home directory for the listener that we want to start: Bourne, Bash, or Korn shell:$ ORACLE_HOME=oracle_home1 $ export ORACLE_HOME C shell:% setenv ORACLE_HOME oracle_home1 Run the following command to restart the Oracle Net listener: $ $ORACLE_HOME/bin/lsnrctl start [listenername] We must specify the listener name only if it is different from the default listener name, LISTENER. The listener name is mentioned in the listener.ora file. To display the contents of this file, run the following command: $ more $ORACLE_HOME/network/admin/listener.ora iSQL*Plus : To stop iSQL*Plus : 1) set the ORACLE_HOME environment variable to specify the appropriate Oracle home directory for iSQL*Plus: Bourne, Bash, or Korn shell:$ ORACLE_HOME=oracle_home $ export ORACLE_HOME C shell:% setenv ORACLE_HOME oracle_home 2) Run the following command to stop iSQL*Plus: $ $ORACLE_HOME/bin/isqlplusctl stop Starting iSQL*Plus : 1) Set the ORACLE_HOME environment variable to specify the appropriate Oracle home directory for the iSQL*Plus instance that we want to start: Bourne, Bash, or Korn shell:$ ORACLE_HOME=oracle_home $ export ORACLE_HOME C shell:% setenv ORACLE_HOME oracle_home 2) Run the following command to start iSQL*Plus: $ $ORACLE_HOME/bin/isqlplusctl start Ultra Search : To stop Oracle Ultra Search: 1) set the ORACLE_HOME environment variable to specify the appropriate Oracle home directory for Oracle Ultra Search: Bourne, Bash, or Korn shell:$ ORACLE_HOME=oracle_home $ export ORACLE_HOME C shell:% setenv ORACLE_HOME oracle_home 2) Run the following command to stop Oracle Ultra Search: $ORACLE_HOME/bin/searchctl stop To start Oracle Ultra Search: 1) set the ORACLE_HOME environment variable to specify the appropriate Oracle home directory for Oracle Ultra Search: Bourne, Bash, or Korn shell:$ ORACLE_HOME=oracle_home $ export ORACLE_HOME C shell:% setenv ORACLE_HOME oracle_home 2) Run the following command to start Oracle Ultra Search: $ORACLE_HOME/bin/searchctl start Enterprise Manager Database Control : To stop Oracle Enterprise Manager Database Control: 1) Depending on our default shell, run the oraenv or coraenv script to set the environment for the database managed by the Database Control that we want to stop: coraenv script:% source /usr/local/bin/coraenv oraenv script:$ . /usr/local/bin/oraenv 2) Run the following command to stop the Database Control: $ORACLE_HOME/bin/emctl stop dbconsole To start Database Control: 1) Set the ORACLE_SID and ORACLE_HOME environment variables to identify the SID and Oracle home directory for the database control that you want to start: Bourne, Bash, or Korn shell:$ ORACLE_HOME=oracle_home $ ORACLE_SID=sid $ export ORACLE_HOME ORACLE_SID C shell:% setenv ORACLE_HOME oracle_home % setenv ORACLE_SID sid 2) Run the following command to start the Database Control: $ORACLE_HOME/bin/emctl start dbconsole Ora Oracle Management Agent : If we are using Oracle Enterprise Manager Grid Control to manage multiple Oracle products from a central location, then wemust have an Oracle Management Agent installed on each host system.Typically, the Oracle Management Agent is installed in its own Oracle home directory.To stop Oracle Management Agent: 1) Run the following command to determine the Oracle home directory for Oracle Management Agent: On Mac OS X:$ ps -auxwww grep emagent On other platforms:$ ps -ef grep emagent This command displays information about the Oracle Management Agent processes. The output of this command is similar to the following: 94248 ?? I 0:00.18 oracle_home/agent/bin/emagent … 2) If required, set the ORACLE_HOME environment variable to specify the appropriate Oracle home directory for the Oracle Management Agent: Bourne, Bash, or Korn shell: $ ORACLE_HOME=oracle_home $ export ORACLE_HOME C shell:% setenv ORACLE_HOME oracle_home 3) Run the following command to stop Oracle Management Agent: $ORACLE_HOME/agent/bin/emctl stop agent To start Oracle Management Agent: 1) set the ORACLE_HOME environment variable to specify the appropriate Oracle home directory for Oracle Management Agent: Bourne, Bash, or Korn shell:$ ORACLE_HOME=oracle_home $ export ORACLE_HOME C shell:% setenv ORACLE_HOME oracle_home 2) Run the following command to start Oracle Management Agent : $ORACLE_HOME/agent/bin/emctl start agent