Tuesday, February 28, 2012

Re-create soft links script for Concurrent Program (Host)

Hi All


Here the small script that will help you to re-create links for Concurrent Program (Host).
During the Rapid Clones and Customization Migration from 11i to R12 the custom prog links in $CUSTOM_TOP/bin are broken.


Usage: ./recreate_prog_links.sh $CUST_TOP


#!/bin/ksh
export CUST_PATH=$1
cd $CUST_PATH/bin
echo "PATH: "  $CUST_PATH/bin
echo "Start re-creating links..."
for f in *.prog
do
PROG_FILE=$f
LINK_FILE=`echo $PROG_FILE | awk -F"." '{ print $1 }'`
LINK_FILE=`ls $LINK_FILE`
if [ "$LINK_FILE" = "" ]
then
echo "Prog File not need relink ...."
else
unlink $LINK_FILE
ln -s $PWD/../../../fnd/12.0.0/bin/fndcpesr $LINK_FILE
### The fndcpesr path need to be changed according the EBS version
For 11i the command : ln -s $PWD/../../../fnd/11.5.0/bin/fndcpesr $LINK_FILE

fi;
done;
echo "Re-creating links finished..."


Guy LiorAnother way to do it (provided by programmer Guy Lior)  it's to run the following sql command in pl/sql developer / sqlplus / toad : 



select 'ln -s $FND_TOP/bin/fndcresr $'||fap.basepath||'/bin/'||fev.executable_name
from   fnd_application     fap,
       fnd_executables_vl  fev
where  fap.application_short_name in ('<Your Application Short name>')
and    fap.application_id = fev.application_id
and    fev.execution_method_code = 'H'

And then just run the received results on Linux server.

Good Luck ...



Monday, February 27, 2012

Compile 10g Forms/Reports Takes a Very Long Time against 11g database


Hi All

Here the new issue that I found during upgrade to R12 with 11g Database.
As you know the biggest part of patches are generating Forms and Reports in the end of patch installation. This procedure was very slow and takes a lot of time.

After some search in Metalink and Google I found the Doc ID 880660.1 - Compilation Against a 11g Database Hangs or Takes a Very Long Time (Thanks to Harry Tieb).

Action Plan 

1. Apply the database Patch 8560951 on top of your Database. 
   The Patch 8560951 brings modifications in a sensible area and it is needed to use _FIX_CONTROL to enable the fix. 

*** This patch is already included in higher database versions (e.g. 10.2.0.5, 11.2.0.2). For these it's not necessary to install the patch.  But, _FIX_CONTROL='8560951:ON' still needs to be set as the fix is disabled by default. 

2. ALTER SYSTEM SET "_FIX_CONTROL"='8560951:ON'; - This will enable the fix in memory. 
OR add this parameter to init.ora file and restart the database.

3. Compile the Forms/Reports again.
    If needed to restore things as they were, you can similarly turn the fix off with:
    ALTER SYSTEM SET "_FIX_CONTROL"='8560951:OFF';
OR 
Use the following workaround: 

1. Connect to the DB with SQL*Plus as the user who compiles the Forms application 
2. Use the following command to create a synonym all_objects with:
    create synonym all_objects for sys.dba_objects; 
    If it's not working, grant SELECT privelege on sys.dba_objects to the user who will be  compiling the form.
3. Compile the Forms/Reports again.
    If you want at the end, you can drop this synonym with:  drop synonym all_objects;

Good Luck ...

Tuesday, February 21, 2012

How to Revert R12.1.3 Homepage Layout to Personal Homepage as in R12.1.1 or 11i


Hi All

This is the fast way to Revert back to the 12.1.1 or 11i Personal Homepage Layout.

You will ask me why to do it.
There is the simple answer: Users become accustomed to the  Homepage style and don't want change it.

After R12.1.3 upgrade or installation the Homepage looks like this:


After the action plan below, you Homepage will be:



