Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 

 

Post Installation Tasks

Oracle Application Server Tips by Burleson Consulting

The Enterprise Manager Application Server Control is a powerful, web based tool for managing the Oracle Application Server.  However, you will want to execute some commands from the operating system prompt, especially if you use scripts to automatically start and stop the application server with the host server.  You must set up the operating system environment prior to directly manipulating the application server components.  Each instance has its own ORACLE_HOME where it?s datafiles are located.  If you issue the command:

[oracle@appsvr oracle]$ opmnctl stopall

The operating system will execute the first opmnctl file that is finds while traversing the PATH variable.  This may not be the file you are trying to execute.  Since each instance has its own environment, the easiest way to do this is to make an environment file for each instance on the server.

Since each time you execute the environment file the PATH is set, I capture the current PATH in a variable called ORG_PATH at log in by adding the following line to the .bash_profile file of the oracle user.

ORG_PATH=$PATH; export ORG_PATH

For each instance on a server I need to:

1. Define ORACLE_HOME

2. Define LD_LIBRARY_PATH

3. Define the ORACLE_SID of the Metadata Repository

4. Update the PATH variable

Below is the listing of the environment file for my Infrastructure instance called infenv. 

# Environment for infra904
ORACLE_HOME=/u01/oracle/infra904; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/local/bin;
export LD_LIBRARY_PATH
ORACLE_SID=asdb; export ORACLE_SID
PATH=/usr/bin:$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORG_PATH
export PATH

Note:  There is a notice in the Release Notes that states that after installation you need to place /usr/bin as the first element of you PATH.

The file is easily modified to support the middle tier.

# Environment for mid904
ORACLE_HOME=/u02/oracle; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/local/bin;
export LD_LIBRARY_PATH
ORACLE_SID=asdb; export ORACLE_SID
PATH=/usr/bin:$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORG_PATH
export PATH

Each instance on a server should have their own environment file.  To use the file invoke it with the source command.

[oracle@appsvr oracle]$ source mid904

or in scripts use the . command

[oracle@appsvr oracle]$ . /home/oracle/mid904

Once I source the environment I can be sure which opmnctl file is being executed. 

So now it is time to bounce the server.  How to I stop and then restart the application server.

Starting and Stopping the Application Server 10g

Even a UNIX/Linux server will eventually need to be rebooted (no Windows jokes please).  We need to have a method to stop and restart all the application server parts together.  Below is a simple script to start the two tiers that we just installed.  Since executing commands from the OS while the EM site is running can potentially lead to problems; we should first shutdown the EM site.

#!/usr/bin/ksh
# Source Infra904
. /home/oracle/infenv
# Shutdown Application Server Control
$ORACLE_HOME/bin/emctl stop em
# Source Mid904
. /home/oracle/midenv
# Shutdown Application Server Control
$ORACLE_HOME/bin/emctl stop em
# Stop the Mid904 Instance
$ORACLE_HOME/opmn/bin/opmnctl stopall
# Source Infra904
. /home/oracle/infenv
# Stop the Infra904 Instance
$ORACLE_HOME/opmn/bin/opmnctl stopall
# Stop the Metatdata Repository DB
$ORACLE_HOME/bin/sqlplus ?/ as sysdba? << EOF
shutdown immediate;
exit;
EOF
# Stop the database Listener
$ORACLE_HOME/bin/lsnrctl stop

This script is named stopall.ksh   The opposite script is logically name startall.ksh and is used to start the application server.

#!/usr/bin/ksh
# Source Infra904
. /home/oracle/infenv
# Start the Listener
$ORACLE_HOME/bin/lsnrctl start
# Stop the Metatdata Repository DB
$ORACLE_HOME/bin/sqlplus ?/ as sysdba? << EOF
startup
exit;
EOF
# Wait 30 second to let the database settle.
sleep 30
# Start the Infra904 Instance
$ORACLE_HOME/opmn/bin/opmnctl startall
# Wait 15 second to let the OID settle.
sleep 15
# Source Mid904
. /home/oracle/midenv
# Start the Mid904 Instance
$ORACLE_HOME/opmn/bin/opmnctl startall
# Wait 15 second to let the Everything settle.
sleep 15
# Source Infra904
. /home/oracle/infenv
# Start Application Server Control
$ORACLE_HOME/bin/emctl start em
# Source Mid904
. /home/oracle/midenv
# Start Application Server Control
$ORACLE_HOME/bin/emctl start em
echo Startup Completed

All of these commands are discussed in detail in the appropriate chapters. 

 

This is an excerpt from "Oracle 10g Application Server Administration Handbook" by Don Burleson and John Garmany.
 

If you like Oracle tuning, you may enjoy the new book "Oracle Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning tips & scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


 

 
��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational