Thursday, December 16, 2010

Enabling Forms Socket Mode

Enabling Forms Socket Mode

Changing forms servlet mode to forms socket mode is very easy. This needs running of just 1 script and bouncing the services.
Follow the below steps for changing from forms servlet mode to forms socket mode. Also note that both these modes cannot co-exits.

1) Stop all services using adstpall.sh present in $ADMIN_SCRIPTS_HOME location.
 Note that while stopping this will call adformsctl.sh script for stopping forms services. This is because the current mode is servlet mode.

2) Run the following command to enable Forms Socket Mode:
$FND_TOP/bin/txkrun.pl -script=ChangeFormsMode \
[-contextfile=] \
-mode=socket \
[-port=] \
-runautoconfig= \
-appspass=
Example :
$FND_TOP/bin/txkrun.pl -script=ChangeFormsMode \
-contextfile=$INST_TOP/appl/admin/mycontext.xml \
-mode=socket \
-port=9095 \
-runautoconfig=Yes

In this case you can get the forms port number from context file.
 Make sure that autoconfig has run successfully and that it has updated the forms launcher in database.

3) start the services using adstrtall.sh present in $ADMIN_SCRIPTS_HOME
Note that this time it will use adformsrvctl.sh script to start the forms. This is the script for starting forms in socket mode.

Executing service control script:
/slot02/appmgr/inst/apps/SCM3R3X3/admin/scripts/adformsrvctl.sh start
script returned:
****************************************************
You are running adformsrvctl.sh version 120.9.12000000.6
Starting FORMS Server in Socket Mode…
adformsrvctl.sh: exiting with status 0
adformsrvctl.sh: check the logfile /slot02/appmgr/inst/apps/SCM3R3X3/logs/ora/10.1.2/forms/socket.log for more information …
You have new mail in /var/spool/mail/appmgr02
.end std out.
.end err out.
After converting to forms socket mode the ICX_FORMS_LAUNCHER will take below form.
://.:/OA_HTML/frmservlet
Also adopmnctl.sh will not list the forms process now.

-bash-3.00$ ./adopmnctl.sh status
You are running adopmnctl.sh version 120.4.12000000.3
Checking status of OPMN managed processes…
Processes in Instance: tkr12r3m_rws60001tch.rws60001tch.us.oracle.com
———————————+——————–+———+———
ias-component | process-type | pid | status
———————————+——————–+———+———
OC4JGroup:OC4J | OC4J:oafm | 14533 | Alive
OC4JGroup:OC4J | OC4J:oacore | 13722 | Alive
OC4JGroup:OC4J | OC4J:oacore | 13723 | Alive
HTTP_Server | HTTP_Server | 13405 | Alive
adopmnctl.sh: exiting with status 0


Regards,
Sukhwinder Singh

Tuesday, December 07, 2010

Apply Patch ---

Steps For Applying Patch: - 


=~=~=~=~=~=~=~=~==~=~ 
  Before  Applying Patch
=~=~=~=~=~=~=~=~==~=~


Download the Patch File.
Save the patch file on desktop.

[root@testerp ~]# cd Desktop
[root@testerp Desktop]# chmod 777 p8786999_R12.PJT.B_R12_GENERIC.zip 
[root@testerp ~]# su - appldev
[appldev@testerp ~]$ cp p8786999_R12.PJT.B_R12_GENERIC.zip  /home/appldev
[appldev@testerp ~]$ cd /home/appldev
[appldev@testerp ~]$ chown appldev.dba p8786999_R12.PJT.B_R12_GENERIC.zip

[root@testerp ~]# ps -ef |grep appldev
[root@testerp ~]# id
=~=~=~=~=~=~=~=~=~=~=~==~=~=~==~=~=~==~=~=~=~=~=~=~=~=~=~==~=~=~=~=~=~=~=~=~==
=~~=      uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
=~=~=~=~=~=~=~=~=~=~=~==~=~=~==~=~=~==~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~==~=~=~==

[root@testerp ~]# su - appldev
[appldev@testerp ]$ cd $ADMIN_SCRIPTS_HOME
[appldev@testerp scripts]$ ps -ef|grep appldev


 1.   Stop Application

[appldev@testerp scripts]$ ./adstpall.sh apps/apps