Here the Action Plan:
Set the following profiles:
  • FND: Applications Navigator Menu Consolidation count : 25
  • FND Slideout menu: Enabled
  • Enable Configurable HomePage: No
  • FND: Personalization Region Link Enabled: Yes
  • FND: Disable Configurable Home Page: True
* The above changes will result in the expandable menus changing to the older 'link style' menus


The Documentation that was used:
12.1.2: How to Modify and Enable The Configurable Home Page Delivered Via 12.1.2 [ID 1061482.1]

Good Luck ...

Sunday, February 19, 2012

How to Download and Install Oracle Linux

Hi All


Here the fast downloading  and installation guide for Oracle Linux.
Where to download:
https://edelivery.oracle.com/linux


1 . Choose Product to Download
 2. Choose Platform -> Press "Go" Button
3. Choose the release (for example Oracle Linux 5.7) 
4. Download full release (not source)


How to install :
Please see the Step by Step guide for Oracle Linux Installation by Gokhan Atil.
This is the best that I found and I always use it (Thanks you Gokhan Atil)


Useful documentation:
Oracle E-Business Suite Installation and Upgrade Notes Release 12 (12.1.1) for Linux x86 [ID 761564.1]
Oracle E-Business Suite Installation and Upgrade Notes Release 12 (12.1.1) for Linux x86-64 [ID 761566.1]


Good Luck ...

Easy Patching

Hi All

My friend Pinhas Rozner working as Oracle Application DBA and SOA Admin Consultant write the Easy Patching script.

I'm using it a lot and want to share it with You...

What you need to do:
1. Create defaultsfile as follow :
run adpatch defaultsfile=$APPL_TOP/admin/$SID/defaults.txt
Now abort autopatch section at point where it asks for patch directory by ctrl + c or ctrl + d
Now check if this file exists.

YOU HAVE TO DO ABOVE STEPS ONLY ONCE IN AN ENVIRONMENT TO CREATE DEFAULTS FILE.

2. Run the script patchrun.sh with the follow parameters:
$1 - driver name
$2 - number of workers to use
$3 - more adpatch options, adding manualy more options for the patch installation

YOU MUST BE IN THE PATCH DRIVER FOLDER

3. Script patchrun.sh
LOG=`echo $PWD |awk -F/ '{print $NF}'`
adpatch defaultsfile=$APPL_TOP/admin/$TWO_TASK/defaults.txt driver=$1 workers=$2 patchtop=$PWD logfile=${LOG}.log $3

Good Luck and  Enjoy Patching ...

How to Create and Support APPS Read-Only DB user

Hi All


Here You can find the scripts for creating APPS read-only DB user.


1. Create tablespace for APPS Read-only user (optional):
create tablespace APPS_RO datafile '<dbf top path>/apps_ro01.dbf'

size                                                  10M
autoextend on maxsize                       200M
extent management local uniform size  64K;


2. Create APPS read-only DB user:
create user apps_ro identified by apps_ro default tablespace  APPS_RO  temporary tablespace TEMP;


3.Grant  APPS read-only DB User:
grant connect, resource to  APPS_RO;


4. Linux SH Script add_to_apps_ro.sh:

#!/bin/ksh
SYSTEM_PWD=$1
OBJECT=$2
OBJECT=`echo $OBJECT | tr [:lower:] [:upper:]`
export SYSTEM_PWD OBJECT


if [ "$SYSTEM_PWD" = "" ] || [ "$OBJECT" = "" ]
then
echo "Usage: install_conc.sh <system password> <object_name>"
echo "For all DB objects please run: add_to_apps_ro.sh <system password> < % >" 
exit
fi;


if [ "$OBJECT" = "%" ]
then
echo "The procedure will run for all DB objects"
echo "--------------------------------------------"
echo "All DB objects will be added to APPS_RO user..."
echo "--------------------------------------------"
sqlplus "/as sysdba" << EOF
@apps_ro_all_create.sql
EOF
echo "Done..."
exit
fi;


