 |
|
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.