=~=~=~=~=~=~==~=~=~==~=~=~=
To kill a process (if error occured)
=~=~=~=~=~=~=~~=~=~==~=~=~=

=~=~=~      [appldev@testerp scripts]$ ps -ef|grep appldev
=~=~=~      [appldev@testerp scripts]$ ps -ef|grep appldev|wc -l
=~=~=~      [appldev@testerp scripts]$ kill -9 14113
=~=~=~      [appldev@testerp scripts]$ kill -9 12618 12657 12385
=~=~=~      [appldev@testerp scripts]$ kill -9 12385
=~=~=~      [appldev@testerp scripts]$ ./adcmctl.sh abort apps/apps
=~=~=~=~=~=~=~=~=~=~=~===


=~=~=~=~=~=~=~
   Apply Patch
=~=~=~=~=~=~=~



2 . Change Mantainance Mode : -


[appldev@testerp ~]$ adadmin
  AD Administration Main Menu
   --------------------------------------------------
   1.    Generate Applications Files menu
   2.    Maintain Applications Files menu
   3.    Compile/Reload Applications Database Entities menu
   4.    Maintain Applications Database Entities menu
   5.    Change Maintenance Mode
   6.    Exit AD Administration


Enter your choice [6] : 5
***************************************************************
***   Change Maintenance Mode
***   -------------------------
***   Maintenance Mode is currently: [Disabled].
***   Maintenance mode should normally be enabled when patching
***   Oracle Applications and disabled when users are logged on
***   to the system.  See the Oracle Applications Maintenance
***   Utilities manual for more information about maintenance mode.
***************************************************************



3 . Enable Mantainance Mode : -

    Please select an option:
---------------------------------------------
   1.    Enable Maintenance Mode
   2.    Disable Maintenance Mode
   3.    Return to Main Menu

Enter your choice [3] : 1
***************************************************************
***   Change Maintenance Mode
***   -------------------------
***   Maintenance Mode is currently: [Enabled].
***  
***   Maintenance mode should normally be enabled when patching
***   Oracle Applications and disabled when users are logged on
***   to the system.  See the Oracle Applications Maintenance
***   Utilities manual for more information about maintenance mode.
***************************************************************

 [appldev@testerp ~]$ sqlplus apps/apps

SQL> select count(*),status from dba_objects group by status;
******************************************
***     COUNT(*)              STATUS
***     ----------                       -------
***       19                           INVALID
***       316522                   VALID
******************************************


SQL> select object_name,owner from dba_objects where status='INVALID';
**********************************************
***     OBJECT_NAME                             OWNER
***    ---------------------                                   ---------
***     PA_PROJ_ACCUM_MAIN             APPS
***     PA_TXN_ACCUMS                          APPS
***     PA_CHECK_COMMITMENTS      APPS

**********************************************

SQL> exit
 [appldev@testerp ~]$ cd
[appldev@testerp ~]$ ls -ltr

4 . Apply Patch (unzip the patch file then run adpatch)


[appldev@testerp ~]$ unzip p8786999_R12.PJT.B_R12_GENERIC.zip
[appldev@testerp ~]$ cd 8786999/
[appldev@testerp 8786999]$ ls -ltr

[appldev@testerp 8786999]$ adpatch
Filename [adpatch.log] : 8786999.log

[appldev@testerp 8786999]$ sqlplus apps/apps

SQL> select count(*),status from dba_objects group by status;
****************************************
***     COUNT(*)  STATUS
***     ---------- -------
***       5       INVALID
***       316536  VALID
****************************************


SQL> select object_name , owner from dba_object  s where status = 'INVALID';
************************************************
***     OBJECT_NAME                  OWNER
***     ----------------------------------
***     OPI_EDW_COGS_F_C             APPS
***     OPI_EDW_OPM_JOB_RSRC_F_C     APPS
***     OPI_EDW_OPM_JOB_DETAIL_F_C   APPS
************************************************


SQL> exit


=~=~=~=~=~=~=~=~=~==~=~
   After Applying Patch
=~=~=~=~=~=~=~=~=~==~=~


[appldev@testerp 8786999]$ adadmin