echo "--------------------------------------------"
echo $OBJECT " will be added to APPS_RO user..."
echo "--------------------------------------------"
sqlplus "/as sysdba" << EOF
@apps_ro_object_create.sql $OBJECT
EOF
echo "Done..."


5. apps_ro_all_create.sql Script

set serveroutput on size 99999
set verify off
set feedback off
set pagesize 0
set linesize 150
set verify off
spool cre_grant.sql
select 'grant select on ' || owner || '.'|| object_name || ' to apps_ro;' 
FROM   all_objects
where    object_type IN ('VIEW', 'TABLE')
/
spool off
set serveroutput on size 99999
set verify off
set feedback off
set pagesize 0
set linesize 150
set verify off
spool cre_synonym.sql
select 'create or replace synonym apps_ro.' || object_name || ' for '  || owner || '.'|| object_name || ';'
FROM   all_objects
where    object_type IN ('VIEW', 'TABLE')
/
spool off
@cre_grant.sql
/
@cre_synonym.sql
/
exit


6. apps_ro_object_create.sql  Script:

set serveroutput on size 99999
set verify off
set feedback off
set pagesize 0
set linesize 150
set verify off
spool cre_grant.sql
select 'grant select on ' || owner || '.'|| object_name || ' to apps_ro;' 
FROM   all_objects
where    object_type IN ('VIEW', 'TABLE')
and object_name = '&1'
/
spool off
set serveroutput on size 99999
set verify off
set feedback off
set pagesize 0
set linesize 150
set verify off
spool cre_synonym.sql
select 'create or replace synonym apps_ro.' || object_name || ' for '  || owner || '.'|| object_name || ';'
FROM   all_objects
where    object_type IN ('VIEW', 'TABLE')
and object_name = '&1'
/
spool off
@cre_grant.sql
/
@cre_synonym.sql
/
exit

7 . How to use it:

  • Connect to Linux server with oracle user.
  • Create Folder apps_ro and put sh and sql's there.
  • chmod +x add_to_apps_ro.sh
  • Run add_to_apps_ro.sh

Usage: install_conc.sh <system password> <object_name>
For all DB objects please run: add_to_apps_ro.sh <system password> < % >" 


8 . Schedule the compilation apps_ro invalid objects (conditional).


Good Luck ...

Monday, February 6, 2012

Migrate Custom Top file system from 11i to R12 after upgrade

Hi All


Here the way to migrate Custom Top file system from 11i to R12 after the upgrade.


1.  Copy the files from 11i to R12
  a. cp -r  <11i APPL_TOP>/xxcust  <R12 APPL_TOP>
  b. cd <R12 APPL_TOP>/cust
  c. mv 11.5.0 12.0.0
  d. If there are forms in your custom top, go to <R12 APPL_TOP>/cust/12.0.0/forms/US
      Remove all fmx files and recompile all fmb again.
      frmcmp_batch module=<path to the fmb file> userid=apps/<apps pwd> output_file=<path to the fmx file> compile_all=special batch=yes
      Check the compilation logs for errors.


2. Add the Custom Top to $CONTEXT_FILE
  a. vi $CONTEXT_FILE
  b. Look for AU_TOP and go to the end of list for all TOP's
  c. Add your Custom top to the list as in example:
<XXCUST_TOP oa_var="s_xxcusttop" oa_type="PROD_TOP" oa_enabled="FALSE"><APPL_TOP full path>/xxcust/12.0.0</XXCUST_TOP>


3. Update FORMS_PATH in $CONTEXT_FILE
  a. vi $CONTEXT_FILE
  b. Look for <FORMS_PATH oa_var
  c. Add $AU_TOP/forms/US in the end of string ($AU_TOP - full path)


4. Run Autoconfig in Application Tier
  $INST_TOP/admin/scripts/adautocfg.sh


