Search Blog Post

Thursday, February 21, 2013

Oracle Applications - How to Bounce Services(Forms, Concurrent Mgr, Application Tier etc)

This post gives you a handy information on bouncing the services in eBusiness Suite Applications 11i/R12

Steps to Bounce
-----------------
1. Login to your unix box


2. Set the environment by running the env file present in $APPL_TOP
       #cd $APPL_TOP
       #ls *.env
       #. <env_name>_<host_name>.env

3. Go to $ADMIN_SCRIPTS_HOME  (In 11i, Use $COMMON_TOP/admin/scripts)
       #cd $ADMIN_SCRIPTS_HOME
      
4. Here you will see a list of files and based on the need you will have to run various scripts as given below

     4.1. Bounce All Services ( Note the 'dot' after the # sign in the commands below and above)
               
                   # .  adstpall.sh apps/<pwd>
                   #.  adstrtal.sh apps/<pwd>

     4.2 Bouce Mid Tier for OAF (Oracle Applications Framework) to be reflected   
                 # adoacorectl.sh  stop                      (For R12)
                 # adapcctl.sh stop
                 #adoacorectl.sh  start                         (For R12)
                 # adapcctl.sh  start

     4.3 Bounce the forms services
                #adformsctl.sh stop
                #adformsctl.sh start

       4.4 Bounce the concurrent manager services
               #adcmctl.sh stop
               #adcmctl.sh start
      
       4.5 Any time you want to check the status of  app server services? Use the below command
              #adapcct.sh status



--------------------------------------------------------x----------------------------------------------------------

Order of Startup Shutdown
————————————–
As in Oracle Apps 11i order for startup is
A) Start Database Tier Services
–Start Database Listener
–Start Database
Then
B) Start Application/Middle Tier Services
– adstrtal.sh
Order for shutdown in Oracle Apps R12 is
A) Stop Application/Middle Tier Services
– adstpall.sh
Then
B) Stop Database Tier Services
–Stop Database
–Stop Database Listener
Database Tier Scripts in R12
————————————–
For Database tier you need to start database and database listener. Scripts are located in Database_Install_Dir/db/tech_st/10.2.0/appsutil/scripts/$CONTEXT_NAME- For Database
Use script addbctl.sh

- For Database Listener
Use script addlnctl.sh
or alternatively you can use
lsnrctl startstop listener_name (For Database Listener)
sqlplus “/as sysdba”
SQL> startup shutdown immediate

Middle/Application Tier Scripts in R12
————————————————-
Scripts for Application Tier services in R12 are located in “Install_base/inst/apps/$CONTEXT_NAME/admin/scripts
where CONTEXT_NAME is of format SID_HOSTNAME
i) adstrtal.sh
Master script to start all components/services of middle tier or application tier. This script will use Service Control API to start all services which are enabled after checking them in context file (SID_HOSTNAME.xml or CONTEXT_NAME.xml)
ii) adstpall.sh
Master script to stop all components/services of middle tier or application tier.
iii) adalnctl.sh
Script to start / stop apps listener (FNDFS and FNDFS). This listener will file will be in 10.1.2 ORACLE_HOME (i.e. Forms & Reports Home)
listener.ora file will be in $INST_TOP/apps/$CONTEXT_NAME/ora/10.1.2/network/admin directory
(Mostly similar to one in 11i with only change in ORACLE_HOME i.e. from 8.0.6 to 10.1.2 )

iv) adapcctl.sh
Script to start/stop Web Server or Oracle HTTP Server. This script uses opmn (Oracle Process Manager and Notification Server) with syntax similar to opmnctl [startstop]proc ohs
like opmnctl stopproc ohs .
(In 11i this script directly used to call apachectl executable but now calls opmnctl which in turn calls apachectl. In 11i web server oracle home was 1.0.2.2.2 but in R12 its 10.1.3)

v) adcmctl.sh
Script to start / stop concurrent manager, Similar to one in 11i. (This script in turn calls startmgr.sh )
vi) adformsctl.sh
Script to start / stop Forms OC4J from 10.1.3 Oracle_Home. This script will also use opmnctl to start/stop Forms OC4J like
opmnctl stopproc type=oc4j instancename=forms
vii) adformsrvctl.sh
This script is used only if you wish to start forms in socket mode. Default forms connect method in R12 is servlet.
If started this will start frmsrv executable from 10.1.2 Oracle_Home in Apps R12