5 . Change Mantainance Mode : -


          AD Administration Main Menu
   --------------------------------------------------
   1.    Generate Applications Files menu
   2.    Maintain Applications Files menu
   3.    Compile/Reload Applications Database Entities menu
   4.    Maintain Applications Database Entities menu
   5.    Change Maintenance Mode
   6.    Exit AD Administration

Enter your choice [6] : 5


6 . Disable Mantainance Mode : -

Please select an option:
   1.    Enable Maintenance Mode
   2.    Disable Maintenance Mode
   3.    Return to Main Menu

Enter your choice [3] : 2

[appldev@testerp 8786999]$ sqlplus apps

SQL> !pwd
/home/appldev/8786999

SQL> select * from ad_bugs where bug_number=8786999;
SQL> select 'installed' from ad_bugs where bug_number=8786999;

Patch Information: - 
SQL> SELECT * FROM
(SELECT bug_number AS Patch
FROM ad_bugs UNION SELECT patch_name AS Patch FROM ad_applied_patches)
WHERE Patch IN (’Patch_Number’);


SQL> exit

7 . Start  Application

[appldev@testerp 8786999]$ cd $ADMIN_SCRIPTS_HOME
[appldev@testerp scripts]$ ./adstrtal.sh apps/apps


[appldev@testerp scripts]$ ps -ef|grep tns
[appldev@testerp scripts]$ ps -ef|grep FNDLIBR
[appldev@testerp scripts]$ ps -ef|grep appldev
[appldev@testerp sql]$ ps -ef|grep pmon

[appldev@testerp scripts]$ exit
[root@testerp ~]# exit


Regards,
Sukhwinder Singh

.

Monday, December 06, 2010

Oracle Apps R12 - Backup using Rapid Clone

Database Instance Pre Clone Script
==================================
[root@testerp ~]# su - oradev
[oradev@testerp /]$ cd /d03/oracle/DEV_NEW/db/tech_st/11.1.0/appsutil/scripts/DEV_testerp/
[oradev@testerp DEV_testerp]$ ./adpreclone.pl dbTier

Application Pre Clone Script
==================================
[root@testerp ~]# su - appldev
[appldev@testerp /]$ cd $INST_TOP
[appldev@testerp DEV_testerp]$ cd admin/scripts/
[appldev@testerp scripts]$ ./adpreclone.pl appsTier

Stop Application
[appldev@testerp /]# ./adstpall.sh apps/apps

Stop Listener
[oradev@testerp DEV_testerp]$ lsnrctl stop $ORACLE_SID

Stop Database Instance
[oradev@testerp DEV_testerp]$ sqlplus "/as sysdba"
SQL> shu immediate
SQL> exit

[root@testerp ~]# df -h       (To check Used & Free Space)[appldev@testerp 
[root@testerp ]# du -ch|grep total       -- total size of a folder
scripts]$ echo $APPL_TOP
+++++++++++++++++++++++++++++++++++++
[appldev@testerp scripts]$ cd /d03
[appldev@testerp d03]$ ls -ltr
+++++++++++++++++++++++++++++++++++++

Create Directory / Folder for Backup Files : -
[root@testerp dev_bkps]# mkdir dec06_2010/
[root@testerp dev_bkps]# chmod -& R 777 dec06_2010/
[root@testerp dec06_2010]$ ls -ltr

[root@testerp dec06_2010]$ mkdir appltest/
[root@testerp dec06_2010]$ mkdir oratest/
[root@testerp dec06_2010]$ mkdir inst/

Start Backup : -
[root@testerp]# cd /d03/dev_bkps/dec06_2010/

Application Backup
/d03/dev_bkps/dec06_2010/appltest
tar -zcvf tech_st.tar.Z /d03/oracle/DEV_NEW/apps/tech_st
tar -zcvf apps_st.tar.Z /d03/oracle/DEV_NEW/apps/apps_st

Database Instance Backup
/d03/dev_bkps/dec06_2010/oratest
tar -zcvf tech_st.tar.Z /d03/oracle/DEV_NEW/db/tech_st
tar -zcvf apps_st.tar.Z /d03/oracle/DEV_NEW/db/apps_st

Inst Backup
tar -zcvf inst.tar.Z /d03/oracle/DEV_NEW/inst



Regards,
Sukhwinder Singh
.
There was an error in this gadget