5. Re-login to Linux Server as applmgr user
6. Start Application Instance using  adstrtal.sh


Good Luck ...

Sunday, February 5, 2012

Send mail in HTML format from Oracle Alert manager

Hi All


My customer asked me if there is any way to send the mail from Oracle Alert Manager in HTML format.
I checked a lot of documentation and blogs but still not found the way to do it. As I understand, only plain text can be sent.


But Oracle Alert Manager can not only send message, but also run Linux script, sql statement and concurrent request.
Here the workaround to send HTML mail with Linux Script


1. Go to Alert Manager --> Define
Create a new Alert (Ex. SEND_HTML_MAIL). In Select Statement  write the following test sql:
select '"select * from dba_objects where status = ''INVALID''"' into &OUTPUT from dual
In the end of procedure you will receive the mail with  results for statement: 
"select * from dba_objects where status = 'INVALID' "
(Pay attention: The sql statement need to be with " )


 2. Actions
Create New Action as Summary --> Go to Action Details



3.  Choose 
Action Type: Operating System Script
Application: Your Custom Top
File:  send_mail.sh &OUTPUT  <'YOUR MAIL'>
where :
&OUTPUT - you sql statement
YOUR MAIL - mail address (may be more than one )
Place the send_mail.sh file in $YOUR_CUSTOM_TOP/bin directory



4. Go to Action Sets.

5. Go to Action Details.
6. Save your Alert.

7. send_mail.sh:

export SQL=$1 #Sql Statement to send
export EMAIL_LIST=$2 # To Mail List
export CC_EMAIL_LIST=<cc mail> # Cc Mail List
export BCC_EMAIL_LIST=<bcc mail> # Bcc Mail List
export LOG_FILE="/tmp/htmlwithsqlplus.log";
export SUBJECT="HTML With SQLPlus";
export SENDMAIL="/usr/sbin/sendmail";
#If you are in 11i OA version, you can get your apps password from  wdbsvr.app

export APPS_PWD=`cat $IAS_ORACLE_HOME/Apache/modplsql/cfg/wdbsvr.app |grep -i -B1 apps |grep password |awk '{print $3 }'`

#You really don.t need to edit anything past the variables, unless you are familiar with HTML and sqlplus formatting options. Having a little bit of HTML knowledge could be using in making the emails more appealing.
#The following creates the email header:
# create header

echo "To: ${EMAIL_LIST}" > ${LOG_FILE};
echo "Cc: ${CC_EMAIL_LIST}" >> ${LOG_FILE};
echo "Bcc: ${BCC_EMAIL_LIST}" >> ${LOG_FILE};

echo "Subject: ${SUBJECT}" >> ${LOG_FILE};
echo "Content-Type: text/html; charset=\"us-ascii\"" >> ${LOG_FILE};
echo "" >> ${LOG_FILE};
#The following creates the start of the HTML content:
# message Starts
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" >> ${LOG_FILE};
echo "<html>" >> ${LOG_FILE};
echo "<head>" >> ${LOG_FILE};
echo "<title></title>" >> ${LOG_FILE};
echo "</head>" >> ${LOG_FILE};
echo "<body bgcolor=\"#ffffff\" text=\"#000000\">" >> ${LOG_FILE};
#Now it's time for the output of sqlplus:
# message body
#If you are in 11i OA version the set markup html on not set.
#So you need to use the IAS_ORACLE_HOME sqlplus version.

export ORACLE_HOME=$IAS_ORACLE_HOME
$IAS_ORACLE_HOME/bin/sqlplus -s apps/$APPS_PWD >> ${LOG_FILE} <<EOF
set markup html on
set feedback off
set PAGES 100
$SQL;
EOF
# finish message
echo "</body>" >> ${LOG_FILE};
echo "</html>" >> ${LOG_FILE};
#The following sends the message:
# mail the logfile results
${SENDMAIL} -t < ${LOG_FILE};


Good Luck ...