viii) adoacorectl.sh
This script will start/stop oacore OC4J in 10.1.3 Oracle_Home. This scripts will also use opmnctl (similar to adapcctl & adformsctl) to start oacore instance of OC4J like
opmnctl startproc type=oc4j instancename=oacore
ix) adoafmctl.sh
This script will start/stop oafm OC4J in 10.1.3 Oracle_Home. This scripts will also use opmnctl (similar to above) to start oacore instance of OC4J like
opmnctl startproc type=oc4j instancename=oafm
x) adopmnctl.sh
This script will start/stop opmn service in 10.1.3 Oracle_Home. opmn will control all services in 10.1.3 Oracle_Home like web server or various oc4j instances. If any services are stopped abnormally opmn will/should start them automatically.
xi) jtffmctl.sh
This script will be used to start/stop one to one fulfilment server.
xii) mwactl.sh
To start / stop mwa telnet server where mwa is mobile application.
Log File Location for Startup Shutdown Services in R12
———————————————————————-
Log files for startup/shutdown scripts for application/mid tier in R12 are in $INST_TOP/apps/$CONTEXT_NAME/logs/appl/admin/log
(adalnctl.txt, adapcctl.txt, adcmctl.txt, adformsctl.txt, adoacorectl.txt, adoafmctl.txt, adopmnctl.txt, adstrtal.log, jtffmctl.txt )

Thursday, February 14, 2013

Steps to uninstall Oracle 10g Database

Stop all the databases and listener on the box either manually or using your startup script (/etc/init.d/oracle stop).

$ORACLE_HOME/bin/localconfig delete

rm -rf /etc/ora*

rm -rf $ORACLE_HOME

rm -rf $ORACLE_BASE

rm -rf /tmp/.oracle
rm -rf /var/tmp/.oracle

This should be enough to remove the whole software from the box, you can drop the OS users and their home directories also if you want

Wednesday, February 13, 2013

Alert log location in Oracle 11gR2

Oracle 11gR2 is a major release upgrade from 10gR2 and 11gR1 both. Many previous parameters like user_dump_dest etc have been deprecated. There is a single parameter called diag_dest.  Many DBA’s are so used to the location of alert log and trace files , that it becomes quite inconvenient when you start using Oracle 11g . But Oracle 11g has a powerful new utility called ADR CLI to navigate around the alert log and other trace files. I will demonstrate a few ways to check the alert log and trace files using “adrci” command.

$ adrci

ADRCI: Release 11.2.0.3.0 - Production on Wed Feb 13 10:25:59 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

ADR base = "/mnt/PRDapps/oracle/trcprddb/11.2.0/dbhome_1/log"

adrci> help
HELP [topic]
Available Topics:
CREATE REPORT
ECHO
EXIT
HELP
HOST
IPS
PURGE
RUN
SET BASE
SET BROWSER
SET CONTROL
SET ECHO
SET EDITOR
SET HOMES | HOME | HOMEPATH
SET TERMOUT
SHOW ALERT
SHOW BASE
SHOW CONTROL
SHOW HM_RUN
SHOW HOMES | HOME | HOMEPATH
SHOW INCDIR
SHOW INCIDENT
SHOW PROBLEM
SHOW REPORT
SHOW TRACEFILE
SPOOL
There are other commands intended to be used directly by Oracle, type
“HELP EXTENDED” to see the list
adrci> show alert
1: diag\clients\user_system\host_3726408541_76
2: diag\rdbms\testdb\testdb
3: diag\tnslsnr\test\listener
Q: to quit
Please select option:

Many of the adrci commands are very similar to the standard Unix vi commands. For example
SHOW ALERT -TAIL (to view the last 10 entries)
SHOW ALERT -TAIL 50 (to view the last 50 entries)
SHOW ALERT -TAIL -F (keeps the alert log open to view as entries arrive until Control C is pressed)
show alert -p “message_text like ‘%ORA-07445%’” (to show all occurences of the string ‘ORA-07445′ in the alert log.)
Purging Alert Log Content
The adrci command ‘purge’ can be used to purge entries from the alert log. Note that this purge will only apply to the XML based alert log and not the text file based alert log which still has to be maintained using OS commands.
The purge command takes the input in minutes and specifies the number of minutes for which records should be retained.
So to purge all alert log entries older than 7 days the following command will be used:
adrci > purge -age 10080 -type ALERT
It is a powerful utility with much more functionality

Monday, February 11, 2013

Database Installation 11g Release2

                                                                Database Installation
Unpack Files
Unzip the files.
[root@gdgridcon01 Stage]# pwd
/Stage
[root@gdgridcon01 Stage]#
[root@gdgridcon01 Stage]# ls -lrt
total 7851100
-rw-r--r-- 1 root root 1009427871 Jan  4 09:10 linux.zseries64_11gR2_database_2of2.zip
-rw-r--r-- 1 root root 1441455828 Jan  4 09:19 linux.zseries64_11gR2_database_1of2.zip
-rw-r--r-- 1 root root 1604870804 Jan  4 09:39 em12cr2_linux64_disk1.zip
-rw-r--r-- 1 root root 1685863807 Jan  4 09:41 em12cr2_linux64_disk2.zip
-rw-r--r-- 1 root root 2290032132 Jan  4 09:49 em12cr2_linux64_disk3.zip
[root@gdgridcon01 Stage]#
[root@gdgridcon01 Stage]# unzip linux.zseries64_11gR2_database_2of2.zip
[root@gdgridcon01 Stage]# unzip linux.zseries64_11gR2_database_1of2.zip

[root@gdgridcon01 Stage]# ls -lrt
total 7851104
-rw-r--r-- 1 root root 1009427871 Jan  4 09:10 linux.zseries64_11gR2_database_2of2.zip
-rw-r--r-- 1 root root 1441455828 Jan  4 09:19 linux.zseries64_11gR2_database_1of2.zip
-rw-r--r-- 1 root root 1604870804 Jan  4 09:39 em12cr2_linux64_disk1.zip
-rw-r--r-- 1 root root 1685863807 Jan  4 09:41 em12cr2_linux64_disk2.zip
-rw-r--r-- 1 root root 2290032132 Jan  4 09:49 em12cr2_linux64_disk3.zip
drwxr-xr-x 8 root root       4096 Jan  4 10:28 database

Hosts File

The "/etc/hosts" file must contain a fully qualified name for the server.
 [root@gdgridcon01 ~]# vi /etc/hosts
[root@gdgridcon01 ~]#
[root@gdgridcon01 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
192.168.2.144   gdgridcon01.tireco.com  gdgridcon01
[root@gdgridcon01 ~]#

Manual Setup
Oracle recommend the following minimum parameter settings.
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

The current values can be tested using the following command.
/sbin/sysctl -a | grep <param-name>

Add or amend the following lines in the "/etc/sysctl.conf" file.

[root@gdgridcon01 ~]# vi /etc/sysctl.conf
[root@gdgridcon01 ~]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmall = 4294967296
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586


Add the following lines to the "/etc/security/limits.conf" file.
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240


Create the new groups and users.

[root@gdgridcon01 ~]# groupadd oinstall
[root@gdgridcon01 ~]# groupadd dba
[root@gdgridcon01 ~]# groupadd oper
[root@gdgridcon01 ~]# useradd -g oinstall -G dba oraOEM
[root@gdgridcon01 ~]# cat /etc/passwd
oraOEM:x:502:502:Oracle Grid control User:/home/oraOEM:/bin/ksh

Disable secure linux by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.
SELINUX=disabled
 
[root@gdgridcon01 ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted
 
 
 
-> Create the directories in which the Oracle software will be installed.

[root@gdgridcon01 gridcon]# mkdir -p /mnt/gridcon/app/oracle/product/11.2.0/db_1
[root@gdgridcon01 gridcon]# chown -R oracle:oinstall /mnt/gridcon/
[root@gdgridcon01 gridcon]# chmod -R 775 /mnt/gridcon/
[root@gdgridcon01 gridcon]#

Login as root and issue the following command.
xhost +<machine-name>


Login as the oraOEM user and add the following lines in env file.

$ . ./OEM.env
$ cat OEM.env
export ORACLE_BASE=/mnt/gridcon/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=OEM
export ORACLE_PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
$
$
$ cd /
$ ls
bin  boot  dev  etc  home  lib  lib64  lost+found  media  misc  mnt  net  opt  proc  root  sbin  selinux  srv  Stage  sys  tftpboot  tmp  usr  var
$ cd Stage
$ ls -lrt
total 7851104
-rw-r--r-- 1 root root 1009427871 Jan  4 09:10 linux.zseries64_11gR2_database_2of2.zip
-rw-r--r-- 1 root root 1441455828 Jan  4 09:19 linux.zseries64_11gR2_database_1of2.zip
-rw-r--r-- 1 root root 1604870804 Jan  4 09:39 em12cr2_linux64_disk1.zip
-rw-r--r-- 1 root root 1685863807 Jan  4 09:41 em12cr2_linux64_disk2.zip
-rw-r--r-- 1 root root 2290032132 Jan  4 09:49 em12cr2_linux64_disk3.zip
drwxr-xr-x 8 root root       4096 Jan  4 10:28 database
$ cd database
$ ls -lrt
total 44
-rw-r--r--  1 root root 5575 Dec 17  2010 welcome.html
drwxr-xr-x 12 root root 4096 Mar 25  2011 doc
drwxr-xr-x  2 root root 4096 Mar 28  2011 sshsetup
-rwxr-xr-x  1 root root 8560 Mar 28  2011 runInstaller
drwxr-xr-x  2 root root 4096 Mar 28  2011 rpm
drwxr-xr-x  2 root root 4096 Mar 28  2011 response
drwxr-xr-x  4 root root 4096 Mar 28  2011 install
$./runInstaller
drwxr-xr-x 14 root root 4096 Jan  4 10:28 stage